# 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://llm.agenticfi.wtf/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.

## Start here
- [Endpoint overview](https://llm.agenticfi.wtf/docs/endpoints.md): Choose among Chat Completions, Messages, Image Generations, Text to Speech, and Speech to Text.
- [Five-minute quickstart](https://llm.agenticfi.wtf/docs/quickstart.md): Make one capped Base mainnet call.
- [Agent integration](https://llm.agenticfi.wtf/docs/agents.md): Follow the safe autonomous workflow and retry rules.
- [Portable Agent Skill](https://llm.agenticfi.wtf/skill/onchain-router/SKILL.md): Install deterministic discovery, wallet-safety, payment, and response instructions.

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

## Guides
- [Pay for AI model requests one at a time](https://llm.agenticfi.wtf/docs/index.md): Send a text, image, or speech request, approve a clear spending limit, pay in USDC, and receive a durable receipt.
- [Choose the right endpoint](https://llm.agenticfi.wtf/docs/endpoints.md): Compare the five paid AI endpoints and four free discovery endpoints in the public Onchain Router contract.
- [What happens during a paid request](https://llm.agenticfi.wtf/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.
- [Production environment and funding](https://llm.agenticfi.wtf/docs/environments.md): Understand the Base mainnet payment environment and how to fund a wallet with USDC.
- [Make your first paid AI request](https://llm.agenticfi.wtf/docs/quickstart.md): Choose a text, image, or speech route, check its payment limit, send one request on Base mainnet, and save the result and receipt.
- [Protect the wallet that pays for requests](https://llm.agenticfi.wtf/docs/wallet-security.md): Use a dedicated wallet with a small balance, set firm spending limits, and check every payment term before signing.
- [Connect an autonomous agent safely](https://llm.agenticfi.wtf/docs/agents.md): Give an agent a clear model contract, firm spending limits, official x402 payment signing, and rules that prevent unsafe retries.
- [Code examples for text, image, and speech](https://llm.agenticfi.wtf/docs/sdk-examples.md): Use an official x402 client with the public text, image, and speech request formats.
- [How authorization, charges, and receipts work](https://llm.agenticfi.wtf/docs/payment-receipts.md): Understand the spending limit you approve, the final amount charged, and the payment evidence saved in the receipt.
- [Understand errors and retry safely](https://llm.agenticfi.wtf/docs/errors-retries.md): Learn which failures are safe to retry and how one idempotency key prevents duplicate model requests and charges.
- [How request content is stored and deleted](https://llm.agenticfi.wtf/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://llm.agenticfi.wtf/docs/changelog.md): Review dated changes to the public interface, model catalog, pricing, payments, and documentation.

## Status and policies
- [Service status](https://llm.agenticfi.wtf/status.md): Review the production payment environment before attempting a payment.
- [Privacy notice](https://llm.agenticfi.wtf/legal/privacy.md): Review data processing, retention, providers, and public blockchain records.
- [Service terms](https://llm.agenticfi.wtf/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.
