An OpenRouter alternative, where you have guarantee that you are getting responses from the model you requested, and not a cheaper/smaller model. With proofs of correct model being called provided by Reclaim Protocol
You can pay for each request, without having to buy a subscription or credits using USDC on Base Network.
Install the LLM x402 client
npm install @reclaimprotocol/llm-x402-client
import { LLMClient } from '@reclaimprotocol/llm-x402-client';
Call the LLM
const client = new LLMClient({
apiUrl: "https://llm-x402.reclaimprotocol.org",
walletPrivateKey: process.env.X402_WALLET_PRIVATE_KEY,
network: 'base',
});
const result = await client.callLlm({
model,
messages: [
{ role: 'user', content: message }
],
});
You can use a private key that you own on Base Network. If you don't own one, you can create one using
npx create-wallet
You must then send USDC and some ETH to the above wallet.
Make sure you add the private key to your .env.local file
LLM_API_URL=https://llm-x402.reclaimprotocol.org/api/call-llm
X402_NETWORK=base
X402_WALLET_PRIVATE_KEY=0x...
Currently supports Anthropic, OpenAI and Google (soon) You can see supported models on Supported Models page
When initializing LLMClient, you can pass your own self hosted x402 server as apiUrl.
To self host,
$ git clone https://github.com/reclaimprotocol/llm-x402.git
Set these in the .env file
# API Keys for LLM Providers
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-proj-...
GOOGLE_API_KEY=AI...
# x402 Payment Configuration
X402_WALLET_ADDRESS=0x...
X402_NETWORK=base
# CDP API Keys for mainnet facilitator
CDP_API_KEY_ID=...
CDP_API_KEY_SECRET=...
# Reclaim Protocol zkFetch Configuration
RECLAIM_APP_ID=...
RECLAIM_APP_SECRET=...
LLM API Keys :
Payment configuration
CDP API Keys
Reclaim API Keys
$ npm run build && npm run start