OpenAI to Anthropic (Claude) API Converter
Paste an OpenAI Chat Completions request and get the equivalent Anthropic Messages API request — endpoint, headers and body remapped field by field — as ready-to-run cURL, Python or Node/TS. Works both ways. Runs entirely in your browser: no key, no upload, no signup.
How it works
The converter is a deterministic transformation of a published request schema — there is no model call. It reads your OpenAI Chat Completions request, applies a fixed set of mapping rules transcribed from the official OpenAI and Anthropic API references, and emits the equivalent Anthropic Messages request. Every rule is a static table entry, so the same input always produces the same output, and the result is testable.
- Endpoint.
POST /v1/chat/completionsonapi.openai.combecomesPOST /v1/messagesonapi.anthropic.com. - Auth & version headers.
Authorization: Bearer …becomesx-api-key: …plus the requiredanthropic-version: 2023-06-01header. - System prompt. Anthropic takes
systemas a top-level string. Everyrole:"system"turn is pulled out of the messages array and concatenated; the remaining user and assistant turns stay inmessages, which must start with a user turn. - max_tokens. Optional in OpenAI, required in Anthropic. If it is absent, the converter injects
1024and flags itRequired-now. - temperature. OpenAI's range is 0.0–2; Anthropic's is 0.0–1. A value above 1 is clamped and flagged
Range-changed.top_pshares the same 0–1 range and passes through. - stop → stop_sequences. A string or array becomes an array.
streampasses through unchanged. - tools & tool_choice.
tools[].function.{name,description,parameters}becomestools[].{name,description,input_schema}— the JSON Schema object moves fromfunction.parameterstoinput_schema.tool_choicevalues are remapped:"auto"→{type:auto},"required"→{type:any},{function:{name}}→{type:tool,name}. - No equivalent.
n,frequency_penalty,presence_penalty,logit_bias,logprobsandseedhave no Anthropic field — each is dropped and noted.response_format(JSON mode) is flaggedManualwith the recommended tool-use or prompt workaround.
As a credibility check, three worked conversions ship as fixtures and are reconciled against the references on every load, and the converter is verified by a round-trip invariant: converting OpenAI → Anthropic → OpenAI must recover the same system content, stop sequences and tool definitions. Two independent code paths agreeing is the guarantee that the rename rules are inverse. Model IDs (for example claude-sonnet-4-6) are cross-checked against the in-repo AI model cheat sheet and the Anthropic models reference; the version header and temperature range are pinned and dated below.
Worked examples
Frequently asked questions
Sources & references
- OpenAI API Reference — Chat Completions
- Anthropic API Reference — Messages
- Anthropic — Tool use (input_schema, tool_choice)
- Anthropic — Migrating from OpenAI (field mapping)
- Anthropic — Models overview (current model IDs)
The mapping rules, the anthropic-version: 2023-06-01 header and the 1 temperature ceiling were last cross-checked against the official references on 2026-06-30. This page is reviewed whenever either provider ships a breaking request-schema change.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a parameter that maps wrong, or want another provider added?
Email me at [email protected] — most fixes ship within 24 hours.