- Python:
openai,anthropic - Vercel AI SDK:
@ai-sdk/openai,@ai-sdk/anthropic - LangChain:
langchain-openai,langchain-anthropic(Python or JS) - LlamaIndex: the OpenAI and Anthropic LLM classes
- Mastra, AutoGen, CrewAI, Instructor, LiteLLM, and similar
- Raw
fetch,curl, or any HTTP client
We run integration tests against the official
openai and anthropic SDKs (Node and Python), @ai-sdk/openai, @ai-sdk/anthropic, and LangChain. The other tools work through the same API formats, but are documented patterns rather than tested paths.What changes
| OpenAI-shape SDK | Anthropic-shape SDK | |
|---|---|---|
| Base URL | https://inference-api.openserv.ai/v1 (with /v1) | https://inference-api.openserv.ai (no /v1) |
| Auth | Authorization: Bearer <SERV_API_KEY> — constructor field is usually apiKey | Authorization: Bearer <SERV_API_KEY> — constructor field is usually authToken |
| Model ID | Any model from the catalog. Names like gpt-5.4-mini and claude-haiku-4.5 work as-is | Most of the catalog routes here too — see endpoint compatibility |
The
google-genai SDK is not supported. It speaks Gemini’s native generateContent format, not the OpenAI or Anthropic API. To use Gemini or Gemma, switch to the OpenAI SDK and call /v1/chat/completions.Python
openai
anthropic
Vercel AI SDK
The AI SDK exposes per-provider factories that accept custom base URLs.@ai-sdk/openai
@ai-sdk/anthropic
Unlike the official Anthropic Node SDK,
@ai-sdk/anthropic requires the /v1 suffix in the baseURL. The “no /v1” rule only applies to the official @anthropic-ai/sdk package.LangChain (JS)
ChatOpenAI
ChatAnthropic
LangChain (Python)
ChatOpenAI
ChatAnthropic
Raw fetch and curl
With no SDK, the wire format is plain JSON.
OpenAI shape
Anthropic shape
Migration prompt for AI coding tools
To migrate an existing integration with Claude Code, Cursor, Copilot, or another coding agent, paste this into the chat:Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
400 A system prompt is required | Missing system / instructions / developer message | Add one. SERV requires it on every request. |
400 The Responses API is not supported with model X | /v1/responses is OpenAI-only | Use /v1/chat/completions for Claude, Gemini, Gemma, Grok, Qwen, and DeepSeek. |
404 on the Anthropic Node SDK | Included /v1 in baseURL | Drop the /v1 — the official Anthropic SDK adds it. |
404 on a raw fetch to /messages | Missing /v1 in the path | Use /v1/messages. |
404 The model 'gemma-...' does not exist | Gemma IDs need the -it suffix the Playground display drops | Use gemma-4-31b-it / gemma-4-26b-a4b-it. |
401 on the Anthropic SDK | Ambient ANTHROPIC_API_KEY conflicts with the SERV key | Pass authToken: SERV_API_KEY explicitly. |
502 on Gemini via /v1/messages | Gemini doesn’t route through the Anthropic-shape endpoint | Use /v1/chat/completions for Gemini. |
Empty content on a reasoning model | Reasoning exhausted the token cap | Raise max_completion_tokens / max_tokens. |
| Model rejected as unsupported | The ID isn’t in the catalog | Use an ID from the catalog. |
See also
- SDK Integration — endpoints and the parameter map.
- Endpoint compatibility — which models work on which endpoint.
- Models — pricing and context windows.
- Playground — compare models before you migrate.

