API reference
Test requests on the API keys page
Send a real request to any of your agents from the app, watch the events stream in, and copy ready-made cURL, TypeScript or Python.
Guide2 min readUpdated 24 October 2026
The API keys page in the app (sidebar, under Configure) is also a sandbox: it calls POST /v1/chat/stream with your own key and agent, exactly as your code will, and shows the server-sent events as they arrive. Use it to check an agent before you wire it into your app.
Before you start
- An agent with a model provider key. See Create an agent.
- Credits: every sandbox reply costs 1 credit, like any other reply.
- Your own account: the shared demo account has no API key and can't send API requests.
What's on the page
| Part | What it does |
|---|---|
| Agent picker | At the top. Chooses the agent; its id fills the Agent ID row and every code sample |
| Connection | Endpoint (POST, returns server-sent events), API key (send it as X-Api-Key) and Agent ID (send it as X-Agent-Id), each with a copy button |
| Code samples | cURL, TypeScript and Python with your endpoint, key and agent filled in, and an Events tab that explains the stream; Copy code copies the open tab |
| Try it | A Request body editor and a send button. The Response shows the answer as it streams, with a copy button, and Sources lists the knowledge passages it used |
| Errors | A short table of what failed requests mean; Errors has every code |
Steps
- 1
Open API keys and pick the agent
Choose the agent your integration will call. The Agent ID row and the samples update.
- 2
Write the body your app will send
Start with a message. Add
conversation_id(from a previous reply'smetaordoneevent) to continue a conversation.Request body { "message": "Can I get a refund on my annual plan?"} - 3
Send it and read the stream
The answer streams into Response. Join the
contentof everydeltaevent for the full answer; with tools,tool_callandtool_resultevents arrive before it. See Streaming events. - 4
Copy the code
Open the cURL, TypeScript or Python tab and use Copy code. Your key is in the snippet: keep it on your server, never in a web page.
You're done when
The sandbox reply matches what you expect, and the same request from your own server streams the same events.
If something goes wrong
401 MISSING_API_KEY or INVALID_API_KEY
The key is missing or wrong in your own code. The sandbox fills it in for you, so compare its cURL sample with your request.
403 AGENT_INACTIVE
The agent is paused. Set it back to Active on its Settings tab. (The page's short error table calls this a paused agent.)
The stream ends with an error event
Failures after the stream starts, such as LLM_AUTH_ERROR or LLM_RATE_LIMITED, arrive as an error event inside a 200 response. Check the agent's provider key first. See Errors.
Still stuck?
Email us with what you tried and any request id. A person replies.