Anthropic Messages

Anthropic-compatible messages at POST /v1/messages.

POST /v1/messages

Anthropic Messages API compatible endpoint.

See Anthropic's documentation for the full request and response specification.

Note

For compatibility with Claude Code and other compatible agents, the /v1/messages endpoint also supports the X-Api-Key header for authentication.

Request#

curl https://hyper.charm.land/v1/messages \  -H "x-api-key: sk-hyper-xxxxxxxxxxxxxxxxxxxxxxxx" \  -H "anthropic-version: 2023-06-01" \  -H "Content-Type: application/json" \  -d '{    "model": "prism",    "max_tokens": 1024,    "messages": [      {"role": "user", "content": "Hello!"}    ]  }'
FieldTypeRequiredDescription
modelstringyesModel ID from /v1/models
max_tokensintegeryesMax output tokens
messagesarrayyesArray of message objects
systemstring or arraynoSystem prompt
streambooleannoSet true for SSE streaming

All standard Anthropic parameters are accepted.

Response#

{  "id": "msg_abc123",  "type": "message",  "role": "assistant",  "content": [{ "type": "text", "text": "Hey there!" }],  "model": "deepseek-v4-pro",  "stop_reason": "end_turn",  "usage": {    "input_tokens": 10,    "output_tokens": 5  }}

Errors#

All errors use the Anthropic error format:

{  "type": "error",  "error": {    "type": "...",    "message": "..."  }}
Statuserror.typeCause
400invalid_request_errorInvalid JSON, missing model, messages, or max_tokens, context window exceeded
401authentication_errorMissing or invalid x-api-key
403permission_errorForbidden
404not_found_errorModel not found
429rate_limit_errorRate limit exceeded
5xxapi_errorUpstream provider failure