POST
/
v1
/
chat
/
completions

Authorizations

Authorization
string
headerrequired

Body

project_id
integer
required

The ID of the project to use.

messages
object[]
required

A list of messages comprising the conversation so far.

session_id
string

The ID of the session to use. It helps to track the chat history.

repositories
object

Options for Retrieval Augmented Generation (RAG). Will override launched model settings

model
string

ID of the model to use. See the model endpoint compatibility table for details.

system_prompt
string

The system prompt to use.

max_tokens
integer | null

The maximum number of tokens to generate in the chat completion.

Required range: x > 0
stream
boolean

If set, partial message deltas will be sent, like in ChatGPT.

temperature
number
default: 1

What sampling temperature to use, between 0 and 2.

Required range: 0 < x < 2
tools
object[] | null

The tools to use in the completion.

response_format
object | null

The format of the response. Can be a JSON schema or a simple json_object type

Response

200 - application/json
choices
object[]
required

A list of chat completion choices. Can be more than one if n is greater than 1.

created
integer
required

The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.

model
string
required

The model to generate the completion.

provider_name
string
required

The name of the provider that generated the completion.

provider_id
string
required

The ID of the provider that generated the completion.

usage
object
required

The usage statistics for the completion.

trace_id
string
required

The trace ID of the completion.

document_chunks
object[]

Chunks used to improve the completion