API compatibility - verified
OpenAI-compatible and Anthropic-compatible API endpoints by provider
All 20 providers here document an OpenAI-compatible API (OpenAI's own is the reference), and 13 document an Anthropic-compatible one, the Messages API format that Claude Code and the Anthropic SDK speak. xAI has deprecated its Anthropic layer. The docs for the other 6 do not mention an Anthropic-compatible endpoint, which is not the same as saying there is none.
Each base URL is copied verbatim, placeholders included, and every provider page quotes the line that documents it. To point a specific coding tool at one of these providers, see the setup guides.
Verified against each provider's own documentation. Not documented means the docs read that day do not say; it never means No.
- Providers
- 20
- OpenAI-compatible
- 20
- Anthropic-compatible
- 13
- Documented limits
- 97
Base URLs by provider
The Anthropic column is the value for ANTHROPIC_BASE_URL. Not documented means the provider's docs do not mention that layer; Deprecated links the notice. Limits counts the limitations the docs list. Open a provider for regional URLs, notes and quotes. Scroll the table sideways on a small screen.
| Provider | OpenAI-compatible base URL | Endpoints | Anthropic-compatible base URLANTHROPIC_BASE_URL | Auth | Limits |
|---|---|---|---|---|---|
| DeepSeek | https:/ |
| https:/ |
| 10 |
| Moonshot AI (Kimi) | https:/ |
| https:/ |
| 0 |
| Z.ai (GLM) | https:/ |
| https:/ |
| 2 |
| MiniMax | https:/ |
| https:/ |
| 8 |
| Alibaba Cloud Model Studio (Qwen) | https:/ |
| https:/ |
| 5 |
| xAI (Grok) | https:/ |
| Deprecated |
| 8 |
| Google Gemini API | https:/ |
| Not documented |
| 5 |
| Mistral AI | https:/ |
| Not documented |
| 0 |
| Groq | https:/ |
| Not documented |
| 4 |
| Cerebras Inference | https:/ |
| Not documented |
| 6 |
| Fireworks AI | https:/ |
| https:/ |
| 9 |
| Together AI | https:/ |
| Not documented |
| 8 |
| OpenRouter | https:/ |
| https:/ |
| 2 |
| Ollama | http:/ |
| http:/ |
| 10 |
| LM Studio | http:/ |
| http:/ |
| 0 |
| vLLM | http:/ |
| http:/ |
| 5 |
| Amazon Bedrock | https:/ |
| https:/Claude models only |
| 3 |
| Microsoft Foundry / Azure OpenAI | https:/ |
| https:/Claude models only |
| 2 |
| Anthropic (Claude API) | https:/Not for production, per Anthropic |
| https:/Native API |
| 10 |
| OpenAI (reference) | https:/Native API |
| Not documented |
| 0 |
Explainer
How compatibility layers work
A compatibility layer lets you keep your SDK and change one URL. The catch is in the details each provider documents, which is why every provider page lists its limitations layer by layer.
- What a compatibility layer is
- An endpoint that accepts another vendor's request format, so an existing SDK or tool works by changing only the base URL, the API key and the model name. An OpenAI-compatible layer speaks the Chat Completions (and sometimes Responses) format; an Anthropic-compatible one speaks the Messages API that Claude Code uses.
- Why some base URLs end in /v1 and some do not
- The OpenAI SDK appends paths such as
/chat/completionsto the base URL, so most OpenAI-compatible values include/v1; 3 here use a different path (DeepSeek, Z.ai (GLM), Google Gemini API). The Anthropic SDK appends/v1/messagesitself, so every Anthropic-compatible base URL in the table stops before/v1. Copy each value exactly as listed rather than adding or dropping/v1to make them match. - Compatible does not mean identical
- Layers accept the format but can ignore parameters, reject content types or map model names. The docs for 16 providers list 97 such limitations in all, each quoted on the provider's page under Documented limitations. Check that list before relying on caching, thinking budgets, tool choice or sampling settings.
FAQ
Which AI providers offer an Anthropic-compatible API?
Besides Anthropic itself, 12 of 20 providers document an Anthropic-compatible (Messages API) endpoint: DeepSeek, Moonshot AI (Kimi), Z.ai (GLM), MiniMax, Alibaba Cloud Model Studio (Qwen), Fireworks AI, OpenRouter, Ollama, LM Studio, vLLM, Amazon Bedrock and Microsoft Foundry / Azure OpenAI. Amazon Bedrock and Microsoft Foundry / Azure OpenAI serve Claude models only on theirs; they are not a translation layer for other model families. xAI (Grok)'s Anthropic layer is deprecated: "Deprecated: The Anthropic SDK compatibility is fully deprecated. Please migrate to the Responses API or the gRPC API." The docs for Google Gemini API, Mistral AI, Groq, Cerebras Inference, Together AI and OpenAI (reference) do not mention one.
What is the OpenAI-compatible base URL for each provider?
Set the OpenAI SDK's base_url (or baseURL) to the provider's value and use its API key. DeepSeek: https://api.deepseek.com; Moonshot AI (Kimi): https://api.moonshot.ai/v1; Z.ai (GLM): https://api.z.ai/api/paas/v4/; MiniMax: https://api.minimax.io/v1; Alibaba Cloud Model Studio (Qwen): https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1; xAI (Grok): https://api.x.ai/v1; Google Gemini API: https://generativelanguage.googleapis.com/v1beta/openai/; Mistral AI: https://api.mistral.ai/v1; Groq: https://api.groq.com/openai/v1; Cerebras Inference: https://api.cerebras.ai/v1; Fireworks AI: https://api.fireworks.ai/inference/v1; Together AI: https://api.together.ai/v1; OpenRouter: https://openrouter.ai/api/v1; Ollama: http://localhost:11434/v1/; LM Studio: http://localhost:1234/v1; vLLM: http://localhost:8000/v1; Amazon Bedrock: https://bedrock-runtime.{region}.amazonaws.com/openai/v1; Microsoft Foundry / Azure OpenAI: https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/; Anthropic (Claude API): https://api.anthropic.com/v1/; OpenAI (reference): https://api.openai.com/v1.
What should ANTHROPIC_BASE_URL be set to for another provider?
Use the provider's Anthropic-compatible base URL, which stops before /v1 because the Anthropic SDK adds the path itself (Fireworks: "The base URL for the Anthropic SDK is https://api.fireworks.ai/inference (without the /v1 suffix). The SDK appends /v1/messages automatically."). DeepSeek: https://api.deepseek.com/anthropic; Moonshot AI (Kimi): https://api.moonshot.ai/anthropic; Z.ai (GLM): https://api.z.ai/api/anthropic; MiniMax: https://api.minimax.io/anthropic; Alibaba Cloud Model Studio (Qwen): https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic; Fireworks AI: https://api.fireworks.ai/inference; OpenRouter: https://openrouter.ai/api; Ollama: http://localhost:11434; LM Studio: http://localhost:1234; vLLM: http://localhost:8000; Amazon Bedrock: https://bedrock-runtime.{region}.amazonaws.com/anthropic (Claude models only); Microsoft Foundry / Azure OpenAI: https://<resource name>.services.ai.azure.com/anthropic (Claude models only). Anthropic's own is https://api.anthropic.com.
Is Anthropic's OpenAI SDK compatibility layer production-ready?
No, by Anthropic's own description: "This compatibility layer is primarily intended to test and compare model capabilities, and is not considered a long-term or production-ready solution for most use cases." It serves chat/completions at https://api.anthropic.com/v1/, and the docs list 10 limitations, including: strict (function calling) ignored; audio input not supported; prompt caching not supported.
Newsletter
Know when a provider changes its API
One email per week. New models, new endpoints and the compatibility changes that break a base URL, and what they mean for your stack.
Keep exploring
Use any model in any coding tool
Install commands, env vars and base URLs for each provider and tool pair, from official docs.
AI API error reference
Documented error codes per provider, with causes, fixes and retry guidance.
Coding agent CLI reference
Every slash command, flag, setting and config file for the major coding agents.