OpenAI-compatible base URLs cheat sheet
Published 2026-10-14 · Updated 2026-10-26
Almost every provider now exposes an OpenAI-compatible endpoint. The API key changes; the code doesn’t. Here’s the table.
| Provider | Base URL | Env var |
|---|---|---|
| OpenAI | https://api.openai.com/v1 |
OPENAI_API_KEY |
| OpenRouter | https://openrouter.ai/api/v1 |
OPENROUTER_API_KEY |
| xAI | https://api.x.ai/v1 |
XAI_API_KEY |
| DeepSeek | https://api.deepseek.com/v1 |
DEEPSEEK_API_KEY |
| Z.ai (GLM) | https://api.z.ai/api/paas/v4 |
ZAI_API_KEY |
| MiniMax | https://api.minimax.io/v1 |
MINIMAX_API_KEY |
| Moonshot (intl) | https://api.moonshot.ai/v1 |
MOONSHOT_API_KEY |
| Moonshot (CN) | https://api.moonshot.cn/v1 |
MOONSHOT_API_KEY |
| DashScope (intl) | https://dashscope-intl.aliyuncs.com/compatible-mode/v1 |
DASHSCOPE_API_KEY |
| Mistral | https://api.mistral.ai/v1 |
MISTRAL_API_KEY |
| Groq | https://api.groq.com/openai/v1 |
GROQ_API_KEY |
| Together | https://api.together.xyz/v1 |
TOGETHER_API_KEY |
| Fireworks | https://api.fireworks.ai/inference/v1 |
FIREWORKS_API_KEY |
| Cerebras | https://api.cerebras.ai/v1 |
CEREBRAS_API_KEY |
| NVIDIA | https://integrate.api.nvidia.com/v1 |
NVIDIA_API_KEY |
| Google (OpenAI-compat) | https://generativelanguage.googleapis.com/v1beta/openai/ |
GEMINI_API_KEY |
The one gotcha: Anthropic
Anthropic’s native API isn’t OpenAI-shaped. For Claude through OpenAI-style code, either use OpenRouter (anthropic/claude-sonnet-5) or a provider with an Anthropic-compat surface.
Trailing details that break configs
- Groq needs
openai/v1, the most-forgotten path segment in the table. - Google’s compat path ends in a slash and lives under
v1beta/openai/. - DashScope differs by region.
-intlfor the Singapore console, plaindashscope.aliyuncs.comfor China. - Model ids change shape. Direct APIs use bare names (
grok-5-mini); OpenRouter usesvendor/model.
When a client asks for “custom OpenAI provider” or “OpenAI-compatible”, this table is all it needs: base URL, key, model id.