Skip to content

Make sessions faster and cheaper

Set up your agent

Give your coding agent a Steel browser and the Steel skills, so that it browses and writes Steel code the right way. Learn more

Install the Steel CLI. It signs you in and installs the skills for your coding agents.

curl -fsS https://setup.steel.dev | sh

Or send this prompt to your coding agent, and it does the same:

Read https://setup.steel.dev/install.md and follow it to set up Steel for this coding client.
Then continue my requested task using the installed Steel skill.

Set up your agent →

A session costs browser time for as long as it is open, and proxy bandwidth and CAPTCHA solves when it uses them. Pricing has the rates. Most of a run's cost and time comes from a few habits: a session that stays open after its work ends, pages that load more than the task needs, and steps that every run repeats. Go through the items below, and compare a run's cost before and after each change.

Release sessions on time

  • Release each session as soon as its work ends. Steel bills a session until it is released or it times out. Release it in a finally block, so that an error does not leave it open. See Always release sessions.
  • Let idle sessions end on their own. Set inactivityTimeout, so that a session that your code forgets ends after a short time without activity. See Release idle sessions.

Load less

  • Block what the task does not need. Steel blocks ads by default. Set optimizeBandwidth to true to block images, media and stylesheets as well, or block the hosts that you choose. Pages load faster, and a session on a Steel proxy uses less bandwidth. Keep stylesheets for a task that needs the page to look right, such as a screenshot. See Reduce bandwidth.

Skip the sign-in

  • Start each run signed in. Sign in once, save the browser as a profile, and start the next sessions from it with profileId. Each run then skips the sign-in steps, and the site sees a browser that it knows instead of a new login. See Stay signed in across sessions.

Turn on paid features only where they help

  • Add a proxy only for the sites that need one. A session without a proxy uses no proxy bandwidth. When a site needs a proxy and you have one, bringing your own adds no proxy bandwidth charge. See Bring your own proxy.
  • Keep one address for a site that checks it. A site that sees a sign-in from a new address can ask for another check, which costs time and can cost a CAPTCHA solve. A dedicated IP keeps one address from one session to the next, for a monthly price for each IP. See Plans and pricing.
  • Solve only the CAPTCHAs that block the task. With solveCaptcha on, Steel solves each CAPTCHA that it detects, and each solve is billed. To choose which ones to solve, set stealthConfig.autoCaptchaSolving to false and ask for each solve yourself. See Solve on request.

Measure the result

  • Read what a session cost. The API returns each session's cost and the usage behind it, so you can compare runs before and after a change. See Session cost.
  • Add up the cost by customer or by job. Tag sessions with metadata, and add up their costs. See Track cost per customer.

Next steps