OpenClaw model provider

agent402-openclaw · npm · MIT

An OpenClaw plugin that adds Agent402 as a model provider: the routed auto model and every model the gateway lists, priced per call. A loopback proxy pays Agent402 and forwards, so OpenClaw only ever sees a local OpenAI-compatible URL. The same key or wallet reaches the tool catalog.

Install

openclaw plugins install agent402-openclaw

Example

openclaw plugins install agent402-openclaw
npx agent402-openclaw setup --write   # no key? it creates a wallet and prints the address to fund
openclaw gateway restart

What it exposes

  • auto (routed per prompt) plus every model id from GET /v1/models.
  • Explicit models go to the metered route by default, where each request is quoted from its body; --flat keeps them on flat per-call tiers.
  • CLI commands: setup, proxy, doctor, wallet, permit2-approve.

How payment works

  • A prepaid credits key: card balance, metered calls debited at actual usage.
  • A wallet: USDC on Base over x402, exact by default; after a one-time permit2-approve, the quote becomes a ceiling and the call settles at actual usage.
  • The proxy answers loopback only and refuses browser-originated requests, so a web page cannot spend the key.
# pay by card instead: buy a credits pack, then
AGENT402_CREDITS_KEY=a402_... npx agent402-openclaw setup --write

# no OpenClaw? run the proxy alone and point any OpenAI client at it
npx agent402-openclaw proxy   # http://127.0.0.1:8412/v1, model "auto"

A call that fails is not charged: settlement runs after the tool and only on a successful response. Background: Pay-per-call APIs · Agent payments.

Tools to try first

Chat completions - metered (pay what the call costs)$0.001
v1-chat-metered
Chat completions (OpenAI-compatible)$0.02
v1-chat
Embeddings (OpenAI-compatible)$0.002
v1-embeddings
Web search$0.02
search
Web answer$0.08
answer

Every tool, price and input schema: the catalog.

Links

agent402-openclaw on npm · source on GitHub
Guides: Use Agent402 as your OpenClaw model provider - pay by card, no wallet · Use Agent402 from Claude Code, Cursor, VS Code, Windsurf, Cline, Roo Code, Codex CLI, Gemini CLI, Muse Code, Continue, ElizaOS, AgentCore and any OpenAI SDK
All integrations