Cheaper Inference API
Wallet-backed, OpenAI- and Anthropic-compatible inference. Authenticate with Authorization: Bearer ci_live_... or x-api-key: ci_live_.... Both are accepted on…
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Wallet-backed, OpenAI- and Anthropic-compatible inference. Authenticate with Authorization: Bearer ci_live_... or x-api-key: ci_live_.... Both are accepted on every endpoint, and Authorization wins if both are present.
Every successful BUFFERED response carries request_id and billing at the top level, with the request id and what the request was billed. Messages streams carry them on the terminal message_delta, and Responses streams on the terminal response.completed or response.incomplete. Chat Completions and Completions streams carry neither: reconcile those from the x-ci-request-id response header. billed_cost_usd is a fixed 6-decimal string, not a number: a JSON float cannot round-trip a micro-dollar amount.
JSON inference bodies may be compressed: /v1/chat/completions, /v1/completions, /v1/responses, /v1/messages, /v1/messages/count_tokens, /v1/images/generations and /v1/videos/generations. Send Content-Encoding: gzip, deflate or br and the body is inflated before parsing, which is how a conversation larger than the 4.5 MB wire limit can be sent. A single encoding only, and a body that inflates past 20 MB is refused with 413 - except on /v1/messages/count_tokens, where the inflated ceiling is 4.5 MB. Multipart image edits and the non-inference endpoints read their bodies directly and expect them uncompressed.
This document covers the customer-facing /v1 surface only.
Endpoints 69
Chat
- POSTCreate a chat completion
/v1/chat/completionsOpenAI-compatible. The request is optimized, served from the exact-match cache when possible, and billed against the wallet. Two opt-in request headers form… - POSTCreate a text completion
/v1/completionsOpenAI-compatible legacy completions. Portable prompt arrays are served as independent, sequential requests through normal admission and billing, then…
Images
- POSTGenerate images
/v1/images/generationsGenerate one or more images. Streaming is not supported on this endpoint. - POSTEdit images
/v1/images/editsEdit up to 10 source images with a 20 MiB decoded aggregate limit across the sources and optional mask. The OpenAI-compatible multipart form accepts image…
Messages
- POSTCreate a message
/v1/messagesAnthropic Messages. max_tokens is required. Errors use Anthropic's envelope, which carries no code or param. A PDF goes in a document block with a base64… - POSTCount input tokens
/v1/messages/count_tokensEstimate the input tokens for a Messages request. Makes no upstream call and moves no money, so max_tokens is not required.
Responses
- POSTCreate a response
/v1/responsesOpenAI Responses, the surface Codex uses. A PDF goes in an input_file part with file_data (a data URI) or file_url (https; we download it, 10 MB and 10 links…
Decisions
- POSTAsk a decision model typed questions
/v1/decisionsAsk predicate, choice and score questions about one input and receive probabilities instead of text. OpenAI Decisions API shape; the OpenAI SDKs work with…
Embeddings
- POSTCreate embeddings
/v1/embeddingsTurn text, or token ids, into vectors. OpenAI Embeddings API shape; the OpenAI SDKs work with only a base URL change. Billed on the input tokens the model…
Rerank
- POSTRerank documents
/v1/rerankScore up to 1000 documents against a query and return them by relevance. Cohere Rerank API shape; the Cohere SDKs work with only a base URL change. Documents… - POSTRerank documents (Cohere v2)
/v2/rerankThe Cohere v2 Rerank shape, which the Cohere SDKs call on the API host: the same as POST /v1/rerank with string documents only.
Audio
- POSTCreate speech
/v1/audio/speechTurn text into one audio file. OpenAI Speech API shape; the OpenAI SDKs work with only a base URL change. Billed per input character; the charge is in the… - POSTCreate a transcription
/v1/audio/transcriptionsTurn audio into text. OpenAI Transcriptions API shape; the OpenAI SDKs work with only a base URL change. Billed per second of audio; the charge is in the… - POSTCreate a translation
/v1/audio/translationsTurn audio in any language into English text. OpenAI Translations API shape. Billed per second of audio like transcriptions. Only the transcription models… - GETOpen a voice session (WebSocket)
/v1/realtime?model=stringA live voice or text conversation over one WebSocket: connect to wss://api.cheaperinference.com/v1/realtime?model=<id> with Authorization: Bearer <key>.… - GETOpen a GPT-Live session (WebSocket)
/v1/live/sessionsOpenAI Live events over one WebSocket, for gpt-live-1: connect to wss://api.cheaperinference.com/v1/live/sessions with Authorization: Bearer <key>. The first…
Models
- GETList models
/v1/modelsEvery model this platform serves, with capabilities and prices. pricing_version is a SHA-256 over the list that was returned, so a filtered response validates… - GETList models (public)
/public/modelsThe advertised catalog, with live prices, and NO API KEY. This is what the marketing pages and any other surface that cannot hold a key read. Prices are… - GETGet one model (public)
/public/models/:model_idOne catalog entry. The id may contain slashes (google/gemini-3.5-flash-lite) and is matched exactly, including case. - GETPrice changes
/v1/pricing/changes?since=2024-01-01T00:00:00ZPrice moves at or after since, oldest first, so a client can detect changes without re-diffing the catalogue. Store the changed_at of the last change you… - GETCount supply under a price ceiling
/v1/models/supply?model=stringHow many supply sources would currently serve a chat request carrying min_discount_percent and/or zdr=true for this model, using the same filter the request… - GETPrice a workload across models
/v1/models/compare?models=stringWhat a given number of prompt and completion tokens would cost on each of up to ten models, cheapest first. Needs usage:read only. It discloses catalog…
Usage
- GETList requests
/v1/usage/requestsPer-request history for the calling workspace, newest first. Requires the usage:read scope. cursor is opaque and comes from the previous page's next_cursor;… - GETDaily spend
/v1/usage/dailyDaily spend for the calling workspace, defaulting to the last 30 days and zero-filled across the range so a chart does not close gaps. Requires the usage:read… - GETTeam Savings
/v1/usage/team-savingsWhat the calling key's workspace spent, against the list price of the same model (baseline.id: same_model_list_price_v1), in total and by member, project or… - GETTeam Savings request records
/v1/usage/team-savings/requestsThe request records behind a Team Savings figure, newest first, with the same scope, filters and permissions as GET /v1/usage/team-savings. Records only: no…
Feedback
- POSTScore a request
/v1/feedbackRate a completed request 1-5. Not present on the legacy service.
Account
- GETGet the account
/v1/accountEmail, workspace and role, how many keys are live and when one was last used, and how many optimization techniques are actually on. - GETGet the wallet balance
/v1/account/balanceBalance, what is reserved against requests in flight, and auto-recharge state. Spend against available_usd, not balance_usd. - GETSummarize usage over a window
/v1/account/usageRequests, billed, saved versus list price and the top models. The rolled-up counterpart to /v1/usage/daily's per-day series. - GETGet the savings snapshot
/v1/account/savingsSavings over 24 hours, 7 days and 30 days, every experiment's per-request economics, and the technique catalog with this account's state on each. - GETRead the workspace admin policy
/v1/account/workspace-policyThe admin policy of the calling key's workspace, and can_edit (owner or admin). Five settings bind every member, owners and admins included: a maximum task… - PUTReplace the workspace admin policy
/v1/account/workspace-policyReplace the whole policy of the calling key's workspace; the workspace is always the key's own. Send expected_version as read: a policy saved in between is… - GETList the workspace's task budgets
/v1/account/task-budgetsEvery member's task budgets in the calling key's workspace, newest first, each with its member and key. Requires account:read and a workspace owner or admin. - GETRead one of the workspace's task budgets
/v1/account/task-budgets/:budget_idOne budget in the calling key's workspace. With include=requests, up to 500 of the requests it held, oldest first, and requests_truncated; that also needs the… - POSTClose a member's task budget
/v1/account/task-budgets/:budget_id/closeClose a budget in the calling key's workspace now: close_reason: admin and closed_by_user_id, audited. Requests it already held settle into it later.… - GETList experiments
/v1/experimentsEvery experiment on the account with its cost, savings and feedback. - GETGet an experiment
/v1/experiments/:experiment_idOne experiment broken down per variant, so arms can be compared. - GETList optimization techniques
/v1/techniquesThe catalog with this account's state on each entry. Preview and unimplemented techniques are included and flagged, not hidden. - PATCHEnable or disable a technique
/v1/techniques/:technique_idRequires account:write. A technique that is not implemented, or is deprecated, is refused with a 404. Turning on a technique the workspace admin policy locks… - GETList API keys
/v1/keysPrefixes only. Saved full keys can be copied by their owner in the dashboard. - POSTCreate an API key
/v1/keysRequires account:write, and refuses a caller authenticated through a chat integration: a short-lived internal token must not be able to mint a permanent… - DELETERevoke an API key
/v1/keys/:key_idRequires account:write. Revoking the key you are authenticating with is allowed. The next request simply fails to authenticate. - GETList connected chat channels
/v1/channelsEvery Slack, Discord, Telegram and email channel this account has connected, plus the event catalog PATCH accepts. - GETGet a channel
/v1/channels/:channel_idOne channel's subscriptions and digest schedule. - PATCHChange a channel's schedule or subscriptions
/v1/channels/:channel_idRequires account:write. An events list containing an unknown id is refused whole rather than partially applied. - POSTPost the savings digest now
/v1/channels/:channel_id/send-reportRequires account:write. Throttled to one send per channel per minute, and does not consume the next scheduled digest. - POSTRecord a refused request against the calling account
/v1/security/strikesReported by the MCP server when it refuses a call. injection, escalation and policy describe hostile arguments and trigger a permanent ban on the first… - GETGet the calling account's standing
/v1/security/standingWhether the account is blocked, and where to appeal. A block is a ban: it has no expiry, so blocked_until is always null and permanent is true whenever tier… - POSTStart a wallet top-up
/v1/billing/topupRequires account:write. Creates a Stripe Checkout session and returns its link. Nothing is charged here. The customer completes the payment on Stripe's own…
Prompt Studio
- GETWhat Prompt Studio can do
/v1/prompt-studio/capabilitiesThe optimization modes and which are available, the rewriter model, the {{variable}} template rule, the limits, and whether the service is reachable now… - POSTCheck a prompt and estimate what optimizing it costs
/v1/prompt-studio/check-promptFree: no model runs and nothing is billed. Judges whether a prompt is fit to optimize (verdict, issues, notes, variables) and estimates, from the rates this… - POSTStart a zero-shot optimization
/v1/prompt-studio/optimizeSpends money: the run bills the calling key's wallet, so the key needs inference as well as prompt-studio:write. Before anything is spent the prompt gets the… - GETList Prompt Studio runs
/v1/prompt-studio/runsThe caller's finished Prompt Studio runs, newest first. Requires prompt-studio:read. - GETGet a Prompt Studio run
/v1/prompt-studio/runs/:run_idOne run: the baseline prompt-set that went in, the optimized prompt-set and model that came out (optimized), or a benchmark's per-arm numbers… - GETGet a Prompt Studio job's status
/v1/prompt-studio/jobs/:job_idA running or finished job: status, stage, and once done its run id and outcome. Polling runs no inference. Requires prompt-studio:read.
Docs
- GETSearch the documentation
/v1/docsWith q, the matching sections in full, best match first. Without it, the table of contents includes every section's id, title, category and link without…
Keak Code
- POSTAttribute your requests to a task
/v1/usage/attributionsTag requests made with the calling key with a client task, an opaque project id and the client name. Requires the inference scope (describing your own traffic… - POSTReport a completed task
/v1/usage/task-outcomesRecord that a task the calling key already attributed (POST /v1/usage/attributions) was completed. Requires the inference scope; only an API key authenticates… - GETRead the calling key's technique profile
/v1/keys/:key_id/techniquesWhat each Cheaper Inference technique will do for requests made with this key, derived from the same resolver that serves requests: the key's own override,… - PUTNarrow the calling key's technique profile
/v1/keys/:key_id/techniquesMove the key's own techniques toward conservative and set its prompt-cache default. profile: "coding-safe-v1" writes an explicit off override for every… - GETList the calling key's task budgets
/v1/keys/:key_id/task-budgetsThe key's open task budget (null when none is open and unexpired) and its 20 newest budgets, newest first. A task budget is a spending cap Cheaper Inference… - POSTOpen a task budget on the calling key
/v1/keys/:key_id/task-budgetsOpen the key's task budget for one client task, with a limit and a lease. Until it is closed or the lease expires, each request on the key holds its… - GETRead one of the calling key's task budgets
/v1/keys/:key_id/task-budgets/:budget_idThe budget as it is now. status is the effective one: an open budget past its lease reads expired. read_at is the server's clock, for lease arithmetic. With… - PATCHRaise a task budget or renew its lease
/v1/keys/:key_id/task-budgets/:budget_idRaise the limit, renew the lease from now, or both. The limit asked for never goes down. Only the budget of the task named in the body changes, and only while… - POSTClose a task budget
/v1/keys/:key_id/task-budgets/:budget_id/closeClose the budget now; requests on the key are no longer held by it. Requests it already held stay counted and settle into it later. Idempotent: a closed or…
Videos
- POSTGenerate a video
/v1/videos/generationsGenerate a video and wait for the completed result. Streaming is not supported.
Uploads
- POSTUpload a temporary image
/v1/uploadsStore an image for a short time and receive a file_id. Send that id in a chat message and it is swapped for a signed URL on the way to the provider. At most 4… - DELETEDelete a temporary image
/v1/uploads/:upload_idRemove an upload before it expires. An id belonging to another account answers 404, exactly as an unknown one does.
API details
- Base URL
https://api.cheaperinference.com- Authentication
- A bearer token in the Authorization header
An API key in the x-api-key header - Operations
- 69 operations on 63 pathsGET 34POST 28PATCH 3PUT 2DELETE 2
- Main resources
- Account 23Keak Code 9Models 6Prompt Studio 6Audio 5Usage 4Chat 2Images 2Messages 2Rerank 2
- Response formats
application/jsontext/event-streamtext/plaintext/vtt- Description format
- OpenAPI 3.1.0, API version
1.0.0 - Links
- OpenAPI document
How to test the Cheaper Inference API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Cheaper Inference API collection, without the publisher's secrets.
- Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Create a chat completion” (POST /v1/chat/completions), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Cheaper Inference API?
Wallet-backed, OpenAI- and Anthropic-compatible inference. Authenticate with Authorization: Bearer ci_live_... or x-api-key: ci_live_.... Both are accepted on… It is listed under AI & machine learning and has 69 endpoints.
Who publishes the Cheaper Inference API?
It is listed from Cheaperinference's public API description (an OpenAPI document), not published by Cheaperinference on Swastik Codes. Anyone who controls cheaperinference.com can claim the profile by adding a DNS TXT record.
What is the base URL of the Cheaper Inference API?
Requests go to https://api.cheaperinference.com. Endpoint paths are added to this base URL.
How do I authenticate with the Cheaper Inference API?
It accepts 2 methods: A bearer token in the Authorization header; an API key in the x-api-key header.
How many endpoints does the Cheaper Inference API have?
69 operations on 63 paths (34 GET, 28 POST, 3 PATCH, 2 PUT, 2 DELETE). The largest groups are Account, Keak Code, Models, Prompt Studio.
Is forking the Cheaper Inference API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.