Limits & error codes
The API uses standard HTTP status codes. Error bodies follow your client’s format, so the OpenAI and Anthropic SDKs can read them as is.
Error format
OpenAI-format endpoints return an error object with message, type, and code. Anthropic-format endpoints return "type": "error" with an error object containing type and message. Errors that occur mid-stream are sent as an event with the same shape.
402
{
"error": {
"message": "GeraiPoints tidak cukup, silakan top up",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}The
message text is written in Indonesian and may change. For program logic, check the HTTP status code and type/code, not the message text.Status codes
| Status | type / code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request_error | Invalid request: the body isn’t JSON, model is empty, or messages is missing/empty. Also appears when the base URL is wrong so the path becomes /v1/v1/…. | Check the body and base URL. |
| 401 | authentication_error | The API key is missing, wrong, or revoked — or used on the wrong route (a bansos key on a paid endpoint, or vice versa). | Check the key and base URL — Authentication. |
| 402 | insufficient_quota | Not enough GeraiPoints for this request. | Top up GeraiPoints, then resend. |
| 403 | permission_error | The model isn’t in this key’s allowlist, or it is a plan-only model you don’t have yet. | Add the model to the key’s allowlist, or use another key. |
| 404 | model_not_found | Unknown model id, or the model isn’t currently open. Prefixed names such as gp/… or openai/… also return 404. | Copy the exact id from the model list. |
| 413 | — | The request body is too large for the server to accept. | Shorten the conversation history or reduce attachments. |
| 429 | rate_limit_error | Too many requests: the model is at full capacity, or the Unlimited/Bansos plan limit has been exceeded. | Wait as indicated by Retry-After (if present), then retry with a delay. |
| 502 | api_error | The model service is busy or having issues; the request is not billed. | Retry after a few seconds, or use another model. |
| 503 | api_error | The model is under maintenance or temporarily unavailable; the request is not billed. | Try again later or use another model. |
Usage limits
| Type | Limit |
|---|---|
| Paid key (gk-) | No fixed rate limit per key; usage is limited by your GeraiPoints balance. 429 only appears when the model is at full capacity. |
| Unlimited plan | Limits on requests per minute and concurrent requests per account. 429 responses include Retry-After and x-ratelimit-*. Details on the Unlimited page. |
| Free tier (Bansos) | Daily request quota and a per-minute limit. 429 responses include Retry-After and x-ratelimit-*. Remaining quota on the Bansos page. |
| Size & response | Bodies that are too large are rejected with 413. Response length (max_tokens) may be lowered automatically if your balance can’t cover the requested value. |
| API key | Up to 20 active keys per account; allowlist of up to 64 models per key. |
| Customer keys | Limits are enforced before a request is processed: a request that would exceed the remaining limit is rejected. One-time limit used up → 402 KEY_BATAS_HABIS (raise the limit to add quota); daily/monthly limit reached → 429 KEY_BATAS_HARIAN / KEY_BATAS_BULANAN with a Retry-After header. Paused key → 403 KEY_DIJEDA. -unli and bansos models cannot be used with customer keys. |
Retrying correctly
- Retry only on 429, 502, and 503, with increasing delays (e.g. 1, 2, 4, 8 seconds) and a limit of 2–3 attempts.
- Don’t retry 400, 401, 402, 403, 404 — fix the request first; the result will be the same.
- Respect the
Retry-Afterheader when present. - Every retry is a new, billed request. If the cause is a timeout in your app, increase the timeout — see Agentic tool settings.