OpenAI-compatible vs Anthropic Messages APIs
Compare OpenAI-compatible and Anthropic Messages API shapes, streaming, tool calls, model discovery, base URLs, and coding-client compatibility.
“OpenAI-compatible” and “Anthropic-compatible” describe wire protocols, not a promise that every model or client behaves identically. A reliable setup starts by identifying the protocol the client sends, then matching the key scope and base URL.
Why the protocol matters
Coding clients often hide request construction behind a provider dropdown. One may send Chat Completions, another may use the Responses API, and a native Claude client sends Anthropic Messages. Pointing all three at the same-looking URL can produce model-discovery success followed by a failed inference request.
The important question is not only “which model did the user select?” It is also “which request and streaming contract will this client use?”
Side-by-side comparison
| Concern | OpenAI-compatible | Anthropic Messages |
|---|---|---|
| Common request path | /v1/chat/completions or /v1/responses | /v1/messages |
| Primary input field | messages or input | messages with an optional top-level system |
| Streaming | Chat chunks or typed Responses events | Typed message and content-block events |
| Tool definitions | OpenAI function-tool shape | Anthropic tool shape |
| Typical clients | Codex, OpenCode, SDKs, and configurable editor extensions | Claude Code, Claude Desktop 3P inference, and native Messages clients |
Base URL rules
OpenAI-compatible clients normally expect a base URL ending in /v1. Native Claude clients normally expect an origin and append /v1/messages themselves. Adding /v1 to a native Claude gateway field can therefore create a duplicated path.
OpenAI-compatible: https://api.cloudservice.services/v1
Native Claude: https://api.cloudservice.services
OpenAI-compatible: https://api.cloudservice.services/token/v1
Native Claude: https://api.cloudservice.services/token
A token key is still provider-scoped. Use only a model returned by that key's authenticated catalog.
Streaming and tool calls need explicit translation
Text is the easy part of compatibility. Tool calls include identifiers, names, JSON arguments, finish reasons, and sometimes partial argument fragments spread across streamed events. A gateway must preserve those semantics instead of flattening everything into plain text.
- Do not advertise tools for a route until a real client has completed a tool call through it.
- Do not retry a request after any response content becomes visible.
- Keep public model IDs stable even when an internal provider route changes.
- Verify both non-streaming and streaming behavior because their event contracts differ.
How to choose the right protocol
- Open the client's provider or custom-gateway documentation.
- Identify whether it names Chat Completions, Responses, or Anthropic Messages.
- Select the CloudService base URL for both that protocol and the key's billing mode.
- Fetch the authenticated model list and copy the exact API ID.
- Send a small verification request before starting a long coding task.
CloudService is not affiliated with OpenAI or Anthropic. Compatibility refers to the documented API shapes and supported client integrations.