This guide walks you through setting up your own Browser Use Cloud SDK.

Building your own client (OpenAPI)

This approach is recommended only if you need to run simple tasks and don’t require fine-grained control.
The best way to build your own client is to use our OpenAPI specification to generate a type-safe client library.

Python

Use openapi-python-client to generate a modern Python client:
# Install the generator
pipx install openapi-python-client --include-deps

# Generate the client
openapi-python-client generate --url http://api.browser-use.com/openapi.json
This will create a Python package with full type hints, modern dataclasses, and async support.

TypeScript/JavaScript

Use OpenAPI TS library to generate a type safe TypeScript client for the Browser Use API. The following guide shows how to create a simple type-safe fetch client, but you can also use other generators.
npm install openapi-fetch 
npm install -D openapi-typescript typescript
package.json
{
  "scripts": {
    "openapi:gen": "openapi-typescript https://api.browser-use.com/openapi.json -o ./src/lib/api/v1.d.ts"
  }
}
pnpm openapi:gen
// client.ts

'use client'

import createClient from 'openapi-fetch'
import { paths } from '@/lib/api/v1'

export type Client = ReturnType<typeof createClient<paths>>

export const client = createClient<paths>({
    baseUrl: 'https://api.browser-use.com/',

    // NOTE: You can get your API key from https://cloud.browser-use.com/billing!
    headers: { Authorization: `Bearer ${apiKey}` },
})

Need help? Contact our support team at support@browser-use.com or join our Discord community