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.ruThe 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-keyorAuthorization: Bearer, both work. The gateway sets theanthropic-versionheader itself;anthropic-betais 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_sequencesinstead ofstop, response format viaoutput_config.format;seed,response_formatandreasoning_effortare silently stripped here.metadatais replaced with the gateway's identifier. - Tools: your own (no
type, orcustom) 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 andcompaction(400). - Streaming —
"stream": true,message_*andcontent_block_*events; usage is inmessage_startandmessage_delta. See Streaming.
The full parameter list is in Request parameters.
Updated September 29, 2026