Skip to main content
POST
/
chat
/
stream
Stream AI chat
curl --request POST \
  --url https://api.buildwithtrace.com/api/v2/chat/stream \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "<string>",
  "session_id": "<string>",
  "mode": "ask",
  "app_type": "schematic",
  "project_path": "<string>",
  "schematic_content": "<string>",
  "pcb_content": "<string>"
}
'
"<string>"

Authorizations

Authorization
string
header
required

JWT access token. Get one via POST /auth/login or from the Trace app (Settings → API Token). Tokens expire after 1 hour.

Body

application/json
message
string
required

The user's message

session_id
string
required

Conversation session ID

mode
enum<string>

AI interaction mode

Available options:
ask,
agent,
plan
app_type
enum<string>

Editor context

Available options:
schematic,
pcb
project_path
string

Path to the project

schematic_content
string

Current schematic file content

pcb_content
string

Current PCB file content

Response

SSE stream of AI responses. Event types: text, tool_call, tool_result, question, plan, status, error, done.

The response is of type string.