logo

Routing, Billing, and Errors

LLMoxy routes your request to an available upstream provider and automatically retries when the upstream temporarily fails. As a user you only need to specify the model; the gateway handles the rest.

Routing

When submitting a request, specify the model you want to call, and LLMoxy will:

  1. Pick a healthy provider from those that support the model and send the request.
  2. Automatically switch to another provider and retry on temporary errors (e.g., 5xx, some 429s, or timeouts).
  3. If all providers fail, return the last error to you in OpenAI style.

You do not need to configure any routing rules, nor do you need to know which provider the current request lands on.

Request Formats

The same key can call models through different format endpoints. Choose the one your application already uses:

FormatRoute
OpenAI ChatPOST /v1/chat/completions
OpenAI ResponsesPOST /v1/responses
Anthropic MessagesPOST /v1/messages
GeminiPOST /v1beta/models/{model}:generateContent
EmbeddingsPOST /v1/embeddings
RerankPOST /v1/rerank
OpenAI VideoPOST /v1/videos

Billing

After the request completes, LLMoxy charges based on the token usage returned by the upstream, covering prompt, completion, cache, audio, image, and reasoning tokens. Billing is per-request; there is no monthly subscription minimum.

Real-time balance and unit prices are based on the console:

  • Wallet: remaining balance and recharge history.
  • Pricing: current unit price for each model.
  • Logs: actual charge and token count for each request.

Error Responses

All errors use a unified OpenAI-style structure:

{
  "error": {
    "message": "error message",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request"
  }
}

Common status codes:

Status CodeCommon Cause
400Invalid request body or unsupported parameters.
401Key missing, misspelled, or disabled.
403Account disabled, IP not on allowlist, balance exhausted, or subscription unavailable.
404Model or route unavailable.
429Your key rate limit triggered, or all upstream providers hit capacity at the same time.
5xxAll upstream providers returned errors, or a gateway internal failure.

For any display involving amounts or usage, read the console or the most recent request response directly. Do not use cached values.