Errors
Every error has the same shape and a code you can branch on.
{ "error": { "code": "no_plan", "message": "This project has no active plan for langbiang-extract-1.0. Choose one at https://developers.montek.io/pricing." } }Branch on code; message is for people and may change.
| Status | Code | What to do |
|---|---|---|
| 400 | invalid_request | Fix the request: a field is missing or malformed, or the url could not be downloaded. The message names the field. |
| 401 | unauthorized | The key is missing, wrong or revoked. Check Authorization: Bearer …. |
| 402 | no_plan | The key's project has no plan for this model. Choose one on Plans. |
| 402 | overage_cap_reached | The project has used its overage cap for this period. Raise the cap on Limits. |
| 403 | forbidden | The key's scopes do not cover this endpoint. Create a key with the scope. |
| 403 | project_suspended | The key's project is suspended. Contact your Montek partner. |
| 404 | not_found | The endpoint, job or part does not exist in the key's project. Check the path and the id. |
| 409 | idempotency_key_reused | This Idempotency-Key was already used with a different request. Use a new key for a new request. |
| 413 | file_too_large | A PDF can be up to 10 MB and an image up to 5 MB. Split the PDF or lower the image resolution. |
| 413 | too_many_pages | A PDF can have up to 30 pages per request. Split it and send the parts. |
| 415 | unsupported_media_type | Send PNG, JPEG, WebP, GIF or PDF, as multipart/form-data with a file or as JSON with a url. |
| 422 | document_too_long | The document has more content than one request can return. Split it and send the parts. |
| 422 | unreadable_document | The file could not be read. Check that it opens, shows a document and is not password-protected. |
| 429 | rate_limited | Wait Retry-After seconds, then retry. The SDKs do this for you. |
| 500 | internal_error | Montek failed. Retry with exponential backoff, with the same Idempotency-Key. |
| 503 | model_unavailable | The model is busy. Wait Retry-After seconds, then retry with the same Idempotency-Key. |
Failed calls are never counted toward usage. Error messages never contain your document's content.