Xinghuo AI Gateway

Developer guides · API access

AI API token billing explained: input, output and cache

Understand input tokens, output tokens, cache reads and writes, group multipliers and usage records before estimating Xinghuo AI API costs.

Xinghuo AI Gateway · Updated

Request costs can depend on input, output, cache usage and group pricing. Confirm the current account quote and compare it with the request usage record.

Separate the billed units

Tokens are not a fixed number of characters. Repeated history and large tool results can increase subsequent input usage.

A hypothetical calculation

This is an arithmetic example, not a site quote. At CNY 10 per million input tokens and CNY 30 per million output tokens, 1,000 ordinary input tokens and 200 output tokens, with no cache or other charges, cost:

1000 / 1,000,000 * 10 + 200 / 1,000,000 * 30 = CNY 0.016

Apply a group multiplier only if the displayed rate does not already include it. Payment currency, credited balance units and model price currency must be checked separately.

Avoid counting cached input twice

Some response formats include cache reads in total input; others report separate categories. Use the usage breakdown and billed result shown by this site. Keep request time, model, group and request ID for reconciliation.

Verify one request

  1. Check starting balance, model and group.
  2. Make one short request with limited output while avoiding other tasks on that key.
  3. Open key usage lookup or account usage and compare tokens, cache, time and cost.
  4. For questions, share redacted records, never the full key.

Control spending

Use separate keys for applications, set output and concurrency limits, and bound retries for recoverable errors. A network interruption does not prove a request was never processed; check usage before repeating an expensive task.

Choose a model. Connect your application.

Check current model access and account pricing, then register and buy the credits you need.

View models & pricing Buy credits Create an account →