Skip to main content

What is an agent task?

An agent task asks a named agent (e.g., gemini) to perform work based on your prompt. You create a task, then check its status or results, and you can list recent tasks for auditing. Base URL: https://agent-api.browser.cash Authentication: Send Authorization: Bearer <AGENT_API_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"
Expect fields like status (queued, running, completed, failed) and, once completed, an optional result payload provided by the agent.

List tasks

curl -H "Authorization: Bearer $API_KEY" \
  "https://agent-api.browser.cash/v1/task/list?pageSize=20&page=1"

Notes

  • stepLimit caps how many autonomous steps the agent can take.
  • Use pagination on list with pageSize and page.
  • Keep your API key secret. Prefer environment variables (e.g., PowerShell: $env:API_BASE = "https://agent-api.browser.cash"; $env:API_KEY = "<your key>").