Onchain Routerby AgenticFI

Public API · Base mainnet · USDC payments

Give agents model access.
Keep control of every dollar.

One provider-neutral API for text, images, and speech. Pay per request with USDC through x402, enforce budgets locally, and keep a verified receipt for every completed payment.

Base mainnetUSDCx402 v20% service fee launch promotionMIT clients

Published model rates, a fixed successful-call fee, and minimum measured-usage charge still apply. Read exact pricing.

Buyer RuntimeOne controlled payment path
Guarded
  1. 1
    Request preparedgemini-3.6-flash
    Ready
  2. 2
    Payment terms checkednetwork · asset · exact amount
    Checked
  3. 3
    Budget approvedmodel · session · daily limits
    Approved
  4. 4
    Receipt verifiedcharge · transaction · usage
    Verified
Wallet authorityNever enters the agent prompt
10reviewed models 4live capabilities 5paid AI endpoints 6public npm packages 3public MIT repositories

One payment core, every surface

Meet agents where they already work.

Use the public API directly, install a client from npm, or connect through an agent-native adapter. Every local surface delegates wallet custody, policy, payment, recovery, and receipt verification to the same Buyer Runtime.

Public API

You already have an x402 buyer

Direct API

Send familiar JSON to one HTTPS origin. Bring an official x402 client that supports exact EIP-3009 Base USDC payments.

npm alpha · 0.1.2

You are building a Node.js application

TypeScript SDK

Typed discovery and paid calls over the Buyer Runtime, with one recovery and receipt contract for every capability.

npm alpha · 0.1.2

You work in a terminal

Buyer CLI

Create and unlock a dedicated wallet, set budgets, make requests, recover outcomes, and inspect receipts.

npm alpha · 0.1.2

Your agent uses native tools

MCP

Nine focused tools for discovery, generation, wallet status, and receipts. Local stdio, with human-owned wallet setup.

npm alpha · 0.1.2

Your app accepts an OpenAI base URL

Local OpenAI proxy

A protected loopback adapter handles payments locally and caches eligible identical text responses for ten minutes.

MIT source · alpha

Your coding agent follows reusable instructions

Agent Skill

Discovery, payment, and recovery guidance over the installed Buyer CLI. The agent never receives your wallet key.

GitHub alpha · 0.1.0

You use OpenClaw agents

OpenClaw

A native provider, live policy-filtered models, bounded media tools, and same-key retry protection through the local proxy.

GitHub alpha · 0.1.0

You use Hermes Agent

Hermes Agent

A native model provider, media tools, in-session discovery, diagnostics, and deliberate recovery commands.

Shared financial control plane

Buyer Runtime

Encrypted wallet, integer-atomic budgets, official x402 payment, ambiguity-safe recovery, and verified receipts. Setup, unlock, funding, and policy widening stay human-only.

Understand the runtime

Available now

One API across four kinds of work.

10 reviewed models across 4 live capability categories. Discover availability and integer-backed pricing before your agent authorizes payment.

Gemini currently serves text and image generation. ElevenLabs serves the public MP3 speech routes. The interface is provider-neutral; the live catalog is authoritative. Video is not available.

From install to first result

Start with familiar tools.

The TypeScript SDK, CLI, MCP server, proxy, Buyer Runtime, and routing package are public npm alphas. Pin the alpha tag and keep wallet setup in a human-controlled terminal.

Public npm alpha · requires human setup and an unlocked Buyer Runtime.

npm install @agenticfi/onchain-router@alpha

import { OnchainRouterBuyer } from '@agenticfi/onchain-router';

const requestKey = process.env.REQUEST_ID;
if (!requestKey) throw new Error('Set a persisted REQUEST_ID');
const buyer = await OnchainRouterBuyer.connect();
try {
  const result = await buyer.chat({
    "model": "gemini-3.6-flash",
    "messages": [
      {
        "role": "user",
        "content": "Explain x402 in one sentence."
      }
    ],
    "max_tokens": 128,
    "stream": false
  }, requestKey);
  if (!result.ok) throw new Error(`${result.outcome}: ${result.message}`);
  console.log(result.body);
  console.log(result.receipt.id, result.payment.actualAtomic);
} finally {
  buyer.close();
}

Public npm alpha · setup, unlock, and policy changes stay human-only.

npm install --global @agenticfi/onchain-router-cli@alpha
onchain-router setup
onchain-router policy show
onchain-router unlock
onchain-router models

Public npm alpha · prints a local stdio configuration without exposing wallet secrets.

npm install --global @agenticfi/onchain-router-mcp@alpha
onchain-router-mcp --print-config

Public API · this plain request inspects the unpaid challenge and does not sign or spend USDC.

request_key="$(node -p 'require("node:crypto").randomUUID()')"
curl -i https://llm.agenticfi.wtf/v1/chat/completions \
  -H 'content-type: application/json' \
  -H "x-idempotency-key: $request_key" \
  --data '{"model":"gemini-3.6-flash","messages":[{"role":"user","content":"Explain x402 in one sentence."}],"max_tokens":128,"stream":false}'

Payment with a paper trail

Built for controlled autonomy.

Agents can discover, choose, and pay for models without receiving the wallet key or permission to widen a budget.

01

Validate before signing

Network, asset, recipient, expiry, scheme, request identity, model, and exact amount must all match local policy.

02

Never retry ambiguity blindly

Provider-unknown and settlement-unknown outcomes stop for review. Recovery preserves the exact request identity.

03

Release only after durability

The service releases a successful result only after settlement evidence and a durable receipt are stored.

04

Cache without a new charge

The loopback proxy can reuse eligible identical text responses for ten minutes and identifies the source receipt.

Transparent catalog

Know the price before you sign.

Prices are published by token, image, character, or audio duration. The live 402 challenge supplies one request-specific exact amount; the durable receipt records payment and normalized usage.

The launch promotion is 0% service markup. A fixed successful-call fee and minimum usage charge are separate and disclosed.

Compare every model

One current example per capability

  • Text & reasoninggemini-3.6-flash$1.5 input · $7.5 output per 1M tokens
  • Image generationgemini-3.1-flash-lite-image1K (default) $0.035000
  • Text to speechelevenlabs/flash-v2.5$0.05 per 1K characters
  • Speech to textelevenlabs/scribe-v2$0.22 per audio hour

Inspect the integration layer

Open where trust matters.

The proprietary gateway and provider credentials remain private. The software that holds buyer policy, signs payments, integrates agent hosts, and verifies receipts is available for review under MIT.

Build on the public alpha

Give your agent a budget.
Then give it a model.

Start with the Buyer CLI, or bring an official x402 buyer to the public API.