OpenAI ↔ Anthropic Format Converter

Direction:
Source (OpenAI format)
Converted (Anthropic format)

Paste source JSON to convert...

Conversion Reference

Messages

role/content strings vs content blocks, system message handling, tool_calls vs tool_use blocks

Tools

function.parameters vs input_schema, type: "function" wrapper

Response

choices[0].message vs content blocks, finish_reason vs stop_reason, usage field mapping

What This Tool Does

OpenAI ↔ Anthropic Format Converter is built for deterministic developer and agent workflows.

Convert between OpenAI and Anthropic API formats. Messages, tools, and responses with automatic format detection and conversion notes.

Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Agent Invocation

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/api-format-converter/

For automation planning, fetch the canonical contract at /api/tool/api-format-converter.json.

How to Use OpenAI ↔ Anthropic Format Converter

  1. 1

    Convert OpenAI function_calling format to Anthropic tools

    Paste OpenAI function schema (name, description, parameters.properties). Tool converts to Anthropic format (input_schema with properties and required fields). Deploy converted schema to Claude API.

  2. 2

    Convert Anthropic tool results to OpenAI format

    Paste Anthropic tool_result (tool_use_id, content). Tool reformats as OpenAI assistant message with tool_call_id and function result. Useful for multi-LLM pipelines.

  3. 3

    Migrate agent codebase between API providers

    Have many functions defined in OpenAI format? Paste all schemas, convert in bulk. Replace in your codebase with Anthropic equivalents. Reduces manual refactoring.

  4. 4

    Validate format compatibility for multi-LLM systems

    If using multiple LLMs (GPT + Claude), convert both to a neutral JSON schema. Check that conversions are semantically equivalent. Ensures consistent behavior across providers.

  5. 5

    Handle nested objects and required field conversion

    Complex schemas with nested objects convert differently. Converter handles required[] arrays and nested properties. Verify output matches your API expectations before deploying.

Frequently Asked Questions

What's different between OpenAI and Anthropic message formats?
OpenAI uses {role, content} where content is a string. Anthropic uses {role, content} where content is an array of blocks like [{type: 'text', text: '...'}]. System messages and tool calls also differ significantly.
Does this convert tool/function definitions?
Yes, it converts between OpenAI's function format ({type: 'function', function: {name, parameters}}), Anthropic's tool format ({name, input_schema}), and MCP tool definitions.
What about features that don't have equivalents?
The tool warns about non-mappable features like Anthropic's cache_control or OpenAI's logprobs, so you know which fields need manual handling during migration.
Can it auto-detect which format I'm pasting?
Yes, the converter detects OpenAI vs Anthropic format based on JSON structure (e.g., presence of 'choices' indicates OpenAI response) and sets the conversion direction automatically.
Is this tool private?
Yes, all conversion happens in your browser. Your API messages and tool definitions are not sent to external services. No data leaves your device.