x402 agent access
Discover and pay for machine-readable market data with the x402 protocol.
The x402 surface lets automated clients pay per request for market data without creating a user session or managing a subscription. The API implements x402 version 2 on Robinhood Chain.
Discover products
The catalog is public:
curl "$TRADOR_API_URL/x402"The catalog reports:
- protocol and version
- network (
eip155:4663) - payment asset (Robinhood Chain USDG, 6 decimals)
- per-request price
- available method and path combinations
Products
| Route | Data product |
|---|---|
GET /x402/tokens | Robinhood Stock Tokens with adjusted prices and Arcus tradability |
GET /x402/tokens/{symbol} | One Robinhood Stock Token snapshot |
GET /x402/tokens/{symbol}/executable-price | Executable Arcus venue comparison |
GET /x402/markets | Perpetual market snapshots |
GET /x402/markets/{symbol} | One perpetual market snapshot |
GET /x402/markets/{symbol}/candles?range=1D | Historical candles |
GET /x402/analysis/{symbol}/basis | Spot/perpetual cross-venue basis |
Payment flow
- The client requests a protected product without payment.
- The API responds with HTTP
402and a structured payment challenge. - The client selects the accepted exact-payment option and authorizes USDG payment on Robinhood Chain.
- The client retries the same request with the encoded payment proof.
- The payment is verified and settled.
- The API returns the requested JSON and exposes the payment response header.
The challenge is available in the PAYMENT-REQUIRED header and as a JSON body for compatibility. Successful settlement metadata is returned in PAYMENT-RESPONSE; the API also mirrors it to X-PAYMENT-RESPONSE.
Cross-venue basis
/x402/analysis/{symbol}/basis combines the multiplier-adjusted Robinhood Stock Token price and the corresponding perpetual snapshot. It is useful for monitoring divergence between spot and derivative venues.
Basis is context, not a guaranteed arbitrage opportunity. Clients must account for:
- quote freshness
- swap price impact and gas
- perpetual spread and slippage
- funding
- deposit and withdrawal latency
- token and venue risk
Client guidance
- Cache the catalog briefly, but treat its price and accepted payment option as changeable.
- Respect the timeout provided in the payment challenge.
- Make paid retries idempotent at the client workflow level.
- Store settlement metadata alongside the retrieved product for reconciliation.
- Never log private keys or raw wallet secrets.
- Distinguish
402payment requirements from temporary service failures.
Naven Marketplace publication
Deploy the API at a public HTTPS origin, set PUBLIC_URL to that origin without a path, and submit its https://your-api.example/docs URL to Naven as the provider contract. Paid operations include stable operationId values, complete input and response schemas, a 402 response, and Naven's x-naven-access, x-payment-info, and x-x402-info extensions.
Naven performs a live unpaid request before publication. The returned challenge must confirm x402 v2, the exact scheme, Robinhood Chain (eip155:4663), and the supported USDG contract. The deployed X402_PAY_TO address is authoritative for settlement.
