Agent runs
Run a server-side agent loop with tool calling and backtracking
POST /v1/agent/run runs an autonomous agent loop on the server. The agent works toward a task, calls the tools you allow, and can backtrack when a path stops paying off. You get the loop without building it client-side.
Parameters
task(required): the goal, 1 to 32000 characters.tools: an allowlist of tools the agent may call.max_steps: cap on loop iterations.max_total_tokens: total token budget, at least 1024.max_tokens_per_step: per-step token cap, at least 256.reasoning_effort:none/minimal(fast),low(brief thinking),medium(thinking),high/xhigh/max(thinking, larger reasoning budget). Defaultmedium.stream: stream events over SSE. Defaulttrue.confidence_threshold: minimum confidence the agent aims for.compression: an object withenabledandtrigger_tokensto compress context as it grows.glassbox: glassbox options object.refusal_mode:softorstrict.
Run with a JSON response
Set stream to false to get a single JSON body instead of an event stream.
curl https://api.ablatic.ai/v1/agent/run \
-H "Authorization: Bearer $ABLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task": "Find the three largest cities in Austria and list their populations.",
"max_steps": 8,
"stream": false
}'The response carries an X-Run-Id header that identifies the run.
Stream events
With stream left at its default of true, the run emits Server-Sent Events. The event types are:
step: the agent took a step.tool_result: a tool returned a result.backtrack: the agent abandoned a path and went back.content: output content.done: the run finished.error: the run failed.
Cancel a run
POST /v1/agent/run/{run_id}/cancelUse the run_id from the X-Run-Id header of the run you want to stop.
Slots
Agent runs need an available agent slot. A request with 0 slots returns 403. Each running agent holds one slot, and if it spawns subagents, each running subagent holds one too, so a run that fans out can use several at once. A run that would exceed your slot limit returns 429.
Accounts get 2 agent slots by default.