Reduce agent token cost with okyra

An AI agent driving a browser pays for every model turn and every token it reads. okyra is a local browser layer built to reduce that agent token cost. It drives Chrome, Chromium, Brave or Edge over the Chrome DevTools Protocol, from a CLI or from an MCP server your agent calls. These pages cover every command, flag and plan field in the current release.

okyra 0.1.0 · checked 16 October 2026

Docs pages
  1. Overview
  2. Install
  3. MCP setup
  4. CLI reference
  5. Targets
  6. Plans
  7. Settle and wait
  8. Licence keys
  9. Troubleshooting

What okyra is

One binary, okyra. It is three things at once: a thin CLI, a daemon that holds the browser session (okyra daemon), and an MCP server over stdio (okyra mcp). The CLI and the MCP server both talk to the same daemon, so they share the browser and its open pages.

agent ──MCP──> okyra mcp ─┐
shell ──────> okyra ... ──┴─unix socket─> okyra daemon ──CDP──> Chromium

The daemon starts on the first call and exits after 30 idle minutes. It uses a throwaway browser profile, never your own, unless you ask it to attach to your running browser.

The cost model

A browser agent pays four costs on every page. okyra is built to cut them in this order, because the first one is the largest: each model turn re-reads the whole context.

CostWhat okyra doesRead more
Model turnsOne call runs a whole plan: fill, click, wait, extract. A failed step returns the error and a snapshot in the same call.Plans
TokensSnapshots are compact outlines with refs like @e7, not page dumps. text and extract read only what you name.Targets
Process startA persistent daemon keeps the browser and named pages open. Later calls reuse it through a local socket.CLI
WaitingActions return when the page has settled: requests done and the DOM quiet. No fixed sleeps, no polling turns.Settle

For measured numbers and how we got them, see the benchmark method.

Quick start in 60 seconds

With okyra on your PATH and a Chromium based browser installed (install guide):

okyra goto https://news.ycombinator.com      # starts the daemon and a headless browser
okyra snapshot -i --max-lines 6               # links and fields, each with a ref like @e4
okyra click @e4                               # or by role and name: okyra click 'link "new"'
okyra extract .titleline --limit 3            # the first three story titles as JSON
okyra stop                                    # stop the daemon and its browser

The snapshot looks like this. Refs are numbered per page and never reused, so yours may differ:

page "Hacker News" https://news.ycombinator.com/
scroll 0 of 1249
link "news.ycombinator.com" @e2
link "Hacker News" @e3
link "new" @e4
link "past" @e5
link "comments" @e6
link "ask" @e7
... 226 more lines, raise max_lines to see them

Then give it to your agent. For Claude Code that is one line; other MCP clients take a JSON or TOML entry.

claude mcp add okyra -- okyra mcp

The agent gets 16 tools. The one that saves the most is okyra_plan: many steps, one call. See plans for the format.

Docs pages

  • Install okyra: downloads, Chromium discovery, containers, the daemon socket.
  • MCP setup: Claude Code, Cursor, Codex, Claude Desktop, and every MCP tool with its parameters.
  • CLI reference: every command and flag, with an example each.
  • Targets: refs, role and name, points, CSS selectors and @item.
  • Plans: the JSON format, named results, optional steps, repeat and each.
  • Settle and wait: how okyra knows a page is ready.
  • Licence keys: OKYRA_LICENSE, okyra license, grace.
  • Troubleshooting: real error messages and what to do.