Skip to content

Errors

Success and failure bodies use the same envelope:

401 Unauthorized
json
{
  "error": {
    "message": "Kunci API tidak valid.",
    "type": "invalid_request_error",
    "code": 401
  },
  "request_id": "req_8f3c1a"
}

type is invalid_request_error for 4xx, insufficient_quota for 402, and server_error for 5xx. code is the HTTP status.

Middleware failures (authentication, rate limits) use a string code. An unknown path answers like this:

Middleware and 404
json
{ "error": { "message": "Kunci API tidak valid.", "type": "invalid_request_error", "code": "INVALID_API_KEY" } }

{ "error": "Not found", "path": "/v1/tidak-ada" }

HTTP status

StatusMeaning
400Request validation failed, or the provider rejected the request.
401The credentials are not valid.
402Insufficient balance (chat).
403Scope, IP, or account status does not allow it.
404Model or endpoint not found.
409The promo code has already been used.
410The HTTP top-up endpoint is no longer available.
422Request validation failed.
429Rate limit exceeded.
500Internal gateway error.
Image and audio endpoints return 400 Insufficient credits, not 402 — only chat uses 402.

Still haven't found the answer? Try it directly in Playground or view the list of active models.