Skip to content

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.

Request structure

Every call shares the same structure. Read the specification below first; each curl later on this page is one instance of it.

Base URL and paths

https://api.eak.eazo.ai

Paths for project-scoped endpoints are all prefixed with the project:

/v1/projects/{project_id}/do_anything/sessions
/v1/projects/{project_id}/do_anything/sessions/{session_id}
/v1/projects/{project_id}/do_anything/sessions/{session_id}/runs/{run_id}/events

Path parameters

The following parameters appear as required by each endpoint's path; when present, they are mandatory:

ParameterFormSource
{project_id}proj_-prefixed stringConsole → Project Switcher; the project is the isolation unit for project-scoped endpoints
{session_id}sess_-prefixed stringthe id in the "Create a session" response
{run_id}run_-prefixed stringa run id in the session response's runs[], or latest_run_id

Authentication

Every request carries a bearer token:

Authorization: Bearer <wa_api_key>

<wa_api_key> is a wa_-prefixed API key, created in Console → Settings → API Keys — see Authentication.

Request body

Mutating endpoints (POST) carry Content-Type: application/json with a JSON body. The full field set for each endpoint is defined by the OpenAPI spec.

Create a session

The examples below use placeholder values (proj_demo_0001 / wa_demo_… / sess_demo_0001 / run_demo_0001); for real calls, substitute your own values per "Request structure" above.

bash
curl https://api.eak.eazo.ai/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."
  }'

Stream events (SSE)

bash
curl -N \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  "https://api.eak.eazo.ai/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/runs/run_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.eak.eazo.ai/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/runs/run_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.eak.eazo.ai/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/runs/run_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 run

bash
curl -X POST https://api.eak.eazo.ai/v1/projects/proj_demo_0001/do_anything/sessions/sess_demo_0001/runs/run_demo_0001/cancel \
  -H "Authorization: Bearer wa_demo_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "user_cancelled" }'

List sessions

bash
curl "https://api.eak.eazo.ai/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.