Usage

API billing, usage, and troubleshooting

Reconcile model, group, units, and cache charges. Diagnose authentication, rate limits, timeouts, and coding-tool configuration.

Updated

Download Markdown

Find 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.
CategoryWhat to check
Uncached inputCheck whether the protocol’s input total already includes cache subcategories.
Cache readCache hits follow the applicable read rate; they are not necessarily free.
Cache writeSeparate reporting depends on protocol and model; cache duration can affect rates.
Output and reasoningDo not add reasoning tokens again if they are already included in output.

Diagnose by error type

SymptomCheck first
401Complete active key and the authentication header required by the endpoint.
403 / model accessKey group, model access, and the response message. A website 403 may instead come from edge protection.
429Error details and limit scope. Reduce concurrency and follow Retry-After when present.
timeout / 5xxWhether 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. 1

    Check activation

    Activate the configuration rather than only saving a draft.

  2. 2

    Reopen the tool and session

    Fully quit and reopen. Start a new session when required.

  3. 3

    Check overrides

    Inspect project settings, environment variables, and organization policies.

  4. 4

    Check the tested scope

    A short reply verifies a basic request. Tool execution, context, and permissions still need a real task check.