New API's protocol conversion: why it can be reached with Anthropic's official SDK
Where the problem starts: three dialects
If your project needs OpenAI, Claude and Gemini at the same time, you will run into this: one feature written three times against three interfaces.
The differences are not surface-level parameter names. They sit in three deeper places.
1. Message structure
OpenAI uses a messages array, with system as one of the messages, carrying role system.
Anthropic makes system a separate top-level field, outside messages, and messages may only contain user and assistant.
Gemini uses a contents array with roles user and model, note model rather than assistant, and does not accept message orderings other than alternating.
2. Streaming response format
OpenAI uses SSE with each chunk as data: {...}, terminated by data: [DONE].
Anthropic uses SSE too, but event types are layered, with message_start, content_block_delta, message_stop and others, and the delta structure differs.
Gemini is a third variation again.
3. Function calling and tool descriptions
OpenAI uses tools plus tool_choice and returns tool_calls.
Anthropic has a different tools structure and returns a tool_use block inside a content array.
Gemini uses functionDeclarations.
What protocol conversion is converting
Flattening the protocols means translating all three of the above in both directions. New API, for example, offers multi-directional conversion rather than one-way normalisation:
- OpenAI format to and from Claude messages format
- OpenAI format to Gemini
- Gemini to OpenAI format
The crucial difference is whether the direction can be reversed:
| Capability | One-way normalisation, the One API route | Multi-directional, the New API route |
|---|---|---|
| Call Claude with an OpenAI SDK | Yes | Yes |
| Call any upstream with Anthropic's official SDK | No | Yes |
| Use native Anthropic clients such as Claude Code or Cursor | Needs a layer | Point directly |
| Reach non-Anthropic models with Claude's official format | No | Yes |
The last two rows are the substantive value: your client can stay unchanged and only swap base_url.
This matters especially for clients like Claude Code that only speak the Anthropic protocol. It will not accept an OpenAI-format endpoint, so if the gateway only normalises one way you must run a separate translation proxy.
The three places conversion breaks
These are not theoretical risks; they are the three most common failures in practice.
1. Alignment of streaming chunks
Upstreams differ in how finely they chunk SSE. Some stream per token, others accumulate a batch before sending. If the conversion layer maps one upstream chunk to one output chunk, you get:
- Repeated tokens in the output, because the increment was miscomputed
- Missing characters, because a multi-byte character was split across two chunks
How to test: have the model output a mix containing Chinese characters, emoji and a code block, and watch for garbling or repetition. This is the single most effective test.
2. Protocol drift in tool calls
Anthropic's tool_use block and OpenAI's tool_calls differ substantially. If the conversion handles input on the Claude side and arguments on the OpenAI side, which is a JSON string, inconsistently, you get:
- Tools that pass in testing but silently corrupt arguments in real conversations
- Lost context across multi-turn tool calls
A recurring piece of advice in discussions of Claude Code routers is to prefer implementations that pass requests through with minimal rewriting. The more rewriting there is, the higher the risk of protocol drift.
3. Silent parameter dropping
When an upstream does not support a parameter there are two options: raise an error, or quietly ignore it.
Ignoring is more dangerous. You think you set temperature: 0 and in fact the default applied; you think response_format is on and in fact nothing is constrained. Problems like this raise no error, they just make results intermittently good and bad.
How to test: deliberately send an invalid value such as temperature: 99 and see whether you get an error or a normal result. A normal result means the parameter is being ignored.
What this means for you
If you are choosing a site
Support for the native Claude protocol is a capability worth confirming separately. The test is simple: use Anthropic's official SDK, point base_url at the site, and make one call. If it works, real conversion is happening. A 404 or a structural error means only one-way normalisation is in place.
If you are self-hosting
This is New API's most concrete advantage over One API. If your users include Claude Code, Cursor or any native Anthropic client, the capability saves you a whole proxy layer.
If you are troubleshooting
When the same prompt gives different results on different sites, do not suspect the model first. Check in the order of streaming alignment, then tool calls, then dropped parameters. These three are far more likely than a difference in the model.
Our articles on common error codes and on telling whose problem it is are useful alongside this one.
Was this useful? If you have run into something the article does not cover, tell us and we will verify it and update the text.
Related articles
Video generation behind a relay: three API shapes, four billing traps, one acceptance checklist
MCP through a relay: what works, what never will, and how to test it in ten minutes
A relay selection decision tree: working back from your scenario to a site
Logging and reconciliation: attributing token spend to the project level
Migrating suppliers gradually: replacing an API site without interrupting service
Build your own probe: twenty lines of script to monitor your API suppliers
The models this article mentions are available on these services
Filtered by the model families the article mentions and ordered by overall score and uptime. This is not a recommendation. Click through to see each service's uptime, latency and endpoint verification.
See the full list in the directory, or browse by model family.