Skip to main content
POST
curl

Authorizations

Authorization
string
header
required

An account API key. Send it as Authorization: Bearer <key>.

Headers

x-naga-routing-strategy
enum<string>

The routing strategy when the body names none. An unknown name is ignored. A NagaAI extension. The order in which NagaAI tries the providers that serve a model. A NagaAI extension.

Available options:
reliability,
balanced,
latency,
throughput,
cache

Body

application/json

The Anthropic-compatible Messages request. The gateway takes an unrecognized key and drops it.

model
string
required

The model to run, named by an id or alias from NagaAI's catalog. An entry without the chat.completions capability draws a refusal.

max_tokens
integer<int64>
required

The ceiling on generated tokens. Required, at least 1, and the gateway raises it where the reasoning budget would not fit.

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

The conversation so far, oldest first: one to 100000 entries. A block sent under the wrong role draws a refusal.

Required array length: 1 - 100000 elements
routing
object | null

How NagaAI orders the providers for this request. It reorders them and never removes one. A NagaAI extension.

system

The system prompt, as one string or as text blocks joined in order.

stream
boolean
default:false

Whether the reply arrives incrementally as the model writes it. An explicit null draws a refusal.

temperature
number<double> | null

How much randomness goes into the reply, between 0 and 2. A provider may still refuse a value this range allows.

Required range: 0 <= x <= 2
top_p
number<double> | null

The sampling cut-off, between 0 and 1, and an alternative to temperature.

Required range: 0 <= x <= 1
top_k
integer<int64> | null

How many top candidates each token is drawn from. It reaches only some providers.

stop_sequences
string[] | null

Strings that end generation the moment the model produces one. The reply never names which matched.

metadata
object | null

An object describing the request. Only user_id counts, and it reaches only some providers.

tools
(Client tool · object | Web search tool · object | Hosted tool · object)[] | null

The tools the model may call. Two dated web-search stamps are the only hosted ones the gateway serves; the other eight families travel no further.

One entry of tools[], in one of the three shapes this dialect accepts.

tool_choice
object

Which tool, if any, the model is to call.

thinking
object

How much reasoning the model does before answering. The budget becomes a tier: under 1024 draws a refusal, and output_config.effort wins over it.

output_config
object | null

Configuration for the output: the reasoning tier, and a schema the reply must satisfy.

Response

The message. application/json carries one message object; text/event-stream carries the event-typed frames of the stream.

The message. The gateway answers a request it does not forward with the second shape, which omits container and stop_details and adds created.

id
string
required

This answer's identifier.

type
string
required

What kind of object this is. Always message.

role
string
required

Who wrote it. Always assistant.

content
object[]
required

The answer itself, block by block.

One block of the answer's content, in the order the model produced it.

model
string
required

The model that answered, by its id in the NagaAI catalog.

stop_reason
string | null
required

Why the model stopped, in one of four values.

stop_sequence
null
required

Always null. Stop sequences are not reported back, which is why stop_reason is never stop_sequence either.

stop_details
null
required

Always null. stop_reason carries the whole of what is known about why the turn ended.

container
null
required

Always null. Code-execution containers are not served.

usage
object
required

What the request cost in tokens.