Skip to content
Go to Dashboard

cURL & raw HTTP

This page documents the common request patterns for WebAgent over raw HTTP — usable from any language that can send HTTPS / JSON, no official SDK required.

Create a session

bash
curl https://api.web-agent.asix.inc/v1/projects/proj_demo_0001/do_anything/sessions \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "instructions": "Find the top 5 stories on Hacker News right now.",
    "model": "claude-sonnet-4.6",
    "max_cost_usd": "0.50"
  }'

Stream events (SSE)

bash
curl -N \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  "https://api.web-agent.asix.inc/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/tasks/task_demo_0001/events"

To resume after a drop, add the last id you received:

bash
curl -N \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  -H "Last-Event-ID: 142" \
  "…/events"

Send a follow-up message

bash
curl https://api.web-agent.asix.inc/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/tasks/task_demo_0001/messages \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "content": "Also include the comment count for each." }'

Answer an input request

bash
curl https://api.web-agent.asix.inc/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/tasks/task_demo_0001/intervene \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "answer_input_request",
    "input_request_id": "ir_01HXX",
    "response": { "solved": true }
  }'

The kind discriminator selects the variant — same endpoint also handles take_control / release_control (see Take Control).

Cancel a task

bash
curl -X POST https://api.web-agent.asix.inc/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/tasks/task_demo_0001/cancel \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "user_cancelled" }'

List sessions

bash
curl "https://api.web-agent.asix.inc/v1/projects/proj_demo_0001/do_anything/sessions?status=running&limit=20" \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx"

Errors

Any non-2xx response is JSON with a stable code:

json
{
  "code": "insufficient_credits",
  "detail": "Project balance below the minimum required ($0.50).",
  "extra": { "balance_usd": "0.12", "required_usd": "0.50" }
}

See API Overview → Errors for the full list.

Idempotency

bash
curl -H "Idempotency-Key: $(uuidgen)"

Replaying the same key returns the same response — safe to retry on network errors.