{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "browserbase-stagehand--run-browser-agents-on-browserbase-with-caching",
 "repo": "browserbase/stagehand",
 "repo_url": "https://github.com/browserbase/stagehand",
 "repo_slug": "browserbase-stagehand",
 "title": "Run browser automations in the cloud with action caching",
 "page_title": "How to run browser automations in the cloud with action caching with Stagehand",
 "summary": "Point the same Stagehand script at Browserbase and turn on caching so repeated actions spend no tokens.",
 "who": "A team running the same browser automations many times a day who wants them faster and cheaper.",
 "problem": "Running browsers on your own servers is fiddly, and paying model tokens for the same action every run adds up.",
 "outcome": "The same script running on hosted browsers, with repeated calls served from cache.",
 "steps": [
  "Get a Browserbase API key and set BROWSERBASE_API_KEY",
  "Launch with browserbase.launch instead of the local browser, keeping the rest of your script",
  "Create Stagehand with cache: true so identical calls come back from Browserbase with no tokens spent",
  "Leave out the model configuration to let the Model Gateway pick the cheapest model for each action",
  "Use session recordings to debug runs that go wrong"
 ],
 "agent_prompt": "Move my existing browserbase/stagehand script <file> from a local browser to Browserbase: launch with browserbase.launch using BROWSERBASE_API_KEY, enable cache, drop the model config so the Model Gateway picks models, and run it twice to show the second run uses the cache.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "Caching only helps when the same call repeats; one-off tasks still pay for model tokens.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Node with pnpm, Python, or Go",
  "Chrome installed for local runs",
  "A model API key such as OPENAI_API_KEY, or a Browserbase API key to use the Model Gateway"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "This needs a Browserbase API key on a paid hosted service; keep it in an environment variable and check pricing before moving high-volume jobs."
  }
 ],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/browserbase-stagehand/run-browser-agents-on-browserbase-with-caching/",
 "md": "https://dedupedai.com/use-cases/browserbase-stagehand/run-browser-agents-on-browserbase-with-caching/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/browserbase-stagehand--run-browser-agents-on-browserbase-with-caching.json",
 "api_version": "v1"
}
