Skip to main content
POST
/
v1
/
messages
curl --request POST \
  --url https://api.naga.ac/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "claude-sonnet-4.5",
  "max_tokens": 512,
  "messages": [
    {
      "role": "user",
      "content": "Explain the CAP theorem in one paragraph."
    }
  ]
}
'
{
  "id": "<string>",
  "model": "<string>",
  "content": [
    {
      "type": "<string>",
      "text": "<string>"
    }
  ],
  "created": 123,
  "type": "message",
  "role": "assistant",
  "stop_reason": "<string>",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "cache_read_input_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Primary authentication for inference endpoints. Send your Naga API key as Authorization: Bearer <api-key>.

Body

application/json

Stateless Messages API endpoint (Anthropic Messages API compatibility).

Request surface is intentionally limited to what maps into our internal /v1/chat/completions pipeline.

model
string
required

Model identifier to route the request to.

Example:

"claude-sonnet-4.5"

max_tokens
integer
required

Maximum number of output tokens to generate.

Required range: x >= 1
messages
MessageParam · object[]
required

Conversation history in Anthropic Messages format.

Required array length: 1 - 100000 elements
system
stream
boolean
default:false

Return Anthropic-style SSE events instead of a single JSON response.

temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
stop_sequences
string[] | null
tools
(ToolParam · object | WebSearchToolParam · object)[] | null
tool_choice
ToolChoiceAutoParam · object
thinking
ThinkingConfigEnabledParam · object
output_config
OutputConfigParam · object

Response

JSON response when stream=false, or Anthropic-style Server-Sent Events when stream=true.

id
string
required
model
string
required
content
(AnthropicTextBlockResponse · object | AnthropicThinkingBlockResponse · object | AnthropicImageBlockResponse · object | AnthropicSearchResultBlockResponse · object | AnthropicToolUseBlockResponse · object)[]
required
created
integer
required
type
string
default:message
Allowed value: "message"
role
string
default:assistant
Allowed value: "assistant"
stop_reason
string | null
stop_sequence
string | null
usage
AnthropicUsageResponse · object