{"uid":"cap_lMBTHpEXolenCRwqs5Lzp","slug":"token4u-ai-chat-completions-8bbd148f","name":"Token4u AI Chat Completions","description":"gpt-4o-mini API call (~128 tokens)","url":"https://token4u.ai/v1/chat/completions","method":"POST","headers":{},"bodySchema":null,"responseSchema":{"type":"json","schema":{"type":"object","required":["id","object","created","model","choices","usage"],"properties":{"id":{"type":"string"},"model":{"type":"string"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"total_tokens":{"type":"integer"},"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"}}},"object":{"enum":["chat.completion"],"type":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string"},"content":{"type":"string"}}},"finish_reason":{"type":"string"}}}},"created":{"type":"integer"}}},"example":{"id":"chatcmpl-abc123","model":"gpt-4o-mini","usage":{"total_tokens":18,"prompt_tokens":10,"completion_tokens":8},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! How can I help you today?"},"finish_reason":"stop"}],"created":1753000000},"payload":{"id":"chatcmpl-abc123","model":"gpt-4o-mini","usage":{"total_tokens":18,"prompt_tokens":10,"completion_tokens":8},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! How can I help you today?"},"finish_reason":"stop"}],"created":1753000000}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vH-bfq6c6y55eke9nBX_G","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pay-per-request AI chat completion endpoint using x402 micro-USDC payments, returning OpenAI-compatible responses","exampleAgentPrompt":"Ask Token4u to answer 'What are three tips for writing clean Python code?' using gpt-4o-mini, paying per request in micro-USDC.","exampleUseCases":[{"title":"Crypto-native AI chatbot backend","prompt":"I'm building a Web3 app and need an AI chat backend that bills users automatically in USDC per message — use Token4u to send 'Explain what a smart contract is in one sentence' and return the response."},{"title":"Pay-as-you-go LLM for agent pipeline","prompt":"My automation pipeline needs to call an AI model only a few times a day, so I don't want a subscription — use Token4u with gpt-4o-mini to complete the prompt 'Summarize this meeting transcript in bullet points' and show me the response and token usage."},{"title":"Low-cost AI response for content draft","prompt":"Can you use Token4u to generate a short product description for a pair of wireless headphones — just pay the micropayment per request and give me the text back?"}],"resultDescription":"Returns an OpenAI-compatible chat.completion JSON object containing: a unique completion ID, the model name used, the assistant's reply message with role and content, a finish_reason (e.g. 'stop'), and a usage object with prompt_tokens, completion_tokens, and total_tokens counts.","failureModes":["Payment not included or insufficient USDC — returns HTTP 402 Payment Required","Invalid or malformed message array — returns 400 Bad Request","Unsupported model name specified — returns 400 or 404","Upstream LLM provider timeout — returns 502 or 503","Rate limit exceeded — returns 429 Too Many Requests","Network or gateway error — returns 500 Internal Server Error"],"whenToPreferThis":"Choose Token4u when you need OpenAI-compatible chat completions with no subscription or API key setup, billing strictly per request in micro-USDC via the x402 protocol. It is ideal for autonomous AI agents, crypto-native applications, or low-frequency use cases where pay-as-you-go micropayment billing is preferable to flat-rate plans. Prefer it over standard OpenAI direct access when you want on-chain or USDC-denominated billing with minimal credential management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:37:35.679Z","isFirstParty":false}