LLM Request Converter — OpenAI ↔ Anthropic ↔ Gemini Format
Convert an LLM chat request body between OpenAI Chat Completions, Anthropic Messages, and Google Gemini formats — messages, system prompt, and max tokens are remapped for you. 100% local.
Last updated:
CommentsPaste a chat request body for OpenAI Chat Completions, Anthropic Messages, or Google Gemini, pick a target provider, and this tool remaps it — moving the system prompt, converting roles, and setting the right max-tokens field. Everything runs in your browser.
Detected format: OpenAI (Chat Completions)
{
"model": "gpt-4o",
"max_tokens": 200,
"messages": [
{
"role": "user",
"content": "Summarize the theory of relativity in one sentence."
}
],
"system": "You are a helpful assistant.",
"temperature": 0.7
}Converts the core request shape — system prompt, messages/contents, and max tokens. Conversion runs entirely in your browser; nothing is uploaded.
What is LLM Request Converter?
Migrating a prompt between providers means more than renaming a field. OpenAI keeps the system prompt as a role: system message inside the messages array and uses max_tokens; Anthropic wants a top-level system string, only user/assistant roles, and a required max_tokens; Gemini uses contents with role user/model, parts: [{ text }], a separate systemInstruction, and generationConfig.maxOutputTokens. This converter parses your request, extracts the system prompt, remaps each message role to the target's vocabulary, and relocates the token limit, producing a ready-to-send body. It focuses on the core request shape that trips people up during migration, so you can switch providers without rewriting the plumbing by hand.
How to convert an LLM request
- 1Paste a request body (OpenAI, Anthropic, or Gemini) — the source format is detected.
- 2Choose the target provider.
- 3Copy the converted request body.
Key Concepts
- system prompt
- A system message in OpenAI; a top-level string in Anthropic; systemInstruction in Gemini.
- role mapping
- assistant (OpenAI/Anthropic) maps to model in Gemini; system is relocated out of messages.
- messages array
- Validate an OpenAI messages array separately.
Frequently Asked Questions
What differs between OpenAI and Anthropic request bodies?
OpenAI puts the system prompt as a message with role: system inside the messages array and uses max_tokens (or max_completion_tokens). Anthropic takes a top-level system string, requires max_tokens, and only allows user/assistant roles in messages. This converter moves the system message out, remaps roles, and sets the right token field.
How does Gemini's format differ?
Gemini uses contents with role user/model (not assistant) and parts: [{ text }], a separate systemInstruction, and generationConfig.maxOutputTokens. The converter maps messages to contents and relocates the system prompt and token limit.
Does it convert tools / function definitions?
It focuses on the core request shape — system, messages/contents, and token limits — which covers most migration needs. Tool/function schemas differ per provider; use the Schema → Tool Definition tool for those.
Is my request uploaded?
No. The conversion runs entirely in your browser.
Try Next
Text Chunker
Split long text into overlapping chunks for embedding and RAG pipelines. Preview recursive, paragraph, sentence, or fixed strategies with live token counts. Runs 100% in your browser.
Related Tools
Context Window Checker
Check whether your prompt fits a model's context window before you send it. Estimates prompt tokens, reserves room for the response, and shows remaining headroom across GPT-4o, o1, Claude, Gemini, DeepSeek and more. 100% local.
Prompt Token Breakdown
Break a prompt into segments and see how many tokens — and how much cost — each part uses. Find the heaviest section (system, few-shot examples, or user input) so you know exactly what to trim. 100% local.
Schema → Tool Definition
Turn a sample JSON payload into function-calling / tool definitions for OpenAI, Anthropic, and Gemini — side by side. Strict-mode toggle adds required + additionalProperties: false. 100% local, paste straight into your tools array.
Chat Messages Validator
Validate a Chat Completions messages array before you send it — checks roles (system/user/assistant/tool), required content, and common mistakes that cause a 400. 100% local.
Prompt Template Tester
Write a prompt with {{variable}} placeholders, fill in values, and preview the final prompt. Detects every variable and flags any you left unfilled. 100% local.
Prompt Diff
Compare two versions of a prompt line by line and see the token delta between them — so you know exactly what changed and whether an edit made the prompt cheaper or more expensive. 100% local.