Skip to main content
POST
Create a chat completion
Send at least one message and a user turn. The reply is in choices[0].message.content. For a continuing conversation, either send its full history on each request or send a stable X-Eigi-Session-Id and only the next turn. For streamed output, set stream to true and read server-sent events through [DONE]. Set stream_options.include_usage to true for a trailing usage chunk. Client setup and examples.

Authorizations

Authorization
string
header
required

The owning account's Studio API key in the Authorization header.

Headers

X-Eigi-Session-Id
string

Stable conversation ID. X-Eigi-Session-Key is accepted as an alias.

Body

application/json
messages
object[]
required
Minimum array length: 1
model
string
Example:

"eigi-agent"

stream
boolean
default:false
stream_options
object

Response

Successful request

id
string
object
string
model
string
choices
object[]
usage
object