{"uid":"cap_hJWGNgQkgp8r0utZcmBA7","slug":"x402engine-gpt-5-2-codex-llm-api-d122edcd","name":"x402engine GPT-5.2 Codex LLM API","description":"108 production APIs behind HTTP 402 micropayments. 72 LLMs, Kling V3 and Hailuo video generation, image generation, code execution, travel search, web scraping, TTS, and transaction simulation. Pay with USDC on Base, USDm on MegaETH, or USDC on Solana.","url":"https://x402engine.app/api/llm/gpt-5.2-codex","method":"POST","headers":{},"bodySchema":null,"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.06","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.06/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.06","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.06","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_YyY8DROmXHnCMk4hiQiy_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.06","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs inference against GPT-5.2 Codex via a pay-per-call HTTP 402 micropayment endpoint on x402engine, billed at $0.06 USDC per call","exampleAgentPrompt":"Write me a Python function that takes a list of integers and returns the top-K elements using a heap — use the GPT-5.2 Codex model on x402engine and pay per call with USDC.","exampleUseCases":[{"title":"Agent-powered code generation","prompt":"I need you to write a TypeScript function that fetches paginated data from a REST API and handles rate limiting — use GPT-5.2 Codex via x402engine and charge my USDC wallet per call."},{"title":"LLM inference without API key setup","prompt":"Can you run this prompt through GPT-5.2 Codex: 'Refactor this SQL query for performance' — I want to use x402engine's pay-per-call so I don't need to manage an OpenAI subscription."},{"title":"Automated coding assistant in CI pipeline","prompt":"In my build pipeline, send this failing test case to GPT-5.2 Codex on x402engine and ask it to suggest a fix — pay $0.06 USDC per inference call from the agent wallet."}],"resultDescription":"Returns a text completion from GPT-5.2 Codex, typically including the generated code or text response, token usage statistics, and model metadata. The response follows standard LLM completion structure.","failureModes":["Insufficient USDC balance causes 402 payment required error with no completion returned","Malformed prompt or missing required fields returns 400 bad request","Model overload or rate limiting may return 429 too many requests","Invalid or expired payment credential returns 401 unauthorized","Long prompts exceeding context window return context length exceeded error"],"whenToPreferThis":"Choose this endpoint when you need GPT-5.2 Codex-class code generation capability in an agent pipeline without managing OpenAI API keys or subscriptions, and when your agent already holds USDC on Base, USDm on MegaETH, or USDC on Solana for micropayment billing. Ideal for per-call, pay-as-you-go inference patterns where predictable $0.06 per call cost is acceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:44:27.778Z","isFirstParty":false}