Base URL
All API requests are made to:Authentication
The API uses Bearer token authentication with your secret API key.Never expose your secret API key (
sk_live_*) in client-side code. All API requests should be made from your server.Error Handling
The API returns errors in an OpenAI-compatible format:Error Types
Rate Limits
The API applies rate limits based on your plan. Limits are enforced per minute and per day. For more information, contact us.Pagination
List endpoints use cursor-based pagination with the following query parameters:
Paginated responses include:
last_id as the after parameter to fetch the next page.
Streaming
The Send Message endpoint supports Server-Sent Events (SSE) for streaming responses. Setstream: true in the request body to enable streaming.
Streaming responses use the text/event-stream content type with the following event format:
Event Types
Streaming Example
Generative UI
When Generative UI is enabled on your app, the agent can generate interactive forms (radio buttons, selects, text inputs, and more) to collect structured user input during conversations. These forms are streamed asresponse.data_spec events containing JSON Patch (RFC 6902) operations that describe the UI components to render.
You can enable Generative UI from your app’s configuration page in the dashboard.
Each response.data_spec event contains a JSON Patch operation describing a UI component:
data.patch field follows the RFC 6902 JSON Patch specification. Multiple response.data_spec events may be emitted during a single response to progressively build up a form.
When Generative UI is enabled, response.data_spec events are interleaved with text events:
Generative UI payloads use JSON Patch operations to describe UI components. Your frontend is responsible for rendering these patches into interactive form elements. You can use the json-render library to render these components in React applications.
Non-Streaming
When streaming is disabled (stream: false or omitted), the Send Message endpoint returns a single JSON response after the agent finishes processing. The response contains an output array with all items produced by the agent.
Output items can be of the following types:
Non-Streaming Example
data_spec items appear alongside message and function_call items in the output array:
Completions
The Create Completion endpoint (POST /apps/{app_id}/completions) generates a single piece of text from a prompt, without creating or belonging to a conversation. Use it for one-shot generation tasks such as autocompleting a form field, drafting a message, or summarizing content, where you want the output written in your agent’s voice and grounded in its business context.
Unlike the conversation endpoints, completions:
- Do not create a conversation and keep no history (each request is independent)
- Use knowledge-base search as their only tool (no other agent tools or tasks run)
- Are billed in Work Credits based on token usage, shown in your dashboard under Usage
prompt and receive the generated text:
Streaming Completions
Setstream: true to receive the completion as Server-Sent Events. Completions emit only text events, ending with a response.completed event:

