Errors
Error codes, what they mean and what to do about them.
Errors are JSON, with a stable code to branch on and a message for people:
{ "error": { "code": "invalid_request", "message": "the \"instructions\" field is missing" }, "request_id": "req_…" }Failed requests cost nothing.
| Status | code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request | A field is missing, unknown or malformed. | Fix the request; the message says which field. |
| 401 | unauthorized | The key is missing, malformed, unknown or revoked. | Check NEXPDF_API_KEY. |
| 402 | payment_required | The account's billing needs attention. | Update the payment method in the dashboard. |
| 404 | not_found | No such job or viewer link, or not this key's. | Check the id; results are deleted 24 hours after a job ends. |
| 409 | not_ready | The job has not finished. | Wait for retry-after, or use waitForJob in the clients. |
| 409 | job_failed | The job failed; it has no result. | Read the job's error. |
| 413 | file_too_large | A file is over the key's size limit. | Split the file, or move to a larger plan. |
| 413 | document_too_long | The text is over the AI endpoints' 300,000 characters. | Split the document first. |
| 422 | fetch_failed | A file sent as a link could not be downloaded, or your own time-stamp authority (timestamp_authority) refused or did not answer; the message says why. | Check that the link works from the internet and has not expired; for a time-stamp authority, its address and credentials. |
| 422 | ai_refused, ai_incomplete | The model declined the document, or the answer would be too long. | Ask for fewer fields; check the document. |
| 422 | processing_failed | The document could not be processed (damaged file, wrong password, page out of range), the job needs more units than are left, or a test key was used to edit Excel or Word. | Check the file and the message. |
| 422 | not_available | This server does not offer what the request asks for, such as ICP-Brasil AD-RT without a time-stamp authority. Refused before any work, at no cost. | For AD-RT, give your own ACT in timestamp_authority, or sign at B-B (AD-RB). |
| 429 | rate_limited | Too many requests this minute. | Retried by the clients; wait for retry-after. |
| 429 | concurrency_limited | Too many requests in progress at once. | Retried by the clients; wait for retry-after. |
| 429 | quota_exceeded | No units left this month. | Upgrade, or wait for the next month. |
| 503 | busy, unavailable | Our side is busy, or a timestamp authority did not answer. | Retried by the clients; wait for retry-after. |
| 503 | ai_unavailable | AI endpoints are not enabled on this server. | Write to us. |
| 504 | timeout | Processing took too long. | Split the job into smaller requests. |
In the clients
Every client raises one error type carrying the status, the code, the message, the request id
and retryAfter. See client libraries. Retries for rate_limited,
concurrency_limited, 503 and network failures happen before the error reaches you.