Usage and Billing
Token usage in every response, prompt caching, reasoning tokens, and how Serverless bills.
Every successful response reports token usage, including streaming responses. Use it to track spend per request. For account-level usage and credit balance, use the dashboard at www.abhigya.ai.
Chat Completions usage
The response carries a usage object.
| Field | Meaning |
|---|---|
prompt_tokens | All prompt tokens, including cached tokens. |
prompt_tokens_details.cached_tokens | Prompt tokens served from the prompt cache. A subset of prompt_tokens. |
completion_tokens | All generated tokens, including reasoning tokens. |
completion_tokens_details.reasoning_tokens | Generated tokens spent on returned reasoning. A subset of completion_tokens. |
total_tokens | prompt_tokens + completion_tokens. |
Successful streams end with a usage chunk before data: [DONE]. You do not need to set stream_options.
Prompt caching
Prompt caching is automatic. When a request starts with the same tokens as a recent request, the cached prefix is reused. You do not need to send cache_control or any other field.
Cached tokens are reported as prompt_tokens_details.cached_tokens and bill at the cache-read rate. Cache hits are not guaranteed.
To get more cache hits, keep the stable part of the prompt (system prompt, tool definitions, long documents) at the start and put changing content at the end.
How requests are billed
Serverless is prepaid. Each request is charged against your credit balance at the model's rates (see Pricing).
- Uncached prompt tokens bill at the input rate.
- Cached prompt tokens bill at the cache-read rate when the model has one.
- Generated tokens, including reasoning tokens, bill at the output rate.
On some models, generated tokens can exceed max_tokens when reasoning is on. See Output length.
Requests rejected before generation starts (authentication, validation, and rate-limit errors) are not charged. A stream that fails after it starts may be charged for tokens already generated.
Before a request runs, we check that your balance covers its maximum possible cost. When it does not, the request returns 402 with code insufficient_credits. See Credits.
Dashboard
The dashboard at www.abhigya.ai shows your credit balance and usage, and is where you add credits. To track individual requests, use the usage object in each response and the x-request-id response header to correlate requests with your logs.