LLM API Parameters Cheat Sheet: Claude Messages API vs OpenAI Responses API
Checked against Claude API and OpenAI API Claude API version header 2026-10-21; OpenAI Responses API docs as read on 2026-11-28 on 28 November 2026. Each section links to the official docs it was checked against.
This sheet puts the request fields of the Anthropic Messages API and the OpenAI Responses API next to each other, for developers who call both or are porting code between them. It follows platform.claude.com (API version 2026-10-21) and developers.openai.com as they read on 28 November 2026. We had no API keys in the test shell, so every row is from the docs and marked untested.
When to use what
The two APIs look alike but differ in a few places that cause most porting bugs. Claude takes the system prompt in a top-level system field and requires max_tokens; OpenAI's Responses API takes instructions and an optional max_output_tokens. Tool definitions use input_schema on Claude and parameters on OpenAI, and the tool result goes back as a tool_result content block on Claude versus a function_call_output item on OpenAI.
Sampling is the newest trap. Claude API version 2026-10-21 removed temperature, top_p and top_k: sending any of them, even at the default, returns a 400. OpenAI's Responses reference still lists temperature (0 to 2, default 1) and top_p. If you share one request builder between providers, strip those fields for Claude.
For cost, both providers charge half price for batch jobs, and both cache repeated prompt prefixes. Claude caching is opt-in with cache_control, up to 4 breakpoints and a 5-minute or 1-hour lifetime. OpenAI caches automatically from 1,024 tokens on GPT-5.6 and later, with a 30-minute default. Our prompt caching post explains the idea, the cache breakpoint planner helps you place Claude breakpoints, and the OpenAI batch JSONL builder writes batch input files. For prices, see our LLM API pricing comparison and the providers' own pages; this sheet does not rank models.
OpenAI's list is at https://developers.openai.com/api/docs/models. Model IDs change often; copy them from the provider's page, not from blog posts.
POST https://api.anthropic.com/v1/messagesClaude: create a message; send x-api-key and anthropic-version: 2026-10-21 headers
POST https://api.openai.com/v1/responsesOpenAI: create a response with the Responses API; Chat Completions at /v1/chat/completions is still supported
claude-opus-5-5 / claude-sonnet-5-5 / claude-haiku-5-5 / claude-fable-5-2Current Claude API model IDs as listed on the models overview page
gpt-6.2-astra / gpt-6.2-sol / gpt-6-lunaModel IDs OpenAI's models page suggests starting with
anthropic-version: 2026-10-21Claude API version header; SDKs set it for you based on their major version
OpenAI fields are from the Responses create reference: https://developers.openai.com/api/reference/resources/responses/methods/create
"max_tokens": 1024Claude: required ceiling on output tokens; set 0 to only warm the prompt cache
"max_output_tokens": 1024OpenAI: optional ceiling on output tokens, reasoning tokens included
"system": "You are a terse reviewer."Claude: system prompt as a top-level string or array of text blocks, not a message
"instructions": "You are a terse reviewer."OpenAI Responses: the system or developer instructions for this response
"temperature": 0.2OpenAI: sampling temperature from 0 to 2, default 1; change this or top_p, not both. Claude 2026-10-21 rejects it
"stop_sequences": ["###"]Claude: stop when a custom string appears; the response stop_reason is then stop_sequence
"stream": trueBoth: stream the reply as server-sent events instead of one JSON body
OpenAI's events are documented at https://developers.openai.com/api/docs/guides/streaming-responses
message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stopClaude SSE event names in the order a normal reply produces them
ping / errorClaude: keep-alive and error events can arrive mid-stream; handle both
response.created, response.output_text.delta, response.completedOpenAI Responses SSE events for start, each text chunk and the end
client.messages.stream(...)Claude SDK helper that sets stream and builds the final message from the events
OpenAI function calling: https://developers.openai.com/api/docs/guides/function-calling
{"name": "get_weather", "description": "...", "input_schema": {"type": "object", ...}}Claude tool definition in the tools array
{"type": "function", "name": "get_weather", "parameters": {...}, "strict": true}OpenAI function tool definition; strict enforces the schema
{"type": "tool_result", "tool_use_id": "...", "content": "..."}Claude: send a tool's output back in the next user message, matched by tool_use_id
{"type": "function_call_output", "call_id": "...", "output": "..."}OpenAI: send a function's output back as an input item, matched by call_id
"tool_choice": {"type": "auto" | "any" | "tool" | "none"}Claude: let the model choose, force some tool, force a named tool, or forbid tools
"disable_parallel_tool_use": trueClaude: inside tool_choice, limit the model to one tool call per turn
"parallel_tool_calls": falseOpenAI: turn off parallel function calls (default true)
OpenAI guide: https://developers.openai.com/api/docs/guides/structured-outputs
"output_config": {"format": {"type": "json_schema", "schema": {...}}}Claude: make the text reply follow a JSON Schema
"strict": true (on a Claude tool)Claude: guarantee tool names and inputs match the schema
"text": {"format": {"type": "json_schema", "strict": true, "schema": {...}}}OpenAI Responses: structured output with schema enforcement
"response_format": {"type": "json_schema", ...}OpenAI Chat Completions spelling of the same feature
OpenAI guide: https://developers.openai.com/api/docs/guides/prompt-caching
"cache_control": {"type": "ephemeral"}Claude: top level for automatic caching, or on a block to set a breakpoint; 5-minute lifetime by default
"cache_control": {"type": "ephemeral", "ttl": "1h"}Claude: one-hour cache lifetime; writes cost 2x base input instead of 1.25x
up to 4 breakpoints, 512-token minimum on current modelsClaude limits; shorter prefixes are silently not cached, so check cache_creation_input_tokens
usage.cache_read_input_tokens / usage.cache_creation_input_tokensClaude usage fields that show cache reads and writes for the request
"prompt_cache_options": {"ttl": "12h"}OpenAI GPT-5.6 and later: keep the cache at least 12 hours (writes 2.5x); default is "30m"
"prompt_cache_key": "tenant-42"OpenAI: separate cache accounting per customer; not needed for routing on GPT-5.6 and later
"prompt_cache_retention": "24h"OpenAI models before GPT-5.6: extended retention instead of in_memory
OpenAI Batch guide: https://developers.openai.com/api/docs/guides/batch. Both batch APIs cost 50% of the standard rate.
POST https://api.anthropic.com/v1/messages/batchesClaude: submit up to 100,000 requests or 256 MB; results within 24 hours, most within an hour
GET /v1/messages/batches/{id}/resultsClaude: download results once the batch has ended
{"custom_id": "request-1", "method": "POST", "url": "/v1/responses", "body": {...}}OpenAI: one line of the batch input JSONL; custom_id must be unique
purpose="batch"OpenAI: upload the JSONL through the Files API with this purpose; keep it under 200 MB
POST /v1/batches {"input_file_id": "file-abc123", "endpoint": "/v1/responses", "completion_window": "24h"}OpenAI: start the batch; 24h is the completion window
OpenAI headers: https://developers.openai.com/api/docs/guides/rate-limits
retry-afterClaude: seconds to wait before retrying a 429; the spend-cap 429 never includes it
anthropic-ratelimit-requests-remaining / -resetClaude: requests left in the window and when it refills (RFC 3339 time)
anthropic-ratelimit-input-tokens-remaining / anthropic-ratelimit-output-tokens-remainingClaude: input and output tokens left, rounded to the nearest thousand
x-ratelimit-remaining-requests / x-ratelimit-remaining-tokensOpenAI: requests and tokens left before you hit the limit
x-ratelimit-reset-requests / x-ratelimit-reset-tokensOpenAI: time until the limit resets, as a duration like 1s or 6m0s
Worked example: Port one tool-calling request from OpenAI to Claude
Say your OpenAI code sends this to /v1/responses:
{"model": "gpt-6.2-sol",
"instructions": "Answer with the tool when you can.",
"input": "Weather in Lisbon?",
"temperature": 0.2,
"tools": [{"type": "function", "name": "get_weather",
"parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}]}
The Claude version for /v1/messages with anthropic-version: 2026-10-21 changes five things:
{"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"system": "Answer with the tool when you can.",
"messages": [{"role": "user", "content": "Weather in Lisbon?"}],
"tools": [{"name": "get_weather",
"input_schema": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}]}
instructions became system. The input string became a messages array. max_tokens was added because Claude requires it. The tool lost its type wrapper and parameters became input_schema. And temperature is gone, because this API version answers it with a 400. When Claude decides to call the tool, the reply has a tool_use block with an id; you run the function and send back a user message containing a tool_result block whose tool_use_id matches. On OpenAI the same step is a function_call_output item keyed by call_id. We did not run these requests, so check the reply shapes against the docs linked in each section.
Common mistakes
Keeping
temperatureortop_pin a shared request builder after moving to Claude API version 2026-10-21.Strip
temperature,top_pandtop_kfor Claude requests; they return a 400 on every model in that version, even at default values.Leaving out
max_tokenson Claude because OpenAI treats the output cap as optional.Always send
max_tokensto the Messages API. Size it with the model's max output in mind, and remember thinking tokens count toward it.Marking a short prompt with
cache_controland assuming it is cached.Below the model's minimum (512 tokens on current Claude models), the request runs uncached with no error. Check that
cache_creation_input_tokensorcache_read_input_tokensis above zero.Copying OpenAI's
parameterskey into a Claude tool, or Claude'sinput_schemainto an OpenAI function.Claude tools use
input_schema; OpenAI function tools usetype: "function"plusparameters. A builder like our function-calling tool can emit both.Retrying a 429 immediately in a tight loop.
Wait at least the
retry-afterseconds on Claude, or readx-ratelimit-reset-*on OpenAI. On Claude's spend-cap 429 there is noretry-after, and retries keep failing until access resumes.Hard-coding a model ID from an old tutorial.
Copy IDs from the provider's models page and keep them in config. Both providers retire older models on published dates.
Related cheat sheets
Sources
- https://platform.claude.com/docs/en/about-claude/models/overview
- https://platform.claude.com/docs/en/api/messages/create
- https://platform.claude.com/docs/en/api/versioning
- https://platform.claude.com/docs/en/api/migration-2026-10-21
- https://platform.claude.com/docs/en/api/rate-limits
- https://platform.claude.com/docs/en/build-with-claude/streaming
- https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview
- https://platform.claude.com/docs/en/build-with-claude/structured-outputs
- https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- https://platform.claude.com/docs/en/build-with-claude/batch-processing
- https://developers.openai.com/api/docs/models
- https://developers.openai.com/api/docs/models/gpt-6.2-astra
- https://developers.openai.com/api/reference/resources/responses/methods/create
- https://developers.openai.com/api/docs/guides/function-calling
- https://developers.openai.com/api/docs/guides/structured-outputs
- https://developers.openai.com/api/docs/guides/streaming-responses
- https://developers.openai.com/api/docs/guides/prompt-caching
- https://developers.openai.com/api/docs/guides/batch
- https://developers.openai.com/api/docs/guides/rate-limits
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.