Skip to main content

Get an API key

  • Copy your Agent API key from the dashboard.
  • Send it in the header: Authorization: Bearer <AGENT_API_KEY>.
Base URL: https://agent-api.browser.cash You can optionally set environment variables in your shell:
  • API_BASE=https://agent-api.browser.cash
  • API_KEY=<your key>

Create a task

curl -X POST "https://agent-api.browser.cash/v1/task/create" \
  -H "Authorization: Bearer $API_KEY" \
  -H "content-type: application/json" \
  -d '{"agent":"gemini","prompt":"What does example.com homepage say?","mode":"text","stepLimit":10}'
Example response (200):
{ "taskId": "02a94d68-b9e9-49bd-a3e4-54b8426e3550" }

Get a task

curl -H "Authorization: Bearer $API_KEY" \
  "https://agent-api.browser.cash/v1/task/$TASK_ID"
Typical fields include a status (e.g., queued, running, completed, failed) and implementation-specific details like result once complete.

List tasks

curl -H "Authorization: Bearer $API_KEY" \
  "$API_BASE/v1/task/list?pageSize=20&page=1"
Learn more in Guides: /agent-api/guides/agent-tasks Tip: Prefer environment variables over hardcoding keys. In PowerShell, set an env var for the current session with:
$env:API_BASE = "https://agent-api.browser.cash"
$env:API_KEY = "<your key>"