# Onchain Router LLM Inference (Anthropic-Compatible)

> Onchain Router LLM Inference (Anthropic-Compatible) is a paid API for AI agents from onchainrouter.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Routes Anthropic-compatible chat completion requests to Google Gemini models, billed per-request on-chain via x402

## Facts

- Endpoint: POST https://onchainrouter.dev/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-llm-inference-anthropic-compatible-ce64ad30
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Rjyiyidq7C__3IbW5MozD

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-llm-inference-anthropic-compatible-ce64ad30 -d '<json body>'
```

Example prompt: Ask gemini-2.5-flash to summarize the following article in 3 bullet points, up to 1024 tokens: 'OpenAI announced a new model today that outperforms GPT-4 on coding benchmarks...' — pay per request using my USDC wallet.

## When to prefer this

Choose this endpoint when you need Anthropic SDK-compatible chat completions backed by Google Gemini models, want pay-per-request billing in USDC via x402 with no subscription, or are building an agent that needs on-chain verifiable AI inference costs. Prefer this over native Google or Anthropic APIs when your stack already uses the Anthropic messages format but you want Gemini models or microtransaction billing.

## Known failure modes

- Insufficient USDC balance causes payment failure and 402 response
- Unsupported model name not in the allowed enum returns a validation error
- max_tokens exceeding 65536 is rejected
- stream:true is not supported and will be rejected (const false)
- Upstream Gemini API unavailability causes 502/503 errors
- Malformed messages array causes 400 bad request

## How this service works

Give agents provider-neutral access to text, image, and speech models with USDC payments on Base, local spending controls, ambiguity-safe recovery, and verified receipts. Stable public npm clients and MIT agent integrations are available now.

## Output

Returns an Anthropic-style JSON message object with role 'assistant', a content array containing a text block, the model name used, and a message ID. Response is non-streaming and includes the generated text completion.

## 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",
    "venice/z-ai-glm-5-3",
    "venice/z-ai-glm-5-3-flash",
    "venice/zai-org-glm-5-2",
    "venice/zai-org-glm-5-1",
    "venice/zai-org-glm-5",
    "venice/z-ai-glm-5-turbo",
    "venice/z-ai-glm-5v-turbo",
    "venice/olafangensan-glm-4.7-flash-heretic",
    "venice/zai-org-glm-4.7-flash",
    "venice/zai-org-glm-4.6",
    "venice/zai-org-glm-4.7",
    "venice/venice-uncensored-1-2",
    "venice/venice-uncensored-role-play",
    "venice/qwen-3-8-2-4t-a95b",
    "venice/qwen-3-8-max",
    "venice/qwen-3-8-27b",
    "venice/qwen-3-7-max",
    "venice/qwen-3-7-plus",
    "venice/qwen-3-6-plus",
    "venice/qwen3-6-27b",
    "venice/qwen3-6-35b-a3b",
    "venice/qwen3-5-9b",
    "venice/qwen3-5-397b-a17b",
    "venice/qwen3-5-35b-a3b",
    "venice/qwen3-235b-a22b-thinking-2507",
    "venice/qwen3-235b-a22b-instruct-2507",
    "venice/qwen3-next-80b",
    "venice/qwen3-vl-235b-a22b",
    "venice/qwen3-coder-480b-a35b-instruct-turbo",
    "venice/grok-4-3",
    "venice/grok-4-5",
    "venice/grok-4-6",
    "venice/grok-4-20",
    "venice/grok-4-20-multi-agent",
    "venice/grok-build-0-1",
    "venice/mistral-small-3-2-24b-instruct",
    "venice/mistral-small-2603",
    "venice/hermes-3-llama-3.1-405b",
    "venice/claude-fable-5",
    "venice/claude-fable-5-1",
    "venice/claude-opus-5",
    "venice/claude-opus-5-fast",
    "venice/claude-opus-4-8",
    "venice/claude-opus-4-8-fast",
    "venice/claude-opus-4-7",
    "venice/claude-opus-4-6",
    "venice/claude-opus-4-5",
    "venice/claude-sonnet-5",
    "venice/claude-sonnet-4-6",
    "venice/claude-sonnet-4-5",
    "venice/openai-gpt-oss-120b",
    "venice/kimi-k2-6",
    "venice/kimi-k2-7-code",
    "venice/kimi-k2-5",
    "venice/kimi-k3",
    "venice/inkling",
    "venice/xiaomi-mimo-v2-5",
    "venice/deepseek-v4-pro",
    "venice/deepseek-v4-flash",
    "venice/deepseek-v4-flash-0731",
    "venice/deepseek-v3.2",
    "venice/seed-2-1-turbo",
    "venice/deepseek-v4-pro-0813",
    "venice/kimi-k3-fast-api",
    "venice/deepseek-v4-flash-0731-fast",
    "venice/aion-labs-aion-3-0",
    "venice/aion-labs-aion-3-0-mini",
    "venice/llama-3.2-3b",
    "venice/llama-3.3-70b",
    "venice/openai-gpt-52",
    "venice/openai-gpt-52-codex",
    "venice/openai-gpt-53
… (truncated)
```

## 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-llm-inference-anthropic-compatible-ce64ad30/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchainrouter.dev](https://www.zero.xyz/host/onchainrouter.dev/llms.txt)
