Skip to main content
POST
/
v1
/
messages
Create a message (Anthropic-compatible)
curl --request POST \
  --url https://litellm-rust.onrender.com/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "anthropic/*",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "max_tokens": 1024,
  "stream": false
}
'
{
  "id": "<string>",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "<string>"
    }
  ],
  "model": "<string>",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Your LITELLM_MASTER_KEY. Default for local Docker Compose: sk-local

Body

application/json
model
string
required

Model alias from config. Available: anthropic/*, gpt-5.5

Example:

"anthropic/*"

messages
object[]
required
Example:
[{ "role": "user", "content": "Hello!" }]
max_tokens
integer
required
Example:

1024

stream
boolean
Example:

false

Response

Message response from upstream provider

id
string
type
string
Example:

"message"

role
string
Example:

"assistant"

content
object[]
model
string
stop_reason
string
Example:

"end_turn"

usage
object