{"uid":"cap_gWgVdCWoGwN1SUK4KF5B5","slug":"openrelay-premium-chat-completions-1738d2c0","name":"OpenRelay Premium Chat Completions","description":"OpenAI-compatible chat completion (branded tier). $0.10/1M tokens, min $0.0010/request. USDC on Solana or Base.","url":"https://openrelay.hggfffdfy687.workers.dev/v1/premium/chat/completions","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"enum":["deepseek-ai/DeepSeek-V4-Flash-0731","moonshotai/Kimi-K2.6","MiniMaxAI/MiniMax-M2.7"],"type":"string","default":"deepseek-ai/DeepSeek-V4-Flash-0731","description":"Model id. Available: DeepSeek V4 Flash (400k ctx), Kimi K2.6 (240k ctx), MiniMax M2.7 (180k ctx). See GET /v1/models. Default: DeepSeek V4 Flash."},"stream":{"type":"boolean","default":false},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant"]},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","default":512,"maximum":16384,"minimum":1},"temperature":{"type":"number","default":1,"maximum":2,"minimum":0}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-openrelay-abc123","model":"deepseek-ai/DeepSeek-V4-Flash-0731","usage":{"total_tokens":15,"prompt_tokens":12,"completion_tokens":3},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}],"created":1787532386}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_D8QK722-eL_D_VW0AUxzw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"OpenAI-compatible premium-tier chat completion endpoint backed by DeepSeek and other models, billed per request via x402 micropayments.","exampleAgentPrompt":"Using the OpenRelay premium chat relay, send this conversation to DeepSeek-V4-Flash: system prompt 'You are a helpful assistant', user message 'Summarize the key differences between REST and GraphQL in 3 bullet points', with max 512 tokens and temperature 0.7.","exampleUseCases":[{"title":"Autonomous agent LLM calls with micropayments","prompt":"I want my agent to call DeepSeek-V4-Flash through OpenRelay's premium tier with the system message 'You are a coding assistant' and the user message 'Write a Python function to parse JSON from a URL', capping the response at 1024 tokens."},{"title":"Multi-turn customer support chatbot","prompt":"Send this three-turn conversation to the OpenRelay premium endpoint using DeepSeek — the system says 'You are a friendly customer support agent', user asks 'How do I reset my password?', assistant replied 'Click Forgot Password', now the user is asking 'I don't see that option' — get the next assistant reply with temperature 0.5 and max 300 tokens."},{"title":"Low-cost on-demand content drafting","prompt":"Use OpenRelay's premium chat API to draft a short product description: system prompt 'You are a marketing copywriter', user message 'Write a 2-sentence description for a noise-cancelling Bluetooth headset targeting remote workers', temperature 0.9, max 256 tokens."}],"resultDescription":"Returns a JSON object in OpenAI chat completion format: an assistant message with generated text, token usage breakdown (prompt, completion, total), finish reason, model ID, and a unique completion ID.","failureModes":["Payment not provided or insufficient — x402 payment required error","Invalid model ID — returns error if model not in available list","Messages array missing or malformed — validation error on required fields","max_tokens exceeds 16384 — schema validation failure","Temperature out of range 0-2 — validation error","Rate limiting or worker timeout on Cloudflare edge — 5xx error","Model temporarily unavailable — upstream inference provider error"],"whenToPreferThis":"Choose this endpoint when you need OpenAI-compatible chat completions billed per request via x402 USDC micropayments, especially for autonomous agents that lack a subscription and want access to DeepSeek or other models without upfront commitment. Prefer this over the standard OpenRelay chat endpoint when the premium tier's pricing tier or model availability is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:39:13.029Z","isFirstParty":false}