Messages

Create a message

Changed on

Creates a model response in the Anthropic Messages dialect and charges the account for the tokens it used. Requires an API key. /v1/chat/completions and /v1/responses serve the same models in the other two dialects.

post/v1/messages

Request

Headers

x-naga-routing-strategy'reliability' | 'balanced' | 'latency' | 'throughput' | 'cache'

The order in which NagaAI tries the providers that serve a model. A NagaAI extension.

The routing strategy when the body names none. An unknown name is ignored. A NagaAI extension.

Request body

modelstring 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_tokensinteger required

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

streamboolean

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

temperaturenumber double nullable

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

top_pnumber double nullable

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

top_kinteger nullable

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

stop_sequencesstring[] nullable

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

metadataobject nullable

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

Response

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

OR

Changes

    • breaking

      added to the // request property allOf list

    • breaking

      added to the // request property allOf list

    • breaking

      removed subschema #2 from the request property anyOf list

    • breaking

      removed subschema #1 subschema #2 from the // request property anyOf list

    • breaking

      removed subschema #1 subschema #2 from the request property anyOf list

    • breaking

      removed subschema #1 subschema #2 from the request property anyOf list

    • breaking

      removed subschema #1 subschema #2 subschema #3 from the request property anyOf list

    • breaking

      removed the enum value assistant of the request property //

    • breaking

      removed the enum value user of the request property //

    • breaking

      request property list-of-types was narrowed by removing types null from media type application/json

    • breaking

      request property list-of-types was narrowed by removing types null from media type application/json

    • breaking

      request property list-of-types was narrowed by removing types null from media type application/json

    • breaking

      request property list-of-types was narrowed by removing types null from media type application/json

    • breaking

      the request property format changed from no format to int64

    • breaking

      the // request property type changed from string to no type

    • breaking

      added subschema #1 subschema #2 subschema #3 subschema #4 subschema #5 subschema #6 to the response body oneOf list for the response status (media type: text/event-stream)

    • breaking

      the response's body type changed from object to no type for status (media type: application/json)

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      removed the required property from the response with the status (media type: application/json)

    • breaking

      removed the required property from the response with the status (media type: application/json)

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property from the response with the status (media type: application/json)

    • breaking

      removed the required property from the response with the status (media type: application/json)

    • warning

      the request property's max was set to 2.00

    • warning

      the request property's max was set to 1.00

    • warning

      the request property's min was set to 0.00

    • warning

      the request property's min was set to 0.00

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property from the response with the status (media type: application/json)

    • warning

      removed the optional property from the response with the status (media type: application/json)

    • warning

      removed the optional property from the response with the status (media type: application/json)

    • warning

      removed the optional property from the response with the status (media type: application/json)

    • warning

      removed the optional property from the response with the status (media type: application/json)

    • info

      api operation id createMessage removed and replaced with create_message

    • info

      added the new optional header request parameter x-naga-routing-strategy

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      added subschema #1 subschema #2 to the request property oneOf list

    • info

      added subschema #1 subschema #2 to the request property oneOf list

    • info

      added subschema #1 subschema #2 to the request property oneOf list

    • info

      added subschema #1 subschema #2 to the request property oneOf list

    • info

      added to the response body anyOf list for the response status (media type: application/json)

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status