{"uid":"cap_Qk0Y5XbohHP2kx2peKAcw","slug":"api-the402-ai-6afdf898","name":"the402.ai Code Execution Service","description":"Purchase: Code Execution","url":"https://api.the402.ai/v1/services/svc_a844123f03b8401a/purchase","method":"POST","headers":{},"bodySchema":null,"responseSchema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string"},"thread_id":{"type":"string"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WVYs57Zs_YPd02d-ZlUqe","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Purchases and executes code on the the402.ai AI agent service marketplace for $0.005 USDC per call","exampleAgentPrompt":"Run this Python snippet for me on the402.ai — it calculates the Fibonacci sequence up to n=20 — and return the output.","exampleUseCases":null,"resultDescription":"The agent receives confirmation of a purchased code execution job, including a job ID and execution output or a reference to poll for results via the platform's job status endpoint.","failureModes":["Insufficient USDC balance — payment fails and execution is not triggered","Invalid or malformed code input — returns error with details","Service unavailable on the402.ai platform — 503 or timeout","Payment authorization failure — x402 payment header rejected","Job times out during execution — returns partial or error result"],"whenToPreferThis":"Use this endpoint when you need to execute arbitrary code in a pay-per-use model via the the402.ai marketplace, especially when operating as an AI agent with a USDC wallet and requiring on-demand, low-cost ($0.005) compute without managing your own infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T14:26:27.148Z","isFirstParty":false}