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 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

Every tool, price and input schema: our tools.

Links