Deploy via REST API
Authentication
All API calls require a Bearer token in the Authorization header. Get your API key from Account → API Keys → Create Key.
Authorization: Bearer afk_your_api_key_hereX-Agent-Id: your-agent-idRun your agent
curl -X POST https://api.auteryn.ai/api/run \ -H "Authorization: Bearer afk_your_key" \ -H "X-Agent-Id: your-agent-id" \ -H "Content-Type: application/json" \ -d '{"query": "Summarize the open P1 bugs", "stream": true}'import httpx, json
with httpx.stream( "POST", "https://api.auteryn.ai/api/run", headers={ "Authorization": "Bearer afk_your_key", "X-Agent-Id": "your-agent-id", }, json={"query": "Summarize the open P1 bugs", "stream": True},) as r: for line in r.iter_lines(): if line.startswith("data: "): event = json.loads(line[6:]) if event["type"] == "text_chunk": print(event["content"], end="", flush=True)const response = await fetch("https://api.auteryn.ai/api/run", { method: "POST", headers: { "Authorization": "Bearer afk_your_key", "X-Agent-Id": "your-agent-id", "Content-Type": "application/json", }, body: JSON.stringify({ query: "Summarize the open P1 bugs", stream: false, }),});const data = await response.json();console.log(data.output);Streaming events
When stream: true, the response is Server-Sent Events:
data: {"type":"run_started","run_id":"run_abc","task_id":"task_xyz"}data: {"type":"text_chunk","content":"Let me check the open P1 bugs..."}data: {"type":"tool_call","tool":"github","action":"list_issues"}data: {"type":"tool_result","tool":"github","result":{...}}data: {"type":"text_chunk","content":"I found 3 open P1 issues:"}data: {"type":"run_completed","run_id":"run_abc","credits_used":6}Continuing a conversation
Pass a task_id to maintain context across multiple requests:
{ "query": "Now focus on only the critical ones", "task_id": "task_xyz789"}