Agent payments (x402 + MPP)
Crane Ledger supports two machine payment protocols so agents can fund API credits (and bootstrap accounts) without a browser checkout:
| Protocol | Rail | Spec |
|---|---|---|
| x402 | USDC on Base (EIP-3009) | HTTP 402 + PAYMENT-REQUIRED / PAYMENT-SIGNATURE |
| MPP (Stripe + Tempo) | Stripe Shared Payment Tokens and/or Tempo | HTTP 402 + WWW-Authenticate: Payment / Payment-Authorization |
Both can be advertised on the same 402 response when Stripe / x402 pay-to is configured: x402 keeps its PAYMENT-REQUIRED header, and MPP adds WWW-Authenticate: Payment …. MPP is on by default whenever those existing vars are present (same pattern as x402).
Credit funding
x402 (unchanged)
POST /organizations/{master_organization_id}/credits/purchase-x402?credits={n}
Authorization: Bearer {api_key}
Full details: x402 credit top-up.
MPP (parallel)
POST /organizations/{master_organization_id}/credits/purchase-mpp?credits={n}
Authorization: Bearer {api_key}
- Omit
Payment-Authorization→ 402 withWWW-Authenticate: Payment …(Stripe and/or Tempo challenges). - Retry with
Payment-Authorization: Payment <credential>after fulfilling the challenge. - Credits are added to the billing master org, idempotent per credential hash.
Because API keys already use Authorization: Bearer, MPP challenges advertise header="Payment-Authorization" (MPP requires_auth pattern).
Account creation
- Free bootstrap (unchanged):
POST /accounts/master - MPP-funded bootstrap:
POST /accounts/master/purchase-mpp?credits={n}with body{"name":"…","base_currency_code":"USD"}. Same 402 →Payment-Authorizationflow; on success returns the new org, funded credits, and a one-time API key.
Operator configuration
MPP reuses the same Railway Stripe / x402 env already used for credit purchases. No new required vars. Every MPP_* key is optional.
| Variable | Purpose |
|---|---|
STRIPE_SECRET_KEY | Enables MPP Stripe (SPT verification); same key as credit top-ups / x402 |
STRIPE_X402_PAYMENT_METHOD_CONFIGURATION | Reused in Stripe MPP challenges when set |
X402_PAY_TO_ADDRESS | Enables MPP Tempo (EVM pay-to; valid on Tempo). Used when MPP_TEMPO_RECIPIENT is unset |
MPP_TEMPO_RECIPIENT | Optional Tempo recipient override |
MPP_STRIPE_CURRENCY | Optional; default usd |
MPP_STRIPE_NETWORK_ID | Optional; default internal |
MPP_STRIPE_PAYMENT_METHOD_TYPES | Optional comma list; default card when no PMC is set |
MPP_REALM | Optional challenge realm (defaults to host from PUBLIC_BASE_URL or api.craneledger.ai) |
PUBLIC_BASE_URL | Public API origin |
x402 env vars are unchanged — see x402 credit top-up.
MCP
Product MCP (https://api.craneledger.ai/mcp) keeps start_x402_credit_purchase / complete_x402_credit_purchase. Prefer REST + an MPP-aware client for MPP. ChatGPT MCP (/mcp/chatgpt) omits credit purchase tools.
Need help?
Create a free account (GitHub, Google, Apple, or email) to access our support portal. Once signed in, use the Support tab in your dashboard to submit a support ticket — no GitHub account required. Our team typically responds within 24 hours.
- ✨ For LLMs/AI assistants: Read our structured API reference
- Legal: Terms of Service · Privacy Policy