Endpoints

All endpoints except /health need Authorization: Bearer <api key>. To run a task at set times, see Schedules. Errors use one shape.

Create a task

POST /v1/tasks
Idempotency-Key: <unique key>

Returns 202 Accepted with the task object and a Location: /v1/tasks/<id> header.

Request body
{
  "url": "https://example.com",
  "task": "Find the page's main heading.",
  "output": { "type": "object", "properties": { "heading": { "type": "string" } } },
  "params": { "email": "user@example.com" },
  "limits": { "timeout_seconds": 600, "max_steps": 40 },
  "metadata": { "your_ref": "abc" },
  "webhook_url": "https://your-app.example/hooks/browserwhale",
  "model": { "provider": "openai", "name": "gpt-5.4-mini", "api_key": "sk-…" }
}
Field Required Description
url yes Public http(s) start URL, up to 2048 characters. See URL rules.
task yes What to do or find, in plain language, up to 4000 characters.
model yes, unless the server has its own Your own model provider key for this task; see Your model key.
output no JSON Schema (draft 2020-12) that output must satisfy, up to 32 KB. Without it, output's keys are chosen for the request and may vary between runs. Keep pattern expressions simple: patterns over 256 characters, backreferences, and repeated groups that themselves repeat or have alternatives (such as (a+)+) are refused with 422.
params no Values the task uses, such as an email address to enter on the site. Files are not accepted yet. Never logged, never shown in the step log, and deleted when the task finishes.
limits no timeout_seconds (default 600, capped at 720) and max_steps (capped at 100). Values above a cap are lowered to it.
metadata no Your own data, echoed back unchanged on the task.
skills no General know-how for the kind of work: "auto" chooses it from your task, or name it: ["shopping"], ["admin"], ["forms"], ["media"].
cache no "read-write": reuse the steps of an earlier completed task of yours with the same request while the page still matches them, and save this one's. "read-only" never saves. Only on servers that keep task data; elsewhere it is rejected.
vision no true (the default): when part of a page can't be read or used as described, such as a seat map or a chart, the agent looks at the screen. This adds input tokens only on the steps where it looks. false: never look.
confirmations no "ask" (the default): before a step that needs your go-ahead, the task asks one yes/no question and waits for your answer. "decline": it asks nothing and ends without that step.
webhook_url no Public http(s) URL that gets signed events: task.waiting_for_confirmation when the task asks a question, task.finished when it finishes. See Webhooks.

Unknown fields are rejected. The body may be at most 128 KB. skills and cache are off unless you set them, and vision is on unless you set it to false; what one of your tasks saves with cache is only ever used by tasks of the same API key.

Your model key

Tasks run on your own model provider account. Send model with each task (the SDKs fill it from your environment when you leave it out):

Field Required Description
provider yes openai, openai-compatible (any endpoint that speaks the OpenAI Chat Completions API), azure, anthropic or google.
name yes The model, as your provider names it (Azure: the deployment name).
api_key yes Your API key for the provider.
base_url for openai-compatible and azure Your provider's public https endpoint. Optional for the others.

The key is used only to run that task. It is kept encrypted until the task starts, removed as soon as the task starts or ends, and never stored, logged, returned or sent in a webhook. A task without model is rejected with 422 (param is model.api_key). Your provider bills you for the model's tokens; usage still reports the calls and tokens, and cost_usd is null unless the server knows that model's price. Because a key is never kept between tasks, schedules are not available on such a server.

Idempotency. Send an Idempotency-Key header (up to 255 characters). Retrying a create with the same key and the same body within 24 hours returns the original task with the header Idempotent-Replayed: true instead of creating a duplicate. The same key with a different body returns 409.

Get a task

GET /v1/tasks/:id?wait=30

Returns the task object. wait is optional, in seconds, from 0 to 30. With wait, the request is held until the task finishes, asks a question, or the wait ends, whichever comes first, so you can loop on it without busy-polling:

let task = await create();
while (["queued", "running", "waiting_for_confirmation"].includes(task.status)) {
  if (task.status === "waiting_for_confirmation") await answer(task);
  task = await get(task.id, { wait: 30 });
}

While a task runs, its steps log grows, so the same call also shows progress.

List tasks

GET /v1/tasks?limit=20&cursor=…

Lists your tasks, newest first. limit is 1 to 100 (default 20).

{ "data": [{ "id": "task_…", "…": "…" }], "has_more": true, "next_cursor": "…" }

Pass next_cursor as cursor to get the next page; it is null on the last page.

Follow a task's progress

GET /v1/tasks/:id/events
Accept: text/event-stream

A stream of server-sent events that says what the task is doing as it happens:

event: status
id: 0
data: {"status":"running"}

event: step
id: 1
data: {"n":1,"description":"Opening the website"}

event: step
id: 2
data: {"n":2,"description":"Clicking \"Sort by price\""}

event: done
id: 2
data: {"id":"task_…","status":"completed","output":{…},…}
Event Data
step Each new step of the task's steps log, { n, description }. The event ID is n.
status The status, whenever it changes, { status }; with waiting_for_confirmation, also confirmation.
done The finished task object. The stream then ends.

A stream ends after about 50 seconds even while the task runs; reconnect with a Last-Event-ID header set to the last ID you received, and the stream resumes after that step. A stream with nothing new gets a : keep-alive comment every 15 seconds. The SDK's onProgress and tasks.events() handle the reconnecting for you. Browsers' EventSource cannot send the Authorization header, so follow tasks from your server, not from a web page.

Answer a task's question

POST /v1/tasks/:id/confirm
Request body
{ "question_id": "q_3f2a9c0d6b7e4e1f8a5c2d9b0e7f4a1c", "answer": "yes" }

Before a step that needs your go-ahead, a task asks one yes/no question: its status becomes waiting_for_confirmation and its confirmation holds the id, the question, such as Click 'Delete permanently' on admin.example.com?, and expires_at. Send its id back as question_id. The browser stays open while the task waits, and the wait does not count against its time limit.

  • "answer": "yes" carries out that one step, and the task goes on. If the page changed while you decided, so the step is no longer the one asked about, it is not done and the task ends as could_not_complete.
  • "answer": "no" ends the task without it, as could_not_complete.
  • No answer by expires_at (5 minutes) is the same as no.

Returns the task. A question takes one answer. Sending the same answer again returns 200 and changes nothing. Another answer to it, or an answer to a question that expired or isn't the one the task asks, returns 409 and changes nothing. A task that isn't yours returns 404. Create the task with "confirmations": "decline" to never be asked.

Cancel a task

POST /v1/tasks/:id/cancel

Requests cancellation and returns the task. Cancelling is idempotent. A task that stops because of cancellation ends with status cancelled; one that had already finished keeps its status.

Get usage

GET /v1/usage?month=2026-11

Your API key's usage and cost for a calendar month (UTC, YYYY-MM; the current month if omitted). Tasks that never started, and tasks that failed because of a problem on our side (internal_error), cost nothing.

{
  "month": "2026-11",
  "tasks": 42,
  "billable_tasks": 39,
  "unfinished_tasks": 1,
  "model_calls": 371,
  "input_tokens": 1520400,
  "output_tokens": 61210,
  "browser_seconds": 3105,
  "charged_usd": 1.84,
  "reserved_usd": 1,
  "spend_limit_usd": 25
}

reserved_usd is held for unfinished tasks until they finish and then replaced by their actual cost. If your key has a monthly spending limit (spend_limit_usd), creating a task that would take charged_usd + reserved_usd past it returns 403. Illustrative values.

The dashboard on this site shows the same: your tasks and usage. Paste an API key to open it; the key stays in that browser tab.

Health check

GET /health

Liveness check. No authentication. Returns { "status": "ok" }.