Docs / x402 Payments
x402 Payments
HTTP 402 payment flow for informational Stakao allocation analysis through USDC on Base.
Updated 2026-07-22
Payment rail
The Worker validates the request and returns the x402 challenge before forwarding a paid request to the backend.
- Protocol: x402 v2.
- Token: USDC.
- Network: Base, CAIP-2 eip155:8453.
- Price: 3 USDC for the paid Agent API analysis endpoints.
- No wallet is required for the direct model portfolio snapshot.
Probe a direct payment challenge
bash
curl -i 'https://api.stakao.com/agent/allocation-analysis/model-portfolio?catalog_item_id=quant_strat'Preflight before payment
Wallet-specific analysis must complete the free preflight before the paid request is attempted.
- The response contains a Stakao-generated client_request_id.
- The paid body must reuse the exact wallet, catalog item, config, and client_request_id.
- Missing or unknown preflight ids return HTTP 428 and do not request payment.
Create a quote
bash
curl -sS -X POST 'https://api.stakao.com/agent/allocation-analysis/allocation/preflight' \
-H 'Content-Type: application/json' \
-d '{"wallet_address":"5YourBittensorWallet","catalog_item_id":"ai_agent","config":{}}'402, pay, retry
A valid request without payment returns HTTP 402 and exposes the payment requirements through x402 headers.
Read PAYMENT-REQUIRED (and the compatibility X-PAYMENT-REQUIRED header when present), pay the exact Base USDC requirement, then retry the identical HTTP request with the payment proof header. A successful response contains decision, product, and payment.
The Worker signs the forwarded request for the backend and binds the request body, query, entitlement, and payment proof. It never treats the internal signature as proof that settlement completed.
Payment safety
Payment purchases an informational analysis, not a staking action.
- The output status is ANALYZED, not RECOMMENDED, APPROVED, or EXECUTED.
- The response carries informational_only=true.
- No user strategy is activated and no delegate transaction is created.
- Errors include code, HTTP status in errors.json, retryable, remediation, and docs_url.
Agent entrypoints