Deploy via REST API
Authentication
Section titled “Authentication”- Create an org API key (
sk_live_...) in Settings → API Keys - Exchange it for a JWT via the auth API
- Call the agent API with
Authorization: Bearer <jwt>andX-Agent-Id
See Authentication → for details.
Run your agent
Section titled “Run your agent”curl -X POST https://agent-api.auteryn.ai/api/run \ -H "Authorization: Bearer eyJ..." \ -H "X-Agent-Id: your-agent-id" \ -H "Content-Type: application/json" \ -d '{"messages":[{"role":"user","content":"Summarize the open P1 bugs"}],"stream":true}'import httpx, json
with httpx.stream( "POST", "https://agent-api.auteryn.ai/api/run", headers={ "Authorization": "Bearer eyJ...", "X-Agent-Id": "your-agent-id", }, json={ "messages": [{"role": "user", "content": "Summarize the open P1 bugs"}], "stream": True, },) as r: for line in r.iter_lines(): if line.startswith("data: "): event = json.loads(line[6:]) print(event)// stream: false → 202 Accepted; follow up via the poll/stream endpoints.const response = await fetch("https://agent-api.auteryn.ai/api/run", { method: "POST", headers: { Authorization: "Bearer eyJ...", "X-Agent-Id": "your-agent-id", "Content-Type": "application/json", }, body: JSON.stringify({ messages: [{ role: "user", content: "Summarize the open P1 bugs" }], stream: false, }),});const { task_id, id: run_id } = await response.json(); // 202// Then poll GET /api/runs/{run_id}/events or open GET /api/tasks/{task_id}/stream.Streaming events
Section titled “Streaming events”When stream: true, the response is Server-Sent Events using the AG-UI protocol.
Each data: frame is one JSON event with a type (and snake_case fields). Core
types include RUN_STARTED, TEXT_MESSAGE_START / TEXT_MESSAGE_CONTENT /
TEXT_MESSAGE_END, TOOL_CALL_START / TOOL_CALL_ARGS / TOOL_CALL_END /
TOOL_CALL_RESULT, RUN_FINISHED, and RUN_ERROR. Agent-specific signals
(reasoning, artifacts, usage, and USER_INPUT_REQUIRED for human-in-the-loop)
arrive as CUSTOM events. See the full
AG-UI event-type reference →.
Continuing a conversation
Section titled “Continuing a conversation”Pass a task_id to maintain context across multiple requests:
{ "messages": [{"role": "user", "content": "Now focus on only the critical ones"}], "task_id": "task_xyz789"}
