Onchain Router Base Mainnet
Base mainnet · USDC paymentsAny verified wallet can pay. Check every payment term and set a local spending limit before signing.

Developer documentation

Pay for AI model requests one at a time

Send a text, image, or speech request, approve a clear spending limit, pay in USDC, and receive a durable receipt.

Page tools

Onchain Router gives you one provider-neutral interface for text generation, image generation, text to speech, and speech to text. You approve a request-specific spending limit in your wallet and receive the result only after the result, final charge, and receipt are safely stored.

Choose your path

What stays familiar

Text requests use the familiar model, messages, max_tokens, and stream fields. Image requests use model, prompt, n, image_size, aspect_ratio, and response_format; 1K and 1:1 are the defaults, and the selected model must advertise the requested values. Text to speech uses JSON with model, input, voice, and response_format. Speech to text accepts one bounded MP3 either as standard multipart form data or as canonical Base64 JSON for agents that cannot construct file uploads. Choose an available capability, endpoint, and model from GET /v1/models; choose a public voice alias from GET /v1/audio/voices.

What x402 adds

The first unpaid request returns Hypertext Transfer Protocol (HTTP) status 402 with the payment network, asset, recipient, expiry time, and maximum amount. An official x402 buyer signs the authorization locally and retries the identical request. After success, inspect the PAYMENT-RESPONSE header, the X-Receipt-ID header, and the receipt link.

You do not need an API subscription, and Onchain Router never stores your wallet key. Never send a private key, model-provider key, or custom provider address in the request body.

Reviewed 2026-08-21Catalog d815ab0e8989

Search guides, endpoint references, models, and pricing.