Credits
Which API calls spend plan allowance, when they answer 402, what each code means and how to check your balance first.
Your plan comes with allowances: voice minutes, concurrent calls, knowledge storage, automation runs and copilot credits. Most of the API is free to use. A few actions spend an allowance, and when one has run out the API answers `402` and does not do the action.
What spends an allowance
| Action | Allowance it needs | Checked when |
|---|---|---|
POST /v1/calls | Voice minutes, concurrent calls, outbound calling | The call is requested. Calls already in progress are not cut off by the check. |
POST /v1/campaigns/{id}/start and /resume | Voice minutes, concurrent calls, outbound calling | The campaign is started or resumed. |
POST /v1/knowledge/documents | Knowledge storage | A document is uploaded. |
POST /v1/automations/{id}/runs | Automation runs | A run is started. |
POST /v1/copilot | Copilot credits | A turn is sent, whenever the copilot is answering with its AI model. |
Reading data, managing contacts, agents, phone numbers and campaigns (other than starting them) never answers 402. Creating an automation does not spend a run; running it does.
The 402 response
detail is an object with a code that says what ran out. Branch on code.
{"detail": {"code": "minutes_limit_reached"}}| `code` | What it means | What to do |
|---|---|---|
minutes_limit_reached | The plan's voice minutes for this cycle are used up and the plan does not allow extra minutes. | Upgrade the plan or wait for the next cycle. |
concurrent_limit_reached | As many calls are live as the plan allows at once. | Wait for a call to end and try again. |
outbound_disabled | Outbound calling is not turned on for this plan or workspace. | Ask a workspace admin or change plan in the dashboard. |
kb_storage_limit_reached | The document would take the workspace over its knowledge storage. | Delete documents you no longer need, or upgrade. |
automation_executions_limit_reached | The plan's automation runs for this cycle are used up and extra runs are not allowed. | Upgrade the plan or wait for the next cycle. |
copilot_credits_exhausted | The plan's copilot credits for this cycle are used up and extra credits are not allowed. | Upgrade the plan or wait for the next cycle. |
wallet_empty | The plan lets you use more than its allowance and pays for the extra from your wallet, but the wallet has no funds left. Applies to voice minutes, automation runs and copilot credits. | Add funds to the wallet in the dashboard. |
workspace_inactive | The workspace is not active. | Contact your workspace admin or support. |
The API only reports the problem. Topping up the wallet, changing plan and checkout are done in the dashboard; see Billing and plans.
Check before you act
GET /v1/account (scope account:read) shows what is left, so an integration can stop or warn before it hits a 402.
curl -sS -X GET "https://api.stage.dhvanee.com/v1/account" \
-H "Authorization: Bearer dhvanee_live_YOUR_KEY"{
"plan": "Free",
"plan_code": "free",
"voice_minutes": {"limit": 60.0, "used": 6.0, "remaining": 54.0},
"concurrency": {"in_use": 0, "cap": 5},
"automation_executions": {"limit": 100.0, "used": 0.0, "remaining": 100.0},
"knowledge_storage_mb": {"limit": 1.5, "used": 0.0, "remaining": 1.5},
"copilot_credits": {"limit": 450.0, "used": 0.0, "remaining": 450.0, "extra_allowed": false},
"wallet": {"balance": 5000.0, "available": 5000.0, "currency": "INR", "required": true},
"cycle_start": "2026-11-27T11:52:25.861802+00:00",
"cycle_end": "2026-12-27T11:52:25.861802+00:00"
}| Field | Meaning |
|---|---|
voice_minutes, automation_executions, knowledge_storage_mb | limit is the plan allowance for this cycle, used is what has been spent and remaining is what is left. A limit of null means no limit. |
concurrency | in_use is calls live now and cap is the most the plan allows at once (null for no cap). |
copilot_credits | Same as above, plus extra_allowed: whether the plan lets you keep going on wallet funds after the allowance. |
wallet | balance is the money in the wallet and available is what can still be used after charges not yet settled, in currency. required is true when extra usage is paid from the wallet and stops when it is empty. |
cycle_start, cycle_end | The billing cycle. Allowances start again at cycle_end. |
GET /v1/account shows balances only. It carries no card or payment details and cannot change anything.A call that is refused
Placing a call needs an Idempotency-Key and a number you own in from. When voice minutes are used up it answers 402 and no call is made:
curl -sS -X POST "https://api.stage.dhvanee.com/v1/calls" \
-H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
-H "Idempotency-Key: order-1042-call" \
-H "Content-Type: application/json" \
-d '{"agent_id":"AGENT_ID","to":"+919876543210","from":"PHONE_NUMBER_ID"}'{"detail": {"code": "minutes_limit_reached"}}- The plan check comes first, before the agent and number are checked, so
402can appear even if the rest of the request has a mistake. - A
402is not remembered by theIdempotency-Key. Once you have added minutes you can send the same request again.
Good habits
- Read
GET /v1/accountbefore a large batch and stop early whenremainingis low. - Treat
402as a business signal, not a fault. Do not retry in a loop; tell a person. - Keep an eye on
concurrency.in_useagainstcapwhen you place many calls at once.