Skip to main content
POST
/
messages
Create an Anthropic-style message
curl --request POST \
  --url https://api.valarhq.ai/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "zai-org/GLM-5.1-FP8",
  "max_tokens": 300,
  "messages": [
    {
      "role": "user",
      "content": "Give me a short launch checklist for an API integration."
    }
  ]
}
'
{
  "id": "<string>",
  "content": [
    {
      "text": "<string>"
    }
  ],
  "model": "<string>",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

anthropic-idempotency-key
string

The Anthropic-style idempotency header. It behaves exactly like Idempotency-Key and exists on the /messages endpoint so you can keep to Anthropic's naming.

Maximum string length: 255

Body

application/json
model
string
required
max_tokens
integer
required
Required range: x >= 1
messages
object[]
required
Minimum array length: 1
temperature
number
Required range: 0 <= x <= 1
top_p
number
Required range: 0 <= x <= 1
output_config
object
tools
object[]

Allowed so the Anthropic SDK stays happy, but Valar ignores it for now. The model never sees these tools and cannot invoke them.

tool_choice
object

Allowed so the Anthropic SDK stays happy, but Valar ignores it for now.

stream
enum<boolean>

Streaming is not available on this endpoint yet.

Available options:
false
metadata
object

Optional string-valued metadata. Use completion_window to influence scheduling, and completion_webhook together with webhook_token to wire up a webhook that fires on completion.

Response

A message response shaped to match Anthropic's format.

id
string
required
type
enum<string>
required
Available options:
message
role
enum<string>
required
Available options:
assistant
content
object[]
required
Minimum array length: 1
model
string
required
stop_reason
enum<string>
required
Available options:
end_turn,
max_tokens,
tool_use,
stop_sequence,
refusal
stop_sequence
string | null
required
usage
object
required