API Errors

What each error means and exactly how to fix it

CodeMeaningQuick fix
400Invalid request formatCheck your request body and model name
401Authentication failedCheck your API key
402Out of creditsTop up on the Credits page
405Method not allowedUse POST (or GET for /models)
429Too many requestsWait a few seconds, then retry
502Upstream hiccupAuto-retried upstream; retry shortly
503No capacity availableTransient — retry in 2-5 seconds
504Upstream timed outRetry; split very long tasks
529Model provider overloadedWait 5-10 seconds, then retry
Can't connect (401)

401Missing API key

The request has no key. The OpenAI endpoint reads Authorization: Bearer <key>; the Anthropic endpoint reads x-api-key: <key> (either header works on both).

Add your InferKey API key to the request header.

401Invalid API key

The key does not exist or was deleted.

Check your keys on the API Keys page and create a new one if needed — deleted keys stop working immediately.

Out of credits (400 / 402)

400Your credit balance is too low to access the API

This account has never purchased credits.

Buy a credit pack on the Credits page — the key starts working immediately after purchase.

402Your credit balance is exhausted

The credits you purchased have been fully spent.

Top up on the Credits page. Requests resume immediately — nothing else to change.

Too many requests (429)

429Requests-per-minute limit exceeded

More requests in the last minute than the model allows (typical defaults: Claude models ~30/min, GPT models ~200/min).

Wait a few seconds and retry. Need sustained higher throughput? Contact us.

429Concurrency limit exceeded

Too many requests in flight at once for the model (typical defaults: Claude ~2 concurrent, GPT ~10 concurrent).

Let in-flight requests finish, or add a small queue to your client.

Invalid request (400)

400model is required / model not available

The request body is missing the "model" field, or names a model that is not offered.

Use a model from the pricing table, or call GET /openai/v1/models to list what is live.

400Other request errors

Prompt too long, invalid tool schema, bad parameter values, etc.

These pass through from the model API with the original message — fix the request as the message describes.

Transient capacity errors (502 / 503 / 504 / 529)

503No capacity available right now

Serving capacity for the model is momentarily saturated or rotating.

Transient — a retry with a 2-5 second delay almost always succeeds.

504Upstream timed out

The model did not finish responding in time (usually very long generations).

Retry. For very long tasks, prefer streaming and consider splitting the work.

529Model provider overloaded

Anthropic's or OpenAI's servers are under heavy load.

Wait 5-10 seconds and retry — this is on the model provider side.

Reading error responses
Errors come back in the same format as the API you are calling, so existing error handling keeps working.
// Anthropic style (/proxy)
{
  "type": "error",
  "error": {
    "type": "...",
    "message": "..."
  }
}
// OpenAI style (/openai/v1)
{
  "error": {
    "type": "...",
    "message": "...",
    "code": "..."
  }
}

Still stuck? Contact us — include the model, endpoint, status code, and rough time of the failing request.