Utilities
Chat format converter: OpenAI to Anthropic and Gemini
Paste an OpenAI, Anthropic or Gemini request and get the same conversation in another API’s format: system prompt, images, tools, tool calls and results, JSON output and sampling settings. Every field that doesn’t map is listed. It’s free and runs in your browser.
Converted in your browser. Nothing you paste is sent anywhere, so API keys and data stay on your device.
Converted OpenAI Chat Completions to Anthropic Messages. (Source detected automatically.) 1 warning.
Changed, dropped or worth checking (1)
- Anthropic has deprecated sampling settings: models released after Claude Opus 4.6 reject
temperatureother than 1.0,top_pbelow 0.99, and anytop_k. Remove them for current models.temperature
Good to know (1)
- Model IDs differ between providers, so
gpt-6-astrawas replaced withMODEL_ID. Replace it with a model ID from Anthropic.model
POST https://api.anthropic.com/v1/messages
{
"model": "MODEL_ID",
"max_tokens": 800,
"system": "You are a support assistant for a bike shop. Check stock before you answer.",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What part is this, and do you have it in stock?"
},
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": "iVBORw0KGgo="
}
}
]
},
{
"role": "assistant",
"content": [
{
"type": "tool_use",
"id": "call_abc123",
"name": "check_stock",
"input": {
"part": "rear derailleur"
}
}
]
},
{
"role": "user",
"content": [
{
"type": "tool_result",
"tool_use_id": "call_abc123",
"content": "{\"in_stock\":true,\"quantity\":4}"
}
]
}
],
"tools": [
{
"name": "check_stock",
"description": "Look up how many of a part the shop has in stock.",
"input_schema": {
"type": "object",
"properties": {
"part": {
"type": "string"
}
},
"required": [
"part"
],
"additionalProperties": false
},
"strict": true
}
],
"temperature": 0.2
}Steps
How to use the chat format converter
- Paste a request body, or just its messages, input or contents array.
- Leave “From” on automatic detection, or pick the source format.
- Choose the target format in “To”.
- Read the notes, fixing anything under “Needs your attention”, then copy or download the converted request.
Method
How it works
OpenAI, Anthropic and Google all model a chat as a list of turns, but they disagree on almost every detail: where the system prompt lives, what the roles are called, how images are encoded and how a tool call and its result are written. The converter reads your request into one neutral conversation, then writes that conversation out in the target format, so every direction uses the same rules.
The differences that break conversions
OpenAI’s Chat Completions puts the system prompt in the message list and sends tool arguments as a string of JSON; Anthropic and Gemini want a separate system field and an arguments object. OpenAI gives each tool result its own tool message, while Anthropic and Gemini put results inside a user turn. Anthropic needs every result for a set of parallel calls in the very next user message, with the tool_result blocks before any text, so the converter merges and reorders turns. Images move from one data: URL to separate media type and base64 fields. For the full background, read OpenAI vs Anthropic vs Gemini message formats.
Gemini details
A Gemini functionResponse needs the function’s name, which an OpenAI tool message doesn’t carry, so the converter looks it up from the matching call. Its response must be an object: JSON objects pass through, and anything else is wrapped as {"result": …}, as in Google’s own example. Tool schemas go in parametersJsonSchema, because the older parameters field takes only an OpenAPI subset: in our test on 12 October 2026 the API rejected an additionalProperties key there, which OpenAI’s strict schemas always include. For calls Gemini didn’t make, the converter adds the skip_thought_signature_validator placeholder that Google documents.
Anthropic details
Anthropic requires max_tokens; if your source has no limit, 4,096 is written and flagged so you can set your own. Tool IDs must match ^[a-zA-Z0-9_-]+$, so other characters are replaced, the same way in the call and its result. Forcing a tool (any or tool) returns a 400 error on Claude Opus 5.5, Sonnet 5.5, Fable 5.1 and Mythos 5.1, so that mapping comes with a warning.
What it doesn’t do
It converts requests, not replies, and it doesn’t translate model IDs: a model from another provider becomes MODEL_ID for you to fill in from the model ID reference. Reasoning blocks, file uploads, audio and built-in tools are left out with a note. If a tool call’s arguments aren’t valid JSON, they become {} with an error, and JSON repair can fix them first.
How we checked it
Every mapping was checked on 12 October 2026 against OpenAI’s published OpenAPI specification, Anthropic’s Messages API reference and Google’s v1beta discovery document. Sample outputs passed the request types in the official openai and Anthropic TypeScript SDKs, and Gemini outputs were sent to the API without a key: Google parses the body before it checks the key, so an authentication error rather than a 400 shows every field name was accepted. That test also showed a trap in Google’s own guide: its newer responseFormat.text.mimeType rejects the "application/json" the guide shows (it wants APPLICATION_JSON), so the converter writes the long-standing responseMimeType and responseJsonSchema pair instead.
Examples
Worked examples
| Piece | OpenAI Chat Completions | OpenAI Responses | Anthropic Messages | Gemini generateContent |
|---|---|---|---|---|
| System prompt | developer or system message | instructions | system | systemInstruction |
| Turns | messages | input items | messages | contents (roles user, model) |
| Image, inline | image_url with a data: URL | input_image with a data: URL | image block, source.type: base64 | inlineData part |
| Image, by URL | image_url with the URL | input_image with the URL | image block, source.type: url | fileData part with fileUri |
| Tool definition | tools[].function.parameters | tools[].parameters | tools[].input_schema | functionDeclarations[].parametersJsonSchema |
| Tool call | tool_calls, arguments as a string | function_call item | tool_use block, input object | functionCall part, args object |
| Tool result | tool message | function_call_output item | tool_result block in a user turn | functionResponse part in a user turn |
| Force a tool call | tool_choice: "required" | tool_choice: "required" | tool_choice: {"type": "any"} | functionCallingConfig.mode: "ANY" |
| JSON schema output | response_format.json_schema | text.format | output_config.format | responseMimeType + responseJsonSchema |
| Output limit | max_completion_tokens | max_output_tokens | max_tokens (required) | generationConfig.maxOutputTokens |
| Stop sequences | stop (up to 4) | None | stop_sequences | stopSequences (up to 5) |
| Field | What happens |
|---|---|
Anthropic cache_control | Removed with a warning: OpenAI and Gemini set up prompt caching differently. |
Gemini safetySettings, cachedContent | Removed with a warning: the other APIs have nothing to map them to. |
OpenAI logprobs, seed, penalties, n | Carried to Gemini, which has all four; listed as dropped for Anthropic. |
logit_bias | Dropped: it uses token IDs from OpenAI’s tokenizer. |
Reasoning (thinking, reasoning_effort, thought parts) | Dropped: signed reasoning can’t be replayed to another provider, and effort levels don’t line up. |
previous_response_id | Flagged as an error: the earlier turns live on OpenAI’s servers, not in the request. |
| Files, audio, PDFs, built-in tools | Dropped with a warning; attach them again in the target API’s own format. |
FAQ
Frequently asked questions
How do I convert OpenAI messages to Anthropic format?
Move every system or developer message into the top-level system field, add the required max_tokens, and rename each tool’s parameters to input_schema. Turn tool_calls into tool_use blocks with the arguments parsed into an object, and put every tool message into one user turn as tool_result blocks, before any text. Split data: image URLs into media type and base64. The converter above does all of this for you.
What doesn’t convert between OpenAI, Anthropic and Gemini?
Anything provider-specific: Anthropic cache_control breakpoints, Gemini safetySettings and cachedContent, OpenAI logit_bias and stored conversations (previous_response_id), reasoning blocks and signatures, file IDs, audio and built-in tools such as web search. The converter lists each one it finds, with the path in your input, so nothing disappears without you knowing.
Why does the Gemini output contain skip_thought_signature_validator?
Gemini 3 rejects a function call in the history unless it carries the thought signature Gemini attached when it made the call. Calls converted from OpenAI or Anthropic never had one, so Google documents this placeholder value for calls another model made. The converter puts it on the first function call in each model turn, which is where Gemini expects a signature for parallel calls.
Why does Anthropic reject the temperature after I convert?
Anthropic has deprecated its sampling settings. Its API reference says models released after Claude Opus 4.6 reject a temperature other than 1.0, a top_p below 0.99 and any top_k. The converter still writes them, capped to Anthropic’s 0 to 1 range, because older Claude models accept them, and warns you. Remove them for current models.
Should I convert requests or use an OpenAI-compatible endpoint?
Both providers offer OpenAI-compatible endpoints: Anthropic’s at https://api.anthropic.com/v1/ and Google’s at https://generativelanguage.googleapis.com/v1beta/openai/. They’re quick for trying a model, but Anthropic describes its layer as mainly for testing and comparing models, and it ignores strict on tools. Native formats give you every feature, which is why converting is worth doing for production code.
Is my request sent anywhere?
No. The conversion is plain JavaScript running in your browser; nothing you paste, including API keys or customer data inside the messages, is uploaded or stored. You can use the page offline once it has loaded. The converter never calls any provider’s API: it only rewrites the JSON.
Related
Related tools
- JSON RepairFix broken JSON from LLM output.
- Prompt BuilderBuild prompts with variables and a live token count.
- Model ID ReferenceCopy current API model IDs for Claude, GPT, Gemini and more.
- JSONL Validator and CSV to JSONLCheck fine-tuning JSONL files and convert CSV to JSONL.
- AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.
- API Key CheckerCheck whether an API key works, without storing it.