POST
/
v1
/
tools
/
perform-web-task
JavaScript
import Anchorbrowser from 'anchorbrowser';

const client = new Anchorbrowser({
  apiKey: 'Your API Key',
});

const response = await client.tools.performWebTask({
  prompt: 'Collect the node names and their CPU average %',
});

console.log(response.data);
{
  "data": {
    "result": "The article discusses various secure browsers..."
  }
}

Authorizations

anchor-api-key
string
header
required

API key passed in the header

Query Parameters

sessionId
string

An optional browser session identifier to reference an existing running browser sessions. When passed, the tool will be executed on the provided browser session.

Body

application/json
prompt
string
required

The task to be autonomously completed.

Example:

"Collect the node names and their CPU average %"

url
string

The URL of the webpage. If not provided, the tool will use the current page in the session.

Example:

"https://anchorbrowser.io"

agent
enum<string>
default:browser-use

The AI agent to use for task completion. Defaults to browser-use.

Available options:
browser-use,
openai-cua
Example:

"openai-cua"

provider
enum<string>

The AI provider to use for task completion.

Available options:
openai,
gemini,
groq,
azure,
xai
Example:

"openai"

model
string

The specific model to use for task completion. see our models page for more information.

Example:

"gpt-4o"

highlight_elements
boolean

Whether to highlight elements during task execution for better visibility.

Example:

true

output_schema
object

JSON Schema defining the expected structure of the output data.

Example:
{
"type": "object",
"properties": {
"nodes_cpu_usage": {
"type": "array",
"items": {
"type": "object",
"properties": {
"node": { "type": "string" },
"cluster": { "type": "string" },
"cpu_avg_percentage": { "type": "number" }
},
"required": ["node", "cluster", "cpu_avg_percentage"]
}
}
},
"required": ["nodes_cpu_usage"]
}

Response

The result of the autonomous task.

data
object