This page covers running HyperAgent via the Hyperbrowser Cloud API. For using the HyperAgent SDK directly in your own code (local or self-hosted), see the HyperAgent SDK documentation.
How It Works
You can use HyperAgent in two ways:- Start and Wait: SDKs provide a
startAndWait()method that blocks until the task completes and returns the result - Async Pattern: Start a task, get a job ID, then poll for status and results—useful for long-running tasks or when you want more control
Installation
Quick Start
The simplest way to run a HyperAgent task is with thestartAndWait() method, which handles everything for you:
Async Pattern
When you need more control, use the async pattern to start a task and poll for results:Stop a Running Task
Stop a task before it completes:Parameters
string
required
Natural language description of what you want HyperAgent to accomplish. Be specific for best results.
string
default:"0.8.0"
Version of HyperAgent to use.
Options:
0.8.0, 1.1.0We highly recommend using the
1.1.0 version of HyperAgent.string
default:"gpt-4o"
LLM model to use. Available options:
"gpt-5.6-luna"- GPT-5.6 Luna"gpt-5.5"- GPT-5.5"gpt-5.2"- GPT-5.2"gpt-5.1"- GPT-5.1"gpt-5"- GPT-5"gpt-5-mini"- GPT-5 Mini"gpt-4o"- GPT-4o (default)"gpt-4o-mini"- GPT-4o Mini"gpt-4.1"- GPT-4.1"gpt-4.1-mini"- GPT-4.1 Mini"claude-sonnet-5"- Claude Sonnet 5"claude-sonnet-4-6"- Claude Sonnet 4.6"claude-sonnet-4-5"- Claude Sonnet 4.5"gemini-3-flash-preview"- Gemini 2.5 Flash"gemini-3-flash-preview"- Gemini 3 Flash Preview
number
default:"20"
Maximum number of actions HyperAgent can take (clicks, typing, navigation, etc.). Increase for complex tasks.
string
ID of an existing browser session to reuse. Useful for multi-step workflows that need to maintain the same browser session.
boolean
default:"false"
Keep the browser session alive after task completion.
object
Session configuration (proxy, stealth, captcha solving, etc.). Only applies when creating a new session. If you provide an existing
sessionId, these options are ignored.boolean
default:"false"
Use your own LLM API keys instead of consuming Hyperbrowser credits for LLM calls. You will only be charged for browser usage.
object
API keys for
openai, anthropic, and google. Required when useCustomApiKeys is true. Must provide keys based on the LLM you are using.Reuse Browser Sessions
You can pass in an existingsessionId to the HyperAgent task so that it can execute the task on an existing session. Also, if you want to keep the session open after executing the task, you can supply the keepBrowserOpen parameter.
Using Your Own API Keys
Bring your own LLM API keys to avoid consuming Hyperbrowser credits for LLM calls. You’ll still be charged for browser session usage, but save on token costs.Session Configuration
Customize the browser session used by HyperAgent with session options.sessionOptions only applies when creating a new session. If you provide a sessionId, these options are ignored.Best Practices
Write clear, specific task descriptions
Write clear, specific task descriptions
Be explicit about what you want HyperAgent to do. Instead of “check the website”, say “go to example.com, find the pricing page, and extract the cost of the Enterprise plan”.
Set appropriate maxSteps
Set appropriate maxSteps
Simple tasks need 10-20 steps. Complex multi-page workflows might need 50+ steps. Monitor failed tasks and adjust accordingly.
Reuse sessions for multi-step workflows
Reuse sessions for multi-step workflows
It is usually better to split up complex tasks into smaller, more manageable ones and execute them as separate agent calls on the same session.