Axiom Stack · Payment Factory
Payment Factory — four protocols, one endpoint
Every priced endpoint at api.axiomstack.dev/v1/* accepts four payment modes simultaneously: x402 (agent-autonomous USDC), AP2 mandate passthrough, MPP-charge voucher, and Bearer quota. Pick the one that matches your shape; we'll always prefer the explicit one if multiple are present.
Four payment modes
Bearer (quota)
livePersistent enterprise shape. Issue an API key, prepay USDC quota, charge against monthly burn. Idempotent retries, predictable margin.
x402 (agent-autonomous)
liveTransient agent commerce. No signup. Agents with a Solana wallet pay per call in USDC; facilitator covers gas. ~30–60% discount vs Bearer for the same call.
AP2 mandate passthrough
liveAuthorization framework for agent commerce. Capture + persist the mandate envelope; charge via Bearer or x402 in the same call.
MPP-charge voucher
livePre-authorized charge envelope. Voucher carries the spend authorization; async settlement on Solana. Suits queued / batch agent workflows.
Integrate into your service
Payment Factory works for any Solana-anchored service. To accept agent payments through your own API:
- Define your priced endpoint (e.g.,
/api/v1/inferenceor/api/v1/data-fetch). - Publish a
.well-known/x402manifest at<your-domain>/.well-known/x402advertising yourpayTo(treasury owner pubkey), accepted asset (USDC mint), network (e.g.,solana-devnet), and price per call. - On HTTP 402, return a
Payment-Requiredbody per the x402 spec listing your accepted protocols. - Clients (agents, applications using
@axiom-stack/sdkclient.pay()— see /developers/sdk) discover your manifest, pay via x402 (or MPP, AP2, Bearer if you accept those), and re-issue the request with proof of payment. - Settlement hits your treasury account on Solana — Axiom's backend is uninvolved.
Example manifest excerpt
{
"accepts": [{
"scheme": "exact",
"network": "solana-devnet",
"asset": "<your-USDC-mint>",
"maxAmountRequired": "50000",
"payTo": "<YOUR_TREASURY_OWNER>",
"resource": "https://yourapi.dev/v1/inference"
}]
}The Axiom SDK's client.discover(serviceUrl) will find and parse this manifest automatically; client.pay() will route end-to-end between your customer's wallet and the facilitator without touching Axiom backend.
For end-to-end integration recipes (Express / FastAPI server, streaming endpoints, agent frameworks), see the Payment Factory integrations guide →
x402 — agent-autonomous
live — devnetAgents with a Solana wallet pay per call in USDC — no API key, no signup, no human-mediated Stripe top-up. Coexists with Bearer on the same endpoint; we prefer Bearer when both are present (predictable enterprise margin) and fall through to x402 for spot agent traffic.
Pricing (USDC, devnet)
- • Equity instant — $0.02
- • Equity audit — $0.20
- • Crypto instant — $0.02
- • Real estate — pending Phase 6 verification
Settlement
Solana devnet. Facilitator: Coinbase Developer Platform. Treasury wallet: 6pPcyDr…A3B3. USDC mint: Circle devnet. You pay 0 gas — facilitator covers Solana fees.
1. Precheck (no header)
curl -X POST https://api.axiomstack.dev/v1/attestation/instant \
-H "Content-Type: application/json" \
-d '{"asset_class": 6, "asset_id": "BTC"}'
# → HTTP 402 Payment Required
# Response body (V1-compat) + PAYMENT-REQUIRED response header (V2):
# {
# "x402Version": 1,
# "accepts": [{
# "scheme": "exact",
# "network": "solana-devnet",
# "asset": "<USDC mint>",
# "maxAmountRequired": "20000", # $0.02 in 6-decimal atomic units
# "payTo": "6pPcyDr…", # treasury OWNER, not ATA
# "resource": "https://api.axiomstack.dev/v1/attestation/instant",
# "extra": { "feePayer": "<facilitator pubkey>", "decimals": 6, "symbol": "USDC" }
# }],
# "error": "X-PAYMENT header is required"
# }2. Sign + resend with payment header
# After signing (use @x402/svm + x402-fetch on Node, or solders on Python):
curl -X POST https://api.axiomstack.dev/v1/attestation/instant \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <base64(PaymentPayload)>" \
-d '{"asset_class": 6, "asset_id": "BTC"}'
# → HTTP 200 with the attestation + PAYMENT-RESPONSE header
# Response envelope includes meta.payment.tx_hash for explorer lookup.Protocol version
Server emits V2 PAYMENT-REQUIRED response header + V1 JSON body simultaneously, and accepts BOTH V2 PAYMENT-SIGNATURE and V1 X-PAYMENT inbound headers. V1 back-compat sunsets 2026-Q3; the SDKs will emit a deprecation warning once you're within 60 days of sunset.
AP2 — mandate passthrough
liveAP2 is the agent-commerce authorization framework. Axiom acts as the passthrough: we capture + persist the mandate envelope (audit trail + non-repudiation), but the charge still happens via Bearer quota or x402 on the same call. Compose AP2 + Bearer for "authorized + billed" flows.
curl -X POST https://api.axiomstack.dev/v1/attestation/instant \
-H "Authorization: Bearer $AXIOM_API_KEY" \
-H "X-AP2-Mandate: <base64(MandateEnvelope)>" \
-H "Content-Type: application/json" \
-d '{"asset_class": 2, "asset_id": "AAPL"}'
# Mandate envelope is captured + persisted; charge happens via Bearer quota.
# Response: meta.ap2.mandate_id + meta.ap2.captured_at.MPP — charge voucher
liveMulti-protocol payment charge voucher. The voucher carries a pre-authorized spend envelope; settlement on Solana is async. Suits queued + batch agent workflows where the agent needs to commit a call before settlement clears.
curl -X POST https://api.axiomstack.dev/v1/attestation/instant \
-H "X-MPP-Voucher: <base64(MPPVoucher)>" \
-H "Content-Type: application/json" \
-d '{"asset_class": 2, "asset_id": "AAPL"}'
# Voucher carries the pre-authorized charge envelope; settlement is async.
# Response: meta.mpp.voucher_id + meta.mpp.charged_at.Bearer — quota
livePredictable enterprise track. Issue an API key (axm_live_…), prepay USDC quota in the dashboard, charge against monthly burn. Bearer wins any conflict with x402 on the same call — predictable margin for the agent operator.
curl -X POST https://api.axiomstack.dev/v1/attestation/instant \
-H "Authorization: Bearer $AXIOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset_class": 2, "asset_id": "AAPL"}'
# Bearer charges against monthly quota; idempotent retries via Idempotency-Key.Composition patterns
Combine modes per call. The server resolves precedence in this order:
- Bearer present → charge Bearer quota. AP2 mandate, if also present, is captured (audit trail). x402 / MPP headers, if also present, are ignored (Bearer wins).
- x402 PAYMENT-SIGNATURE present, no Bearer → settle via x402. AP2 mandate captured if present.
- MPP voucher present, no Bearer / x402 → settle via MPP. AP2 mandate captured if present.
- None present → HTTP 402 with the .well-known accepts list.
Every settled call writes a receipt row visible in your dashboard: protocol, amount, on-chain tx hash where applicable, captured mandate where applicable.
.well-known/x402 — payment-side fields
The same manifest at api.axiomstack.dev/v1/.well-known/x402 advertises payment shape. The payment-side fields:
scheme—exact(V1 / V2 x402 settlement scheme).network—solana-devnettoday,solana-mainnetpost-audit.asset— USDC mint pubkey on the target network.payTo— treasury OWNER pubkey, not the ATA (the facilitator derives the ATA).auth_modes— array advertising["bearer", "x402", "ap2", "mpp"]for the endpoint.extra.feePayer— facilitator pubkey (covers Solana gas for x402).
For the oracle-side fields (asset_class / tier / vendor), see the Themra reference.
See it live
Every settled call shows up in your dashboard with the full payment provenance — Bearer receipts, x402 on-chain hashes, captured AP2 mandates, MPP voucher settlement state.