Skip to main content
This walkthrough takes you from a fresh API key to a working chat round-trip in five minutes.

0. Prerequisites

  • A workspace with at least one published agent (use Studio to create one if you don’t have any).
  • A workspace API key (see Authentication).
Export the key once so the snippets below are copy-pasteable:

1. Verify the key

The health endpoint validates the key and returns the workspace it’s bound to.
Response
A non-ok response — or any 401 — means stop. Re-check Authentication before continuing.

2. List your agents

The response is paginated. Save the publicId of an agent that has status: "published" — you’ll need it next.
Response (trimmed)

3. Send a message

The endpoint blocks until the agent finishes (or timeoutSeconds expires — default is 60 seconds). The response contains the reply text, the conversation ID, token usage, and cost.
Response (trimmed)

4. Continue the conversation

Pass back the conversationId from step 3 to keep the same thread:

5. Streaming responses

For interactive UIs, use the SSE endpoint instead of the blocking one. Same body shape; response is text/event-stream.
You’ll receive a stream of events: conversation-id, repeated text-delta, then debug-info with token usage and cost.

Next

Conventions

Pagination, error format, common headers.

Full reference

Every endpoint with try-it-out and schemas. Browse under “Endpoints” in the sidebar.