Authentication
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 response carries a cheaper_inference object with the request id and what the request was billed. billed_cost_usd is a fixed 6-decimal string, not a number: a JSON float cannot round-trip a micro-dollar amount.
This document covers the customer-facing /v1 surface only.
Base URL
https://api.cheaperinference.com
Version 1.0.0 of the document. Paths below are relative to this base.
- BearerAuth — HTTP bearer: send `Authorization: Bearer <key>`.
- AnthropicApiKey — API key in the `x-api-key` request header.
Both schemes are accepted on every endpoint, and Authorization wins if both are present.
Chat
OpenAI-compatible chat and text completion.
/v1/chat/completionsstreamsCreate a chat completion
OpenAI-compatible. The request is optimized, served from the exact-match cache when possible, and billed against the wallet.
Request body ChatCompletionRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
messagesrequired | object[] | |
stream | boolean | |
max_tokens | integer | |
temperature | number | |
top_p | number | |
tools | object[] | |
tool_choice | any |
Additional properties are forwarded to the serving provider rather than rejected.
Response ChatCompletionResponse
Successful response
X-Cheaper-Inference-Request-Id— Request identifier. Legacy name, still emitted; identical to x-ci-request-id.x-ci-request-id— Request identifier. Canonical going forward.x-ci-tokens-saved— Input tokens removed by the optimizer.x-ci-saved-usd— Total saved against the provider's list price, in USD.x-ci-techniques— Comma-separated ids of the optimization techniques applied. Empty when none were.x-ci-cache— `hit` or `miss` for the exact-match cache.x-ci-experiment-variant— Name of the assigned experiment variant. Present only when the request included X-CI-Experiment and matched a running experiment.
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
/v1/completionsstreamsCreate a text completion
OpenAI-compatible legacy completions.
Request body CompletionRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
promptrequired | string | array | |
stream | boolean | |
max_tokens | integer |
Additional properties are forwarded to the serving provider rather than rejected.
Response CompletionResponse
Successful response
X-Cheaper-Inference-Request-Id— Request identifier. Legacy name, still emitted; identical to x-ci-request-id.x-ci-request-id— Request identifier. Canonical going forward.x-ci-tokens-saved— Input tokens removed by the optimizer.x-ci-saved-usd— Total saved against the provider's list price, in USD.x-ci-techniques— Comma-separated ids of the optimization techniques applied. Empty when none were.x-ci-cache— `hit` or `miss` for the exact-match cache.x-ci-experiment-variant— Name of the assigned experiment variant. Present only when the request included X-CI-Experiment and matched a running experiment.
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Messages
Anthropic Messages. Claude Code integrates here.
/v1/messagesstreamsCreate a message
Anthropic Messages. `max_tokens` is required. Errors use Anthropic's envelope, which carries no `code` or `param`.
Request body AnthropicMessagesRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
max_tokensrequired | integer | Required on this endpoint. |
messagesrequired | object[] | |
system | string | array | |
stream | boolean | |
stop_sequences | string[] | |
temperature | number | |
top_p | number | |
tools | object[] | |
tool_choice | object | |
thinking | object |
Additional properties are forwarded to the serving provider rather than rejected.
Response AnthropicMessagesResponse
Successful response
X-Cheaper-Inference-Request-Id— Request identifier. Legacy name, still emitted; identical to x-ci-request-id.x-ci-request-id— Request identifier. Canonical going forward.x-ci-tokens-saved— Input tokens removed by the optimizer.x-ci-saved-usd— Total saved against the provider's list price, in USD.x-ci-techniques— Comma-separated ids of the optimization techniques applied. Empty when none were.x-ci-cache— `hit` or `miss` for the exact-match cache.x-ci-experiment-variant— Name of the assigned experiment variant. Present only when the request included X-CI-Experiment and matched a running experiment.
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
/v1/messages/count_tokensCount input tokens
Estimate the input tokens for a Messages request. Makes no upstream call and moves no money, so `max_tokens` is not required.
Request body CountTokensRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
messagesrequired | object[] | |
system | string | array | |
tools | object[] |
Additional properties are forwarded to the serving provider rather than rejected.
Response CountTokensResponse
Successful response
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Responses
OpenAI Responses. Codex integrates here.
/v1/responsesstreamsCreate a response
OpenAI Responses, the surface Codex uses. Stateless: `store` must be `false`, and `previous_response_id` and `conversation` are refused. Replay prior output items in `input` instead.
Request body ResponsesRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
storerequired | boolean | Must be false. This endpoint is stateless.false |
inputrequired | string | array | |
instructions | string | null | |
stream | boolean | |
max_output_tokens | integer | null | |
tools | object[] | |
tool_choice | any | |
parallel_tool_calls | boolean | |
reasoning | object | null | |
text | object |
Additional properties are forwarded to the serving provider rather than rejected.
Response ResponsesResponse
Successful response
X-Cheaper-Inference-Request-Id— Request identifier. Legacy name, still emitted; identical to x-ci-request-id.x-ci-request-id— Request identifier. Canonical going forward.x-ci-tokens-saved— Input tokens removed by the optimizer.x-ci-saved-usd— Total saved against the provider's list price, in USD.x-ci-techniques— Comma-separated ids of the optimization techniques applied. Empty when none were.x-ci-cache— `hit` or `miss` for the exact-match cache.x-ci-experiment-variant— Name of the assigned experiment variant. Present only when the request included X-CI-Experiment and matched a running experiment.
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Models
The catalog, its capabilities and its prices.
/v1/modelsList models
Every 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 its own cache and not the unfiltered one.
Query parameters
| Field | Type | Notes |
|---|---|---|
type | string | `text` for chat models, `image` for models that generate something other than text.text, image |
vision | boolean | Select models that do or do not accept image input. Accepts 1/true/t/yes/y/on and 0/false/f/no/n/off. |
video | boolean | Select models that do or do not accept video input. Accepts 1/true/t/yes/y/on and 0/false/f/no/n/off. |
reasoning | boolean | Select models that do or do not reason. Accepts 1/true/t/yes/y/on and 0/false/f/no/n/off. |
streaming | boolean | Select models that do or do not stream. Accepts 1/true/t/yes/y/on and 0/false/f/no/n/off. |
provider | string | Exact provider name, compared trimmed and case-insensitively. A prefix does not match.length 1–80 |
Response ModelList
Successful response
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
/public/modelsList models (public)
The 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 resolved by the same rule that bills a request, so a quote here and the charge cannot disagree. `/v1/models` covers the same catalog for authenticated clients and adds marketplace-only models.
Response PublicModelCatalog
The catalog.
Error statuses (1)
503The catalog could not be read. No prices are served rather than stale ones.
/public/models/{model_id}Get one model (public)
One catalog entry. The id may contain slashes (`google/gemini-3.5-flash-lite`) and is matched exactly, including case.
Query parameters
| Field | Type | Notes |
|---|---|---|
model_idrequired | string | Model id. May contain `/`. |
Response PublicModel
The model.
Error statuses (2)
404No such model, or it is not currently advertised.503The catalog could not be read. No prices are served rather than stale ones.
/v1/pricing/changesPrice changes
Price 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 processed and pass it as `since` on the next poll, then follow `next_cursor` to the end. Requires the `usage:read` scope.
Query parameters
| Field | Type | Notes |
|---|---|---|
sincerequired | string (date-time) | Return changes at or after this time. Required: there is no default window, and an unbounded feed would return the whole price history. |
limit | integer | Maximum changes to return.1–100 |
cursor | string | Opaque cursor from the previous page's `next_cursor`. |
Response PricingChangeList
Successful response
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Usage
What the workspace spent. Requires the usage:read scope.
/v1/usage/requestsList requests
Per-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`; do not parse it.
Query parameters
| Field | Type | Notes |
|---|---|---|
limit | integer | 1–100 |
cursor | string | Opaque cursor from the previous page. |
start_at | string (date-time) | Inclusive lower bound. A value with no offset is read as UTC. |
end_at | string (date-time) | Exclusive upper bound. |
api_key_id | string (uuid) | Limit to one key in the calling workspace. A key outside it is a 404, not an empty list. |
Response UsageRequestList
Successful response
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
/v1/usage/dailyDaily spend
Daily 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` scope. Only settled requests contribute to spend.
Query parameters
| Field | Type | Notes |
|---|---|---|
start_at | string (date-time) | Inclusive lower bound. A value with no offset is read as UTC. |
end_at | string (date-time) | Exclusive upper bound. |
api_key_id | string (uuid) | Limit to one key in the calling workspace. A key outside it is a 404, not an empty list. |
timezone_offset_minutes | integer | Minutes east of UTC, deciding which calendar day a request falls on.-840–840 |
Response UsageDaily
Successful response
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Feedback
Score a completed request.
/v1/feedbackScore a request
Rate a completed request 1-5. Not present on the legacy service.
Request body FeedbackRequest
| Field | Type | Notes |
|---|---|---|
request_idrequired | string (uuid) | |
scorerequired | integer | 1–5 |
comment | string | null |
Response FeedbackResponse
Successful response
Error statuses (15)
400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Uploads
/v1/uploadsUpload a temporary image
Store 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. Rejected for an account with zero data retention.
Error statuses (16)
201The upload was stored400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
/v1/uploads/{upload_id}Delete a temporary image
Remove an upload before it expires. An id belonging to another account answers 404, exactly as an unknown one does.
Query parameters
| Field | Type | Notes |
|---|---|---|
upload_idrequired | string |
Error statuses (16)
204The upload was deleted400Malformed request (`type: invalid_request_error`, `code: invalid_request`)401Invalid or missing API key (`type: authentication_error`, `code: invalid_api_key`)402Insufficient wallet balance (`type: invalid_request_error`, `code: insufficient_balance`)403The API key lacks the scope this endpoint requires (`type: permission_denied_error`, `code: permission_denied`)404Not found (`type: invalid_request_error`, `code: not_found`)408Request timed out (`type: invalid_request_error`, `code: request_failed`)409Conflict (`type: invalid_request_error`, `code: conflict`)413Request too large (`type: invalid_request_error`, `code: request_too_large`)422A parameter failed validation (`type: invalid_request_error`, `code: invalid_request`)425Too early (`type: invalid_request_error`, `code: request_failed`)429Rate limited (`type: rate_limit_error`, `code: rate_limit_exceeded`)500Server error (`type: api_error`, `code: server_error`)502The upstream provider returned an unusable response (`type: api_error`, `code: upstream_error`)503Service unavailable (`type: api_error`, `code: service_unavailable`)504Upstream timeout (`type: api_error`, `code: upstream_timeout`)
Schemas
Every object named above, with the fields the API declares. Objects marked as forwarding additional properties accept fields not listed here and pass them to the serving provider.
OpenAIError
Every `/v1/*` path except `/v1/messages*`.
| Field | Type | Notes |
|---|---|---|
errorrequired | object |
AnthropicError
`/v1/messages` and `/v1/messages/count_tokens`. No `code`, no `param`.
| Field | Type | Notes |
|---|---|---|
typerequired | string | error |
errorrequired | object |
ChatCompletionRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
messagesrequired | object[] | |
stream | boolean | |
max_tokens | integer | |
temperature | number | |
top_p | number | |
tools | object[] | |
tool_choice | any |
Additional properties are forwarded rather than rejected.
ChatCompletionResponse
| Field | Type | Notes |
|---|---|---|
idrequired | string | |
object | string | |
created | integer | |
model | string | |
choicesrequired | object[] | |
usage | object | |
cheaper_inference | object | What this request was billed. Present on every successful response. |
Additional properties are forwarded rather than rejected.
CompletionRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
promptrequired | string | array | |
stream | boolean | |
max_tokens | integer |
Additional properties are forwarded rather than rejected.
CompletionResponse
| Field | Type | Notes |
|---|---|---|
idrequired | string | |
choicesrequired | object[] | |
usage | object | |
cheaper_inference | object | What this request was billed. Present on every successful response. |
Additional properties are forwarded rather than rejected.
AnthropicMessagesRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
max_tokensrequired | integer | Required on this endpoint. |
messagesrequired | object[] | |
system | string | array | |
stream | boolean | |
stop_sequences | string[] | |
temperature | number | |
top_p | number | |
tools | object[] | |
tool_choice | object | |
thinking | object |
Additional properties are forwarded rather than rejected.
AnthropicMessagesResponse
| Field | Type | Notes |
|---|---|---|
idrequired | string | |
typerequired | string | message |
rolerequired | string | assistant |
model | string | |
contentrequired | object[] | |
stop_reason | string | null | |
stop_sequence | string | null | |
usage | object | |
cheaper_inference | object | What this request was billed. Present on every successful response. |
CountTokensRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
messagesrequired | object[] | |
system | string | array | |
tools | object[] |
Additional properties are forwarded rather than rejected.
CountTokensResponse
| Field | Type | Notes |
|---|---|---|
input_tokensrequired | integer |
ResponsesRequest
| Field | Type | Notes |
|---|---|---|
modelrequired | string | |
storerequired | boolean | Must be false. This endpoint is stateless.false |
inputrequired | string | array | |
instructions | string | null | |
stream | boolean | |
max_output_tokens | integer | null | |
tools | object[] | |
tool_choice | any | |
parallel_tool_calls | boolean | |
reasoning | object | null | |
text | object |
Additional properties are forwarded rather than rejected.
ResponsesResponse
| Field | Type | Notes |
|---|---|---|
idrequired | string | |
objectrequired | string | response |
created_at | integer | |
statusrequired | string | completed, incomplete, failed, in_progress |
outputrequired | object[] | |
usage | object | null | |
cheaper_inference | object | What this request was billed. Present on every successful response. |
Additional properties are forwarded rather than rejected.
ModelList
| Field | Type | Notes |
|---|---|---|
objectrequired | string | list |
datarequired | Model[] | |
pricing_versionrequired | string | |
pricing_checked_at | string | null | |
pricing_updated_at | string | null |
Model
| Field | Type | Notes |
|---|---|---|
idrequired | string | |
objectrequired | string | model |
owned_by | string | |
provider | string | null | |
typerequired | string | text, image |
endpoint | string | |
capabilitiesrequired | object | |
is_free | boolean | |
available_until | string | null | |
pricingrequired | object |
PublicModelCatalog
| Field | Type | Notes |
|---|---|---|
modelsrequired | PublicModel[] |
PublicModel
| Field | Type | Notes |
|---|---|---|
idrequired | string | |
aliases | string[] | Vendor-qualified ids that also resolve to this model. |
model_typerequired | string | text, image, video |
input_per_millionrequired | string | |
output_per_millionrequired | string | |
cache_read_per_million | string | null | |
cache_write_per_million | string | null | |
image_output_per_million | string | null | |
media_input_unit_price | string | null | |
media_unit_price | string | null | Price per picture, for models billed per unit. Their token rates are not the price. |
media_unit | string | null | |
media_prices | map<string, string> | |
image_pricing_unit | string | token, image |
reference_input_per_million | string | null | |
reference_output_per_million | string | null | |
reference_cache_read_per_million | string | null | |
reference_cache_write_per_million | string | null | |
reference_image_output_per_million | string | null | |
reference_media_input_unit_price | string | null | |
reference_media_unit_price | string | null | |
reference_media_prices | map<string, string> | |
discount_percentrequired | string | Measured from the price actually charged against the list price, on whichever basis bills the model. `0.00` means no list price is published to compare with. |
logo_url | string | null | |
provider_name | string | null | |
primary_model_id | string | null | |
is_visible | boolean | |
supports_vision | boolean | |
supports_video | boolean | |
supports_reasoning | boolean | |
reasoning_capability_mode | string | auto, manual |
supports_streaming | boolean | |
is_free | boolean | |
available_until | string | null | |
input_token_price_threshold | integer | null | |
input_per_million_above_threshold | string | null | |
output_per_million_above_threshold | string | null |
DetailError
The error body the /public routes answer with.
| Field | Type | Notes |
|---|---|---|
detailrequired | string |
UsageRequestList
| Field | Type | Notes |
|---|---|---|
objectrequired | string | list |
scoperequired | string | workspace |
datarequired | UsageRequest[] | |
has_morerequired | boolean | |
next_cursor | string | null | Opaque. Pass back as `cursor`; do not parse. |
UsageRequest
| Field | Type | Notes |
|---|---|---|
request_idrequired | string (uuid) | |
api_key_id | string | null | |
api_key_name | string | null | |
modelrequired | string | |
endpointrequired | string | |
statusrequired | string | settled, cached, failed |
prompt_tokens | integer | |
completion_tokens | integer | |
total_tokens | integer | |
billed_cost_usd | string | null | Null unless the request settled. |
currencyrequired | string | USD |
total_latency_ms | integer | null | |
created_atrequired | string (date-time) | |
cache_read_input_tokens | integer | null | Not recorded yet. |
cache_write_input_tokens | integer | null | Not recorded yet. |
image_output_tokens | integer | null | Not recorded yet. |
time_to_first_token_ms | integer | null | Not recorded yet. |
model_latency_ms | integer | null | Not recorded yet. |
model_time_to_first_token_ms | integer | null | Not recorded yet. |
generation_duration_ms | integer | null | Not recorded yet. |
output_tokens_per_second | string | null | Not recorded yet. |
completed_at | string | null | Not recorded yet. |
PricingChangeList
| Field | Type | Notes |
|---|---|---|
objectrequired | string | list |
pricing_versionrequired | string | |
pricing_checked_at | string (date-time) | |
pricing_updated_at | string (date-time) | |
datarequired | object[] | |
has_morerequired | boolean | |
next_cursor | string |
PricingChangeRates
Customer-facing rates on one side of a change. Null means the rate was not quoted at that point, which is different from zero.
| Field | Type | Notes |
|---|---|---|
input_per_million | string | |
output_per_million | string | |
media_unit_price | string |
UsageDaily
| Field | Type | Notes |
|---|---|---|
objectrequired | string | usage.daily |
scoperequired | string | workspace |
currencyrequired | string | USD |
start_at | string (date-time) | |
end_at | string (date-time) | |
timezone_offset_minutes | integer | |
total_requests | integer | |
settled_requests | integer | |
spend_usdrequired | string | |
daily_spendrequired | object[] |
FeedbackRequest
| Field | Type | Notes |
|---|---|---|
request_idrequired | string (uuid) | |
scorerequired | integer | 1–5 |
comment | string | null |
FeedbackResponse
| Field | Type | Notes |
|---|---|---|
okrequired | boolean |