Skip to main content
The Chat API lets you create conversations with assistants, send messages, and receive streamed AI responses in real time via Server-Sent Events (SSE).

List Conversations

Returns conversations for the authenticated user within a workspace. Uses offset-based pagination.
Response 200 OK

Get Conversation

Retrieves a single conversation with metadata.

Delete Conversation

Permanently deletes a conversation and all its messages.
Response 204 No Content

Create Message (Streaming)

Sends a user message and streams the assistant’s response via Server-Sent Events.
If the conversation ID does not exist, the API creates a new conversation automatically.

SSE Event Format

The streaming response uses the text/event-stream content type. Each event is a JSON object on a data: line.

Event Types

Always handle the error event type. Errors can occur mid-stream if the model encounters an issue, the context window is exceeded, or a rate limit is reached.

List Messages

Returns messages in a conversation. Uses cursor-based pagination, ordered from newest to oldest.
Response 200 OK

Get Message

Retrieves a single message by ID.

File Attachments

Messages can include file attachments uploaded via Uploadcare.
Supported file types include PDF, TXT, DOCX, PNG, JPG, and CSV. Maximum file size is 10 MB per attachment and 3 attachments per message.

Set webSearch: true on a message to allow the assistant to search the web for current information. When active, the assistant may emit tool-call and tool-result events for the webSearch tool before generating its response.