Skip to main content
POST
Generate Chat Completions

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Session-ID
string | null
X-Request-Time
string | null

Body

application/json
model
string
required

The name of the model to use.

Example:

"nugen-flash-instruct"

messages
ChatTextRequestMessage · object[]
required

A list of messages comprising the conversation so far.

Minimum array length: 1
max_tokens
integer | null
default:2000

The maximum number of tokens to generate in the completion.

prompt_truncate_len
integer | null
default:1500

The size to which to truncate chat prompts.

temperature
number | null
default:1

What sampling temperature to use, between 0 and 2.

Required range: 0 <= x <= 2
stream
boolean | null
default:false

Whether to stream back partial progress as server-sent events.

tools
Tools · object[] | null

List of tools/functions

tool_choice

'auto', 'none', or specific tool

top_p
number | null

Nucleus sampling

top_k
integer | null

Top-k sampling

n
integer | null
default:1

Number of completions

reasoning
ReasoningFields · object | null

Reasoning configuration for the model

stream_options
Stream Options · object | null

Options for streaming responses, e.g., {'include_usage': true}

Response

Streaming chat completion responses or complete response depending on stream parameter