POST
/
v1
/
chat
/
completions

NB!

Required to fill in ‘content’ and ‘role’ under ‘body’ -> ‘messages’.

Authorization

Authorization
string
required

Bearer authentication header of the form Bearer ‘key’, where ‘key’ is your api key. Use test key or get yours from llmOS dashboard.

Body

model
string
required
ID of the model to use. [“mistral-7b-instruct”]
messages
array
required

A list of messages comprising the conversation so far.

content
string
required
The contents of the message. `content is required for all messages, and may be null for assistant messages with function calls.
role
string
required
Role [“user”, “assistant”]
name
string
The name of the author of this message. name is required if role is function, and it should be the name of the function whose response is in the content. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
max_tokens
integer
The maximum number of tokens to generate in the chat completion.
stream
boolean
If set, partial message deltas will be sent, like in ChatGPT.
temperture
number
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.
top_p
number
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
presence_penalty
number
Up to 4 sequences where the API will stop generating further tokens.
logit_bias
object
Modify the likelihood of specified tokens appearing in the completion.
frequency_penalty
string
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.
false
integer
How many chat completion choices to generate for each input message.