Send a chat message

Sends a message to an agent and returns its reply. This is the core endpoint of the API distribution channel.

Response mode

  • Streaming (default when messages is provided, or stream: true) — a text/event-stream of Server-Sent Events (Vercel AI UI message stream; x-vercel-ai-ui-message-stream: v1).
  • JSON (stream: false) — a single JSON object with the agent reply.

The reply always comes from the agent configured on the API distribution that owns the key; the request-level agent_id is ignored on API-key calls. Pass conversation_id to continue an existing thread.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
messages
array of objects

Conversation history in useChat format. The last user message is the prompt. Provide either messages or message.

messages
string

Legacy single-message field. Use messages for new integrations.

uuid

The agent to send the message to. On API-key-authenticated requests this is ignored — the reply always comes from the agent configured on the API distribution that owns the key.

uuid

Pin the response to a specific published agent version.

uuid

Continue an existing conversation. Omit to start a new one.

string

Channel label recorded on the conversation (for analytics and routing).

string

Free-form source label recorded on the conversation.

boolean
Defaults to false

Include source citations in the response.

boolean
Defaults to false

Include the agent reasoning trace in the response.

boolean
Defaults to false

Include tool-call events in the response.

string

Visitor's email. Attaches the conversation to a contact.

string

Visitor's name. Attaches the conversation to a contact.

string

Stable visitor token that ties messages to one contact across requests. Reuse the value returned on the first response.

attachments
array of objects

File attachment references (e.g. the result of POST /chat/upload).

attachments
boolean

Stream the response as Server-Sent Events. Defaults to true when messages is provided, false otherwise. When false, a single JSON object is returned.

Responses
200

Agent reply. An SSE stream when streaming, or a single JSON object when stream is false.

400

Message content is required.

Language
Credentials
Bearer
krns_sk_*
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!