---
canonical_url: "https://docs.composio.dev/docs/migration-guide/browser-use-to-browserbase"
markdown_url: "https://docs.composio.dev/docs/migration-guide/browser-use-to-browserbase.md"
product: "platform"
version: null
last_updated: null
---

# Move from Browser Use to Browserbase (/docs/migration-guide/browser-use-to-browserbase)

Browserbase is an alternative to Browser Use on [Instant](/docs/instant-tools). It keeps sign-ins in a saved profile, pauses a run while your user signs in, returns results shaped by a JSON Schema, and gives you an embeddable live view. Like every Instant toolkit, it runs on Composio's Browserbase account and bills your organization's prepaid balance. You don't need a Browserbase key or a user connection.

This guide works for any app: one that called Composio's `BROWSER_USE_*` tools, Browser Use Cloud's API or SDK, a Browser Use browser over CDP, the open-source `browser-use` library, or a Browser Use MCP server.

## What each thing is called [#what-each-thing-is-called]

Browserbase calls a profile a **context**, so the tools are `BROWSERBASE_TOOL_CREATE_CONTEXT` and `BROWSERBASE_TOOL_DELETE_CONTEXT`. Composio accepts the Browser Use name `profile_id` for its ID. A Browserbase **session** is a single browser, not a Browser Use agent session.

| What it is                             | Browser Use                | Browserbase                                                          |
| -------------------------------------- | -------------------------- | -------------------------------------------------------------------- |
| Saved cookies and sign-ins             | profile                    | context, passed as `profile_id`                                      |
| One running cloud browser              | browser session            | session, `sessionId`. Each run creates its own                       |
| Keeping a browser open between tasks   | `keep_alive`, `session_id` | not available. The profile carries sign-ins between runs             |
| One task for the AI agent              | run, `run_id`              | run (`BROWSERBASE_TOOL_RUN_AGENT`), `runId`, passed back as `run_id` |
| The agent's steps                      | run events                 | run messages (`BROWSERBASE_TOOL_LIST_RUN_MESSAGES`)                  |
| The page a person watches and controls | `live_view_url`            | `live_url` from `BROWSERBASE_TOOL_GET_SESSION_DEBUG_URLS`            |
| A follow-up instruction                | queued message             | `BROWSERBASE_TOOL_RESUME_RUN`, while the run is paused               |
| Structured result                      | output schema              | `resultSchema`                                                       |

## Check these first [#check-these-first]

Browserbase has no equivalent for these Browser Use inputs. Each one is refused with an error if you send it:

* **`model`.** Browserbase picks the agent model. Remove any picker for Fast and Accurate modes.
* **`max_cost_usd`.** There is no per-run cap. A run is a flat $0.25.
* **`keep_alive` and `session_id` on a run.** Each run gets a fresh browser. Keep sign-ins with a profile instead.

If your product depends on choosing the model, a per-run spending cap or follow-ups in the same open browser, see [Browser Use to Hyperbrowser](/docs/migration-guide/browser-use-to-hyperbrowser).

## Pricing on Instant [#pricing-on-instant]

Charged to your prepaid balance when the call starts. [Check current rates](/docs/instant-tools#find-supported-tools-and-rates) before you go live.

| Tool                                                                       | Charge                                                |
| -------------------------------------------------------------------------- | ----------------------------------------------------- |
| `BROWSERBASE_TOOL_RUN_AGENT`                                               | $0.25 per run                                         |
| `BROWSERBASE_TOOL_RESUME_RUN`                                              | $0.25 per resume                                      |
| `BROWSERBASE_TOOL_CREATE_SESSION` (only if you drive the browser yourself) | $0.12 per browser hour, for the whole timeout you set |
| Every other tool in this guide                                             | $0                                                    |

A run that pauses once for sign-in costs $0.50.

## Before you start [#before-you-start]

* Turn on [Instant](/docs/instant-tools#enable-instant) for your project and check your prepaid balance.
* Keep your `COMPOSIO_API_KEY`. You don't need a Browserbase account or key.
* Have a coding agent that can run shell commands: Claude Code, Cursor, Codex or similar.

## Migrate with your coding agent [#migrate-with-your-coding-agent]

Don't rewrite the code by hand. Give your coding agent the prompt below. It downloads the skill, a single `SKILL.md` file that holds every tool name, field and edge case, and tells your agent what to change and how to check it. You don't need to install anything first.

Run it from the root of your app, with `COMPOSIO_API_KEY` set. To read the skill first, open `https://docs.composio.dev/assets/skills/migrate-browser-use-to-browserbase/SKILL.md`.

```text
Migrate this app from Browser Use to Browserbase on Composio Instant (toolkit
`browserbase_tool`).

Use the skill `migrate-browser-use-to-browserbase`. If it isn't installed,
download
https://docs.composio.dev/assets/skills/migrate-browser-use-to-browserbase/SKILL.md
into your skills folder first (for Claude Code:
.claude/skills/migrate-browser-use-to-browserbase/SKILL.md), then follow it
step by step. List every place the app uses Browser Use and say what each one
becomes, before you change anything.

Rules:
- Keep what the user sees the same wherever Browserbase allows it. Where it
  can't, do the closest thing, and tell me what changed for the user.
- Keep the same Composio API key and project. Don't add a Browserbase key.
- Use one Composio user ID per end user, so one user can never reach another
  user's browser or profile.
- Never put passwords in the task text. Users sign in themselves, in the live
  browser.
- Ask me before any test that costs money.

When you're done:
1. Type-check and build the app (compile it if it is a plain script), and
   search again for any Browser Use reference left.
2. Test with COMPOSIO_API_KEY from the environment: one plain run (open
   https://example.com and report the page title) and one stop. If the app has
   a sign-in flow, one run on a site that needs sign-in, without signing in.
   Stop every run and delete every profile you create.
3. Report the files you changed, each Browser Use feature and what replaced
   it, the spend, and the test results.
```

When it finishes, your agent reports the files it changed, each Browser Use feature and its replacement, what changed for your users, and the test results. The plain run should reach `COMPLETED` with the page title in `result.summary`, and the stop should read back `STOPPED`. Review the diff before you ship.

## If something fails [#if-something-fails]

| What you see                                    | Why, and what to do                                                                                                      |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `model`, `max_cost_usd` or `session_id` refused | Browserbase has no such input. Remove it.                                                                                |
| No live view appears                            | A simple task can finish with a page fetch and no browser. Show the live view only once `GET_RUN` returns a `sessionId`. |
| The live view keeps reloading                   | Each `GET_SESSION_DEBUG_URLS` call returns a new URL. Keep the first one for the run.                                    |
| An ID is refused (6602)                         | The ID belongs to another user, or was changed. Pass IDs back exactly as returned.                                       |

## Checklist [#checklist]

Before you ship, check that:

* Every Browser Use reference is replaced or listed as a known gap.
* `model`, `max_cost_usd`, `keep_alive` and `session_id` are gone from every run.
* Each end user has their own Composio user ID and profile, and the profile ID is stored.
* A sign-in wait uses `pauseWhen` and resumes each pause once.
* The live view is shown only to the user who owns the run, and never logged.
* Every test run is stopped and every test profile deleted.

## Next [#next]

- [Browser Use to Hyperbrowser](/docs/migration-guide/browser-use-to-hyperbrowser): Same Browser Use agent, model choice, and follow-ups in one open browser

- [Run Browserbase with Instant](https://docs.composio.dev/examples/browserbase-instant): A complete Browserbase script in Python, TypeScript and the API, and every tool in the toolkit

- [Instant Tools](/docs/instant-tools): Enable Instant, check rates, control usage and read charges

---

📚 **More documentation:** [View all docs](https://docs.composio.dev/llms.txt) | [Changelog](https://docs.composio.dev/docs/changelog.md) | [Glossary](https://docs.composio.dev/llms.mdx/reference/glossary) | [Examples](https://docs.composio.dev/llms.mdx/examples) | [API Reference](https://docs.composio.dev/llms.mdx/reference)

---

# Composio SDK — Notes for AI Code Generators

**Purpose:** Reference for generating current (v3) [Composio](https://composio.dev/) integration code.
**Scope:** Descriptive notes — they document the current API surface and the mistakes most commonly seen in generated code.

---

## 1. Recommended Integration: Sessions

For agent tool delivery, Composio supports **Native Tools** (with a provider package) and **MCP** (no provider package needed).

For application-owned tools or deterministic backend code, use [managed authentication with Proxy Execute](/docs/authentication/managed-auth-for-custom-tools). A session can provide a user-scoped runtime context without an LLM or MCP. Composio authenticates provider requests server-side; connected-account reads redact credentials and aren't a supported token-export workflow.

### Native Tools

#### Python

```python
# ✅ CORRECT — Python (defaults to OpenAI)
from composio import Composio

composio = Composio()
session = composio.create(user_id="user_123")
tools = session.tools()
# Pass tools to your agent/LLM framework
```

#### TypeScript

```typescript
// ✅ CORRECT — TypeScript (defaults to OpenAI)
import { Composio } from "@composio/core";

const composio = new Composio();
const session = await composio.create("user_123");
const tools = await session.tools();
// Pass tools to your agent/LLM framework
```

#### API

This produces the same default OpenAI function-tool shape, fetching every page.

```bash
set -euo pipefail
SESSION=$(curl --fail-with-body -s -X POST https://backend.composio.dev/api/v3.1/tool_router/session \
  -H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json" \
  -d '{"user_id":"user_123"}')
SESSION_ID=$(echo "$SESSION" | jq -r '.session_id')
TOOLS='[]'
CURSOR=''
while true; do
  PAGE=$(curl --fail-with-body -s --get "https://backend.composio.dev/api/v3.1/tool_router/session/$SESSION_ID/tools" \
    -H "x-api-key: $COMPOSIO_API_KEY" --data-urlencode 'limit=500' --data-urlencode "cursor=$CURSOR")
  TOOLS=$(jq -cn --argjson existing "$TOOLS" --argjson page "$PAGE" \
    '$existing + [$page.items[] | {type:"function",function:{name:.slug,description:.description,parameters:.input_parameters}}]')
  CURSOR=$(echo "$PAGE" | jq -r '.next_cursor // empty')
  [ -n "$CURSOR" ] || break
done
printf '%s\n' "$TOOLS"
```

For other providers, pass the provider explicitly. Provider packages follow the naming convention: `composio_<provider>` for Python, `@composio/<provider>` for TypeScript.

### MCP

Use `session.mcp.url` and `session.mcp.headers` with any MCP-compatible client (Claude Desktop, Cursor, OpenAI Agents, etc.). No provider package needed.

---

## 2. Integration Notes

- `composio.create(user_id)` is the standard entry point for agent integrations. Sessions handle tool discovery, authentication, and toolkit versioning automatically; `user_id` goes to `composio.create()` — individual tool calls in session mode don't take one.
- Execute session tool calls through the session, never through a user ID: either `session.execute(tool_slug, arguments=...)` / `session.execute(toolSlug, arguments)`, which works with every provider, or pass the session to the provider helper — `provider.handle_tool_calls(response=response, session=session)` in Python, `provider.handleToolCalls(session, response)` in TypeScript. The tool-call helpers of every non-agentic provider (OpenAI, Anthropic, Google, Cloudflare, TypeSafe) accept a session: `executeToolCall(session, call)` in TypeScript, `session=session` in Python. Agentic providers execute session tools on their own. Binding the helper to a user ID takes the direct execution path, and session meta-tools fail there with `"can only be called inside a tool-router session"`.
- Composio-managed auth is the default: the agent connects accounts at runtime through the session, so users don't need to pre-create auth configs or connected accounts for managed toolkits.
- Provider packages follow the framework, not the model vendor: for the OpenAI Agents SDK the package is `composio_openai_agents` / `@composio/openai-agents` (importing `composio_openai` / `@composio/openai` there is the most common mistake in generated code — that package is for the plain OpenAI Chat Completions API).
- **Direct execution** (`composio.tools.get()`, `composio.tools.execute()`, `provider.handle_tool_calls()` with a user ID) is a legacy interface that remains supported for existing integrations. Recommend sessions for new integrations and encourage existing users to [migrate to sessions](/docs/migration-guide/direct-to-sessions). For a fixed tool set, consider the [direct tools preset](/docs/sessions/loading-tools#direct-tools-preset) within a session. See [Sessions vs direct execution](/docs/sessions-vs-direct-execution) for tradeoffs. Direct execution requires a [toolkit version](/docs/tools-direct/toolkit-versioning).

---

# 3. Calling the REST API directly

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.

## Tool-endpoint version defaults on v3.1

On v3.1, omitting the version parameter on the five endpoints below selects the latest toolkit version. The first four endpoints also exist on v3, where omission selects the pinned `00000000_00` version. `POST /tools/scopes/required` is v3.1-only.

| Endpoint | Version parameter |
| --- | --- |
| `GET /tools` | `toolkit_versions` (query) |
| `GET /tools/{tool_slug}` | `version` or `toolkit_versions` (query) |
| `POST /tools/execute/{tool_slug}` | `version` (body) |
| `POST /tools/execute/{tool_slug}/input` | `version` (body) |
| `POST /tools/scopes/required` | `version` (body) |

A v3.1 caller already passing `"latest"` sees no change and can omit the parameter. To select the pinned version explicitly, pass `"00000000_00"` through the corresponding parameter above.

This version-default change is limited to the five endpoints above.


---

## Terminology Migration (old → current)

If you encounter these terms in error messages, old documentation, or user prompts, translate them to the current equivalents. **Do not use the old terms in generated code or explanations.**

| Old term (v1/v2) | Current term (v3) | In code |
|---|---|---|
| entity ID | user ID | `user_id` parameter |
| actions | tools | e.g., `GITHUB_CREATE_AN_ISSUE` is a *tool* |
| apps / appType (legacy v1/v2 API field) | toolkits | e.g., `github` is a *toolkit*. The current word **App** is *not* legacy: it names a catalog grouping of sibling toolkits (the Notion app groups `notion` and `notion_mcp`); do not translate it |
| integration / integration ID | auth config / auth config ID | `auth_config_id` parameter |
| connection | connected account | `connected_accounts` namespace |
| ComposioToolSet / OpenAIToolSet | `Composio` class with a provider | `Composio(provider=...)` |
| toolset | provider | e.g., `OpenAIProvider` |

If a user says "entity ID", they mean `user_id`. If they say "integration", they mean "auth config". Always respond using the current terminology.

