Skip to main content
POST
Called from the browser with a publishable key. The agent answers with the same setup that answers its text messages: its prompt, tools and model. Read the reply with List Chat Messages. The Chat SDK calls both endpoints for you. The request Origin must be one of the publishable key’s allowed origins, exactly as for Voice Sessions. Responses to an allowed origin carry CORS headers.
string
required
Bearer pk_live_...
string (UUID)
required
The agent to chat with
string
required
A random id you keep per visitor, 8 to 64 letters, digits, _ or -. The same id continues the same conversation. The SDK stores one in localStorage.
string
required
The message, 1 to 4000 characters
string
Up to 64 letters, digits, _ or -. Sending the same id again is a no-op (duplicate: true), so a retried request never posts the message twice.

Errors