Cost management
Cost control
Control call costs and balance consumption.
- Choose a model that is sufficient for the task instead of defaulting to the most expensive model.
- Limit output length and avoid repeatedly sending irrelevant context.
- Reuse stable prefixes when caching is supported, and pay attention to cached-input prices.
- For image requests, validate the prompt with
n=1before increasing the quantity. - Set a low-balance alert and regularly review the daily usage summary and ledger.
- Automatic retries must have a retry count and total time budget; do not replay 429s, timeouts, or upstream 5xx responses indefinitely.
Do not control costs by fabricating usage, bypassing balance checks, or reusing someone else's API key.
Last updated on