Skip to main content
POST
/
v1
/
messages
curl --request POST \
  --url https://api.caprioletech.com/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "claude-opus-4-8",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Hello World!"
    }
  ]
}
'
{}

Documentation Index

Fetch the complete documentation index at: https://docs.capriole.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use this endpoint when your application, SDK, or agent expects the Anthropic Messages request and response format. Send a standard Messages payload with model, messages, and max_tokens. Capriole AI rewrites the model to the selected upstream Claude model, forwards compatible fields such as system, tools, thinking, and stream, and returns the upstream JSON or SSE stream unchanged. POST /v1/messages/count_tokens is also available for Anthropic-compatible clients that need a token-count preflight. It accepts the same message shape and returns the upstream token-count JSON unchanged. For simple Capriole-native text generation, use POST /v1/chat. Use POST /v1/messages when Anthropic Messages wire behavior is required.

Authorizations

Authorization
string
header
required

Use an API key created in the Capriole AI page. Send it as Authorization: Bearer sk-....

Body

application/json
model
enum<string>
required

Public Anthropic Messages model identifier

Available options:
claude-opus-4-8,
claude-opus-4-7
messages
object[]
required

Anthropic-compatible conversation messages.

max_tokens
integer
required

Maximum number of output tokens.

system

Optional Anthropic-compatible system prompt.

tools
object[]

Anthropic-compatible tool definitions.

thinking
object

Anthropic-compatible thinking options.

stream
boolean
default:false

Stream the response as Anthropic-compatible server-sent events.

Response

Anthropic Messages-compatible JSON response or SSE stream

Anthropic Messages-compatible response body.