Billing & reconciliation
How LLM calls and media tasks are priced, settled, released, and reconciled.
LLM calls
Each completed LLM call records normalized usage, token counts, the buyer charge, and a Request ID. Pricing uses input/output token usage and the model's configured price or coefficient rules.
Cache-read tokens use the selected model's cache-read price ratio. Cache-write tokens are recorded separately from ordinary input tokens. For Anthropic, cache_creation_input_tokens is the total cache-write amount and cache_creation.ephemeral_1h_input_tokens is the 1-hour subset; the remainder uses the 5-minute cache-write price. A missing 1-hour price falls back to the 5-minute cache-write price, and a missing cache-write price falls back to the model's ordinary input price. Other protocols have no cache-write segment.
Wallet settlement depends on the configured credit provider:
- With the local ledger, a successful per-call deduction is shown as fully settled immediately.
- With IPOS credit, each call is still recorded individually, while wallet deductions are accumulated and settled in recoverable batches (the default settlement threshold is 10 credits). After a batch succeeds, settled amounts are assigned to calls in chronological order, so the final call in a batch can be partially settled.
Therefore, use both the Charge and Settled columns on the Usage page for per-call reconciliation even when the external wallet moves in batches. Amounts not yet included in a successful wallet charge are shown as 0.
Media tasks
Asynchronous media tasks other than GPT Image 2 use fixed pricing locked at task creation and temporarily reserved from the available balance before upstream submission:
- Image models use the configured fixed price for the task / quality / resolution.
- Video models use the configured per-second reference price ×
input.duration.
For grok-imagine-video, the reference prices are 2 credits/second at 480p, 3 credits/second at 720p, and 5 credits/second at 1080p; supported durations are integer values from 1 to 15 seconds. See Grok Imagine Video for the full parameter matrix and examples.
- Success settles the existing reservation exactly once, and the resulting Usage record is shown as fully settled.
- Failure or cancellation releases the reservation without a charge.
- The upstream provider's real
costis retained for internal cost auditing and does not determine the buyer charge.
GPT Image 2 token billing
All gpt-image-2 modes and endpoints are postpaid Token-billing paths. They do not precharge. After a successful terminal callback, the gateway records uncached input, cached input, and output tokens from result.usage, converts the official USD amount at $1 = 100 credits, and applies the existing pricing coefficients.
GPT Image 2 supports Token billing only. Current prices are USD per 1M tokens and are the same for Official API Relay (standard) and Subscription Direct (flex): text input $5.000000, cached text input $1.250000, image input $8.000000, cached image input $2.000000, and image output $30.000000.
The two compatible endpoints require enough balance for the full final charge before delivering a result. Async pro instead caps the charge at the balance available when the terminal result is settled, reduces that usable gateway balance to zero, delivers the result, and does not carry the uncollected difference as debt. The charge is reserved as outstanding usage immediately; the external wallet deduction can occur later in the image batch described next. A zero-balance account cannot create another task.
Every token-billed image call remains an exact per-call Usage record with input, cached-input, and output token counts. Once unsettled image charges reach at least 10 credits, multiple records are combined into one whole-credit wallet charge. Fractional credits are not discarded: the remainder stays unsettled and is carried into the next batch. The Usage page's Settled column is 0 before settlement and shows the amount of each record already included in successful batches; the final record in a batch can be partially settled.
Console and limits
| Where to see usage | The console's Usage page: each row includes a Request ID, model, token usage, and charge; search or copy the ID to reconcile. |
| Balance / top-up | View balance on Overview and use the Top-up page to add credits. |
| Per-key management | Key names are required. The full key is shown only once at creation; later lists show only a masked fingerprint. API Keys supports channel selection, rename, enable/disable, delete, and unlimited, fixed-total, UTC weekly, or UTC monthly limits. Weekly/monthly limits reset automatically; changing the amount within the same type preserves current-period usage, while changing the type starts a new period. Once reached, that key returns HTTP 402 with insufficient_quota. |
Keep your key secret: an sk- key controls account spending — never put it in frontend code,
commit it to Git, or paste it in public. If leaked, disable or delete it and create a new one on
the API Keys page immediately.