The Three Official API Formats: How Chat Completions, Responses and Messages Differ

Request shape, system prompts, multi-turn context, tool calls, streaming events and usage fields — a side-by-side comparison of OpenAI's two APIs and Anthropic Messages, and which to pick for a new project.

4 min read

Every request you send to a large language model follows an API format. Three dominate today: OpenAI's Chat Completions and Responses, and Anthropic's Messages. All three can hold a conversation, but their request shapes, tool calls and streaming events differ. Knowing the differences saves time when you migrate code, debug issues or pick an SDK.

The differences at a glance

AspectChat CompletionsResponsesMessages
EndpointPOST /v1/chat/completionsPOST /v1/responsesPOST /v1/messages
Input fieldmessages arrayinput (string or item array)messages array
System promptsystem / developer role messagetop-level instructionstop-level system
Output limitmax_completion_tokensmax_output_tokensmax_tokens (required)
Output shapechoices[].messagearray of output itemsarray of content blocks
Tool callstool_calls + tool role messagefunction_call / function_call_output itemstool_use / tool_result blocks
Streamingdata-only SSE ending in [DONE]named events ending in a terminal eventnamed events ending in message_stop
Usage fieldsprompt_tokens / completion_tokensinput_tokens / output_tokensinput_tokens / output_tokens + cache fields

One request, three ways

{
  "model": "gpt-6.1-sol",
  "messages": [
    { "role": "developer", "content": "You are a concise technical advisor." },
    { "role": "user", "content": "Explain idempotency." }
  ],
  "max_completion_tokens": 800
}

All three say the same thing; they differ in where the system prompt goes, what the input is called and what the output limit is called. max_tokens is required in Messages — leaving it out returns 400, one of the most common mistakes when moving over from OpenAI.

Output shape: message, items and content blocks

  • Chat Completions puts the output in choices[0].message; text and tool calls hang off that assistant message.
  • Responses returns an array of output items: reasoning, text messages and function calls are separate items. The SDKs offer an output_text convenience field that joins all the text.
  • Messages returns an array of content blocks: text, thinking, tool_use and so on, in order.

The difference matters most with reasoning models: Responses and Messages can return "thinking" as its own part so you can pass it back unchanged in multi-turn calls; Chat Completions has no equivalent structure.

The tool-call round trip

Tool calling is where the formats differ most. Take "the model asks to call get_weather, you run it and return the result":

StepChat CompletionsResponsesMessages
Model requests a calltool_calls[] on the assistant messagean output item with type: "function_call"a content block with type: "tool_use"
You return the resulta role: "tool" message with tool_call_idan input item with type: "function_call_output" and call_ida type: "tool_result" block in a user message with tool_use_id
Tool definitiontools[].function.parameterstools[].parameterstools[].input_schema

When you port an agent framework, this message-assembly layer is usually all that changes; the business logic stays.

Stateful versus stateless

Chat Completions and Messages are stateless: every request carries the full conversation.

Responses is designed to support server-side conversation storage, continued with previous_response_id, so you don't re-upload history. But "stateful" also means data stays on a server. UnioAPI does not store Responses — send the full input each time; continuing with previous_response_id returns 400 previous_response_not_found. The upside is that nothing is persisted, and the repeated history can be billed at the cache price through prompt caching.

Streaming events

  • Chat Completions: each chunk carries only the delta; the last line is data: [DONE]. For usage, add stream_options.include_usage; it arrives in the final chunk.
  • Responses: named events such as response.output_text.delta and response.completed, no [DONE]; usage is in the terminal event.
  • Messages: named events — message_start, content_block_delta, message_delta, message_stop.

Whatever the format, no end marker means no success. How to handle dropped streams is covered in Error handling for LLM APIs in production.

Which one for a new project

  • New OpenAI projects: Responses. New model capabilities (built-in tools, reasoning items, 12-hour caching) arrive there first or only, and models like gpt-5.5-pro are Responses-only. Why is explained in Why more new models are Responses-only.
  • Existing Chat Completions code: keep it. It is still widely supported, and plenty of open-source tools speak only this format.
  • Claude models: Messages. Prompt caching, thinking, Fast and similar fields are most complete in the native format.

On UnioAPI: one key, both native formats

UnioAPI serves all three endpoints with official request and response shapes, so switching models doesn't mean switching SDKs:

ClientBase URL
OpenAI SDK (Chat Completions / Responses)https://api.unioapi.com/v1
Anthropic SDK (Messages)https://api.unioapi.com

Which endpoint each model accepts is listed in endpoint_capabilities from GET /v1/models; the full comparison is in Choose a Protocol.

Keep reading