insumer_buy_key
Purchase an API key by sending USDC, USDT, or BTC to the provided wallet. No email or authentication needed. Volume discounts reduce cost per call from $0.04 to $0.02.
Instructions
Buy a new API key with USDC, USDT, or BTC (no auth required). Agent-friendly: no email needed. Send USDC/USDT to EVM wallet 0xAd982CB19aCCa2923Df8F687C0614a7700255a23 or Solana wallet 6a1mLjefhvSJX1sEX8PTnionbE9DqoYjU6F6bNkT4Ydr. Send BTC to bc1qg7qnerdhlmdn899zemtez5tcx2a2snc0dt9dt0 (1 confirmation required). USDC/USDT auto-detected from transaction. BTC converted to USD at market rate. One key per wallet — use insumer_buy_credits to top up. Volume discounts: $5–$99 = $0.04/call, $100–$499 = $0.03, $500+ = $0.02. Non-refundable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txHash | Yes | Transaction hash proving payment | |
| chainId | Yes | Payment chain: 1, 8453, 137, 42161, 10, 56, 43114, 'solana', or 'bitcoin'. EVM/Solana accept USDC and USDT (auto-detected). Bitcoin accepts BTC (converted to USD at market rate). | |
| amount | No | Stablecoin amount sent (minimum 5). Not required for BTC — USD value derived from on-chain amount at market rate. | |
| appName | Yes | Name for the API key (e.g. your agent or app name) |
Implementation Reference
- src/index.ts:457-470 (registration)Registration of the 'insumer_buy_key' tool on the MCP server. It defines the tool name, description, schema (txHash, chainId, amount, appName), and a handler that makes a public (unauthenticated) POST request to /keys/buy endpoint.
server.tool( "insumer_buy_key", "Buy a new API key with USDC, USDT, or BTC (no auth required). Agent-friendly: no email needed. Send USDC/USDT to EVM wallet 0xAd982CB19aCCa2923Df8F687C0614a7700255a23 or Solana wallet 6a1mLjefhvSJX1sEX8PTnionbE9DqoYjU6F6bNkT4Ydr. Send BTC to bc1qg7qnerdhlmdn899zemtez5tcx2a2snc0dt9dt0 (1 confirmation required). USDC/USDT auto-detected from transaction. BTC converted to USD at market rate. One key per wallet — use insumer_buy_credits to top up. Volume discounts: $5–$99 = $0.04/call, $100–$499 = $0.03, $500+ = $0.02. Non-refundable.", { txHash: z.string().describe("Transaction hash proving payment"), chainId: UsdcChainIdWithBitcoin, amount: z.number().min(5).optional().describe("Stablecoin amount sent (minimum 5). Not required for BTC — USD value derived from on-chain amount at market rate."), appName: z.string().max(100).describe("Name for the API key (e.g. your agent or app name)"), }, async (args) => { const result = await publicApiCall("POST", "/keys/buy", args); return formatResult(result); } ); - src/index.ts:466-469 (handler)Handler function for insumer_buy_key: calls publicApiCall to POST /keys/buy with the input args (txHash, chainId, amount, appName), then formats the result.
async (args) => { const result = await publicApiCall("POST", "/keys/buy", args); return formatResult(result); } - src/index.ts:460-464 (schema)Input schema for insumer_buy_key using Zod validation: txHash (string), chainId (UsdcChainIdWithBitcoin union type), amount (optional number, min 5), appName (string max 100 chars).
{ txHash: z.string().describe("Transaction hash proving payment"), chainId: UsdcChainIdWithBitcoin, amount: z.number().min(5).optional().describe("Stablecoin amount sent (minimum 5). Not required for BTC — USD value derived from on-chain amount at market rate."), appName: z.string().max(100).describe("Name for the API key (e.g. your agent or app name)"), - src/index.ts:113-123 (helper)Zod schema UsdcChainIdWithBitcoin used in the chainId parameter of insumer_buy_key. Supports EVM chain IDs (1, 8453, 137, 42161, 10, 56, 43114), 'solana', or 'bitcoin'.
const UsdcChainIdWithBitcoin = z .union([ z.enum(["1", "8453", "137", "42161", "10", "56", "43114"]).transform(Number), z.number().int().refine( (n) => [1, 8453, 137, 42161, 10, 56, 43114].includes(n), "Must be a supported payment chain" ), z.literal("solana"), z.literal("bitcoin"), ]) .describe("Payment chain: 1, 8453, 137, 42161, 10, 56, 43114, 'solana', or 'bitcoin'. EVM/Solana accept USDC and USDT (auto-detected). Bitcoin accepts BTC (converted to USD at market rate)."); - src/index.ts:42-59 (helper)The publicApiCall helper function used by insumer_buy_key's handler. Unlike apiCall, it does NOT include an X-API-Key header, making the call unauthenticated (since buying a key doesn't require an existing API key).
async function publicApiCall( method: string, path: string, body?: Record<string, unknown> ): Promise<{ ok: boolean; data?: unknown; error?: unknown; meta?: unknown }> { const url = `${API_BASE}${path}`; const res = await fetch(url, { method, headers: { "Content-Type": "application/json" }, body: body ? JSON.stringify(body) : undefined, }); return res.json() as Promise<{ ok: boolean; data?: unknown; error?: unknown; meta?: unknown; }>; }