# Onchain Router – AI Model Routing via x402 USDC Payment

> Onchain Router – AI Model Routing via x402 USDC Payment is a paid API for AI agents from llm.agenticfi.wtf, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Routes LLM inference requests (text, image, speech) across Google Gemini model variants through a provider-neutral API, billing per-request in USDC with an on-chain receipt.

## Facts

- Endpoint: POST https://llm.agenticfi.wtf/v1/messages
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-router-ai-model-routing-via-x402-usdc-payment-4fd83ebc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CDLmYpBBrJQdedPS3LFj3

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability onchain-router-ai-model-routing-via-x402-usdc-payment-4fd83ebc -d '<json body>'
```

Example prompt: Use Gemini 2.5 Flash through the Onchain Router to answer: 'Explain the difference between proof-of-work and proof-of-stake in three sentences,' with a max of 512 tokens, paying in USDC per request.

## When to prefer this

Choose this endpoint when you need to call Gemini LLM models without managing Google API keys directly, want per-request USDC billing with an on-chain receipt for auditability, are building a web3-native or agent-to-agent workflow that requires crypto-native payment rails, or want a provider-neutral API surface compatible with the Anthropic Messages format pointing at Google Gemini backends.

## Known failure modes

- Insufficient USDC balance causes payment failure and a 402 Payment Required response
- Invalid or unsupported model enum value returns a 400 validation error
- max_tokens out of range (below 1 or above 65536) returns a schema validation error
- stream:true is not supported and returns an error (only stream:false is allowed)
- Empty or malformed messages array causes a 400 bad request
- Network or upstream Gemini provider outage results in a 503 or timeout

## How this service works

Anthropic-compatible request-priced llm inference · 0% service fee launch promotion

## Output

Returns a JSON object with an assistant message containing the model's text response, the message ID, the model name used, role set to 'assistant', and a durable on-chain USDC payment receipt. The response follows the Anthropic Messages API shape (content array with text blocks).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "enum": [
    "gemini-3.6-flash",
    "gemini-3.5-flash-lite",
    "gemini-3.5-flash",
    "gemini-3.1-flash-lite",
    "gemini-2.5-flash",
    "gemini-2.5-pro",
    "gemini-2.5-flash-lite"
   ],
   "type": "string"
  },
  "stream": {
   "type": "boolean",
   "const": false
  },
  "messages": {
   "type": "array"
  },
  "max_tokens": {
   "type": "integer",
   "maximum": 65536,
   "minimum": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "msg_example",
  "role": "assistant",
  "type": "message",
  "model": "gemini-3.6-flash",
  "content": [
   {
    "text": "Hello",
    "type": "text"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-router-ai-model-routing-via-x402-usdc-payment-4fd83ebc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from llm.agenticfi.wtf](https://www.zero.xyz/host/llm.agenticfi.wtf/llms.txt)
