{"uid":"cap_mSGM18vQm70Hpny7speNm","slug":"x402-ai-apis-gpt-5-chat-completions-22da542b","name":"x402 AI APIs – GPT-5 Chat Completions","description":"Paid AI API endpoints via x402 micropayments","url":"https://x402-ai-peach.vercel.app/api/gpt5","method":"POST","headers":{},"bodySchema":{"type":"object","required":["messages"],"properties":{"stream":{"type":"boolean","description":"Stream response"},"messages":{"type":"array","description":"Chat messages array"},"max_tokens":{"type":"integer","description":"Max tokens"},"temperature":{"type":"number","description":"Temperature"}}},"responseSchema":{"type":"object","properties":{"id":{"type":"string","description":"Response ID"},"choices":{"type":"array","items":{"type":"object","properties":{"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}}}}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.15","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.15/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ysH9E7jUvNLOIEFhAuLv4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.15","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Provides GPT-5 chat completions via a pay-per-call x402 micropayment API endpoint","exampleAgentPrompt":"Using the GPT-5 endpoint, send these messages to get a completion: system message 'You are a helpful assistant', user message 'Explain quantum entanglement in plain English' — stream the response and allow up to 512 tokens.","exampleUseCases":[{"title":"Autonomous agent reasoning step","prompt":"I need you to call the GPT-5 chat API with this conversation history and get its next response — use temperature 0.2 and cap output at 300 tokens so we stay concise."},{"title":"Creative writing generation","prompt":"Send these messages to GPT-5: a system prompt saying 'You are a creative fiction writer' and my user message 'Write the opening paragraph of a noir detective story set in Tokyo' — stream the response back to me."},{"title":"Code explanation on demand","prompt":"Ask GPT-5 to explain this Python snippet to me in simple terms — pass it as a user message, keep temperature at 0 for a precise answer, and allow up to 400 tokens."}],"resultDescription":"Returns a JSON object containing a response ID and a choices array; each choice has a message object with a role (e.g. 'assistant') and content string containing the generated text. Supports streaming mode for incremental token delivery.","failureModes":["Payment failure if wallet lacks sufficient USDC balance — returns 402 Payment Required","Invalid or missing messages array — returns 400 Bad Request","Temperature or max_tokens out of valid range — returns 400 validation error","Model capacity issues or upstream OpenAI errors — returns 500 or 503","Streaming requested but connection dropped mid-response — partial content received"],"whenToPreferThis":"Choose this endpoint when you need pay-per-call access to GPT-5 without a monthly OpenAI subscription, especially in agentic pipelines where you want fine-grained cost control via x402 micropayments. Prefer it over direct OpenAI API calls when your infrastructure is built around x402 payment rails or when you want to avoid API key management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:39:54.471Z","isFirstParty":false}