---
site: steel.dev
collection: blog
canonical_url: https://steel.dev/blog/commands-api
markdown_url: https://steel.dev/blog/commands-api.md
content_signal: ai-input=yes, ai-train=yes, search=yes
related:
  - https://steel.dev/blog/introducing-steel-skills.md
  - https://steel.dev/blog/steel-cli-and-agent-skill.md
  - https://steel.dev/blog/we-gave-pi-agent-a-real-browser.md
title: Introducing the Commands API
description: An agent-first API for Steel browsers, with compact snapshots, refs, screenshots, and remote execution. Batch known steps into one request.
date: 2026-11-23
authors:
  - Hussien Hussien
category: Product
launch_week: v4
minutes: 5
tldr: The Commands API lets agents drive Steel browsers over HTTP, the SDKs, or the CLI. Read snapshots, act by ref or coordinates, and batch known steps. In a 50-command browser-local form benchmark, batching reduced median elapsed time from 8.42 to 1.27 seconds.
topics:
  - Browser automation
  - Agent tools
  - Command batching
  - Observation tokens
entities:
  - Steel
  - Commands API
  - Playwright
  - Claude Code
  - Codex
answers_questions:
  - How does the Commands API give an agent browser control?
  - How do snapshots and refs work?
  - Can an agent use screenshots and pixel coordinates?
  - How much time did batching save in the registration-form benchmark?
  - How do I use Commands with my coding agent?
---

# Introducing the Commands API

Today we’re introducing the [Commands API](https://steel.dev/docs/control/commands), an agent-first way to drive Steel browser sessions over HTTP. Your agent reads a page as text, acts on the elements it finds, and gets the result back. Steel executes the commands alongside the browser; you don’t need a local browser process or a WebSocket connection to maintain.

Use our [Python SDK](https://steel.dev/docs/reference/sdks/python) or [Node.js SDK](https://steel.dev/docs/reference/sdks/typescript) in your own agent, or give a coding agent the [Steel CLI](https://steel.dev/docs/control/cli).

## Why we built it

Connecting Playwright or Puppeteer to Steel over [CDP](https://steel.dev/docs/control/cdp) gives you control of a browser. You still need to decide what the model should see and turn its decisions into browser actions. That can mean maintaining tools and page-cleaning code alongside the application you wanted to build.

We wanted to offer the browser interface as well as the browser. Commands takes inspiration from how coding agents use browsers: read a snapshot, pick an element, act, then inspect what changed. The execution runs on Steel, so your application can send work when it’s ready without keeping a browser-control server running between steps.

You choose the model and write the agent loop.

## How it works

Open a page and take an interactive snapshot:

```sh
steel browser open https://example.com
steel browser snapshot -i
```

The [snapshot](https://steel.dev/docs/control/snapshots-and-refs) gives your agent a text representation of the page, with a reference for each element it can act on or point to:

```text nocopy
- link "Learn more" [ref=e1]
```

Your agent can use that ref directly, without constructing a CSS selector. A ref stays usable while its element remains valid; if it goes stale, the agent gets an error and can take another snapshot.

```sh
steel browser click e1 --diff
```

The response shows what changed after the click. Your agent can request a full snapshot whenever it needs more context, or keep observations shorter with the compact and interactive options.

Across ten benchmark pages, the median interactive snapshot contained **1,487 input tokens, compared with 8,916 for raw HTML**. Filtering removes content, though: an interactive snapshot may show a product’s price and stock while leaving out its description. Choose the observation that contains what the task needs.

### Choose what the model reads

Median input tokens across ten pages

| Representation | Median input tokens | Estimated input cost / 1,000 observations at median size |
| - | -: | -: |
| Raw HTML | 8916 | $35.66 |
| Full snapshot | 2639.5 | $10.56 |
| Compact snapshot | 1938 | $7.75 |
| Interactive snapshot | 1487 | $5.95 |
| Viewport screenshot | 1104 | $4.42 |

Interactive + compact matched interactive on all ten pages; the extra flag saved no tokens in this sample.

Viewport screenshot: 1104 calculated image tokens for GPT-5.6 Sol, high detail, 1272 × 709 pixels. This covers the visible viewport, while text can cover the full page. Each representation preserves different information; the experiment did not measure model task success.

Costs use GPT-5.6 Sol at $4/million uncached input tokens as of November 23, 2026; promotional pricing ends November 30, 2026. Estimates exclude other request tokens, output, and Steel charges. [Model pricing](https://developers.openai.com/api/docs/models/gpt-5.6-sol).

[Benchmark methodology](https://steel.dev/blog/commands-api#benchmark-methodology)

When text doesn’t explain enough, a vision-capable agent can request a [screenshot](https://steel.dev/docs/reference/commands#screenshot). That lets it inspect a chart or see where something sits on the page, then act by reference or [click at pixel coordinates](https://steel.dev/docs/reference/commands#mouse) within the browser viewport.

The same interface gives you:

- **[28 browser command types](https://steel.dev/docs/reference/commands)**, including form controls, mouse and keyboard input, file uploads, tabs, page extraction, and JavaScript. You can target elements inside frames.
- **Steel’s [fingerprint management](https://steel.dev/docs/stealth/fingerprints) and [proxy options](https://steel.dev/docs/stealth/proxies)**, including residential proxies and [dedicated IPs](https://steel.dev/docs/stealth/dedicated-ips), with [CAPTCHA solving](https://steel.dev/docs/stealth/captcha-solving) for supported challenges.
- **[Persistent profiles](https://steel.dev/docs/logins/profiles)** to reuse browser state across sessions.
- **[Live viewing](https://steel.dev/docs/observability/live-view) and [recordings](https://steel.dev/docs/observability/recordings)**, with logs to investigate a failed run. A person can also take over through the live view.

Configure those session features as you would with CDP; availability depends on your plan.

## Batch the steps your agent already knows

Once your agent has found a registration form, it can fill the fields and submit the entry in one request with [`steel browser batch`](https://steel.dev/docs/reference/cli#steel-browser-batch). This example adds an attendee to the form we used in our benchmark, then reads the result:

```sh
steel browser batch \
  "fill #name Ada" \
  "fill #email ada@example.com" \
  "select #workshop Engineering" \
  "check #confirm" \
  "click #save" \
  "snapshot -i"
```

The CLI sends the commands in one request and prints the final interactive snapshot. Steel runs them in order and stops at the first failure so your agent can inspect it before continuing.

In our 50-command registration-form benchmark, batching cut median elapsed time **from 8.42 seconds to 1.27 seconds (6.7× faster)** and reduced timed requests from 50 to one. Each run registered ten attendees in a browser-local form fixture, using the same actions and starting state for both modes.

### Batching the same form actions

Registration-form fixture · 30 attempts per configuration · median elapsed time

| Commands | Individual (s) | Batched (s) |
| - | -: | -: |
| 5 | 0.854 | 0.259 |
| 10 | 1.693 | 0.364 |
| 25 | 4.326 | 0.707 |
| 50 | 8.424 | 1.267 |

At 50 commands: 8.42 seconds → 1.27 seconds, 6.7× faster; 50 timed requests → one. Both modes performed the same browser-local form actions. No model inference was timed.

[Benchmark methodology](https://steel.dev/blog/commands-api#benchmark-methodology)

A request can contain up to 50 commands; return to the model whenever the next action needs its judgment.

## Get started

Use HTTP, the [Python SDK](https://steel.dev/docs/reference/sdks/python), or the [Node.js SDK](https://steel.dev/docs/reference/sdks/typescript) to add Commands to your own agent. The [Commands guide](https://steel.dev/docs/control/commands) includes the requests and responses for a working browser loop.

For coding agents, install the [Steel CLI](https://steel.dev/docs/control/cli) and [browser skill](https://steel.dev/docs/control/skills):

```sh
curl -fsS https://setup.steel.dev | sh
steel skills install steel-browser
```

The CLI works with Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, and Gemini CLI, or any agent that can run shell commands. Follow the [CLI setup](https://steel.dev/docs/control/cli), then ask your agent to try a browser task. Run `steel browser stop` when you’re done to release the session.

This is Day 1 of Steel Launch Week V4. Follow the week at [steel.dev/launch-week](https://steel.dev/launch-week).

**Benchmark methodology**

### Batching

We ran the benchmark on November 23, 2026 with Python `steel-sdk` 0.23.0, HTTP/1.1, and automatic SDK retries disabled. The client ran in Toronto; five timing sessions reported `iad` and one reported `us-east`. Each pair used the same browser and reset document, and we alternated execution order across 30 attempts per configuration. A separate observation session overlapped parts of rounds 3–5.

The form registered one attendee per five commands: two fills, a workshop selection, a checkbox, and a submit click. Fifty commands registered ten attendees. All writes stayed in the browser fixture; the test didn’t include a live application backend. The arithmetic workload evaluated `i*2` in sequence.

We timed the first SDK command call through decoding and checking the last response for completion, including client overhead, network, queueing, and browser execution. Setup/reset, session lifecycle, and final-state verification sat outside the timer. No model inference ran.

Medians and p90s use successful, verified trials. Across 480 attempts, 477 passed; three SDK connection errors remain in the success-rate denominators. All trials at 50 commands passed. The 50-command form’s p90 dropped from 9.29 to 1.37 seconds. At 50 arithmetic commands, median time dropped from 7.48 to 0.39 seconds (19.2×); this measures a simple-command microbenchmark.

[Download batching results](https://steel.dev/blog/commands-api/batching-results.csv), including attempts, success counts, p90s, and request counts.

### Observation input

We captured each representation from the same verified state on ten pages spanning forms, dashboards, tables, ecommerce, and long-form content. Text counts use tiktoken 0.14.0 with `o200k_base` on the exact saved strings. The figures show the median for each representation across the ten pages, rather than a median per-page reduction.

For viewport screenshots, we calculated GPT-5.6 Sol’s high-detail image tokens using [OpenAI’s published rules](https://developers.openai.com/api/docs/guides/images-vision#calculating-costs). Each 1,272 × 709 image uses 920 patches of 32 pixels, multiplied by 1.2, for 1,104 tokens. We made no model calls. Counts exclude the shared 9-token instruction, message framing, tool definitions, conversation history, and output.

Estimated input costs use 1,000 observations at each representation’s median size, multiplied by [GPT-5.6 Sol’s published uncached input rate](https://developers.openai.com/api/docs/models/gpt-5.6-sol) of $4 per million tokens as of November 23, 2026. That promotional rate runs through November 30, 2026 and applies to requests at or below 272K input tokens. These estimates exclude other request tokens, output, and Steel charges; they aren’t measured bills or the average cost across the ten pages.

The screenshot covers the viewport; HTML and snapshots can cover the full page. Images retain chart shapes and layout, while snapshots provide text and actionable refs. Filtering can remove information needed for a task. Interactive and interactive-plus-compact produced identical content on all ten pages, so adding compact saved no further tokens. We didn’t test how these representations affect model task success.

[Download per-page observation counts](https://steel.dev/blog/commands-api/observation-tokens.csv).
