[KongchangAI]
ConceptAnthropic 协议 / Anthropic 兼容协议

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

Timeline (last 90 days)

Oct 25

Claude Code relies on the Anthropic Messages API and a structured tool-calling protocol.

Unverified50%
Oct 24

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.

Unverified50%
Oct 23

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.

Unverified50%
Oct 19

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.

Verified75%
Oct 18

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.

Unverified50%
Oct 17

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.

Unverified50%
Oct 17

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.

Unverified50%
Oct 13

The 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.

Unverified50%
Oct 13

When stop_reason is stop_sequence, the stop_sequence field in the response carries back the actual stop sequence string that was hit.

Unverified50%
Oct 13

In streaming (SSE) mode, stop_reason is given in the message_delta event, immediately before message_stop, rather than arriving with the first event.

Unverified50%

4 more timeline events

All Facts (16)

Verified

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.

75%
Verified

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.

65%
Unverified

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.

60%
Unverified

Claude Code relies on the Anthropic Messages API and a structured tool-calling protocol.

50%
Unverified

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.

50%
Unverified

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.

50%
Unverified

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.

50%
Unverified

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.

50%
Unverified

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.

50%
Unverified

The 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.

50%
Unverified

In streaming (SSE) mode, stop_reason is given in the message_delta event, immediately before message_stop, rather than arriving with the first event.

50%
Unverified

When stop_reason is stop_sequence, the stop_sequence field in the response carries back the actual stop sequence string that was hit.

50%
Unverified

Claude Code can point to localhost by setting the ANTHROPIC_BASE_URL environment variable, communicating with local models without a proxy translation layer.

50%
Unverified

Anthropic's Messages API allows system content to be inserted at any position in the conversation.

50%
Unverified

The max_tokens parameter is required in the Anthropic Messages protocol.

50%
Unverified

In January 2026, Ollama natively supported the Anthropic Messages API, with LM Studio and llama.cpp following closely behind.

50%

Source Articles