DEV Community

RemoteBrowser
RemoteBrowser

Posted on Originally published at remote-browser.dev

Session Browser-Hour: How Remote Browser Meters AI Agent Time

Session Browser-Hour: How Remote Browser Meters AI Agent Time

When you run an AI agent that drives a browser, you are paying for compute, network egress, and browser runtime. The session browser-hour is the unit that ties those costs together. Remote Browser meters hosted Chromium sessions by the hour, so you know exactly what your agent consumes and what it costs.

This post explains what a session browser-hour is, how Remote Browser counts it, how it differs from per-request or per-credit pricing, and how to control spend without sacrificing agent reliability.

What Is a Session Browser-Hour?

A session browser-hour is one hour of wall-clock time that a hosted Chromium session stays alive. It does not matter whether the browser is idle, executing a Playwright script, or waiting for a network response. If the session is open, it consumes browser-hours.

Remote Browser starts a session when you request a new browser instance via the API, CDP, or a WebSocket connection. The session ends when you explicitly close it, when it times out due to inactivity, or when your usage limit is reached. The total billable time is the sum of all open session durations across your account.

This metering model is common in cloud infrastructure. It is the same logic behind EC2 instance-hours or container runtime charges. The difference is that Remote Browser optimizes the browser runtime itself, so you are not paying for a full VM when you only need a browser tab.

How Remote Browser Counts Session Time

Remote Browser tracks session time from the moment the browser process starts until it terminates. Here is what counts toward a session browser-hour:

  • Active execution: Playwright, Puppeteer, or Selenium commands running inside the session.
  • Idle time: The browser is open but no commands are executing. This still counts.
  • Network waits: Page loads, API calls, or WebSocket delays while the session is open.
  • Live viewer usage: If you open the live debugging viewer, the session stays active.

What does not count:

  • Time between sessions: If you close a session and start a new one later, only the open duration of each session is billed.
  • API calls outside a session: Creating a session object or querying session status does not consume browser-hours.

Remote Browser rounds partial hours to the nearest second, not to the next full hour. If your agent runs for 3 minutes and 20 seconds, you are billed for 3.33 minutes, not a full hour. This granularity matters for short-lived automation tasks.

Session Browser-Hour vs. Per-Request Pricing

Many browser automation APIs charge per request or per action. That model works for simple API calls but breaks down for AI agents that need persistent state, multiple page navigations, or long-running reasoning loops.

Here is a comparison:

Pricing Model How It Works Best For Drawbacks
Per-request Pay per API call or action Simple, stateless tasks Expensive for multi-step agents; no session state
Per-credit Pay per abstract unit (e.g., 1 credit = 1 action) Predictable workloads Opaque; hard to estimate real cost
Session browser-hour Pay per hour of open browser session AI agents, long-running tasks, persistent profiles Requires session lifecycle management

Session browser-hour pricing is more predictable for AI agents because the cost is directly tied to runtime, not to the number of actions. A single agent that performs 50 steps in one session costs less than 50 individual API calls, even if the session runs for an hour.

Why Session-Based Metering Fits AI Agents

AI agents are not stateless API consumers. They navigate, click, fill forms, extract data, and sometimes pause to reason about the next step. Each of those actions requires the browser to stay alive.

With session browser-hour metering, you get:

  • Persistent profiles: Cookies, localStorage, and session data survive across steps within the same session.
  • Live debugging: You can watch the agent operate in real time without paying for a separate debugging tool.
  • Session isolation: Each agent gets its own browser context, so failures do not bleed into other sessions.
  • Configurable browser settings: You can adjust proxy, user agent, and other browser-level options per session.

The alternative—spinning up a fresh browser for every action—is both slower and more expensive. Session-based metering aligns cost with actual resource consumption.

Controlling Session Browser-Hour Usage

The biggest risk with session-based pricing is leaving sessions open longer than necessary. Remote Browser provides several controls to prevent that.

Set Inactivity Timeouts

You can configure a session to auto-close after a period of inactivity. If your agent stops sending commands for, say, 5 minutes, Remote Browser terminates the session and stops the meter. This is useful for agents that might hang or wait for external input.

Use Explicit Session Lifecycle Management

Your code should close sessions when the task is complete. In Playwright, that means calling browser.close() or context.close(). In CDP, it means sending Browser.close or terminating the WebSocket connection.

Here is a TypeScript example using Playwright with Remote Browser:

import { chromium } from 'playwright-core';

async function runAgentTask() {
  // Connect to a Remote Browser session via CDP
  const browser = await chromium.connectOverCDP('wss://remote-browser.dev/cdp/session');

  try {
    const context = browser.contexts()[0];
    const page = await context.newPage();

    await page.goto('https://example.com');
    await page.fill('#search', 'session browser-hour');
    await page.click('#submit');

    const results = await page.textContent('.results');
    console.log('Agent completed:', results);

    // Explicitly close the session to stop the browser-hour meter
    await browser.close();
  } catch (error) {
    console.error('Agent failed:', error);
    // Ensure the session is closed even on failure
    await browser.close().catch(() => {});
  }
}

runAgentTask();
Enter fullscreen mode Exit fullscreen mode

Monitor Usage in Real Time

Remote Browser exposes session status endpoints that show whether a session is active, idle, or closed. You can poll these endpoints from your orchestration layer to detect orphaned sessions and close them programmatically.

Set Account-Level Usage Limits

You can define a maximum number of concurrent sessions and a total monthly browser-hour budget. When the limit is reached, Remote Browser rejects new session requests or terminates existing ones, depending on your configuration. This prevents runaway costs from a misbehaving agent.

Session Browser-Hour Rate and Cost Planning

The exact session browser-hour rate depends on your plan and any volume discounts. Remote Browser does not publish a single flat rate because usage patterns vary widely. Instead, the pricing page shows current rates for different tiers.

What you should plan for:

  • Concurrency: How many sessions do you need at peak? Each concurrent session consumes browser-hours independently.
  • Average session duration: Measure this from your logs. If your agents typically run 10 minutes, you can estimate monthly hours as (sessions per day × 10 minutes × 30) / 60.
  • Idle overhead: Factor in timeouts and retries. A session that waits 2 minutes for a slow API response still consumes browser-hours.

For a typical AI agent that runs 20 sessions per day, each lasting 15 minutes, the monthly consumption is about 150 browser-hours. That is a useful baseline for budgeting.

Managed Browser-Hour vs. Self-Managed Sessions

Remote Browser offers both fully managed sessions and more granular control through the API. The distinction matters for cost and operational overhead.

Aspect Managed Browser-Hour Self-Managed Session
Session lifecycle Remote Browser handles timeouts and cleanup You control start and end explicitly
Cost predictability Higher, because you pay for convenience Lower, if you manage lifecycles well
Operational effort Minimal Requires monitoring and cleanup logic
Best for Quick prototypes, low-volume agents Production workloads with tight cost controls

Most production teams start with self-managed sessions and add managed timeouts as a safety net. This gives you the cost benefits of precise lifecycle control without the risk of orphaned sessions.

How Session Browser-Hours Compare to Browser-Use Alternatives

Browser-use and similar open-source projects run locally, which means you pay for your own compute and network. That works for development but not for production scale. Hosted sessions shift the cost to a predictable per-hour rate.

The trade-off is clear:

  • Local browser-use: Free software, but you manage Chromium, proxies, and infrastructure. Your session browser-hour cost is your own VM or laptop time.
  • Hosted session browser-hour: You pay a rate per hour, but Remote Browser handles the browser runtime, session isolation, and debugging tools.

For teams that need reliability and scale, the hosted model is usually cheaper than the engineering time required to maintain local browser farms. See our post on remote browsers for AI agents for a deeper comparison.

Common Pitfalls That Inflate Browser-Hour Usage

Even with good intentions, teams often waste browser-hours. Here are the most common mistakes:

  1. Not closing sessions after errors: An exception in your agent code can leave the browser open. Always use try/finally or try/catch with a close call.
  2. Long inactivity timeouts: A 30-minute timeout might seem safe, but it means 30 minutes of billable idle time if the agent stalls.
  3. Creating sessions for every step: Some developers create a new session per action, thinking it is cleaner. This multiplies overhead and loses session state.
  4. Ignoring session status: If you do not monitor active sessions, you will not notice leaks until the bill arrives.

Use the Remote Browser documentation to understand session lifecycle APIs and implement proper cleanup.

Real-World Example: Cost Breakdown

Suppose you run a web research agent that visits 10 pages per task and takes 8 minutes per task. You run 50 tasks per day.

  • Sessions per day: 50
  • Average session duration: 8 minutes
  • Daily browser-hours: 50 × 8 / 60 = 6.67 hours
  • Monthly browser-hours: 6.67 × 30 = 200 hours

If your session browser-hour rate is competitive, this workload is affordable. The key is that you are paying for actual browser runtime, not for the number of pages visited or actions performed.

Session Browser-Hour and Persistent Profiles

One advantage of session-based metering is that persistent profiles work naturally. A profile is tied to a session, so you can reuse cookies, login states, and local storage across multiple runs without paying for a separate storage service.

This is especially useful for agents that need to maintain authenticated sessions. Instead of re-authenticating every time, you keep the profile alive and only pay for the browser-hours when the session is open.

For more on how profiles work with sessions, see our guide on remote web browser infrastructure.

Final Thoughts on Session Browser-Hour

The session browser-hour is the right unit for AI agent workloads because it aligns cost with actual resource consumption. You pay for the time your browser is alive, not for arbitrary action counts or abstract credits.

To keep costs under control:

  • Close sessions explicitly in your code.
  • Set inactivity timeouts as a safety net.
  • Monitor session status and usage limits.
  • Plan for concurrency and average session duration.

Remote Browser gives you the tools to manage all of this through its API and dashboard. Check the pricing page for current session browser-hour rates, and read our remote control browser post if you need a deeper dive into the API.

If you are evaluating alternatives, the browser-use alternatives post covers what to look for in a production-grade browser runtime. And for a technical reference, the Chrome DevTools Protocol documentation explains the underlying session and target model that Remote Browser exposes.

Session browser-hour pricing is straightforward once you understand the metering. Build your agents with explicit lifecycle management, and you will get predictable costs and reliable automation.

Top comments (0)