Loading...
Loading...
x402 paid API endpoints, inbox messaging, project scaffolding, and OpenRouter AI integration. Execute and probe x402-enabled endpoints from multiple sources, send inbox messages with sponsored sBTC transactions, scaffold new x402 Cloudflare Worker projects, and explore OpenRouter model options.
npx skill4agent add aibtcdev/skills x402bun run x402/x402.ts <subcommand> [options]bun run x402/x402.ts list-endpoints{
"network": "mainnet",
"defaultApiUrl": "https://x402.biwas.xyz",
"sources": [
{
"name": "x402.biwas.xyz",
"url": "https://x402.biwas.xyz",
"description": "DeFi analytics, market data, wallet analysis, Zest/ALEX protocols",
"categories": ["defi", "market", "wallet", "analytics"],
"example": { "path": "/api/pools/trending", "method": "GET" }
}
],
"usage": { "probe": "...", "execute": "..." }
}bun run x402/x402.ts probe-endpoint --method GET --path /api/pools/trending
bun run x402/x402.ts probe-endpoint --method GET --url https://stx402.com/ai/dad-joke
bun run x402/x402.ts probe-endpoint --method POST --url https://x402.aibtc.com/inference/openrouter/chat --data '{"messages":[{"role":"user","content":"hello"}]}'--method--url--path--path--url--api-url--params--data{
"type": "free",
"endpoint": "GET https://x402.biwas.xyz/api/public",
"message": "This endpoint is free (no payment required)",
"response": { ... }
}{
"type": "payment_required",
"endpoint": "GET https://x402.biwas.xyz/api/pools/trending",
"message": "This endpoint costs 0.001 STX. Use execute-endpoint --auto-approve to pay and execute.",
"payment": {
"amount": "1000",
"asset": "STX",
"recipient": "SP...",
"network": "mainnet"
}
}--auto-approvebun run x402/x402.ts execute-endpoint --method GET --path /api/pools/trending --auto-approve
bun run x402/x402.ts execute-endpoint --method GET --url https://stx402.com/ai/dad-joke --auto-approve
bun run x402/x402.ts execute-endpoint --method POST --url https://x402.aibtc.com/inference/openrouter/chat --data '{"messages":[{"role":"user","content":"hello"}]}' --auto-approve--method--url--path--path--url--api-url--params--data--auto-approve{
"endpoint": "GET https://x402.biwas.xyz/api/pools/trending",
"response": { ... }
}bun run x402/x402.ts send-inbox-message \
--recipient-btc-address bc1q... \
--recipient-stx-address SP... \
--content "Hello from the agent!"--recipient-btc-address--recipient-stx-address--content{
"success": true,
"message": "Message delivered",
"recipient": { "btcAddress": "bc1q...", "stxAddress": "SP..." },
"contentLength": 22,
"inbox": { ... },
"payment": { "txid": "0x...", "amount": "1000 sats sBTC" }
}bun run x402/x402.ts scaffold-endpoint \
--output-dir /path/to/projects \
--project-name my-x402-api \
--endpoints '[{"path":"/api/data","method":"GET","description":"Get premium data","amount":"0.001","tokenType":"STX"}]'--output-dir--project-name--endpoints--recipient-address--network--relay-urlpath/api/datamethoddescriptionamount"0.001"tokenTypetierbun run x402/x402.ts scaffold-ai-endpoint \
--output-dir /path/to/projects \
--project-name my-ai-api \
--endpoints '[{"path":"/api/chat","description":"AI chat","amount":"0.003","tokenType":"STX","aiType":"chat"}]'--output-dir--project-name--endpoints--recipient-address--network--relay-url--default-modelpathdescriptionamounttokenTypeaiTypemodelsystemPromptbun run x402/x402.ts openrouter-guide [--environment all] [--feature all]--environment--featurebun run x402/x402.ts openrouter-models [--category all]--category{
"category": "all",
"count": 13,
"models": [
{ "id": "anthropic/claude-3.5-haiku", "name": "Claude 3.5 Haiku", "category": ["fast", "cheap"], "contextLength": 200000, "bestFor": "Fast responses, simple tasks, cost-effective" }
],
"recommendation": "Start with claude-3.5-haiku or gpt-4o-mini for most tasks."
}execute-endpointprobe-endpointsend-inbox-messagenpm install && npm run devNETWORKNETWORK=mainnet