Skip to content

API docs · Chat & images

Chat billing

Priced by input, output and cache tokens; holds, settlement and interrupted streams.

Chat models are priced per token, per million tokens in USD, with separate input and output prices. Input served from cache is billed at the cache-read price, and input written to cache at the cache-write price (or the input price when no separate price is set).

Holds and settlement

  1. Before the request starts, a maximum is held: input tokens are estimated conservatively from the size of the request body in bytes (plus about 1,600 tokens per image), all at the higher of the input and cache-write prices; output is max_tokens (or the model's max output when unset) times the output price.
  2. If your balance or the key's limits (total limit, daily limit) can't cover that hold, the request is not rejected outright: the platform holds what you can afford and lowers the output limit of this request to match, so the reply may be cut short (finish_reason is length; stop_reason is max_tokens in the Anthropic format). The X-AiToken-Output-Capped response header carries the lowered limit. Top up or raise the key's limit to get full-length output back. If the lowered limit would be under 1,024 tokens, you get 402 and nothing is sent upstream; the error message states the minimum amount to hold and the amount available.
  3. The lowering described above applies to requests sent to /v1/messages, to GPT-family models, and to models the platform reaches through the Anthropic, OpenAI Responses or Gemini native API (on these, the output limit also counts thinking tokens). When lowering, the platform uses only 90% of the amount you can afford to work out the output limit and the hold, keeping a 10% margin. Other models called through /v1/chat/completions are not lowered: if the hold for the full output limit can't be covered you get 402, and the amount to hold in the error is the amount for the full output limit. Send a smaller max_tokens or top up, then retry.
  4. When the request ends it is settled on the usage the upstream reports, rounded up to the pricing step; the unused part of the hold is released. In the rare case that the actual cost is higher than the hold (for example, the real input is larger than the estimate), the difference is charged to your available balance.
  5. If the upstream reports no usage, input is billed at the estimate and output by the bytes actually returned.
  6. A request that fails before producing any output is free; a stream that breaks midway is billed for what it already output.

usage fields

ItemOpenAI formatAnthropic format
Inputprompt_tokens − cached_tokensinput_tokens
Cache readprompt_tokens_details.cached_tokenscache_read_input_tokens
Cache writeResponse header (see below)cache_creation_input_tokens
Outputcompletion_tokensoutput_tokens

In the OpenAI format, total_tokens always equals prompt_tokens + completion_tokens.

Response headers

HeaderDescription
X-Request-IdThe ID of this request; include it when reporting a problem
X-RateLimit-Limit / Remaining / ResetRequests-per-minute limit, remaining requests and reset time (Unix seconds); returned only when the account or the key has an RPM limit
Usage-Cache-Write-Tokens-5m / -1hTokens written to the cache (the 5-minute and 1-hour retention tiers). Returned only on non-streaming responses; always 0 for models that do not bill cache writes separately (such as Kimi). For streaming requests, read usage from the last chunk
X-AiToken-Output-CappedReturned only when your balance or key limit could not cover the hold for the requested output limit: the output token limit per reply was lowered to this value for this request. Also sent on streaming responses

Prices

Claude Fable 5

claude-fable-5
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$10.00
Output$50.00
Cache read$1.00
Cache write$12.50
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Fable 5.1

claude-fable-5-1
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$10.00
Output$50.00
Cache read$0.25
Cache write$12.50
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Fable 5.2

claude-fable-5-2
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$8.00
Output$40.00
Cache read$0.20
Cache write$10.00
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Haiku 4.5

claude-haiku-4-5-20251001
Context window
200,000 tokens
Max output
64,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$1.00
Output$5.00
Cache read$0.10
Cache write$1.25
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Opus 4.6

claude-opus-4-6
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$5.00
Output$25.00
Cache read$0.50
Cache write$6.25
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Opus 4.7

claude-opus-4-7
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$5.00
Output$25.00
Cache read$0.50
Cache write$6.25
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Opus 4.8

claude-opus-4-8
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$5.00
Output$25.00
Cache read$0.50
Cache write$6.25
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Opus 5

claude-opus-5
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$5.00
Output$25.00
Cache read$0.50
Cache write$6.25
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Opus 5.5

claude-opus-5-5
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$4.00
Output$20.00
Cache read$0.20
Cache write$5.00
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Sonnet 4.5

claude-sonnet-4-5-20250929
Context window
200,000 tokens
Max output
64,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$3.00
Output$15.00
Cache read$0.30
Cache write$3.75
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Sonnet 4.6

claude-sonnet-4-6
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$3.00
Output$15.00
Cache read$0.30
Cache write$3.75
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Sonnet 5

claude-sonnet-5
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.20
Cache write$2.50
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Claude Sonnet 5.5

claude-sonnet-5-5
Context window
1,000,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completionsAnthropic · /v1/messages
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.20
Cache write$2.50
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Gemini 3.5 Flash

gemini-3.5-flash
Context window
1,048,576 tokens
Max output
65,536 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$1.50
Output$9.00
Cache read$0.15
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Gemini 3.7 Flash

gemini-3.7-flash
Context window
1,048,576 tokens
Max output
65,536 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$0.75
Output$3.75
Cache read$0.08
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Gemini 3.8 Flash

gemini-3.8-flash
Context window
1,048,576 tokens
Max output
65,536 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$0.75
Output$3.75
Cache read$0.08
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Gemini 4 Argon

gemini-4-argon
Context window
1,000,000 tokens
Max output
64,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.10
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Gemini 4 Carbon

gemini-4-carbon
Context window
1,000,000 tokens
Max output
64,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.10
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Gemini 4 Hydrogen

gemini-4-hydrogen
Context window
1,000,000 tokens
Max output
64,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$1.50
Output$7.50
Cache read$0.08
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-5.5

gpt-5.5
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$5.00
Output$30.00
Cache read$0.50
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$10.00
Output$45.00
Cache read$1.00
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-5.6 Luna

gpt-5.6-luna
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$0.20
Output$1.20
Cache read$0.02
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$0.40
Output$1.80
Cache read$0.04
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-5.6 Sol

gpt-5.6-sol
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$4.00
Output$20.00
Cache read$0.40
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$8.00
Output$30.00
Cache read$0.80
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-5.6 Terra

gpt-5.6-terra
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$2.00
Output$12.00
Cache read$0.20
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$4.00
Output$18.00
Cache read$0.40
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-6 Astra

gpt-6-astra
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$10.00
Output$50.00
Cache read$1.00
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$20.00
Output$75.00
Cache read$2.00
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-6 Luna

gpt-6-luna
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$0.10
Output$0.50
Cache read$0.01
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$0.20
Output$0.75
Cache read$0.02
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-6 Sol

gpt-6-sol
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.20
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$4.00
Output$15.00
Cache read$0.40
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

GPT-6.1 Sol

gpt-6.1-sol
Context window
1,050,000 tokens
Max output
128,000 tokens
Input
Text + Images
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.10
Cache writeSame as input
Requests whose prompt exceeds 272,000 tokens are billed entirely at these long-context rates:
Input$4.00
Output$15.00
Cache read$0.20
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Kimi K3

kimi-k3
Context window
1,000,000 tokens
Max output
32,000 tokens
Input
Text
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$3.00
Output$15.00
Cache read$0.30
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Kimi K3.1 Pro

kimi-k3.1-pro
Context window
1,000,000 tokens
Max output
32,000 tokens
Input
Text
Tool use
Supported
API formats
OpenAI · /v1/chat/completions
ItemPer million tokens
Input$2.00
Output$10.00
Cache read$0.20
Cache writeSame as input
  • Billed by the token usage the upstream reports; cached input is billed at the cache-read price.
  • Before the request starts we hold “estimated input + max_tokens”; when it ends we settle on actual usage and release the rest.
  • Charges are rounded up to 0.01 USD.

Tokens and charges for every request are listed by model under Call logs (purpose: Chat) and in the billing center in the console.

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "claude-sonnet-4-5",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" }],
  "usage": {
    "prompt_tokens": 2000,
    "completion_tokens": 300,
    "prompt_tokens_details": { "cached_tokens": 1500 }
  }
}