TokenPad
Datasets

OpenAI to Anthropic Format Converter

Move a request between the two message formats without losing the system prompt.

Your input

103 characters1 lines0 tokensor drop a file

OpenAI ↔ AnthropicExact
0Token change
Token change0no change
Input tokens0what you pasted
Output tokens0what you would send
Token cost of this result
Output tokens0
As input$0.00
× 100K requests$0.00

Everything on this page runs in your browser. Nothing you paste is transmitted, because there is no server here to transmit it to.

Result
 

The difference that breaks ports

OpenAI puts the system prompt inside the messages array with role "system". Anthropic takes it as a separate top-level field and requires max_tokens, which OpenAI treats as optional.

Both mistakes fail unhelpfully. A system message left inside an Anthropic messages array is rejected or ignored, and a missing max_tokens is a validation error that tells you nothing about the system prompt you also got wrong.

The main use: evaluating across providers

Deciding between models means running the same prompt against both. Doing that by hand introduces differences, and a difference in the prompt invalidates the comparison you were trying to make.

Convert mechanically, run both, then price the results with your real volume rather than the sample.

Same prompt, different token counts

Converting the format does not make the request equivalent in cost. Each provider tokenizes with its own vocabulary, so the identical text produces different counts — Anthropic has stated that the tokenizer introduced with Claude 4.7 yields roughly 30% more tokens for the same input than its predecessor.

Always re-measure after porting. A comparison built on one token count applied to both providers is wrong in a direction you cannot predict.

Frequently asked questions

What is not converted?
Tool definitions, image content blocks and provider-specific parameters differ enough between the two that mechanical conversion would produce something plausible and wrong. Those need a deliberate port.
Why does max_tokens appear in the Anthropic output?
Because it is required there. The value inserted is a placeholder — set it to something realistic for your task, since an inflated ceiling can consume rate-limit quota you never use.

More datasets tools