Skip to main content
POST
Generate 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

Body

application/json
model
string
required

Use your aligned model id (e.g. aligned-model-01kmqm4nrn9fw6r). The same aligned id serves chat completions, completions, embeddings and reranking. Base text models (e.g. nugen-flash-instruct) also work if you have not aligned a model yet.

Examples:

"aligned-model-01kmqm4nrn9fw6r"

"nugen-flash-instruct"

prompt
required

The prompt to generate completions for. It can be a single string or a list of strings. It can also be an array of integers or an array of integer arrays, which allows to pass already tokenized prompt.

Example:

"The sky is"

max_tokens
integer | null
default:16

The maximum number of tokens to generate in the completion.

Required range: x >= 0
Example:

400

temperature
number | null
default:1

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

Required range: 0 <= x <= 2
Example:

1

stream
boolean | null
default:false

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

stream_options
Stream Options · object | null

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

Response

Streaming text completion responses or complete response depending on stream parameter