Operations
Errors
Every error code the API returns, what causes it and what to do next.
Errors use conventional HTTP status codes and a consistent JSON body. Branch on error.code, which is stable; message is for humans and may change.
Error object
{
"error": {
"type": "billing_error",
"code": "insufficient_words",
"message": "Your allowance is used and pay as you go is off, or its monthly cap is reached. Nothing was processed. This request needs 6120 words; 2400 are left in this period's allowance.",
"request_id": "req_01JD4R9QT2",
"doc_url": "https://intactvoice.com/docs/errors#insufficient_words",
"words_needed": 6120,
"plan_words_remaining": 2400
}
}Error codes
| Status | code | Cause | What to do |
|---|---|---|---|
| 400 | invalid_request | A parameter is missing, has the wrong type or is out of range. error.param names it. | Fix the request. Don't retry unchanged. |
| 400 | text_too_short | Detect input under 40 words, or Rewrite input under 20 words. | Send more text, or skip detection for short snippets. |
| 401 | invalid_api_key | Missing, malformed or revoked key. | Check the Authorization header and key mode. |
| 402 | insufficient_words | Your allowance is used and pay as you go is off, or its monthly cap is reached. Nothing was processed. Also returned when the workspace has no plan. | Upgrade, or switch on pay as you go (or raise its cap) in Dashboard → Billing. |
| 403 | permission_denied | The key lacks a scope, a voice from the other mode (test or live) was passed as voice_id or calibrate_to, or the feature needs a higher plan (deep strength, calibrated Detect, more voices). | Use a key with the scope in error.param, use a voice from the same mode, or upgrade. |
| 404 | not_found | Unknown voice, job or endpoint, or it belongs to another workspace. | Check the id and the key's workspace. |
| 409 | idempotency_conflict | Same Idempotency-Key reused with a different body, or sent again while the first request with that key is still being processed (Retry-After: 5). | Use a new key per distinct request. If the first request is still being processed, wait for Retry-After and retry with the same key. |
| 410 | result_expired | The job's result was already delivered (sync response, an earlier GET, the event stream or a webhook) or wasn't collected within 60 minutes, so it was deleted. | Save the result the first time you receive it. Run the request again if you need it (that is billed again). |
| 413 | text_too_long | Input over 25,000 words, or a request body over 4 MB. | Split the document or contact us for higher limits. |
| 422 | fidelity_failed | Strict mode only: a protected fact changed in the output (a number, unit, date, link or preserve string found in code, or a name, quote or claim confirmed by the model review). HTTP 422 on a synchronous request; on an async job it is the job's error and the job.failed webhook. changed_facts lists each change with an explanation. Not billed. Under the default, standard, the rewrite is returned with the change flagged instead. | Retry once, then route to a person. |
| 422 | quality_failed | Standard or Deep introduced excessive tiny fragments or could not improve the displayed AI-likelihood score of a clearly AI-scored draft. No rewrite is returned and no words are billed. Light edits are exempt; the signal check is also skipped for drafts below the likely-AI band. | Retry once, then review the draft with an editor. |
| 429 | rate_limited | Per-key request, concurrency or word limit exceeded, or too many async jobs in flight for the workspace. | Wait for Retry-After, then back off. |
| 500 | internal_error | Something failed on our side (on a job: it failed on our side several times). Nothing was billed. | Retry with backoff; quote request_id to support. |
| 503 | overloaded | Temporary capacity limit. | Retry with backoff, or use async jobs. |
capacity_unavailable | An accepted job could not finish within 120 minutes of being accepted because model capacity stayed unavailable. Reported on the job and its job.failed webhook. Nothing was billed and your text was deleted. | Submit the job again later. |
422 fidelity_failed
Only sent with fidelity: "strict". A protected fact changed during rewriting and we refused to return it. No words are billed. Under the default, standard, the same change comes back with the rewrite as fidelity.status: "warn".
{
"error": {
"type": "fidelity_error",
"code": "fidelity_failed",
"message": "A protected fact changed in the rewrite and strict fidelity is on. Nothing was billed.",
"request_id": "job_01JD4QC7",
"doc_url": "https://intactvoice.com/docs/errors#fidelity_failed",
"changed_facts": [
{
"type": "number_unit",
"source": "14 days",
"output": "14 weeks",
"position": {
"start": 118,
"end": 126
},
"explanation": "\"14 days\" in your text became \"14 weeks\" in the rewrite."
},
{
"type": "claim",
"source": "the writer receives only a topic",
"output": "the writer gets a topic",
"explanation": "The rewrite drops \"only\", which changes the claim."
}
]
}
}See Fidelity checks for the rules.
What to retry
- Retry with backoff:
429,500,503, and network timeouts. - Retry once, then escalate:
422 fidelity_failedor422 quality_failed. - Don't retry: other
4xxcodes. The same request will fail the same way.
Note:
Send anIdempotency-Key header on POST requests so a retry after a timeout can't bill you twice. A replay answers from the original job (we never store response text): an async request gets the job; a sync request gets its result if the first response never reached you, otherwise 410 result_expired. A retry sent while the first request with that key is still being processed gets 409 idempotency_conflict with Retry-After: 5. Wait that long and retry with the same key to get the original job.