LLM API Request Format Converter
Paste a chat request written for one provider and get the same request for another, with tool calls, images and settings translated and every lossy step explained.
S'executa al teu navegador. Els fitxers mai no surten del dispositiu. Mira com comprovar-ho
…
Com es fa
- 1Paste the request
Paste the JSON body your app sends, or open it from a file, and press Format if it is minified.
- 2Check the source
The source box shows the detected format; pick it by hand if detection is unsure.
- 3Pick the target
Choose To OpenAI, To Anthropic or To Gemini and type the model you plan to use.
- 4Read the notes
Go through the conversion notes: each one names a field that was capped, merged or has no equivalent.
- 5Review the mapping
Open What was mapped to compare turn, image, tool and parameter counts with your original.
- 6Copy or test
Copy the JSON, download it, or copy the curl command and run it with your key in an environment variable.
Sobre aquesta eina
Moving an app from one model provider to another usually starts with the request body, and the three big chat APIs disagree on almost every field. OpenAI Chat Completions puts the system prompt in a message with role system, sends tool results as separate messages with role tool and keeps tool arguments as a JSON string. Anthropic Messages keeps the system prompt in its own top-level field, requires max_tokens, puts tool_use and tool_result blocks inside the assistant and user turns and expects turns to alternate. Gemini generateContent calls the assistant model, wraps everything in contents and parts, names functions in functionCall and functionResponse parts and places sampling settings inside generationConfig. This converter reads a request in any of the three formats, detects which one it is, and writes it out in the other two. System prompts, multi-turn history, images, function definitions, forced tool choice, JSON mode and structured output schemas, stop sequences, temperature, top_p, top_k, seeds, penalties and thinking budgets are all mapped. Anything that has no counterpart is listed in plain words instead of being dropped silently.
How the mapping works
The tool first turns your request into a neutral list of turns, each holding text, images, tool calls or tool results, and then writes that list in the target format. Tool call ids are kept when both sides have them. Gemini has no call ids, so ids are generated in order and each functionResponse is matched back to its call by function name. Consecutive turns from the same role are merged for Anthropic and Gemini, and tool results are moved to the front of their user turn, which is where Anthropic expects them.
Parameters that change meaning
Temperature runs from 0 to 2 at OpenAI and Gemini but from 0 to 1 at Anthropic, so higher values are capped and flagged. OpenAI accepts four stop sequences and Gemini five. top_k exists at Anthropic and Gemini but not OpenAI. An OpenAI reasoning_effort becomes an approximate thinking budget for Claude or Gemini, and the reverse mapping picks the nearest effort level. A JSON schema response format becomes Gemini's responseSchema, and for Anthropic it becomes a forced tool whose input is the schema, which is the documented way to get schema-shaped output there.
Schemas for Gemini
Gemini's parameters field accepts an OpenAPI-style subset of JSON Schema. Keywords such as additionalProperties, $schema and $ref are removed, a const becomes a one-item enum and a type list that includes null becomes nullable. The notes name every keyword that was removed so you can check the result.
Limits
This page does not call any API and never asks for a key; the curl view reads keys from environment variables on your own machine. Provider-specific extras such as built-in web search, code execution, file references, audio input and prompt caching markers are not converted and are listed in the notes. Model names are not translated, because there is no one-to-one match between providers: type the model you want in the target field.
Exemple resolt
A weather app sends an OpenAI request: a system prompt, a user turn with text and an image URL, an assistant tool call get_weather with arguments city Dhaka and unit celsius, a tool result with temp 31 and rain_chance 0.7, one function tool, temperature 1.3, max_tokens 300, seed 7 and stop END. Converted to Anthropic, the system prompt moves to the top-level system field, the image becomes a url image block, the call becomes a tool_use block with input as an object, and the result becomes a tool_result block in a user turn. max_tokens stays 300, stop becomes stop_sequences, and the notes say temperature 1.3 was capped at 1 and seed was dropped. Converting that output to Gemini gives three contents (user, model, user), a functionResponse whose response object holds temp 31 and rain_chance 0.7, and maxOutputTokens 300 in generationConfig.
En resum
- Categoria: Desenvolupament i dades
- S'executa al navegador, sense registre, sense pujar res.
- La informació que introdueixes es queda al dispositiu.
- Disponible en anglès.
- Contingut revisat per última vegada:
- Font oficial: OpenAI Chat Completions, Anthropic Messages and Google Gemini generateContent API references
Preguntes freqüents
Which formats does it read?
OpenAI Chat Completions request bodies, Anthropic Messages request bodies and Gemini generateContent request bodies, in camelCase or snake_case. Detection looks at fields such as contents, system, tool roles and content blocks, and you can override it.
Does it support the OpenAI Responses API?
Not as input. Responses uses a different item list. Content parts named input_text are read, but full Responses requests with built-in tools should be rewritten to Chat Completions first.
What happens to images?
Base64 data URLs become inline base64 blocks or inlineData parts. Plain URLs become url image sources for Anthropic and fileData for Gemini, with a note that Gemini fetches only certain URLs.
Why is my model name replaced?
A model name from one provider is meaningless to another, so the converter writes a current default for the target and tells you. Type your own model in the target model box to keep it.
Can I convert a whole conversation with tool calls?
Yes. Every tool call and result is carried across, ids are kept or generated, and results are matched to calls. Parallel calls in one assistant turn stay together.
Is my request sent anywhere?
No. Parsing and conversion run in your browser tab. The page stores your last input in local storage so the undo history survives a reload.
