Skip to main content
Pre-launch. fremai is not open for signups yet. These docs describe the launch API and are subject to change. fremai.eu →
Error codes

Error codes

fremai returns errors in the OpenAI-compatible error envelope, so existing OpenAI error-handling works unchanged.

Envelope

{
  "error": {
    "message": "Human-readable description of what went wrong.",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
  • message — a human-readable explanation.
  • type — the error category.
  • param — the offending request field, when applicable (else null).
  • code — a machine-readable code, when applicable (else null).

HTTP status codes

StatusMeaningWhat to do
400Bad request — malformed body or invalid parameters.Fix the request. Check param for the offending field.
401Unauthorized — missing or invalid API key.Check the Authorization: Bearer sk-fremai-… header; rotate the key if needed.
402Payment required — prepaid credit exhausted or a budget cap reached.Top up or raise the budget in the console.
404Model not found — the requested model is not in your catalog.Use an id from GET /models or the catalog.
429Rate limited — a rate, token, or concurrency limit was exceeded.Back off for the Retry-After interval, then retry. See rate limits.

Handling 429

A 429 includes a Retry-After header (seconds). Respect it before retrying:

HTTP/1.1 429 Too Many Requests
Retry-After: 5

The official OpenAI SDKs implement Retry-After-aware backoff automatically. If you build your own client, add exponential backoff that honours the header.

Handling 402

A 402 means you have run out of prepaid credit or hit a budget cap. It is not a transient error — retrying will keep failing until you top up or raise the budget in the console. Wire threshold alerts (see rate limits & budgets) so you are warned before this happens.