OpenAI compatible API · Attested · Public status
x402 Stablecoin Funding For Agents
Let agents add TrustedRouter prepaid credits with Stripe x402 while prompt traffic stays inside the attested API gateway.
Onebase URL to migrate
100sof models and routes
0prompt or output logs. Always.
x402 stablecoin funding
API-key requiredx402 is a funding rail for prepaid credits. It does not run inside the enclave and it does not carry prompts. Agents use a normal TrustedRouter API key, add credits with stablecoin when needed, then retry the same attested API call.
curl https://trustedrouter.com/v1/billing/x402/fund \
-H "Authorization: Bearer $TRUSTEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount":"10.00"}'
The response is HTTP 402 Payment Required and includes a payment-required header for x402-capable clients.
Settle after payment
idempotentcurl https://trustedrouter.com/v1/billing/x402/settle \
-H "Authorization: Bearer $TRUSTEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"payment_intent_id":"pi_..."}'
Stripe webhooks also settle the same payment. If the webhook wins the race, the settle call returns the current state without double-crediting.
Boundary
control plane only- x402 endpoints require a sk-tr-... key.
- Workspace is derived from the key, never from request body input.
- Stripe metadata contains billing ids and amounts only.
- Prompt and output content stay out of Stripe, Sentry, logs, and billing records.
- The enclave still authorizes only when prepaid credits are available.
Agent retry loop
recommended1. Call /v1/chat/completions or /v1/responses.
2. If TrustedRouter returns insufficient credits, call https://trustedrouter.com/v1/billing/x402/fund.
3. Pay using the payment-required header.
4. Poll https://trustedrouter.com/v1/billing/x402/settle with backoff: 5s, 10s, 20s, 30s, then every 60s.
5. Retry the original attested inference call after credits land.