Ottili AI usage is credit-based. Each request consumes credits according to the model, input and output size, and any tool execution. Credits are tracked per company and enforced before dispatch.
Budget controls
A monthly AI budget is configured in Settings → AI. When the budget or remaining credits are exhausted, generation requests return a clear error rather than over-spending. No charges occur without an explicit, configured budget.
Usage fields
Every successful generation response includes a usage object:
{
"usage": {
"prompt_tokens": 182,
"completion_tokens": 47,
"total_tokens": 229
}
}When the upstream provider does not report exact counts,usage.sourceis"estimated"and cache/reasoning detail fields are omitted — never invented. The console labels estimated usage honestly.
| Field | Type | Description |
|---|---|---|
prompt_tokens | integer | Tokens sent in the request. |
completion_tokens | integer | Tokens generated in the response. |
total_tokens | integer | prompt_tokens + completion_tokens. |
credits | number | Credits consumed by this request. |
Streaming responses report usage in the final event.
Checking remaining credits
Credit balance and limits are reported through the developer identity and company endpoints; do not poll the generation endpoint to track spend. Cache the balance and react to usage-limit errors instead.
Exceeding limits
When the credit balance or monthly budget is exhausted, generation
requests return insufficient_balance (HTTP 402) or rate_limit_exceeded
(HTTP 429) with a machine-readable body, rather than over-spending.
Top up the budget in Settings → AI to resume.
Was this article helpful?
