Route model calls
Providers
Mubit routes a call to the provider named by the path prefix the call uses. This page lists the providers and what you set for each. It is for anyone choosing which page to open next.
For every provider, the change in your code is the same: use Mubit's base URL for the provider, and send your Mubit key where the provider's SDK sends its API key. Keep your model IDs and the rest of your code.
| Provider | Prefix | Base URL for the SDK | Key header | Guide |
|---|---|---|---|---|
| OpenAI | /openai/v1 | https://api.mubit.ai/openai/v1 | Authorization: Bearer | Connect with the OpenAI SDK |
| Anthropic | /anthropic | https://api.mubit.ai/anthropic | x-api-key, or Authorization: Bearer | Connect with the Anthropic SDK |
| Gemini | /gemini | https://api.mubit.ai/gemini | x-goog-api-key | Connect with the Gemini SDK |
| OpenRouter, Groq, Together, Mistral | /compat/{service}/v1 | https://api.mubit.ai/compat/{service}/v1 | Authorization: Bearer | OpenAI-compatible services |
| Neon AI Gateway | none: chosen by your keys | the OpenAI, Anthropic or Gemini base URL | the same as that provider | Connect with the Neon AI Gateway |
| Any of the above, without an SDK | the prefixes above | the same as that provider | Connect with plain HTTP |
What every provider shares
- One key from your app. The key in the header is your Mubit key, never the provider's. How a call is routed says which provider key Mubit uses for the call.
- Your provider keys stay in the console. An admin adds them under Provider keys: see Provider keys.
- The provider's own API. Paths, request bodies, answers and streams are the provider's. Mubit passes them on.
- Recording. Mubit records each call by default. What Mubit records shows what is kept and how to lower it.
- Errors. Mubit's own errors take the provider's error format. Errors from Mubit lists them.
The base URL
The base URL in the table is https://api.mubit.ai, plus the prefix. Use the base URL your console's Connect page shows.
Call Mubit from your server, not from a browser. The API answers no CORS preflight request, so a browser refuses to send the call.
Not served
- A path outside these prefixes gets
404 unknown_route. - An organization or admin endpoint of a provider gets
403 admin_path_refused. Call the provider directly for those. - A service under
/compat/that isn't in the table gets404 unknown_provider.