Claude's Computer Use allows Claude to directly interact with your computer to perform tasks much like a human. This capability allows Claude to move the cursor, click buttons, type text, and navigate the web, thereby automating complex, multi-step workflows.
Hyperbrowser's Claude Computer Use agent allows you to easily execute agent tasks on the web with just a simple call. Hyperbrowser exposes endpoints for starting/stopping a Claude Computer Use task and for getting it's status and results.
By default, these tasks are handled in an asynchronous manner of first starting the task and then checking it's status until it is completed. However, if you don't want to handle the monitoring yourself, our SDKs provide a simple function that handles the whole flow and returns the data once the task is completed.
Installation
npm install @hyperbrowser/sdk
or
yarn add @hyperbrowser/sdk
pip install hyperbrowser
or
uv add hyperbrowser
Usage
import { Hyperbrowser } from "@hyperbrowser/sdk";
import { config } from "dotenv";
config();
const hbClient = new Hyperbrowser({
apiKey: process.env.HYPERBROWSER_API_KEY,
});
const main = async () => {
const result = await hbClient.agents.claudeComputerUse.startAndWait({
task: "what are the top 5 posts on Hacker News",
});
console.log(`Output:\n\n${result.data?.finalResult}`);
};
main().catch((err) => {
console.error(`Error: ${err.message}`);
});
import os
from hyperbrowser import Hyperbrowser
from hyperbrowser.models import StartClaudeComputerUseTaskParams
from dotenv import load_dotenv
load_dotenv()
hb_client = Hyperbrowser(api_key=os.getenv("HYPERBROWSER_API_KEY"))
def main():
resp = hb_client.agents.claude_computer_use.start_and_wait(
StartClaudeComputerUseTaskParams(
task="what are the top 5 posts on Hacker News"
)
)
print(f"Output:\n\n{resp.data.final_result}")
if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"Error: {e}")
Start Claude Computer Use task
curl -X POST https://app.hyperbrowser.ai/api/task/claude-computer-use \
-H 'Content-Type: application/json' \
-H 'x-api-key: <YOUR_API_KEY>' \
-d '{
"task": "what are the top 5 posts on Hacker News"
}'
curl -X PUT https://app.hyperbrowser.ai/api/task/claude-computer-use/{jobId}/stop \
-H 'x-api-key: <YOUR_API_KEY>'
Claude Computer Use tasks can be configured with a number of parameters. Some of them are described briefly here, but a list can be found in our Claude Computer Use API Reference.
Task parameters
task - The instruction or goal to be accomplished by Claude Computer Use.
sessionId - An optional existing browser session ID to connect to instead of creating a new one.
maxFailures - The maximum number of consecutive failures allowed before the task is aborted.
maxSteps - The maximum number of interaction steps the agent can take to complete the task.
keepBrowserOpen - When enabled, keeps the browser session open after task completion.
You can also provide configurations for the session that will be used to execute the task just as you would when creating a new session itself. These could include using a proxy or solving CAPTCHAs. To see the full list of session configurations, checkout the Session API Reference.
The sessionOptions will only apply if creating a new session when no sessionId is provided.
import { Hyperbrowser } from "@hyperbrowser/sdk";
import { config } from "dotenv";
config();
const hbClient = new Hyperbrowser({
apiKey: process.env.HYPERBROWSER_API_KEY,
});
const main = async () => {
const result = await hbClient.agents.claudeComputerUse.startAndWait({
task: "what are the top 5 posts on Hacker News",
sessionOptions: {
acceptCookies: true,
}
});
console.log(`Output:\n\n${result.data?.finalResult}`);
};
main().catch((err) => {
console.error(`Error: ${err.message}`);
});
import os
from hyperbrowser import Hyperbrowser
from hyperbrowser.models import StartClaudeComputerUseTaskParams, CreateSessionParams
from dotenv import load_dotenv
load_dotenv()
hb_client = Hyperbrowser(api_key=os.getenv("HYPERBROWSER_API_KEY"))
def main():
resp = hb_client.agents.claude_computer_use.start_and_wait(
StartClaudeComputerUseTaskParams(
task="what are the top 5 posts on Hacker News",
session_options=CreateSessionParams(
accept_cookies=True,
),
)
)
print(f"Output:\n\n{resp.data.final_result}")
if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"Error: {e}")
curl -X POST https://app.hyperbrowser.ai/api/task/claude-computer-use \
-H 'Content-Type: application/json' \
-H 'x-api-key: <YOUR_API_KEY>' \
-d '{
"task": "what are the top 5 posts on Hacker News",
"sessionOptions": {
"acceptCookies": true
}
}'
Hyperbrowser's CAPTCHA solving and proxy usage features require being on a PAID plan.
Using proxy and solving CAPTCHAs will slow down the web navigation in the Claude Computer Use task so use it only if necessary.