Anthropic Messages API
An API communication protocol specification defined by Anthropic. Third-party providers can implement the same request/response structure and authentication method on their servers, allowing compatible clients to connect without modification.
Core Facts
M3.1 Flash can be called via the AI SDK, Chat Completions, Responses, and the Anthropic Messages API, with the model name minimax/minimax-m3.1-flash.
Mainstream large language model APIs differ significantly in message format: Anthropic uses a messages array structure with a special system prompt separation approach, while OpenAI uses role/content key-value pairs and supports the function calling format.
Claude uses the Anthropic Messages API format, while the GPT series uses the OpenAI Chat Completions format, and the two have fundamentally different interface specifications.
Timeline (last 90 days)
Claude Code natively calls Anthropic's Messages API, while most domestic and third-party providers expose only OpenAI's Chat Completions format, and the two are incompatible in field naming, role expression and streaming event structure.
There are two paths to building a harness in TypeScript or Python: use the Claude Agent SDK, or write a bare tool-calling loop directly against the Anthropic Messages API, OpenAI, or Ollama-compatible endpoints.
The model name is `anthropic/claude-fable-5.2`, callable through APIs such as AI SDK, Chat Completions, Responses, and Anthropic Messages.
Claude Code relies on the Anthropic Messages API and a structured tool-calling protocol.
Claude Code follows the request format of the Anthropic Messages API, so third-party models compatible with that format can be called by replacing the base URL and the key.
Developers can call Kimi K3.1 Pro via the AI SDK, Chat Completions API, Responses API, Anthropic Messages API, or a coding Agent connected to the AI Gateway.
M3.1 Flash can be called via the AI SDK, Chat Completions, Responses, and the Anthropic Messages API, with the model name minimax/minimax-m3.1-flash.
Claude Code uses Anthropic's Messages protocol rather than OpenAI's chat completions protocol, so setting only the Base URL cannot directly connect to OpenAI-shaped endpoints.
The Anthropic Messages API stream carries the input token count in the message_start event (message.usage), and output tokens arrive later via the message_delta event.
When using a custom relay station, you need to fill in both the Base URL and the API Key, and ensure that the service is compatible with the Anthropic Messages API format; otherwise, requests will fail or streaming output will be abnormal.
7 more timeline events
All Facts (20)
M3.1 Flash can be called via the AI SDK, Chat Completions, Responses, and the Anthropic Messages API, with the model name minimax/minimax-m3.1-flash.
80%VerifiedMainstream large language model APIs differ significantly in message format: Anthropic uses a messages array structure with a special system prompt separation approach, while OpenAI uses role/content key-value pairs and supports the function calling format.
65%VerifiedClaude uses the Anthropic Messages API format, while the GPT series uses the OpenAI Chat Completions format, and the two have fundamentally different interface specifications.
65%UnverifiedThe Anthropic Messages API stream carries the input token count in the message_start event (message.usage), and output tokens arrive later via the message_delta event.
60%UnverifiedThe stop_reason field in the top-level response of the Anthropic Messages API has seven possible values in total: end_turn, tool_use, max_tokens, stop_sequence, refusal, pause_turn, and model_context_window_exceeded.
60%UnverifiedClaude Code natively supports only Anthropic's official API endpoint.
60%UnverifiedClaude Code natively calls Anthropic's Messages API, while most domestic and third-party providers expose only OpenAI's Chat Completions format, and the two are incompatible in field naming, role expression and streaming event structure.
50%UnverifiedThere are two paths to building a harness in TypeScript or Python: use the Claude Agent SDK, or write a bare tool-calling loop directly against the Anthropic Messages API, OpenAI, or Ollama-compatible endpoints.
50%UnverifiedThe model name is `anthropic/claude-fable-5.2`, callable through APIs such as AI SDK, Chat Completions, Responses, and Anthropic Messages.
50%UnverifiedClaude Code relies on the Anthropic Messages API and a structured tool-calling protocol.
50%UnverifiedClaude Code follows the request format of the Anthropic Messages API, so third-party models compatible with that format can be called by replacing the base URL and the key.
50%UnverifiedDevelopers can call Kimi K3.1 Pro via the AI SDK, Chat Completions API, Responses API, Anthropic Messages API, or a coding Agent connected to the AI Gateway.
50%UnverifiedClaude Code uses Anthropic's Messages protocol rather than OpenAI's chat completions protocol, so setting only the Base URL cannot directly connect to OpenAI-shaped endpoints.
50%UnverifiedWhen using a custom relay station, you need to fill in both the Base URL and the API Key, and ensure that the service is compatible with the Anthropic Messages API format; otherwise, requests will fail or streaming output will be abnormal.
50%UnverifiedIn streaming (SSE) mode, stop_reason is given in the message_delta event, immediately before message_stop, rather than arriving with the first event.
50%UnverifiedWhen stop_reason is stop_sequence, the stop_sequence field in the response carries back the actual stop sequence string that was hit.
50%UnverifiedClaude Code can point to localhost by setting the ANTHROPIC_BASE_URL environment variable, communicating with local models without a proxy translation layer.
50%UnverifiedAnthropic's Messages API allows system content to be inserted at any position in the conversation.
50%UnverifiedThe max_tokens parameter is required in the Anthropic Messages protocol.
50%UnverifiedIn January 2026, Ollama natively supported the Anthropic Messages API, with LM Studio and llama.cpp following closely behind.
50%