Tollstile

Using Tollstile with coding agents

Give Claude Code, Codex, Cursor, and other coding agents what they need to add payments with Tollstile.

Pre-release · planned API

Tollstile is designed to be picked up by coding agents. Give yours one of these, then describe the outcome you want.

Machine-readable docs

ResourceUse
/llms.txtIndex of every page, grouped by task
/llms-full.txtAll docs as one Markdown file
/llms.mdx/docs/<page>/content.mdAny single page as Markdown (the Copy Markdown button)

Agent skill

The repository ships a skill at skills/tollstile/SKILL.md with the rules an agent needs: which package to install, how to price a route, how to choose a flow, and what never to do (floats for money, catching provider errors, skipping reconciliation).

Add it to your agent's skills folder, or reference it from your project's AGENTS.md:

When adding payments, pay-per-call pricing, credits, or x402/MPP support, follow
https://github.com/tollstile/tollstile/blob/main/skills/tollstile/SKILL.md

Prompts that work

Add $0.05 pay-per-call pricing to GET /weather in this Hono app using Tollstile.
Use the test rail for local development.
Let signed-in users with credits call POST /v1/generate for $0.02 per call using
Tollstile credits, and require payment from everyone else.
Charge up to $0.50 per render with Tollstile and settle the actual cost after the
render finishes.
Add a daily spend limit of $20 per payer to every paid route.

What a correct change looks like

  • createTollstile is created once and reused.
  • Prices are strings like "$0.05" or upTo("$0.50") — never numbers.
  • Routes are wrapped with the framework adapter, e.g. tollstile(toll.price("$0.05")) for Hono.
  • toll.reconcile() runs on a schedule in production.
  • Live rails come with a secret from the environment, and the test rail is never deployed next to them.

On this page