OpenAI ⇄ Anthropic Request Converter
Convert a chat request between the OpenAI and Anthropic shapes in either direction, including tool calls and tool results, with a list of every field that had no equivalent.
Every one of them is listed below. Nothing was dropped without being named.
- Converted body, characters
- 679
- Round trip differences
- 2
- Model ids do not translate: "your-model-id" must be replaced with the id of the model you are actually calling.
- `n` was not converted — the Messages API returns one completion per call — send the request n times.
- `frequency_penalty` was not converted — no equivalent.
- n
- frequency_penalty
system outside the message list and requires max_tokens; OpenAI has no top_k and expresses tool results as their own message role rather than as blocks inside a user turn. Sampling parameters are copied numerically, not rescaled — a temperature is not the same knob on two different models even when both accept the number. Everything on this page runs in your browser. Nothing you paste is uploaded, logged or sent anywhere.Most of a chat request survives a move between these two APIs untouched. What does not survive is worth knowing before you discover it in production: a request with n: 3 quietly becomes a request for one completion, a seed disappears, and a system message that was second in the list gets hoisted out of order into a field that has no position at all.
The round-trip line
Converting the output back and diffing it against your input is the only honest way to show what a converter lost. If that list is empty, the mapping was lossless for your particular body. If it names top_k, that parameter has no home in the other format and no amount of care will bring it back. The list is computed from your own request rather than from a table of what is usually lost, so it is right about your case specifically.
Tool calls are the part that breaks
Both formats can describe a model calling a function and getting an answer, and they do it with completely different shapes. One puts the call in a tool_calls array on an assistant message and the answer in a message with role tool; the other puts both in content blocks, keyed by an id that must match. The converter rewrites between them, splits a multi-result turn into several messages, and tells you when an id was missing — because a mismatched id is rejected by the API with an error that does not say which id.