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;
--flatkeeps them on flat per-call tiers. - CLI commands:
setup,proxy,doctor,wallet,permit2-approve.
How payment works
- A credits key bought earlier: 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.
# already hold a credits key? use it instead of a wallet
AGENT402_CREDITS_KEY=a402_... npx agent402-openclaw setup --write
# no OpenClaw? run the proxy alone and point any OpenAI client at it;
# install it with its wallet peers in one folder and run it from there
npm i agent402-openclaw @x402/fetch @x402/evm viem
export AGENT402_WALLET_KEY=0x... # an EVM key holding USDC on Base
npx agent402-openclaw proxy # http://127.0.0.1:8412/v1, model "auto"
A paid call that ends in any status of 400 or above is not charged over x402: 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
Chat completions (OpenAI-compatible)$0.02
Embeddings (OpenAI-compatible)$0.002
Web search$0.01
Web answer$0.08
Every tool, price and input schema: our tools.
Links
- agent402-openclaw on npm
- source on GitHub
- Guide: Use Agent402 as your OpenClaw model provider - pay per call
- Guide: Use Agent402 from Claude Code, Cursor, VS Code, Windsurf, Cline, Roo Code, Codex CLI, Gemini CLI, Continue, ElizaOS, Paperclip, HarnessRouter, AgentCore and any OpenAI SDK
- All integrations