Usage
API billing, usage, and troubleshooting
Updated
Download MarkdownFind the same request first
Open console usage logs and find the call by time. Keep the model, group, request ID, status, and charge. Remove keys and sensitive content before sharing diagnostics.
- Match the requested model with key access and the model recorded in the log.
- Do not mix groups, context sizes, or the several calls made by one tool task.
- Logs help reconciliation. Contact support with the request ID and time if further investigation is needed.
Check units before calculating cost
For rates per million tokens, a category’s cost = billable tokens ÷ 1,000,000 × rate. Calculate input, output, and applicable cache categories according to that model’s rules.
For per-request rates, reconcile charged requests and the applicable rules. A request rate is not a rate per million tokens, and one tool task can make multiple requests.
On the pricing page, select the model and your key’s group. Check credits, USD, or CNY, and whether the rate is per token or per request.
Reconcile cache reads and writes separately
- Do not sum every usage field across vendors; check parent and child categories first.
- History, tool definitions, and tool results add later input. Cache expiration and prefix changes can affect hits.
- Missing usage does not mean zero cost. Keep the raw response and request ID for unexplained records.
| Category | What to check |
|---|---|
| Uncached input | Check whether the protocol’s input total already includes cache subcategories. |
| Cache read | Cache hits follow the applicable read rate; they are not necessarily free. |
| Cache write | Separate reporting depends on protocol and model; cache duration can affect rates. |
| Output and reasoning | Do not add reasoning tokens again if they are already included in output. |
Diagnose by error type
| Symptom | Check first |
|---|---|
| 401 | Complete active key and the authentication header required by the endpoint. |
| 403 / model access | Key group, model access, and the response message. A website 403 may instead come from edge protection. |
| 429 | Error details and limit scope. Reduce concurrency and follow Retry-After when present. |
| timeout / 5xx | Whether the request was sent and whether logs contain a result. A timeout does not prove the server failed to complete. |
The API works but the coding tool does not
See the Codex and Claude Code guides. Contact support with redacted diagnostics if needed.
- 1
Check activation
Activate the configuration rather than only saving a draft.
- 2
Reopen the tool and session
Fully quit and reopen. Start a new session when required.
- 3
Check overrides
Inspect project settings, environment variables, and organization policies.
- 4
Check the tested scope
A short reply verifies a basic request. Tool execution, context, and permissions still need a real task check.