Agent-readable docs index: /docs/llms.txt. Full docs in one file: /docs/llms-full.txt. Download /docs/docs.zip to grep all markdown files locally.

Libretto Cloud

Run agent browser sessions on Libretto Cloud.
Import from libretto-browser-tools/libretto-cloud. This is the SDK provider for hosted browsers — not the Libretto CLI --provider flag. For CLI hosting, see Libretto Cloud Hosting.

Configure

LIBRETTO_API_KEY=<libretto-api-key> # optional # LIBRETTO_API_URL=https://api.libretto.sh # LIBRETTO_TIMEOUT_SECONDS=3600

Provider options

Constructor / env settings for the provider itself:
OptionEnvDefaultDescription
apiKeyLIBRETTO_API_KEY(required)API key
apiUrlLIBRETTO_API_URLhttps://api.libretto.shAPI base URL
timeoutSecondsLIBRETTO_TIMEOUT_SECONDS3600Browser session TTL at create time
headlesstrueRequest a headless session

Session create options

Pass these to provider.createSession({ ... }) (or via browser_open({ url }) for startUrl):
OptionDescription
startUrlURL opened before CDP is returned
gpuRequest GPU acceleration
viewport{ width, height } window size
Sessions may queue briefly until capacity is available (up to 10 minutes). Ready sessions expose liveViewUrl. Closing a session may return replayUrl when a recording is available. When startUrl is sent, the session returns startUrlPreloaded: true.

Example

import { createAiSdkBrowserTools } from "libretto-browser-tools/ai-sdk"; import { LibrettoCloudBrowserProvider } from "libretto-browser-tools/libretto-cloud"; const { tools, dispose } = createAiSdkBrowserTools( new LibrettoCloudBrowserProvider(), ); try { // agent loop using tools… } finally { await dispose(); }