Messages (Anthropic)

Messages (Anthropic)

POST /v1/messages — the Anthropic Messages format for Claude Code and the Anthropic SDK.

POST /v1/messages is the Anthropic Messages format, used by Claude Code and the Anthropic SDK. Their base URL has no /v1: the SDK appends the path itself.

https://ai-seller.vibe-codes.ru

The gateway does not translate formats: the request reaches the model's provider in the Anthropic format. The endpoint works only with models whose provider supports that format. If a model returns an error, use it through Chat Completions or Responses.

Request

curl https://ai-seller.vibe-codes.ru/v1/messages \
  -H "x-api-key: $AISELLER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "max_tokens": 200,
    "system": "Answer briefly.",
    "messages": [{"role": "user", "content": "How many planets are in the Solar System?"}]
  }'

Response

json
{
  "id": "msg_...",
  "type": "message",
  "role": "assistant",
  "model": "gpt-5.6-sol",
  "content": [{"type": "text", "text": "Eight."}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 20, "output_tokens": 2}
}

Specifics

  • Authentication — x-api-key or Authorization: Bearer, both work. The gateway sets the anthropic-version header itself; anthropic-beta is not passed to the provider, so API beta features are unavailable.
  • Errors come in the Anthropic envelope ({"type": "error", ...}) — the SDK and Claude Code parse them natively. See Errors.
  • Parameters: stop_sequences instead of stop, response format via output_config.format; seed, response_format and reasoning_effort are silently stripped here. metadata is replaced with the gateway's identifier.
  • Tools: your own (no type, or custom) and Anthropic client tools — bash_*, text_editor_*, memory_*, computer_*. Server tools (web search, code execution, MCP) are stripped.
  • Not available: /v1/messages/count_tokens, the Files API and compaction (400).
  • Streaming — "stream": true, message_* and content_block_* events; usage is in message_start and message_delta. See Streaming.

The full parameter list is in Request parameters.

Updated September 29, 2026