{"uid":"cap_HoA0qA-tz4z6P3le8oocE","slug":"bitcoin-benji-ai-code-generation-9f1b7d83","name":"Bitcoin Benji AI Code Generation","description":"L402-gated APIs: real-time Bitcoin mempool intelligence and private AI inference. Pay-per-call via Lightning. Zero API keys. Zero subscriptions.","url":"https://api.bitcoinbenji.com/ai/code-generate","method":"POST","headers":{},"bodySchema":null,"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.04","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.04/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PrA8u8v_bTL_SR09tWURq","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.04","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates code snippets or scripts on demand via a pay-per-call Lightning-native AI inference endpoint, gated by L402 micropayments.","exampleAgentPrompt":"Write me a Python function that connects to a Bitcoin Lightning node, checks the channel balance, and returns it as a dictionary — pay for it with a Lightning micropayment.","exampleUseCases":[{"title":"Lightning-paid boilerplate generation","prompt":"Generate a Node.js Express server boilerplate with routes for a REST API that handles user authentication — pay the $0.04 Lightning fee automatically."},{"title":"Bitcoin scripting assistance","prompt":"Write me a Python script that parses raw Bitcoin transactions and extracts the sender, receiver, and amount from each output."},{"title":"Quick utility function on demand","prompt":"Generate a TypeScript utility function that takes an array of objects and groups them by a specified key, with full type annotations."}],"resultDescription":"A JSON response containing AI-generated code based on the provided prompt, returned after successful L402 Lightning payment verification. Typically includes the generated code as a string, potentially with metadata about the generation.","failureModes":["Payment not provided or Lightning invoice expired — returns HTTP 402 with a new invoice","Malformed or missing prompt in request body — returns 400 Bad Request","AI inference backend unavailable — returns 503 Service Unavailable","Generated code may be incorrect or incomplete for complex tasks","Rate limits or quota exceeded on the underlying AI provider"],"whenToPreferThis":"Choose this endpoint when you need pay-per-call AI code generation without API keys or subscriptions, especially in Bitcoin/Lightning-native agentic workflows where micropayments via L402 are already part of the stack. Ideal for agents that need to generate code on demand without committing to a monthly subscription to a traditional AI provider.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:39:50.586Z","isFirstParty":false}