Skip to content
WRAITHERIXDocsENRU

Create message (Anthropic format)

POST
/v1/messages
curl --request POST \
--url https://api.wraitherix.com/v1/messages \
--header 'Content-Type: application/json' \
--header 'anthropic-version: 2023-06-01' \
--header 'x-api-key: <x-api-key>' \
--data '{ "model": "claude-opus-5-5", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Hello, Claude" } ] }'

Anthropic Messages API. Authenticate with x-api-key (or Authorization: Bearer) and send anthropic-version: 2023-06-01. Supports streaming, tools, extended thinking and prompt caching (cache_control).

anthropic-version
required
string

Example

2023-06-01
Media typeapplication/json
object
model
required
string
max_tokens
required
integer
system
One of:
string
messages
required
Array<object>
object
role
string
Allowed values: user assistant
content
One of:
string
stream
boolean
temperature
number
tools
Array<object>
object
tool_choice
object
thinking
object
type
string
Allowed values: enabled disabled
budget_tokens
integer

Example

{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, Claude"
}
]
}

Message object, or SSE events (message_start, content_block_delta, message_stop, …) when streaming.

Media typeapplication/json
object
id
string
type
string
role
string
model
string
content
Array<object>
object
stop_reason
string
usage
object
input_tokens
integer
output_tokens
integer
cache_creation_input_tokens
integer
cache_read_input_tokens
integer

Example

{
"type": "message",
"role": "assistant"
}

The request is malformed or a parameter is invalid.

Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string

Example

{
"error": {
"message": "Invalid request body",
"type": "invalid_request_error",
"param": "",
"code": "invalid_request"
}
}

Missing or invalid API key.

Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string

Example

{
"error": {
"message": "Invalid API key",
"type": "api_error",
"param": "",
"code": ""
}
}

Not enough credits on the account, or the key has reached its own credit limit.

Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string

Example

{
"error": {
"message": "Insufficient balance",
"type": "api_error",
"param": "",
"code": "insufficient_user_quota"
}
}