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

Timeline (last 90 days)

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

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

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%
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 January 2026, Ollama natively supported the Anthropic Messages API, with LM Studio and llama.cpp following closely behind.

Unverified50%
Oct 13

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

Unverified50%
Oct 12

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

Unverified50%
Oct 12

The max_tokens parameter is required in the Anthropic Messages protocol.

Unverified50%
Jul 22

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.

Unverified60%

All Facts (11)

Unverified

Claude使用Anthropic Messages API格式,而GPT系列使用OpenAI Chat Completions格式,两者接口规范存在本质差异

95%
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 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

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

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

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

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