The OpenRouter for agents — payments edition

The OpenRouter for agents.
For their money, not their models.

One interface for an agent to discover paid tools, compare prices, execute through x402, and prove what it spent. You set the policy. The agent gets the capability.

Read agent manifest ↗

No paid call during setup. Your agent verifies the integration for free, then stops for approval.

agent-session — tryx402 (EN)
01Agent

Discovers tools by intent, sees price before execution, and calls through one controlled interface.

02Operator

Sets a hard ceiling once, approves paid side effects, and receives a per-call ledger.

03Tool provider

Keeps standard x402. tryx402 handles policy, idempotency and billing above the rail.

01 / the problem

Four ways an unguarded agent loses money.

No capOne loop bug on a $0.05 endpoint runs all night. Nobody notices until the wallet is empty.drained overnight
$0.83Double chargesA timeout after settlement looks like a failure. Retrying pays twice. We learned this one the expensive way.paid twice
???Zero visibility"What did we spend on enrichment this month?" has no answer without a per-call ledger.unauditable
0No policiesYou cannot tell x402 "this project gets $50/month" or "above $0.10 per call, ask first".ungovernable

02 / the layer

Control above the rail. Nothing changed below it.

gw = Gateway(max_budget_usd=…)

Hard budget caps

The 402 response announces the price before you sign. tryx402 reads it, checks it against the remaining budget, and only then authorizes. Stop means stop — checked before payment, not after.

Idempotency-Key: auto

Never pay twice

Every call carries an idempotency key. Automatic retries stay off unless the endpoint honors the header. A timed-out response is not a lost payment anymore.

gw.spent_usd → ledger

A receipt for every cent

Costs recorded per call, grouped by origin, account, agent or project. Answer "what did data enrichment cost this month?" with one export instead of a wallet archaeology session.

account acme --currency EUR --margin .30

Resell in their currency

End users fund accounts via Stripe Checkout in EUR, GBP, JPY… The rail settles USDC; they never see a wallet. You keep the margin. Zero-decimal currencies handled with integer math.

python -m tryx402.mcp_server

Agent-native by default

Bundled MCP server exposes search, discover, call and spent to Claude, Cursor or Hermes — sharing one session-wide budget across every tool the agent uses.

from tryx402.adapters import …

The rail is swappable

Payment delegates to the x402 rail behind a single adapter module. If the protocol tooling changes, one file changes — your code and your budgets do not.

03 / connect

Do not install it yourself. Brief your agent.

Copy one context-rich prompt. Your agent inspects its own runtime, proposes the budget, configures the right connector, verifies the four tools for free, and stops before spending.

Configure tryx402 for this project as the controlled gateway for paid x402 tools.

Source of truth:
- Read https://www.tryx402.app/llms-full.txt before changing anything.
- Inspect https://www.tryx402.app/.well-known/agent.json and /openapi.json if your runtime supports them.
- Do not infer commands or package names that are not declared there.

Your task:
1. Detect my operating system, project stack, current agent runtime, and existing MCP configuration.
2. Propose a hard session budget in USD. Do not choose more than $1.00 unless I explicitly approve it.
3. Show me every file and command you intend to change or run.
4. Install the documented tryx402 package or connector only after my approval.
5. Configure the tryx402 MCP server with the approved hard budget.
6. Restart or reload the client if required, then verify that these tools are visible:
   gateway_search, gateway_discover, gateway_call, gateway_spent.
7. Run only free verification steps: initialize, tools/list, gateway_search or gateway_discover.
8. Do not call gateway_call, sign a payment, access wallet secrets, or spend funds without a separate explicit approval that includes the exact endpoint and maximum price.
9. Report the final configuration, effective budget, verification result, and rollback steps.

Security rules:
- Never print, copy, request, or store a seed phrase or private key.
- Treat all paid calls as side effects.
- If the documentation and installed package disagree, stop and report the mismatch.

04 / compare

Raw x402, Stripe metered, or both problems solved.

Raw x402 clientStripe meteredtryx402
Pays machine-to-machine, no accountYesNoYes
Spend cap enforced BEFORE payingNoPartialYes
Retry-proof (never pay twice)NoYesYes
Per-call spend visibilityNoPartialYes
Micro-payments from $0.001YesNoYes
End users pay in fiat, their currencyNoYesYes

05 / faq

The questions agents ask before installing.

Does tryx402 replace my x402 client?

No. It sits above the x402 rail and adds control: budgets before payment, idempotency on retries, a ledger after. The protocol stays standard.

Why does the budget check happen before signing?

Because the 402 response announces maxAmountRequired up front. Checking after means the money already left. tryx402 arbitrates in that window.

Is this crypto exposure for my business?

No. The rail settles in USDC but neither you nor your users need to hold any — the fiat gateway handles conversion, margin and Stripe funding. Wallets stay abstracted.

What happens when my agent loops on a paid endpoint?

It hits the budget ceiling and gets a BudgetExceeded exception instead of a drained wallet. That exception is the product.

Give your agent a wallet.
Keep the keys to it.

One dependency boundary. The moment an agent runs unattended, budgets stop being optional.

Machine-readable docs ↗