900 mTwilight zone
Cut the token costs of an AI agent
An agent pays for every token it reads: the pages it opens, the tool definitions its client loads, the JSON answers it gets, the text it passes on. Six levers of the open sea spare some of them. Each acts only when the agent asks for it, says in its headers what it spared, and is counted in one public ledger. Below: what each was measured to spare, where it spares nothing, and the line to copy. No account, no key.
First: what a page costs
On the task set of the proof of function (33 pages, measured 2026-11-24, o200k_base), the median destination page took 199,463 tokens as raw HTML, 2,030 as the Markdown of the sea's reader and 843 as plain text. The Markdown keeps headings, links and tables, so it is longer than plain text. Page by page, raw HTML took a median of 98.8 times the tokens of the Markdown. An agent that reads pages itself starts there:
curl -s https://mareliberum.dev/r/https://example.com/
The six levers
| Lever | Loses anything? | Measured | Where it spares nothing | Guide |
|---|---|---|---|---|
| TOON instead of JSON | lossless | On 19 real answers (bench of 2026-11-25): TOON was smaller for 10 and at least 20 % smaller, the rule of the lever, for 3 (thinking, routes, agents). With the rule, 45,382 tokens instead of 46,234 (1.8 % fewer). All 19 as TOON: 46,311 (0.2 % more). | Answers that are not tables: the lever then sends the JSON and says why in x-sea-engine-note. | – |
| The lean MCP door | lossless | The tool list: 631 tokens instead of 9,695 (55 tools behind 4). | Clients that defer tool definitions already: Claude Code, Copilot CLI, OpenAI's Agents API. | the guide |
| Read again, only the change | lossless | The example of the toll: a page of 9,128 tokens read again costs 51 (9,077 saved); If-None-Match answers 304 without a body. | A page that changes on every read. | the guide |
| A page to your budget | lossy | You name the budget; a page is fitted to it, never below 50 tokens. | It leaves parts out (marked), so it counts in no headline. | – |
| Only the fields you need | lossy | You name the fields; the rest of the answer stays out. | It leaves members out, so it counts in no headline. | the guide |
| Squeeze what you hold | lossless, or lossy when asked | Lossless steps first; a body of up to 1 MB. | A model that sends text it already holds: it pays for that text again as output tokens. | the guide |
A line for each
TOON instead of JSON
Structured answers repeat every key in every row. TOON says the keys of a table once and then the rows: the same data, every value kept.
curl -s 'https://mareliberum.dev/routes.json?fmt=toon'or the header Accept: text/toon on any JSON door
The lean MCP door
An MCP client may put every tool definition of a server into the model's context on every turn. The lean door lists four tools; find_tools finds any of the others and call_tool calls it, with the same answers. Its results go out as text only, so a client that reads text and structured content (ChatGPT) does not read an answer twice.
curl -s https://mareliberum.dev/mcp/lean -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'add it to a client as an MCP server at /mcp/lean
Squeeze what you hold
Text, HTML or JSON on its way to a model: made smaller, the lossless steps first (HTML to Markdown, JSON minified or as TOON, repeated lines said once). A question or a token budget only when one is named, then lossy, and said so.
curl -s -X POST https://mareliberum.dev/compress -H 'content-type: application/json' -d '{"html":"<h1>…</h1>","q":"price"}'GET /compress says how; nothing posted is kept
Read again, only the change
A page read a second time costs the whole page again. With the ETag of the first answer the sea says "unchanged" in one line, or sends only the lines that changed, each under its nearest heading.
curl -s 'https://mareliberum.dev/r/https://example.com/?since=<etag>'or If-None-Match: <etag> for a 304 without a body
A page to your budget
A page longer than the question needs: fitted to the token budget the agent names, the parts that answer its question first, every gap marked. It leaves things out, so it is lossy, and says so at the top.
curl -s 'https://mareliberum.dev/r/https://example.com/?budget=800&q=pricing'with q, the blocks that answer the question come first
Only the fields you need
A JSON answer carries every field of every row. Name the ones you need, with dots for nested ones, and the rest stays out: deterministic, no model in between.
curl -s 'https://mareliberum.dev/savings.json?fields=hero.tokens,hero.measured'fields=<a,b.c>: a list of fields, dots for nested ones
How the savings are counted
One measuring rule for every lever: what the agent would have read and what it read, each in UTF-8 bytes, each made tokens with the ratio the bench measured for its form (savingOf in node/engine.mjs). No saving, no count, no header claiming one.
Lossless and lossy savings are counted and shown apart. Lossless savings join the measured figure of /savings as their own kind; lossy ones (a page fitted to a budget or a question, an answer cut to named fields) are in no figure of the headline.
The ratios of the bench: one token holds 3.66 UTF-8 bytes of JSON and 3.56 of TOON (o200k_base, 2026-11-25).
What a saving is worth: the prices of the ledger are list prices for uncached input tokens; a client that had the same text in its prompt cache pays 0.025 to 0.1 times that (Claude, OpenAI and Google pricing), so a saving on a cached prefix such as a tool list is worth far less than this.
Every answer a lever shaped says so: x-sea-engine (the lever), x-sea-engine-tokens (before->after), x-sea-engine-saved, and x-sea-engine-lossy when it left something out.
What it costs
Up to 10,000 tokens saved by the lossless levers stay free per network and UTC day; above that an answer costs 20 % of the tokens it saved, at USD 2 per million, settled over x402 in one payment from $0.05; without payment the lean answers pause and the normal answers continue, and unpaid tolls are not collected. The rule, the formula and whether it acts on this node: /engine#toll.
More guides
- Lean MCP door: a smaller tool list
- Read a web page again for 51 tokens
- Only the fields you need
- /compress in a LiteLLM proxy or the Vercel AI SDK
Sources of every number on this page: /engine (the bench run) · /proof (the run) · the toll · the code: github.com/daoudandiaye98-alt/mare-liberum
