Onchain Routerby AgenticFI Base Mainnet

Developer documentation

Choose an agent entry point

Select npm clients, OpenClaw, Hermes, or the portable skill without widening wallet authority.

Page tools

<!-- Generated from scripts/fixtures/agent-entrypoints.v1.json by scripts/generate-agent-entry-docs.mjs. -->

Choose one primary path

UseChoose it whenCurrent capability categoriesAuthority boundary
Focused MCPThe agent host supports local stdio MCP and should receive narrow native tools.text_generation, image_generation, text_to_speech, speech_to_textNine bounded tools; every payment uses the shared Buyer Runtime.
Loopback proxyAn OpenAI-compatible client can set a local base URL and API key but cannot perform x402.text_generation, image_generation, text_to_speech, speech_to_textAuthenticated loopback, five non-streaming paid JSON routes; speech returns hosted JSON, not binary audio.
TypeScript or Python SDKApplication code needs typed discovery, all paid JSON endpoints, recovery, and receipts.text_generation, image_generation, text_to_speech, speech_to_textCalls an already-unlocked Buyer Runtime and has no wallet-secret constructor.
Buyer CLIA human is setting up, unlocking, funding, changing policy, diagnosing, or running shell automation.text_generation, image_generation, text_to_speech, speech_to_textHuman wallet authority plus bounded JSON media and explicit owned-file MP3 upload.
Portable Agent SkillThe agent host supports portable skills and can invoke an installed local Buyer CLI.text_generation, image_generation, text_to_speech, speech_to_textThin CLI-only workflows; no independent wallet or payment implementation.
OpenClaw extensionThe agent runs in OpenClaw and should use a native provider plus bounded media tools.text_generation, image_generation, text_to_speech, speech_to_textNative host adapter over the authenticated local proxy; no wallet admin or second signer.
Hermes Agent pluginThe agent runs in Hermes and needs a native provider, media tools, and recovery commands.text_generation, image_generation, text_to_speech, speech_to_textNative host adapter over the authenticated local proxy; no wallet admin or automatic paid retry.

All seven local entry points cover the four current capability categories through direct methods, host providers, or bounded tools. Media uses live model/option validation and the same durable buyer lifecycle. MCP provides nine narrow tools: discovery, chat, messages, images, speech, transcriptions, voices, wallet status, and receipt lookup. MCP limits MP3 Base64 to 1,048,576 characters; portable skill JSON is bounded to 1,000,000 bytes. CLI/SDK/proxy accept at most 25 MiB decoded MP3. The CLI explicit-file path rejects symlinks, special files, non-owned files, and changed files. Speech-to-text requires human permission for provider-retained audio/transcript processing and local acknowledge_provider_retention: true; the SDK removes that flag before sending the API request. Images default to hosted URLs. The proxy returns hosted speech JSON, not OpenAI binary audio, and does not yet support multipart transcription. Do not claim those transport forms work.

One shared contract

  • Canonical origin: https://onchainrouter.dev.
  • Network: Base mainnet eip155:8453.
  • Asset: official Base USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.
  • Models and prices: always read /v1/models and /v1/pricing; never copy a price or assume an alias remains enabled.
  • Paid endpoints: /v1/chat/completions, /v1/messages, /v1/images/generations, /v1/audio/speech, /v1/audio/transcriptions.
  • Example text model at generation time: gemini-3.6-flash. Confirm it against live discovery before a call.
  • Idempotency: create one stable key before the unpaid request and retain it through signing, recovery, and receipt lookup.
  • Inspection: empty, incomplete, or malformed unsigned JSON returns a discovery-only 402. Do not sign an inspection challenge; submit a valid body to obtain the request-specific exact price first.
  • Success: return ok, outcome, idempotencyKey, body, receipt, payment.
  • Failure: return ok, outcome, retry, idempotencyKey, message, reference without secret-bearing diagnostics.

Every adapter delegates wallet custody, integer-atomic budgets, official x402 payment, ambiguity, recovery, and receipt verification to Buyer Runtime. None may contain a second signer or payment implementation.

The private loopback proxy additionally reuses eligible identical text answers within one wallet/agent/session/policy/catalog for up to ten minutes in bounded memory. Explicit idempotency keys bypass this cache and retain the durable recovery path; keep using them when recovery is required. A cache hit is the proxy-only outcome CachedResponse, with x-onchain-router-cache: HIT, x-onchain-router-charge-atomic: 0, the original source idempotency key, and x-onchain-router-source-receipt-id. It is not a new Buyer Runtime success, receipt, or settlement; body usage refers to the original inference. Ordinary payment/receipt headers are omitted on hits. Use Cache-Control: no-cache to refresh, Cache-Control: no-store or JSON cache: false / no_cache: true to bypass, or proxy --no-cache to disable. Tools/media are excluded. Direct SDK/CLI/MCP/public API and provider cached-token pricing are unchanged.

Human-owned setup

The following actions are human-only and must run in a direct terminal:

  • wallet create or import
  • wallet unlock
  • funding
  • legacy Permit2 profile migration
  • policy widening
  • confirmation-policy changes
  • backup or restore
  • key rotation
  • wallet export or exit

Do not send a wallet key, seed phrase, passphrase, broker capability, payment payload, or receipt capability through an agent tool, prompt, environment value, or HTTP request.

Installed-client and public-source entry points are:

Entry pointArtifactInspect or start
Focused MCP@agenticfi/onchain-router-mcponchain-router-mcp --print-config
Loopback proxy@agenticfi/onchain-router-proxyonchain-router-proxy --print-config
TypeScript or Python SDK@agenticfi/onchain-router or onchain-routerOnchainRouterBuyer.connect() or OnchainRouterBuyer()
Buyer CLI@agenticfi/onchain-router-clionchain-router help
Portable Agent Skillskills/onchain-routernode scripts/models.mjs
OpenClaw extensionAgenticFI/onchain-router-openclawopenclaw plugins install git:github.com/AgenticFI/onchain-router-openclaw@v0.1.0 --force
Hermes Agent pluginAgenticFI/onchain-router-hermeshermes plugins install AgenticFI/onchain-router-hermes --enable

Install npm packages only from the @agenticfi scope with the alpha tag. Install OpenClaw and Hermes only from the exact AgenticFI GitHub repositories and pinned release references shown above. Host-native Git installability is independent of ClawHub or PyPI listing status.

Stable outcomes

OutcomeRetry directive
PaymentPolicyRejecteddo_not_retry
UnsupportedNetworkdo_not_retry
UnexpectedAssetdo_not_retry
UnexpectedRecipientdo_not_retry
AuthorizationAboveLocalCapdo_not_retry
InsufficientFundsretry_unpaid_request
Permit2ApprovalRequireddo_not_retry
Permit2ApprovalOutcomeUnknownhuman_review
PaymentVerificationRejectedretry_unpaid_request
ProviderOutcomeUnknownhuman_review
SettlementOutcomeUnknownhuman_review
IdempotencyConflictdo_not_retry
ResultRecoveryExpireddo_not_retry
ReceiptVerificationFailedretry_same_idempotency_key
WalletLockedunlock_wallet
RuntimeUnavailableretry_same_idempotency_key

ProviderOutcomeUnknown and SettlementOutcomeUnknown always require human review. A retry_same_idempotency_key directive means identical request and identical key; it never authorizes a fresh logical request. WalletLocked requires a direct human unlock.

Receipt and output

Return the requested content, selected model, normalized usage, signed exact atomic USDC amount, Base network, transaction, and verified receipt. Hosted media URLs are bearer capabilities: disclose their expiry but avoid logs or public messages containing the complete URL. A receipt proves Onchain Router's settlement and attested usage; it is not an upstream-provider attestation.

Public API discovery

Read /llms.txt, then /v1/models, /v1/pricing, and /openapi.json. Use /v1/audio/voices before text to speech and /v1/balance?address=0x... for a free Base USDC balance check. The public API accepts direct official x402 buyers whether or not a Release B local adapter is installed.

The portable skill source is available at /skill/onchain-router/SKILL.md and requires the public-alpha Buyer CLI. The llms.txt convention and Agent Skills are discovery and workflow mechanisms, not access-control or wallet-authority systems.

Reviewed 2026-09-04Catalog c1f92fac4f1d

Search guides, endpoint references, models, and pricing.