Claude Code on GPT and DeepSeek: how Lazu translates APIs
The short version: with one Lazu key, Claude Code can run on GPT and DeepSeek, and the OpenAI SDKs can run on Claude, with tool calls and streaming working as usual. Behind that is the protocol layer we rebuilt this month. Translation between the three API formats now follows one set of rules.
This post covers what you can use today, the three principles the design keeps, and how we check that it translates correctly.
What you can use today #
Claude Code on GPT or DeepSeek #
Claude Code only speaks Anthropic's Messages protocol. Point it at Lazu and pick another vendor's model:
export ANTHROPIC_BASE_URL=https://api.lazu.ai
export ANTHROPIC_AUTH_TOKEN=sk-lazu-...
claude --model deepseek-flash
Tool calls such as reading files and editing code go out and come back normally, and streaming doesn't stall. After the release we ran the same tool definitions against claude-haiku-5-5, deepseek-flash and gpt-6-luna, and all three called the tool correctly.
GPT-6 has one limit: on Chat Completions it takes tool calls only with reasoning turned off. If Claude Code's request names a reasoning effort and the channel supports the Responses API, Lazu routes it there and keeps both reasoning and tools. Only on a Chat-only channel does it turn reasoning off for the tool call.
The OpenAI SDKs on Claude #
OpenAI's Responses API can now pick Claude directly:
curl https://api.lazu.ai/v1/responses \
-H "Authorization: Bearer sk-lazu-..." \
-H "Content-Type: application/json" \
-d '{"model": "claude-haiku-5-5", "input": "hi"}'
Streaming, function calls and reasoning summaries come back in the Responses event format. Calling Claude from a Chat Completions SDK works the same way, and reasoning_effort maps onto Claude's thinking settings.
Codex on Claude doesn't work yet. By default Codex sends tools that OpenAI hosts, such as web_search, and asks for encrypted reasoning back. Neither has a counterpart on Claude. Lazu refuses the request and names the field, rather than dropping them silently.
Usage that matches your bill #
- Cache hits count toward
prompt_tokens, the way OpenAI reports them. Billing still uses Anthropic's line items, so cache reads are charged at the cache price. - A Chat stream with
stream_options.include_usageends with its own usage chunk whosechoicesis empty, matching OpenAI's format. - When the upstream reports no usage, Lazu estimates it from the output, counting each tool call's name, arguments and fixed per-call overhead.
Three principles #
Translate once, not pair by pair #
We used to keep a hand-written converter for each pair of protocols. Three protocols make six directed pairs, each handling the same details, so fixing one often missed another.
Now every request is parsed into one intermediate representation, then written out in the upstream's protocol. Responses work the same way: they are parsed into one stream of events, then written back in the client's protocol. Billing, retries and refunds are written once, in the middle, and shared by all three protocols.
Translate what carries over exactly, and say so when something doesn't #
Some things have no counterpart across protocols. Claude, for example, generates one answer per request, while Chat Completions can ask for several with n. Converters used to drop fields like this silently: the request succeeded, but the result wasn't what you asked for.
Now Lazu refuses before sending the request, and names the field:
{
"error": {
"message": "unsupported feature sampling.n at n: a Messages bridge supports exactly one output",
"code": "protocol_bridge_unsupported",
"param": "n"
}
}
The refusal happens during routing. If another channel for the same model can take the request as it is, Lazu tries that channel before returning an error.
Substitutions are registered, and always announced #
We allow a substitution in one kind of case: the channel is known not to support a feature, and there is a well-tested stand-in. Only one is registered today. A channel without json_schema gets json_object, with the schema stated in the prompt. A channel with neither gets the schema in the prompt alone.
Each substitution rule records its reason and its source. When one applies, the X-Lazu-Warning response header names the rule, and the request details show it too. Anything not registered is refused, under the previous principle.
Switching to another endpoint goes in the same header. DeepSeek's Chat endpoint, for example, doesn't take json_schema, but its Responses endpoint does. A Chat request with json_schema to deepseek-flash goes through Responses, the result comes back as usual, and the response carries:
X-Lazu-Warning: endpoint_bridge:output.json_schema
How we check it translates correctly #
- Recorded upstream responses. We recorded real streamed responses from each upstream, covering text, thinking, tool calls, structured output and errors. Every change runs against them.
- Old against new. Until the old converters are removed, every output of the new layer is compared with the old converter's, and they must match. Each mismatch is either a bug in the old code or a fix the new code needs.
- Live checks after release. After each release we send real requests across all three protocols and four model families, streamed and with tools.
The third check earned its keep this time. The first release of the protocol layer passed every test, but the live check found that Claude channels with a parameter override (param_override) refused Chat-format requests. The new code treated the channel's override as OpenAI-shaped, when those overrides were written for Anthropic's format all along. We rolled back within 8 minutes, fixed it and released again. Every request in that window came from our own test key, so no customer was affected.
What's still in progress #
- Codex on Claude: hosted tools and encrypted reasoning need a faithful mapping first.
- Gemini-format clients, such as the Google SDK calling Lazu directly, still use the old conversion path. The new Gemini translation is written and being compared against the old path. We'll write it up when it's live.
- In a few edge cases we pass a request through rather than refuse it. For example, a Claude JSON schema sent to OpenAI doesn't switch on OpenAI's strict mode, because strict mode demands more and would reject some valid schemas.
If a translated request comes back wrong, send us the request_id from the response and we'll look into it.
How other gateways handle protocols, and which of them translate between formats, is in the Protocols section of Lazu compared with other LLM gateways.