Skip to main content
POST
Chat with Agent

Authorizations

Authorization
string
header
required

Enter your API key

Body

application/json
project_id
string
required

Project ID

bot_id
string
required

Agent ID

message
string
required

The user's message

provider_key
string

Optional API key for the AI provider

provider_host
string

Optional host URL for the AI provider

model
string

Override the default model for this request

source_ids
string[]

Specific memory sources to use

tags
string[]

Filter memory by tags

top
integer
default:5

Number of memory results to include

instruction
string

Override system instructions for this request

max_reply_tokens
integer

Maximum tokens in the response

stream
boolean
default:false

Enable streaming response

chat_id
string

Chat conversation ID (creates new if not provided)

reasoning_mode
enum<string>
default:auto

Reasoning mode for the agent response. 'auto' selects the best approach automatically, 'standard' for quick single-pass answers (1x credit), 'agent' for autonomous multi-step reasoning with tool use (up to 10x credit)

Available options:
auto,
standard,
agent
chat_mode
enum<string>
default:ask

Chat mode. 'ask' for normal chat, 'edit' for agent-powered code editing, 'plan' for conversational plan-then-execute workflow

Available options:
ask,
edit,
plan
memory
boolean

Search the agent's knowledge before answering. Omit to use the agent's own setting; an explicit value overrides it, and it gates the search_memory tool for agent turns.

attachments
object[]

Files to attach to this message

pasted
string[]

Long pasted text, kept out of the message body

workspace_uuid
string

Target a specific workspace for this turn

purpose
enum<string>

Set to service when your own backend is calling on behalf of many end users, rather than one person chatting. Allows workspace_uuid to pin the turn to a workspace and lets chat_mode survive the request. Never grants the Site builder persona or access to other people's conversations. Granted only when the API key belongs to a member of the project; requesting it otherwise is ignored and the call proceeds unchanged.

Available options:
service

Response

200 - application/json

Chat response received successfully

Response structure varies based on reasoning_mode. Contains 'chat' object with mode-specific fields.

chat
object

Chat response data with mode-specific structure