# Onchain Router

> Onchain Router is the x402-native AI model router: one provider-neutral API for text, image, and speech, USDC payments, and a durable receipt for every successful request. Gemini serves text and image generation; ElevenLabs serves the current public MP3 speech routes.

The public contract contains five paid AI endpoints and four free discovery endpoints. Flash v2.5 provides text to speech, Scribe v2 provides speech to text, and no payer registration is required.

## Read everything in one request
- [Complete documentation](https://onchainrouter.dev/llms-full.txt): Read the public product overview, guides, endpoint references, model catalog, status, legal drafts, and agent instructions in one Markdown file.

## Production environment
Onchain Router uses Base mainnet and USDC. Validate the live Hypertext Transfer Protocol (HTTP) 402 response and enforce a local spending cap before signing. Empty, incomplete, or malformed unsigned JSON returns an inspection challenge; submit a valid body before signing.

## Start here
- [Endpoint overview](https://onchainrouter.dev/docs/endpoints.md): Choose among Chat Completions, Messages, Image Generations, Text to Speech, and Speech to Text.
- [First-request guide](https://onchainrouter.dev/docs/quickstart.md): Make one capped Base mainnet call.
- [Task recipes](https://onchainrouter.dev/docs/recipes.md): Copy complete request shapes and safe recovery behavior.
- [Wallet compatibility](https://onchainrouter.dev/docs/wallet-compatibility.md): Separate protocol fit, tested compatibility, indexing, and unsupported networks.
- [Agent integration](https://onchainrouter.dev/docs/agents.md): Follow the safe autonomous workflow and retry rules.
- [Portable Agent Skill](https://onchainrouter.dev/skill/onchain-router/SKILL.md): Read the public MIT workflow instructions; the matching public-alpha Buyer CLI is required.

## Machine-readable contracts
- [OpenAPI document](https://onchainrouter.dev/openapi.json): Read the nine public request, response, and error schemas.
- [Runtime model catalog](https://onchainrouter.dev/v1/models): Read available capability categories, compatible endpoints, and model aliases.
- [Detailed pricing](https://onchainrouter.dev/v1/pricing): Read current rates and the pricing policy for every available model.
- [Voice catalog](https://onchainrouter.dev/v1/audio/voices): Read the 20 available public voice aliases and model default.
- [Base USDC balance](https://onchainrouter.dev/v1/balance?address=0x...): Check public wallet balance data before attempting a paid request.
- [Build-time model catalog](https://onchainrouter.dev/models.json): Read the sanitized catalog artifact for documentation and parity checks.
- [x402 discovery document](https://onchainrouter.dev/.well-known/x402): Read authoritative payment terms.
- [XML sitemap](https://onchainrouter.dev/sitemap.xml): Discover every public human-readable and machine-readable page.

## Guides
- [Build with Onchain Router](https://onchainrouter.dev/docs/index.md): Choose an integration for text, images, and speech, with clear publication status and human-owned payment setup.
- [Choose the right endpoint](https://onchainrouter.dev/docs/endpoints.md): Compare the five paid AI endpoints and four free discovery endpoints in the public Onchain Router contract.
- [Installation & availability](https://onchainrouter.dev/docs/installation.md): Install the public npm and host-native GitHub alphas, verify their sources, and understand the remaining release boundaries.
- [Buyer Runtime](https://onchainrouter.dev/docs/buyer-runtime.md): The shared local foundation for wallet custody, budgets, x402 payments, recovery, and receipts.
- [What happens during a paid request](https://onchainrouter.dev/docs/how-it-works.md): See when payment is checked, when the model is called, how the final charge is calculated, and when the answer is released.
- [Buyer CLI](https://onchainrouter.dev/docs/cli.md): Human-owned wallet setup and a terminal interface for discovery, paid requests, recovery, and receipts.
- [Production environment and funding](https://onchainrouter.dev/docs/environments.md): Understand the Base mainnet payment environment and how to fund a wallet with USDC.
- [Local MCP integration](https://onchainrouter.dev/docs/mcp.md): Nine focused tools for agents, with wallet setup and authority kept outside the model.
- [Local OpenAI proxy](https://onchainrouter.dev/docs/proxy.md): Connect an OpenAI-compatible application to a payment-aware loopback adapter.
- [Make your first paid AI request](https://onchainrouter.dev/docs/quickstart.md): Choose a text, image, or speech route, check its exact price, send one request on Base mainnet, and save the result and receipt.
- [Portable Agent Skill](https://onchainrouter.dev/docs/agent-skill.md): Reusable agent guidance over the local Buyer CLI, without a second signer.
- [OpenClaw integration](https://onchainrouter.dev/docs/openclaw.md): Use Onchain Router as an OpenClaw model provider with policy-filtered models, bounded media tools, and local payment authority.
- [Hermes Agent integration](https://onchainrouter.dev/docs/hermes.md): Use Onchain Router as a Hermes model provider with media tools, diagnostics, and deliberate recovery over the local Buyer Runtime.
- [Direct x402 API](https://onchainrouter.dev/docs/direct-api.md): Use the public HTTPS API with an official Base USDC payment-aware buyer.
- [Protect the wallet that pays for requests](https://onchainrouter.dev/docs/wallet-security.md): Use a dedicated wallet with a small balance, set firm spending limits, and check every payment term before signing.
- [Browser Workbench](https://onchainrouter.dev/docs/workbench.md): Try the request flow with a browser wallet and inspect output, charges, receipts, and expiry.
- [Choose an agent entry point](https://onchainrouter.dev/docs/agents.md): Select npm clients, OpenClaw, Hermes, or the portable skill without widening wallet authority.
- [TypeScript, CLI, MCP & HTTP examples](https://onchainrouter.dev/docs/sdk-examples.md): Public-alpha client examples over Buyer Runtime, plus a public unpaid HTTP challenge.
- [Agent task recipes](https://onchainrouter.dev/docs/recipes.md): Copy complete request shapes for text, images, and speech, then recover the same paid operation safely.
- [Wallet and agent compatibility](https://onchainrouter.dev/docs/wallet-compatibility.md): Understand which x402 buyers fit the current Base exact contract and which integrations still need external proof.
- [How authorization, charges, and receipts work](https://onchainrouter.dev/docs/payment-receipts.md): Understand the exact price you approve, the amount paid, and the payment evidence saved in the receipt.
- [Text generation & Messages](https://onchainrouter.dev/docs/text.md): Two familiar request formats for the same text capability.
- [Generate images](https://onchainrouter.dev/docs/images.md): Select an image model and supported specifications, then retrieve hosted or Base64 output.
- [Understand errors and retry safely](https://onchainrouter.dev/docs/errors-retries.md): Learn which failures are safe to retry and how one idempotency key prevents duplicate model requests and charges.
- [Generate speech](https://onchainrouter.dev/docs/speech.md): Turn text into hosted MP3 audio using a live model and public voice alias.
- [Transcribe speech](https://onchainrouter.dev/docs/transcription.md): Send one bounded MP3 with an explicit understanding of provider retention.
- [Local response caching](https://onchainrouter.dev/docs/caching.md): What is cached, when a cache hit costs nothing new, and how to preserve recovery.
- [How request content is stored and deleted](https://onchainrouter.dev/docs/privacy.md): See which request content is stored, why it is needed, when it is deleted, and which sensitive values never enter logs or receipts.
- [Product changes and model retirement policy](https://onchainrouter.dev/docs/changelog.md): Review dated changes to the public interface, model catalog, pricing, payments, and documentation.

## Status and policies
- [Service status](https://onchainrouter.dev/status.md): Review the production payment environment before attempting a payment.
- [Privacy notice](https://onchainrouter.dev/legal/privacy.md): Review data processing, retention, providers, and public blockchain records.
- [Service terms](https://onchainrouter.dev/legal/terms.md): Review payment, output, failure, receipt, wallet, and acceptable-use rules.

Prices and payment terms must be validated against the current catalog and live HTTP 402 response before signing.

## Integration availability
AgenticFI client packages version 0.1.2 are public MIT-licensed alphas on npm under the alpha tag. OpenClaw and Hermes version 0.1.0 are public MIT alphas installable through their hosts’ native GitHub installers. The Python SDK remains source-only; ClawHub and PyPI listings are not claimed.
- [Choose an integration](https://onchainrouter.dev/docs/index.md): Direct API, MCP, SDKs, proxy, CLI, OpenClaw, Hermes, and Agent Skill.
- [Buyer Runtime](https://onchainrouter.dev/docs/buyer-runtime.md): Human-owned wallet, budgets, recovery, and receipts.
- [Install and availability](https://onchainrouter.dev/docs/installation.md): Exact npm and host-native GitHub alpha commands and platform support.
- [Browser Workbench](https://onchainrouter.dev/docs/workbench.md): Included in this build; local read-only previews cannot pay.
- [Product manifest](https://onchainrouter.dev/products.json): Machine-readable publication and integration status.
Local stdio MCP is not a hosted ChatGPT connector. OpenClaw and Hermes are GitHub-installable public alphas, not claimed ClawHub or PyPI listings; funded host acceptance remains unverified. The local proxy cache is not public API caching. Automatic routing is experimental source-only.
