Browserbase

The Browserbase REST API behind one wildcard route
View as Markdown

Proxies the Browserbase REST API — sessions, contexts, extensions, and projects. Like ElevenLabs, it’s a whole API surface, so the gateway mounts a wildcard and forwards the path after /browserbase/ verbatim:

GET|POST|PUT|DELETE /browserbase/<api path> → https://api.browserbase.com/<api path>

Because the path passes through unchanged, new Browserbase endpoints work without any gateway change. The methods are the REST verbs across sessions/contexts/extensions — GET, POST, PUT, DELETE.

Common paths

PathPurpose
POST /browserbase/v1/sessionsCreate a session
GET /browserbase/v1/sessions/{id}Session details
POST /browserbase/v1/contextsCreate a context
GET /browserbase/v1/projectsList projects

What the gateway injects and strips

  • The X-BB-API-Key header is injected, overwriting any client-supplied one.
  • The Authorization header is stripped before forwarding — Browserbase has no use for your gateway token.

projectId is optional on session/context creation — Browserbase infers it from the API key — so the gateway injects nothing into the body. You may still pass projectId explicitly if you need to target a specific project.

WebSocket / browser automation

The WebSocket session is not proxied — the gateway is plain HTTP only.

Browserbase runs the actual browser automation over a WebSocket connectUrl that the session response returns. Create the session through the gateway, then connect your Playwright/Puppeteer client directly to the session-scoped connectUrl:

  1. POST /browserbase/v1/sessions through the gateway.
  2. Connect your automation client directly to the connectUrl it returns.

The master key still never reaches the client.

Example

$curl -X POST "$GATEWAY/browserbase/v1/sessions" \
> -H "Authorization: Bearer $TOKEN" \
> -H "Content-Type: application/json" \
> -d '{}'

The response is Browserbase’s JSON, returned unchanged. For request and response fields, follow Browserbase’s API reference — the gateway does not alter them.