Usage, fees and current limits
Understand usage units, reconcile call records, and control request budgets.
Where to find out the fees?
Models and Prices displays models and grouped quotes; Wallet manages balances; Call Records is used to check actual requests and consumption. Records and statistics may use different time ranges and should be compared after aligning dates, time zones, models and accounts.
Billing unit
Text may distinguish input, output, cache reads, or writes; images, videos, audio, and task models may use number of images, duration, times, or other measurements. Don’t estimate the token based solely on the length of the response text, and don’t directly compare the unit prices of different units.
Withholding and Settlement
For some requests, a quota is reserved before the call is made, and will be settled according to actual measurement after completion. Credit changes during long task waiting periods do not necessarily equal the final cost. Client cancellation or network timeout also does not prove that the upstream is not executing.
Quota and current limit
Accounts, keys, model groups, and upstreams may each have restrictions. 429 It is necessary to reduce concurrency or wait for the current limiting window; if the balance or key quota is insufficient, the quota should be supplemented or the settings should be adjusted, and retrying should not be continued.
Control costs
Verify from a single small request, set application budget and concurrency limit. Save the status of repeated business tasks to avoid repeated creation after timeout. For fee disputes, please provide the desensitization request ID, model and time. The complete key will not be sent.
How to check a request
- Record the request time, time zone, model, protocol, and request ID.
- Filter the same time period and Key in the call record to confirm that it is this request.
- Check the actual grouping, input and output, and currently visible cache, image or task usage.
- Compare the applicable price units and do not directly multiply Tokens per million by each time or second.
- Wait until the final state of a long task before checking the final results, and keep necessary desensitization records.
Common sources of errors
| Situation | Why it’s different |
|---|---|
| Client estimates based on text only | May not cover tools, images, or cache categories |
| The request has been canceled | The upstream may have performed some or all of the work |
| Looking at different time windows | The time zone and statistical date are inconsistent |
| Same model changed grouping | Available sources and quotes may differ |
| The task is still running | The reserved quota and the final settlement are not at the same time |
Apply budget
Set single request output, concurrency, single user and project cycle budgets respectively, and calculate the worst case scenario before submitting batch tasks. The application layer budget needs to consider tasks that have been submitted but not yet completed, and cannot only count downloaded results. Setting alarms does not replace actual limits.
429 and insufficient quota
Differentiate rate, concurrency, account balance and key limit based on errors. There is limited back-off for rate issues, and account settings are dealt with for quota issues first, without repeated retries. When reporting to support, please attach the request ID and verification basis, and the complete balance history and key will not be disclosed.