{"uid":"cap_YebT07UtuadT_2kh8NAsF","slug":"tanship-payai-console-ai-code-generation-x402-9877f137","name":"Tanship PayAI Console — AI Code Generation (x402)","description":"Payment-gated AI and browser automation API using the x402 protocol. All /v1/* endpoints require USDC payment on Base (eip155:8453) via x402 v2 exact scheme.","url":"https://x402.tanship.dev/v1/ai/code","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"1","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":"$1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PipVFJj88qzK78JjUQC5F","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates code via a payment-gated AI endpoint requiring USDC micropayment on Base via the x402 protocol","exampleAgentPrompt":"Write me a Python function that parses a CSV file and returns the top 5 rows sorted by a given column — pay the $0.005 USDC fee via x402 and give me the code.","exampleUseCases":[{"title":"Automated boilerplate code generation","prompt":"Generate a TypeScript Express.js REST API boilerplate with GET and POST routes for a /users endpoint — use the Tanship AI code API and pay with USDC."},{"title":"On-demand script creation for data tasks","prompt":"Write me a Python script that reads a JSON file, filters records where 'status' equals 'active', and outputs the results to a new JSON file."},{"title":"Per-call AI coding assistant for CI pipeline","prompt":"Generate a Bash script that checks if a Docker container named 'app-server' is running and restarts it if not — I need this for my CI pipeline."}],"resultDescription":"Returns AI-generated code as a response body, containing the requested code snippet, function, script, or program based on the natural language prompt submitted in the HTTP body. Payment is settled on-chain via x402 before the response is delivered.","failureModes":["Payment not included or insufficient USDC — returns HTTP 402 Payment Required","Invalid body type not matching json/form-data/text enum — returns validation error","Malformed input object missing required fields (type, method, bodyType, body) — returns 400","Network or blockchain payment settlement failure — payment not confirmed","Ambiguous or unsupported code generation prompt — may return incomplete or empty code output"],"whenToPreferThis":"Choose this endpoint when you need AI-generated code and want to pay per-call in USDC without a subscription, especially in autonomous agent workflows that use the x402 micropayment protocol on Base. Ideal for agentic pipelines that programmatically generate code on demand and need a trustless, blockchain-settled payment model.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:50:46.288Z","isFirstParty":false}