reference
Errors and limits
Errors use the OpenAI envelope, so existing client error handling works:
{
"error": {
"message": "Your credit balance is empty. Add credits at ...",
"type": "insufficient_quota",
"param": null,
"code": "insufficient_credit"
}
}Codes
| status | code | meaning | retry? |
|---|---|---|---|
| 400 | invalid_json | The body was not valid JSON. | No |
| 400 | missing_text | /v1/restyle was called without a non-empty text. | No |
| 400 | input_too_large | Over 6,000 characters. Send the document a section at a time. | No |
| 400 | input_too_long | A single block exceeded the context window. Add a paragraph break. | No |
| 401 | invalid_api_key | Missing, malformed, unknown or revoked key. | No |
| 402 | insufficient_credit | The account balance is empty. Add credit, or turn on auto top-up. | After topping up |
| 402 | key_spend_limit_reached | This key hit its lifetime cap. Other keys are unaffected. | After raising it |
| 403 | model_not_permitted | The key’s allowlist does not include this model. | No |
| 404 | model_not_found | No such model id. | No |
| 404 | model_not_available | The model is in the catalogue but not serving yet. | No |
| 502 | upstream_error | The model returned an error. | Yes, with backoff |
| 502 | upstream_unreachable | The model could not be reached. | Yes, with backoff |
| 503 | no_capacity | No capacity is available. A problem on our side, not with your request. | Yes, with backoff |
| 504 | timeout | The model took too long. | Yes |
In short: retry 5xx with exponential backoff and jitter. Do not retry 4xx, nothing about the request will have changed.
Failed requests are not charged
A request that fails before the model generates anything costs nothing. It is still recorded, at zero cost, so a failing integration is visible on your usage dashboard instead of only in our logs.
Limits
| limit | value |
|---|---|
| Request body | 6,000 characters per request |
| Single block | ~1,150 words |
| Context window | 4,096 tokens, prompt and completion together |
| Request timeout | 180 seconds per block |
| Playground, signed out | 10 runs a day per IP, 2,000 characters each |
Per-key concurrency limits apply so that one caller cannot occupy the whole fleet. If you are planning something high-volume, email hello@meragpt.com first and we will make sure the capacity is there.