{"uid":"cap_Y0X5qX7dolFwV3a3SubfA","slug":"x402-ai-apis-discord-shield-chat-endpoint-7e1662a7","name":"x402 AI APIs – Discord Shield Chat Endpoint","description":"Paid AI API endpoints via x402 micropayments","url":"https://x402-ai-peach.vercel.app/api/discord-shield","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.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_DUqz-xzdsshezqPdyVXX8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Provides a pay-per-call chat completion endpoint (OpenAI-compatible) accessible via x402 micropayments, routed through a Discord-shield branded path","exampleAgentPrompt":"Send this conversation history to the x402 discord-shield chat endpoint, allow up to 512 tokens in the response, use temperature 0.7, and pay the $0.05 USDC fee automatically: [{\"role\":\"user\",\"content\":\"What is the capital of France?\"}]","exampleUseCases":[{"title":"Pay-per-call chatbot backend","prompt":"Send this message thread to the x402 AI chat endpoint and get a reply — pay the $0.05 USDC micropayment automatically. Messages: [{\"role\":\"user\",\"content\":\"Summarize the history of the internet in 3 sentences.\"}]. Cap the response at 300 tokens."},{"title":"Streaming AI response for live UI","prompt":"Call the x402 discord-shield chat completion API with streaming enabled so I can show the response word by word in my UI. Use temperature 0.5, max 200 tokens, and these messages: [{\"role\":\"system\",\"content\":\"You are a helpful assistant.\"},{\"role\":\"user\",\"content\":\"Give me three tips for better sleep.\"}]"},{"title":"One-off AI query without subscription","prompt":"I don't want to sign up for an AI API plan — just fire a single chat request to the x402 pay-as-you-go endpoint, pay the $0.05, and give me the answer to: 'What are the main differences between REST and GraphQL?' Keep it under 400 tokens."}],"resultDescription":"Returns an OpenAI-style JSON object containing a response ID, and a choices array with the assistant's generated message (role + content string). Supports optional streaming mode for incremental token delivery.","failureModes":["Payment not included or insufficient USDC — returns HTTP 402 Payment Required","Missing required 'messages' field — returns 400 Bad Request","Model backend unavailable — returns 500 or 503","Invalid temperature or max_tokens values — may return 422 or 400","Streaming requested but client does not handle chunked responses correctly — partial data loss"],"whenToPreferThis":"Choose this endpoint when you need an OpenAI-compatible chat completion API with no subscription and pay-per-call billing via x402 USDC micropayments. Ideal for agents or apps that want to avoid API key management and instead use programmable crypto payments. Best when call volume is low or unpredictable and you want cost control at the individual-request level.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:35:17.132Z","isFirstParty":false}