
Tryx402
io.github.crypto-yannsoPublished by GitHub account crypto-yannsov0.2.0Updated Oct 24, 2026
Budget router over x402: hard budget caps, idempotent paid calls, cost ledger, server-side pricing.
Overview
A local MCP server that lets an assistant search, price and safely call paid x402 endpoints under a hard USD budget cap, with idempotency and a cost ledger.
- What you can do
- Search and discover x402 endpoints and tools in the catalogue without paying, and estimate the cost of a multi-call workflow before spending anything. Call any x402 endpoint with a per-call price and a hard budget cap, with idempotency protection and a single transparent retry after a payment challenge. Review spend through a cost ledger and retrieve signed receipts as proof of payment. In the hosted variant, manage a hosted account: session tokens, balance checks, credit top-ups and proxied calls.
- When to use it
- Use it when an assistant needs to call pay-per-use x402 or AgentCash endpoints and you want spending bounded by a hard cap, no duplicate charges, and a record of what was paid. Also useful for pricing a planned workflow before committing money.
- Requirements
- Runs locally as a Python package installed with pip. A crypto wallet compatible with x402 or AgentCash is needed for paid calls. The hosted variant needs a hosted account and the TRYX402_API_KEY secret; the budget cap is set with GATEWAY_MAX_BUDGET_USD. Network access to the target endpoints and the hosted service.
Installation
In SourceWeft
- Open Tryx402 in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
tryx402 — the OpenRouter for agent payments
MIT licensed. Built in France. The first open-source payment governance layer for AI agents.
A safe, provider-agnostic wrapper over AgentCash / x402. Not limited to prospecting — it drives any endpoint, and adds what AgentCash itself lacks and we learned we need the hard way:
- hard budget caps — stop before overspending
- idempotency — never pay twice for the same call (the $0.83 double-charge lesson)
- cost ledger — USD spent, reconciled, grouped by origin / account
- plan estimation — price a multi-call workflow before spending a single cent
- signed receipts — Ed25519 offline-verifiable proof of every payment
- session tokens + circuit breaker — per-task spend caps with half-open cooldown
- transparent 402→pay→retry — native httpx transport, exactly one retry, no loops
- discovery pipeline — live x402 bazaar indexing (Onyx Bazaar, gold-402)
Open source, no fear
This repo is the open-source SDK: the safe caller, budget guard, idempotency, ledger, CLI and MCP server. MIT licensed.
We don't hide features behind paywalls. We don't split the SDK into "core" and "pro". Everything is here. Use it, fork it, build on it.
The hosted service (https://www.tryx402.app) is the commercial engine:
multi-currency fiat billing, margins, FX, Stripe funding, the verified-tools
catalogue and the provider portal. Pricing is decided server-side via
/v1/quote — a client-side margin is a margin nobody pays.
Revenue model: commission on every pay-per-call transaction routed through the hosted service. The SDK is free. The service takes a cut. That's it.
Positionnement
tryx402 est le premier SDK open source de gouvernance de paiements pour agents IA dans l'écosystème x402. Conçu en France, distribué sous MIT, adopté par la communauté.
Face aux agrégateurs propriétaires (treg.to et consorts), tryx402 défend une position différente : pas de lock-in, pas de licence restrictive, pas de "commercial use only". Le code est libre. La confiance vient du service, pas de la licence.
| Face | Who | Where |\n|---|---|---|\n| Power-tool | you / an agent drive paid endpoints safely | this SDK (gateway.cli, gateway.client) |\n| Fiat gateway | end users pay in their currency, you resell x402 with margin | hosted service (closed) |
Embed it (for agents)
Python — one import:
Terminal — one command (like agentcash), after pip install tryx402:
MCP — two modes (pick the one you need):
SDK MCP (pip install) — 6 tools, safe caller only
6 tools: gateway_search, gateway_discover, gateway_call, gateway_spent,
gateway_plan, gateway_receipt. Works directly with your x402/AgentCash
crypto wallet — no hosted account needed.
You will NOT see
gateway_check_balance,gateway_recharge,gateway_lookup, orgateway_proxy_callfrompip install tryx402. This is deliberate, not a bug. These tools manage your hosted account credits (funded via Stripe, separate from your crypto wallet). The SDK MCP is a safe x402 caller; the hosted gateway handles the fiat credit layer. For the full 10-tool MCP, see Option B below or connect tohttps://www.tryx402.app/api/mcp.
Gateway MCP (clone repo) — 10 tools, hosted account management
All 6 SDK tools plus gateway_session, gateway_check_balance,
gateway_recharge, gateway_proxy_call. No API key needed — anonymous
session auth throughout. check_balance / recharge manage your
hosted account credits (funded via Stripe in EUR/USD — not crypto).
Layout
Use
Discover (free — no payment):
Call any endpoint safely (spends USDC — budget-capped, idempotent):
Ask the hosted service what a call costs your account (server-side FX + margin):
What's real vs hosted
- Real (this SDK): the safe caller, budget cap, idempotency, cost ledger, catalogue search/discover.
- Hosted: accounts, balances, fiat funding (Stripe), FX conversion, margins — all decided by the server; the SDK only asks with
quote(). - Deliberately off: auto-retry of paid calls (default
max_retries=0) — retrying a possibly-paid call is what double-charged us; opt in only if the server honors theIdempotency-Keyheader.
Telemetry (optional)
tryx402 sends one anonymous ping on first import to help us understand usage: install-id (random, persisted locally), package version, Python version, platform.
No PII. No tracking across sites. No personal data.
Disable it anytime:
Or set an empty URL to disable:
Source: README.md at commit 29c9746
Tools
0Version history
1- v0.2.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts