Errors
Errors return an HTTP status and a JSON body. A request that fails is never billed.
{
"error": {
"code": "card_required",
"message": "This month's 10000 free words are used up. Add a card in the dashboard to keep going; usage is billed at the end of the month."
}
}
Validation errors (422) use Laravel's format instead: {"message": "…", "errors": {"field": ["…"]}}.
| Status | Code | What to do |
|---|---|---|
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 402 | card_required | This month's free words are used up. Add a card in the dashboard. |
| 402 | payment_failed | Your last invoice could not be charged. Replace the card in the dashboard. |
| 402 | monthly_limit_reached | This request would pass your monthly word limit. Ask us to raise it. |
| 422 | invalid_text | Fewer than 30 words, or a file that cannot be read. |
| 422 | text_too_long | More than 15,000 words. Split the text. |
| 429 | rate_limited | More than 60 requests a minute on one key. Wait for the seconds in Retry-After. |
| 502 | analysis_failed | The analysis failed on our side. Retry. |
| 504 | timeout | The analysis took too long. Retry after a few seconds. |