Get an API key
- Copy your Agent API key from the dashboard.
- Send it in the header:
Authorization: Bearer <AGENT_API_KEY>or pass it as an argument to the SDK.
(Optional) Install the SDK
If your project uses Node.js or TypeScript, you can install the Browsercash SDK for easier access to the Agent API.1) Create a task
All agents are available via the Agent API. Here is an example using thegemini agent to fetch text from a webpage.
Agents are consumed via tasks, which you create, fetch, and list.
taskId you can use to track progress and fetch results.
2) Get a task
Now that you have ataskId, you can fetch the task to track status and retrieve the output of the agent.
An agent’s state can either be active, completed, or failed. You can see the full output shape here.
3) List tasks
After you’ve ran a few tasks, you might want to list them. Using the list endpoint, you can paginate through your tasks. This will return a paginated list of tasks you have created. It can have a slightly different shape than fetching a single task. You can see the full output shape here.Notes:
- Agent runs cannot be deleted or stopped once started at this time.
- Session outputs may be deleted at any time after completion.