POST https://51kik.com/anthropic/v1/messages
Create a Messages API response. Shape follows Anthropic Messages.
Authentication
x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
Content-Type: application/json
Or Authorization: Bearer YOUR_API_KEY.
Recommended headers
Optional, same as OpenAI surface: x-trace-id, x-user-id, x-agent-name.
Request body
| Field | Required | Description |
|---|---|---|
model | yes | Catalog id |
messages | yes | user / assistant, min 1 |
max_tokens | yes | Max output tokens |
system | no | String or [{ type: "text", text }] |
stream | no | true → Anthropic SSE |
temperature, top_p, top_k | no | Sampling |
stop_sequences | no | String array |
tools | no | { name, description?, input_schema }[] |
tool_choice | no | auto / any / named tool |
metadata | no | e.g. { user_id } |
pdf_preprocess | no | Same PDF extension as OpenAI chat |
extra_body | no | JSON merged upstream |
Limit: JSON up to 32 MB.
messages[].content
String or block array: text, image, tool_use, tool_result, thinking, etc. Invalid blocks return 400.
Non-streaming example
curl -sS "https://51kik.com/anthropic/v1/messages" \
-H "x-api-key: $API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "One sentence about gateways." }]
}'
Streaming
"stream": true and Accept: text/event-stream. Events: message_start, content_block_delta, message_stop, … See Streaming.
Tools
- Send
tools+tool_choice. - Assistant
contentmay includetool_useblocks. - Next turn:
usermessage withtool_resultblocks matchingtool_use_id.
Response (non-streaming)
Anthropic-shaped: id, type: "message", role, content[], model, stop_reason, usage, …
Errors
{
"type": "error",
"error": { "type": "invalid_request_error", "message": "..." },
"request_id": "req_..."
}
See Errors · Anthropic differences.