重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
browserbase by vm0-ai/vm0-skills
npx skills add https://github.com/vm0-ai/vm0-skills --skill browserbase面向 AI 代理和自动化的云端浏览器基础设施。创建浏览器会话、通过上下文持久化认证、实时调试会话,并获取会话录制。
在以下情况下使用此技能:
设置环境变量:
export BROWSERBASE_TOKEN="your-api-key-here"
export BROWSERBASE_PROJECT_ID="your-project-id-here"
注意: 免费计划有 1 个并发会话限制。如果超过此限制,您将收到 429 错误。请在 Browserbase 仪表板中查看您的计划详情。
创建一个新的浏览器会话:
写入 /tmp/request.json:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
{
"projectId": "<your-project-id>"
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
设置超时和保持连接:
写入 /tmp/request.json:
{
"projectId": "<your-project-id>",
"timeout": 300,
"keepAlive": true
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
启用代理(需要付费计划):
写入 /tmp/request.json:
{
"projectId": "<your-project-id>",
"proxies": true
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
注意: 免费计划不提供代理功能。如果您在未升级的情况下尝试使用此功能,将收到 402 错误。
指定特定区域(us-west-2, us-east-1, eu-central-1, ap-southeast-1):
写入 /tmp/request.json:
{
"projectId": "<your-project-id>",
"region": "us-west-2"
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
响应包含:
id - 用于连接的会话 IDconnectUrl - 用于 Playwright/Puppeteer 的 WebSocket URLseleniumRemoteUrl - 用于 Selenium 连接的 URLsigningKey - 用于 HTTP 连接的密钥列出所有会话,支持可选过滤器:
curl -s -X GET "https://api.browserbase.com/v1/sessions" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
按状态过滤(RUNNING, ERROR, TIMED_OUT, COMPLETED):
curl -s -X GET "https://api.browserbase.com/v1/sessions?status=RUNNING" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
按用户元数据查询:
注意: 用户元数据过滤的查询语法使用单引号:
user_metadata['key']:'value'。为避免复杂的 shell 转义,请将查询写入文件并使用--data-urlencode "q@filename"。
将内容写入 /tmp/query.txt:
user_metadata['test']:'true'
然后查询会话:
curl -s -X GET -G "https://api.browserbase.com/v1/sessions" --data-urlencode "q@/tmp/query.txt" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
更多示例:
按 stagehand 元数据查询 - 写入 /tmp/query.txt:
user_metadata['stagehand']:'true'
按环境查询 - 写入 /tmp/query.txt:
user_metadata['env']:'production'
然后运行:
curl -s -X GET -G "https://api.browserbase.com/v1/sessions" --data-urlencode "q@/tmp/query.txt" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
获取特定会话的详情。将 <your-session-id> 替换为实际的会话 ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
请求在超时前释放会话以避免额外费用。将 <your-session-id> 替换为实际的会话 ID:
写入 /tmp/request.json:
{
"status": "REQUEST_RELEASE"
}
curl -s -X POST "https://api.browserbase.com/v1/sessions/<your-session-id>" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
会话状态将变为 COMPLETED,并设置 endedAt 时间戳。
获取运行中会话的实时调试 URL。将 <your-session-id> 替换为实际的会话 ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/debug" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
注意: 调试 URL 可能仅在浏览器客户端通过 WebSocket 连接到会话后才可用。
响应包含:
debuggerUrl - Chrome DevTools 调试器 URLdebuggerFullscreenUrl - 全屏调试器视图wsUrl - WebSocket URLpages - 包含其调试器 URL 的已打开页面数组检索会话的日志。将 <your-session-id> 替换为实际的会话 ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/logs" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
获取会话的 rrweb 录制。将 <your-session-id> 替换为实际的会话 ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/recording" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
检索会话期间下载的文件(返回 ZIP 文件)。将 <your-session-id> 替换为实际的会话 ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/downloads" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" --output downloads.zip
上传文件以供浏览器会话使用。将 <your-session-id> 替换为实际的会话 ID:
curl -s -X POST "https://api.browserbase.com/v1/sessions/<your-session-id>/uploads" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -F "file=@/path/to/file.pdf"
上下文允许您在多个浏览器会话间持久化 Cookie、缓存和会话存储。
写入 /tmp/request.json:
{
"projectId": "<your-project-id>"
}
curl -s -X POST "https://api.browserbase.com/v1/contexts" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
保存返回的 id 以便在会话中使用。
检索特定上下文的详情。将 <your-context-id> 替换为实际的上下文 ID:
curl -s -X GET "https://api.browserbase.com/v1/contexts/<your-context-id>" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
响应包含:
id - 上下文标识符createdAt - 创建时间戳updatedAt - 最后更新时间戳projectId - 与上下文关联的项目 ID使用现有上下文来恢复 Cookie 和登录状态。将 <your-context-id> 替换为实际的上下文 ID:
写入 /tmp/request.json:
{
"projectId": "<your-project-id>",
"browserSettings": {
"context": {
"id": "<your-context-id>",
"persist": true
}
}
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
设置 persist: true 可在会话结束后将更新保存回上下文。
当不再需要时删除上下文。将 <your-context-id> 替换为实际的上下文 ID:
curl -s -X DELETE "https://api.browserbase.com/v1/contexts/<your-context-id>" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -w "\nHTTP Status: %{http_code}"
成功删除返回 HTTP 204(无内容)。
检索项目范围的使用统计信息(浏览器分钟数和代理字节数)。将 <your-project-id> 替换为您的实际项目 ID:
curl -s -X GET "https://api.browserbase.com/v1/projects/<your-project-id>/usage" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
| 端点 | 方法 | 描述 |
|---|---|---|
/v1/sessions | POST | 创建新的浏览器会话 |
/v1/sessions | GET | 列出所有会话 |
/v1/sessions/{id} | GET | 获取会话详情(返回数组) |
/v1/sessions/{id} | POST | 更新会话(释放) |
/v1/sessions/{id}/debug | GET | 获取实时调试 URL |
/v1/sessions/{id}/logs | GET | 获取会话日志 |
/v1/sessions/{id}/recording | GET | 获取会话录制(rrweb) |
/v1/sessions/{id}/downloads | GET | 获取下载的文件(ZIP) |
/v1/sessions/{id}/uploads | POST | 上传文件到会话 |
/v1/contexts | POST | 创建新的上下文 |
/v1/contexts/{id} | GET | 获取上下文详情 |
/v1/contexts/{id} | DELETE | 删除上下文 |
/v1/projects/{id}/usage | GET | 获取项目使用统计 |
| 状态 | 描述 |
|---|---|
RUNNING | 会话当前处于活动状态 |
COMPLETED | 会话成功结束 |
ERROR | 会话因错误结束 |
TIMED_OUT | 会话超时 |
REQUEST_RELEASE | 请求结束会话 |
keepAlive: true。每周安装数
56
仓库
GitHub 星标数
51
首次出现
2026年1月24日
安全审计
安装于
opencode47
gemini-cli47
codex45
cursor44
github-copilot43
amp42
Cloud browser infrastructure for AI agents and automation. Create browser sessions, persist authentication with contexts, debug live sessions, and retrieve session recordings.
Official docs: https://docs.browserbase.com/
Use this skill when you need to:
Set environment variables:
export BROWSERBASE_TOKEN="your-api-key-here"
export BROWSERBASE_PROJECT_ID="your-project-id-here"
Note: Free plans have a concurrent session limit of 1. You'll receive a 429 error if you exceed this limit. Check your plan details in the Browserbase dashboard.
Create a new browser session:
Write /tmp/request.json:
{
"projectId": "<your-project-id>"
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
With timeout and keepAlive:
Write /tmp/request.json:
{
"projectId": "<your-project-id>",
"timeout": 300,
"keepAlive": true
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
With proxy enabled (requires paid plan):
Write /tmp/request.json:
{
"projectId": "<your-project-id>",
"proxies": true
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
Note: Proxies are not available on the free plan. You'll receive a 402 error if you try to use this feature without upgrading.
With specific region (us-west-2, us-east-1, eu-central-1, ap-southeast-1):
Write /tmp/request.json:
{
"projectId": "<your-project-id>",
"region": "us-west-2"
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
Response includes:
id - Session ID to use for connectionsconnectUrl - WebSocket URL for Playwright/PuppeteerseleniumRemoteUrl - URL for Selenium connectionssigningKey - Key for HTTP connectionsList all sessions with optional filters:
curl -s -X GET "https://api.browserbase.com/v1/sessions" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Filter by status (RUNNING, ERROR, TIMED_OUT, COMPLETED):
curl -s -X GET "https://api.browserbase.com/v1/sessions?status=RUNNING" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Query by user metadata:
Note: The query syntax for user metadata filtering uses single quotes:
user_metadata['key']:'value'. To avoid complex shell escaping, write the query to a file and use--data-urlencode "q@filename".
Write /tmp/query.txt with content:
user_metadata['test']:'true'
Then query sessions:
curl -s -X GET -G "https://api.browserbase.com/v1/sessions" --data-urlencode "q@/tmp/query.txt" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
More examples:
Query by stagehand metadata - write /tmp/query.txt:
user_metadata['stagehand']:'true'
Query by environment - write /tmp/query.txt:
user_metadata['env']:'production'
Then run:
curl -s -X GET -G "https://api.browserbase.com/v1/sessions" --data-urlencode "q@/tmp/query.txt" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Get details of a specific session. Replace <your-session-id> with the actual session ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Request to release a session before its timeout to avoid additional charges. Replace <your-session-id> with the actual session ID:
Write /tmp/request.json:
{
"status": "REQUEST_RELEASE"
}
curl -s -X POST "https://api.browserbase.com/v1/sessions/<your-session-id>" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
The session status will change to COMPLETED and endedAt timestamp will be set.
Get live debugging URLs for a running session. Replace <your-session-id> with the actual session ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/debug" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Note: Debug URLs may only be available after a browser client has connected to the session via WebSocket.
Response includes:
debuggerUrl - Chrome DevTools debugger URLdebuggerFullscreenUrl - Fullscreen debugger viewwsUrl - WebSocket URLpages - Array of open pages with their debugger URLsRetrieve logs from a session. Replace <your-session-id> with the actual session ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/logs" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Get the rrweb recording of a session. Replace <your-session-id> with the actual session ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/recording" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Retrieve files downloaded during a session (returns ZIP file). Replace <your-session-id> with the actual session ID:
curl -s -X GET "https://api.browserbase.com/v1/sessions/<your-session-id>/downloads" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" --output downloads.zip
Upload files to use in a browser session. Replace <your-session-id> with the actual session ID:
curl -s -X POST "https://api.browserbase.com/v1/sessions/<your-session-id>/uploads" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -F "file=@/path/to/file.pdf"
Contexts allow you to persist cookies, cache, and session storage across multiple browser sessions.
Write /tmp/request.json:
{
"projectId": "<your-project-id>"
}
curl -s -X POST "https://api.browserbase.com/v1/contexts" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
Save the returned id to use in sessions.
Retrieve details of a specific context. Replace <your-context-id> with the actual context ID:
curl -s -X GET "https://api.browserbase.com/v1/contexts/<your-context-id>" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
Response includes:
id - Context identifiercreatedAt - Creation timestampupdatedAt - Last update timestampprojectId - The Project ID linked to the contextUse an existing context to restore cookies and login state. Replace <your-context-id> with the actual context ID:
Write /tmp/request.json:
{
"projectId": "<your-project-id>",
"browserSettings": {
"context": {
"id": "<your-context-id>",
"persist": true
}
}
}
curl -s -X POST "https://api.browserbase.com/v1/sessions" --header "Content-Type: application/json" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -d @/tmp/request.json
Set persist: true to save updates back to the context after the session ends.
Delete a context when it's no longer needed. Replace <your-context-id> with the actual context ID:
curl -s -X DELETE "https://api.browserbase.com/v1/contexts/<your-context-id>" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)" -w "\nHTTP Status: %{http_code}"
Successful deletion returns HTTP 204 (No Content).
Retrieve project-wide usage statistics (browser minutes and proxy bytes). Replace <your-project-id> with your actual project ID:
curl -s -X GET "https://api.browserbase.com/v1/projects/<your-project-id>/usage" --header "X-BB-API-Key: $(printenv BROWSERBASE_TOKEN)"
| Endpoint | Method | Description |
|---|---|---|
/v1/sessions | POST | Create a new browser session |
/v1/sessions | GET | List all sessions |
/v1/sessions/{id} | GET | Get session details (returns array) |
/v1/sessions/{id} | POST | Update session (release) |
/v1/sessions/{id}/debug | GET |
| Status | Description |
|---|---|
RUNNING | Session is currently active |
COMPLETED | Session ended successfully |
ERROR | Session ended with an error |
TIMED_OUT | Session exceeded timeout |
REQUEST_RELEASE | Request to end session |
keepAlive: true for longer sessions.Weekly Installs
56
Repository
GitHub Stars
51
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode47
gemini-cli47
codex45
cursor44
github-copilot43
amp42
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
118,400 周安装
| Get live debug URLs |
/v1/sessions/{id}/logs | GET | Get session logs |
/v1/sessions/{id}/recording | GET | Get session recording (rrweb) |
/v1/sessions/{id}/downloads | GET | Get downloaded files (ZIP) |
/v1/sessions/{id}/uploads | POST | Upload files to session |
/v1/contexts | POST | Create a new context |
/v1/contexts/{id} | GET | Get context details |
/v1/contexts/{id} | DELETE | Delete a context |
/v1/projects/{id}/usage | GET | Get project usage stats |