Skip to main content
llm.kiwi uses conventional HTTP response codes to indicate the success or failure of an API request.

HTTP Status Codes

CodeTypeDescription
200SuccessEverything worked as expected.
400Bad RequestThe request was unacceptable, often due to missing parameters.
401UnauthorizedNo valid API key provided.
403ForbiddenYou lack permissions for the requested resource (e.g., tier limits).
404Not FoundThe requested resource doesn’t exist.
429Rate LimitToo many requests hit the API too quickly.
500Server ErrorSomething went wrong on our end.

Error Object Structure

When an error occurs, the API returns a JSON object with details about the failure.
{
  "error": {
    "message": "The model 'invalid-model' does not exist.",
    "type": "invalid_request_error",
    "code": "model_not_found"
  }
}

Common Error Scenarios

Rate Limiting (429)

If you exceed your tier’s limits, you will receive a 429 error. We recommend implementing exponential backoff to handle these gracefully.

Token Limits (400)

If your messages array combined with max_tokens exceeds the model’s context window, the request will fail.

Invalid Key (401)

Ensure your Authorization header is formatted correctly as Bearer YOUR_API_KEY.