Skip to main content
POST
https://api.naga.ac
/
v1
/
messages
Messages API (Anthropic-compatible)
curl --request POST \
  --url https://api.naga.ac/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "max_tokens": 123,
  "messages": [
    {}
  ],
  "system": {},
  "stream": true,
  "temperature": 123,
  "top_p": 123,
  "stop_sequences": [
    "<string>"
  ],
  "tools": [
    {}
  ],
  "tool_choice": {},
  "thinking": {}
}
'
Anthropic-compatible This endpoint mirrors Anthropic’s Messages API. It is used by tools like Claude Code and the official Anthropic SDK.

Request Parameters

model
string
required
Target model ID (for example: claude-sonnet-4.5).
max_tokens
integer
required
Maximum number of tokens to generate (minimum: 1).
messages
array
required
Conversation messages (minimum: 1; maximum: 100000).Each item is a MessageParam object:
  • role (required): "user" | "assistant"
  • content (required): string or an array of typed blocks (discriminator: type)
system
string | array
Optional system prompt. Can be:
  • a string, or
  • an array of text blocks: { "type": "text", "text": "..." }
stream
boolean
default:"false"
Whether to stream the response.
temperature
number
Sampling temperature (0..2). Higher values make output more random.
top_p
number
Nucleus sampling probability (0..1). Alternative to temperature.
stop_sequences
string[]
Stop sequences. Generation stops when any stop sequence is encountered.
tools
array
Tool definitions (Anthropic Messages API format).
tool_choice
object
Tool choice strategy (Anthropic format).
thinking
object
Thinking configuration (Anthropic format).

Usage examples

from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.naga.ac",
    api_key="YOUR_API_KEY",
)

message = client.messages.create(
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": "Hello, Claude!",
        }
    ],
    model="claude-sonnet-4.5",
)

print(message.content)

Response

Returns an Anthropic-compatible Messages API response object.