x402 Payments

How x402 payments work on Stakao: the HTTP 402 challenge, free preflight, 3 USDC on Base, exact retry and the informational result an agent receives.

Updated 2026-10-13

Then €19/month$20/month. Card required. Cancel before your trial ends to avoid charges.

01

Payment rail

The API validates the request and returns the x402 challenge before it accepts a paid request.

  • 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'
02

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":{}}'
03

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.

Retrying with the same client_request_id and the same body returns the same decision. Reusing the id with a different body returns HTTP 409 instead of creating a second paid action.

04

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.