Skip to content

Chat completion

POST
/api/v1/gen_agents/chat_completion

Create a chat completion with an AI agent.

ChatCompletionRequest
object
agent_id
required
Agent Id
string
messages
required
Messages
Array<object>
ChatMessage
object
role
required
Role
string
Allowed values: user assistant
content
required
Content
string
engine
Engine
string
default: Gemini
Allowed values: Gemini OpenAI

Successful Response

ChatCompletionContentResponse
object
message
required
ChatMessage
object
role
required
Role
string
Allowed values: user assistant
content
required
Content
string

Invalid request error

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string
Example
{
"error": "Invalid request parameters",
"error_code": "invalid_request_error"
}

Not Found

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Server error during chat completion

ErrorResponse
object
detail
Any of:
string
error
Any of:
string
error_code
Any of:
string
Example
{
"error": "Internal server error",
"error_code": "server_error"
}