POST
/
chat
/
completions

Authorizations

Authorization
string
headerrequired

Tune API Keys are the preferred way to authenticate with the API. You can create an API Key from your Tune Studio Profile → 'Access Keys' (in sidebar)

Headers

X-Org-Id
string
required

Organization ID. If not provided, the user's default organization will be used.

Body

application/json
messages
object[]

List of messages to use for completion.

model
string

The model named to use for completion, looks like username/model-name

max_tokens
integer

Maximum number of tokens to generate per output sequence.

temperature
number

Float that controls the randomness of the sampling. Lower values make the model more deterministic, while higher values make the model more random. Zero means greedy sampling.

top_p
number

Float that controls the cumulative probability of the top tokens to consider. Must be in (0, 1]. Set to 1 to consider all tokens.

n
integer

Number of output sequences to return for the given prompt.

stream
boolean

If true, the API will return a stream of responses, one at a time. If false, the API will return all responses at once.

stop
string[]

List of tokens where the API will stop generating completions.

presence_penalty
number

Float that penalizes new tokens based on whether they appear in the generated text so far. Values > 0 encourage the model to use new tokens, while values < 0 encourage the model to repeat tokens.

frequency_penalty
number

Float that penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage the model to use new tokens, while values < 0 encourage the model to repeat tokens.

logit_bias
object

Dictionary of logit bias values for specific tokens. For example, you can use this to force the model to generate a specific token by setting the bias value to a large positive number.

tools
object[]

List of tools to use for completion.

echo
boolean

If true, the API will echo the prompt in the response.

Response

200 - application/json
id
string
object
string
created
integer
model
string
usage
object
choices
object[]