Skip to content
Zalmir Beta

Claude Code and Codex compatibility

Zalmir's models answer in the chat format. Claude Code speaks Anthropic Messages and Codex speaks OpenAI Responses, so Zalmir translates each request to the model and translates the answer back. This page lists what happens to each request feature. Setup: Claude Code and Codex.

How we check it: for every row, an automated test replays the request shape the client sends through our real gateway code, with a stand-in model, and checks the answer, what is sent to the model and what is charged. We have not run Claude Code or Codex themselves against Zalmir.

Claude Code (Anthropic Messages)

Request featureStatusWhat happens
POST /v1/messages?beta=true with x-api-key or Bearer, anthropic-version and repeated anthropic-beta headers, JSON or streamingTranslatedAn Anthropic message, or Anthropic stream events ending in message_stop. The beta and version headers are accepted and not passed on. One hold, one charge.
max_tokens missing or 0Refused, no charge400 before anything is held or charged. Claude Code always sends max_tokens, so this only affects hand-written requests.
Tool names such as Read and mcp__server__tool, including 65-character names and dotsTranslatedSent to the model unchanged as function names; a call comes back as tool_use with the same name and parsed input.
thinking and output_config.effortTranslatedBecome reasoning_effort for the model. The model's reasoning comes back as a thinking block, without a signature.
cache_control on system, messages and toolsTranslatedThe hints are not passed on. When the provider reports cached prompt tokens and the model has a cached price, usage shows cache_read_input_tokens and they are billed at that price.
PDF document blocks (base64)TranslatedRead in memory and sent as text (see PDF input). A file that is not a readable PDF is refused with 400 before anything is held or charged.
A retry that repeats the same Idempotency-Key headerKeptCharged once: the repeat gets 409 and starts no second request. A retry without the header is a new request and is charged again.
POST /v1/messages/count_tokensNot supported, no charge501; nothing is sent or charged. Claude Code then shows its own estimate in /context.
Images inside tool results (Read on an image file, MCP screenshot tools)TranslatedEach image is moved into a user message right after the tool results, and the tool result gets a short note naming it. Held and charged like any image in the prompt. A model without image input gets 400 before anything is held or charged.
Claude model names, server tools such as web search, and PDFs inside tool resultsRefused, no charge400 before anything is held or charged. The Claude model error names ANTHROPIC_MODEL; map every ANTHROPIC_DEFAULT_*_MODEL to a Zalmir model.

Codex (OpenAI Responses)

Request featureStatusWhat happens
POST /v1/responses with store: false, the whole conversation each turn, function and custom (apply_patch) tools, JSON or streamingTranslatedA Responses object, or Responses stream events ending in response.completed. Instructions become the system message; custom tools are sent as functions. One hold, one charge.
max_output_tokens missing or 0TranslatedMissing: the model's own output limit applies. 0: refused with 400 before anything is held or charged.
reasoning.effort and summary, include reasoning.encrypted_content, prompt_cache_keyTranslatedEffort becomes reasoning_effort. Reasoning comes back as a plain-text summary; no encrypted reasoning is made up. include and prompt_cache_key are accepted and not passed on.
Cached prompt tokensTranslatedWhen the provider reports cached prompt tokens and the model has a cached price, usage shows input_tokens_details.cached_tokens and they are billed at that price.
Function names such as mcp__server__toolTranslatedSent unchanged; a call comes back as a function_call item with the same name, call ID and arguments.
input_file PDFs (base64 data URL)TranslatedRead in memory and sent as text (see PDF input). A file that is not a readable PDF is refused with 400 file_type_unsupported before anything is held or charged.
A retry that repeats the same Idempotency-Key headerKeptCharged once: the repeat gets 409 idempotency_replay_unavailable and starts no second request.
store: true, previous_response_id, hosted tools (web_search, local_shell) and images in tool outputRefused, no charge400 before anything is held or charged. Keep web_search = "disabled" in your Codex config.

Charges

Every translated request is held and charged once, from the model's own usage figures, the same as a chat request. Anything refused here is refused before anything is held or charged. A retry is charged again unless it repeats the same Idempotency-Key header. See Errors and headers.