RouteMux Docs

Connection and usage

Base URLs, auth headers, and telling misconfiguration apart from failure.

Which base URL do I use?

It depends on the protocol your client speaks, not on which model you want:

Your client speaksBase URL
OpenAIhttps://api.routemux.com/v1
Anthropichttps://api.routemux.com
Google GenAI / Vertexhttps://api.routemux.com/vertex-ai

Why OpenAI keeps /v1 and Anthropic does not

OpenAI clients append only the operation path (/chat/completions), so /v1 belongs in the base URL. Anthropic clients append /v1/messages themselves, so putting /v1 in the base URL yields /v1/v1/messages. Getting these backwards is the most common setup error.

How do I authenticate?

Authorization: Bearer sk-... works everywhere. x-api-key (Anthropic style) and x-goog-api-key (Google style) are also accepted, so SDKs work unmodified.

Sending several key headers with the same value is fine. Sending different values returns 400 AMBIGUOUS_API_KEY — usually a stale key left in a field you stopped using.

Which models can I call?

GET /v1/models returns exactly the set your key can call. It is a metadata query and is not billed. Treat it as the source of truth: a model that is not in that response will fail no matter how the client is configured.

What does each error mean?

StatusMeaningWhat to do
401Key missing, malformed, or revokedCheck the key starts with sk- and has no stray whitespace
402Wallet balance is zeroTop up, then retry. This is not a request problem
429Rate limitedLower concurrency; retrying harder makes it worse
503Upstream overloadedRetry with backoff
400 AMBIGUOUS_API_KEYTwo different keys sentClear the header you are not using

Does streaming work?

Yes, unchanged. RouteMux forwards SSE without buffering the whole response, and settles billing on real usage once the upstream finishes.

On this page