Setup guide · Devnet beta
From zero to your first call
in about ten minutes.
You need a small wallet that holds a little devUSDC, and one of three ways to call the API: a Claude or Codex tool, or a short script. The wallet only pays the few cents per call and can't touch your locks.
Make a small payer wallet.
- Use a new, separate wallet with a few dollars at most. It is only for paying API fees. Never use the wallet that owns your locks.
- Create the file. Any Solana keypair JSON works, for example solana-keygen new --outfile payer.json.
- Add devUSDC. Get free test devUSDC from the Solve3 devnet faucet by connecting the wallet (100 per day), or send some to the wallet's address. It must be the devUSDC token (FrN7oi…).
- No SOL needed to pay. The payment service covers the network fee. devUSDC is enough.
Get the connector.
The connector is a small program (an MCP server) that lets an AI assistant call the API for you. During the beta it ships from the Solve3 agent repository; a published package is planned.
git clone https://github.com/solve3fi/X402-agent.git cd X402-agent npm install
You need Node.js 22 or newer. Access to the repository is required during the beta.
Connect it as a tool.
Replace /path/to with your real paths. After connecting, restart the app.
Claude Code
One command:
claude mcp add solve3-agent \ -e SOLVE3_PAYER_KEYPAIR_PATH=/path/to/payer.json \ -- node --import tsx /path/to/X402-agent/src/mcp.ts
Claude Desktop
Add to claude_desktop_config.json (Settings, Developer, Edit config):
{
"mcpServers": {
"solve3-agent": {
"command": "node",
"args": ["--import", "tsx", "/path/to/X402-agent/src/mcp.ts"],
"env": { "SOLVE3_PAYER_KEYPAIR_PATH": "/path/to/payer.json" }
}
}
}Codex
Add to ~/.codex/config.toml:
[mcp_servers.solve3-agent]
command = "node"
args = ["--import", "tsx", "/path/to/X402-agent/src/mcp.ts"]
env = { SOLVE3_PAYER_KEYPAIR_PATH = "/path/to/payer.json" }Try it.
Ask your assistant in plain English. It picks the right tool and pays automatically.
- "What can wallet <address> claim on Solve3?"
- "Show this week's Solve3 pools and suggest how to vote lock 6."
- "Build the transaction to claim everything for <address>. Don't send it."
- "How much have I spent on Solve3 calls today?"
Tools available: gauges, locks, claimable, vote plan, auto-vote status, and builders for claim-all, vote, lock, add to lock and auto-vote on or off, plus a free spend check.
Built-in spending limits.
- Per-call limit: refuses anything above $0.05 (change with SOLVE3_MAX_PRICE_PER_CALL_USD).
- Daily limit: $1.00 a day, remembered across restarts (change with SOLVE3_DAILY_CAP_USD).
- Only pays Solve3: it refuses to pay any address other than the Solve3 treasury, or any token it doesn't recognise.
- Never signs for you: transaction tools return unsigned transactions. You review and sign them yourself, for example on the agent page.
Call it from a script.
See the price
An unpaid request shows the 402 challenge:
curl -i https://agent.solve3.fi/v1/gauges # HTTP/1.1 402 Payment Required <- the price and who to pay, in the payment-required header
Pay and read
An x402 client pays and retries for you:
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactSvmScheme } from "@x402/svm/exact/client";
import { createKeyPairSignerFromBytes } from "@solana/kit";
import { readFileSync } from "node:fs";
const signer = await createKeyPairSignerFromBytes(
Uint8Array.from(JSON.parse(readFileSync("payer.json", "utf8"))),
);
const client = new x402Client().register("solana:*", new ExactSvmScheme(signer));
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://agent.solve3.fi/v1/claimable/<wallet>");
console.log(await res.json());Sign what it builds
Transaction routes return unsigned transactions:
import { Connection, Transaction } from "@solana/web3.js";
// bundle = the JSON returned by a /v1/tx/... call; wallet = the owner's Keypair
for (const t of bundle.transactions) {
const tx = Transaction.from(Buffer.from(t.transaction, "base64"));
tx.sign(wallet); // the owner signs; the API never does
await connection.sendRawTransaction(tx.serialize());
}
// Transactions expire after about a minute (see lastValidBlockHeight), so sign soon after building.If something goes wrong.
- "Payment required". The connector has no payer wallet. Check SOLVE3_PAYER_KEYPAIR_PATH and restart the assistant.
- "refused: … limit". A spending limit stopped a payment, which is the safety working. Raise the limit only if you meant to.
- Payment fails. The wallet needs devUSDC (FrN7oi…) and it must already have a token account for it. Receiving USDC from the faucet creates one.
- "Could not reach the API". You weren't charged. Try again in a minute, and check https://agent.solve3.fi/health.
- The transaction expired. Build it again and sign within a minute.
You're set. Ask away.
Devnet beta. Test tokens have no monetary value, and suggestions are estimates, not advice.