The chat API is included on every plan, Free too, with 2,500 sessions per workspace a month. Legacy plans keep their own allowance.
Before you start
- An API key with the
chat:writescope, used from your server. Never call the chat API from a browser or mobile app with a secret key. - The chat switched on for the workspace (Settings → Agent → Status, or
PATCH /v1/agentwith{"live": true}). If it is off, messages return409conflict.
How it works
- Create a session for each conversation. One session is one conversation in Darwin.
- Send each visitor message to the session. Darwin adds it to the transcript it keeps, runs the agent and answers with its reply and any
actions. - Show the reply in your interface, and act on what the agent did: show a booking link, or tell your team a person was asked for.
Create a session
The
201 response is the session:
conversation is the id to use with GET /v1/conversations/{id}.
Send a message
text is the person’s message, 1 to 4,000 characters. The reply:
Actions
Stream the reply
Send"stream": true to receive the reply as it is written, as server-sent events (Content-Type: text/event-stream). The stream is the Vercel AI SDK UI message stream, version 1: each event is a data: line with a JSON chunk, and the stream ends with data: [DONE]. Chunks with "type": "text-delta" carry the next piece of text in delta.
actions summary; tool calls arrive as their own chunks. If you need the actions, use the JSON reply, or read the session afterwards.
Read a session
GET /v1/chat/sessions/{id} returns the session with its whole transcript, as in the create response, and a status:
Monthly allowance
Each workspace can start 2,500 chat API sessions each calendar month, on every plan. On Agency, each client workspace has its own 2,500. Messages within a session are not counted. Legacy plans keep their allowance: Origin none, Adapt 500, Evolve 2,500 and Apex 10,000. When the allowance is used, creating a session returns429 quota_exceeded, with Retry-After set to the start of the next month. Sessions already open keep working. Meetings booked and requests sent through the chat API use credits like any other. See Plans and credits.
Each message is also a heavy request for per-minute rate limits: 30 a minute per key on every plan.
Errors
See Errors for every code.