Skip to content

Menu

LLM Messages Format Converter

Convert a whole conversation between OpenAI Chat Completions, Anthropic Messages and Gemini contents, with tool calls, tool results and system prompts.

Runs entirely in your browserAIFree, no sign-up
Loading tool

01What is LLM Messages Format Converter?

LLM Messages Format Converter rewrites a whole conversation from one model API's message format into another's. It covers OpenAI Chat Completions messages, Anthropic Messages and Gemini contents. Paste a messages array or a full request body, pick a target, and the converted JSON appears beside it as you type. The three formats store the same ideas in different places. OpenAI puts the system prompt in a message with role system or developer. Anthropic keeps it in a separate system field, and Gemini uses systemInstruction with a list of parts. OpenAI calls the model assistant, while Gemini calls it model. Tool calls differ the most. OpenAI puts tool_calls on the assistant message, with the arguments as a JSON string, and answers each call with a message whose role is tool. Anthropic uses tool_use blocks in the assistant turn and tool_result blocks in the next user turn. Gemini uses functionCall and functionResponse parts, where args and response are JSON objects. Under the hood, the converter reads the source into a neutral list of turns, then writes that list out for the target. Several OpenAI tool messages in a row become one Anthropic user turn, with the tool_result blocks first, because Anthropic's docs require results to come before any text. Argument strings are parsed into objects. If a string is not valid JSON, it is kept under _raw_arguments and you get a warning. Base64 images move between data URLs, Anthropic base64 sources and Gemini inlineData. Some things have no match on the other side, and the tool tells you. OpenAI has no is_error flag, so an Anthropic error result becomes a normal tool message with a warning. Gemini error results use an error key inside response, as Google's reference suggests, and that maps back to is_error. Gemini calls often lack ids. The tool then makes ids like toolu_1 or call_1 and matches each functionResponse to the oldest open call with the same name. A worked example: take an OpenAI chat with a system message, the question "Weather in Paris?", an assistant tool call get_weather with arguments {"city":"Paris"}, a tool reply {"temp":18} and a final answer. Convert it to Gemini. You get systemInstruction holding the system text and a model turn whose functionCall args is the object {"city":"Paris"}. The next user turn carries a functionResponse with response {"temp":18}, and no warnings appear. Limits: tool definitions, model settings and thinking blocks are not converted. Audio and file parts are dropped with a warning. Everything runs in your browser, so the transcript never leaves your machine.

Developers moving agents or chat logs between OpenAI, Anthropic and Gemini APIs. The tool runs entirely in your browser, so your data never leaves your device.

02How to use LLM Messages Format Converter

  1. Paste a messages array or a full request body into the input box
  2. Leave From on Auto-detect, or pick the source format if detection guesses wrong
  3. Choose the target format under To
  4. Read any warnings about fields that could not be carried over
  5. Copy the converted JSON

03Worked examples

Input: OpenAI: system "You are helpful.", user "Weather in Paris?", assistant tool_calls get_weather (call_1) arguments "{\"city\":\"Paris\"}", tool call_1 "{\"temp\":18}", assistant "It is 18 degrees." to Anthropic
Result: {"system":"You are helpful.","messages":[{"role":"user","content":"Weather in Paris?"},{"role":"assistant","content":[{"type":"tool_use","id":"call_1","name":"get_weather","input":{"city":"Paris"}}]},{"role":"user","content":[{"type":"tool_result","tool_use_id":"call_1","content":"{\"temp\":18}"}]},{"role":"assistant","content":"It is 18 degrees."}]}
No warnings. The arguments string became an input object.
Input: Same OpenAI conversation to Gemini
Result: {"systemInstruction":{"parts":[{"text":"You are helpful."}]},"contents":[{"role":"user","parts":[{"text":"Weather in Paris?"}]},{"role":"model","parts":[{"functionCall":{"name":"get_weather","args":{"city":"Paris"},"id":"call_1"}}]},{"role":"user","parts":[{"functionResponse":{"name":"get_weather","response":{"temp":18},"id":"call_1"}}]},{"role":"model","parts":[{"text":"It is 18 degrees."}]}]}
Input: Anthropic: system "Be brief.", assistant text "Checking." plus tool_use toolu_a get_order {id: 7}, then a user turn with tool_result "not found" (is_error: true) and text "Try again", to OpenAI
Result: {"role":"assistant","content":"Checking.","tool_calls":[{"id":"toolu_a","type":"function","function":{"name":"get_order","arguments":"{\"id\":7}"}}]},{"role":"tool","tool_call_id":"toolu_a","content":"not found"},{"role":"user","content":"Try again"}
Trimmed to the last three messages. Warning: Chat Completions has no is_error field, so the text is sent as a normal tool message.
Input: Gemini: model calls f {} and g {a: 1} with no ids; user answers g with {error: "boom"} and f with {ok: true}, to Anthropic
Result: {"role":"user","content":[{"type":"tool_result","tool_use_id":"toolu_2","content":"boom","is_error":true},{"type":"tool_result","tool_use_id":"toolu_1","content":"{\"ok\":true}"}]}
Trimmed to the final turn. The calls got ids toolu_1 and toolu_2, matched by name, and the error key became is_error.
Input: OpenAI: developer "Describe images in one line.", user text plus image_url data:image/png;base64,iVBORw0KGgo=, to Gemini
Result: {"systemInstruction":{"parts":[{"text":"Describe images in one line."}]},"contents":[{"role":"user","parts":[{"text":"What is in this picture?"},{"inlineData":{"mimeType":"image/png","data":"iVBORw0KGgo="}}]},{"role":"model","parts":[{"text":"A small test image."}]}]}
Input: OpenAI tool call search_flights with arguments "{city: Oslo}" to Anthropic
Result: {"type":"tool_use","id":"call_9","name":"search_flights","input":{"_raw_arguments":"{city: Oslo}"}}
Trimmed to the tool_use block. Warning: Message 1: tool call arguments are not valid JSON; kept under _raw_arguments.

04Common use cases

  • Replaying an OpenAI chat log against Claude or Gemini to compare the answers
  • Moving saved agent transcripts to a new provider without hand-editing every tool call
  • Building an evaluation set once and running it against several model APIs
  • Tracking down a 400 error caused by a tool_result block sitting after text in a user turn
  • Turning Gemini traces without call ids into OpenAI or Anthropic shape for a tracing tool
  • Checking how a base64 image in a user message should look in Gemini inlineData
  • Spotting a tool call whose arguments string was never valid JSON in the first place

05Tips

  • Plain user and assistant messages with string content look the same in OpenAI and Anthropic, so auto-detect treats them as OpenAI; set From by hand if that matters
  • Converting to Anthropic always puts tool_result blocks before text in a user turn, which the Messages API requires
  • Gemini wants response to be an object, so a plain string result is wrapped as {"output": ...}
  • Ids generated for Gemini calls are only for matching; they are not added to Gemini output unless the source had them
  • Read the warnings list before copying, since it names every field that could not be carried over

06Related concepts

tool_calls, tool_use, tool_result, functionCall, functionResponse, systemInstruction.

Frequently Asked Questions

What is LLM Messages Format Converter?

LLM Messages Format Converter is a free, browser-based developer tool on AIDToolStack. Convert a whole conversation between OpenAI Chat Completions, Anthropic Messages and Gemini contents, with tool calls, tool results and system prompts. It requires no installation or sign-up and works entirely in your browser.

Is LLM Messages Format Converter free to use?

Yes. No sign-up, no fees and no usage cap.

Does LLM Messages Format Converter store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe