POST
/
v1
/
chat
/
completions

Authorizations

Authorization
string
headerrequired

Body

project_id
integer
required

The ID of the project to use.

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

messages
object[]
required

A list of messages comprising the conversation so far.

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.

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.

tools
object[] | null

The tools to use in the completion.

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.

document_chunks
object[]

Chunks used to improve the completion

usage
object
required

The usage statistics for the completion.

trace_id
string
required

The trace ID of the completion.