{"uid":"cap_sXHNAD_y69emPimj1Jfzc","slug":"openrelay-text-completions-4289527a","name":"OpenRelay Text Completions","description":"OpenRelay is a pay-per-request LLM inference relay. Autonomous AI agents call our OpenAI-compatible endpoints and pay in USDC via x402 — no API keys, no signup, no subscriptions. Backed by DeepSeek V4 Flash (400k ctx), Kimi K2.6 (240k ctx), and MiniMax M2.7 (180k ctx). Price: $0.10 per 1M tokens (input + max_tokens). USDC on Solana or Base. Facilitator: PayAI (gasless).","url":"https://openrelay.hggfffdfy687.workers.dev/v1/completions","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"Model id. Call GET /v1/models for list. Default: deepseek-ai/DeepSeek-V4-Flash-0731."},"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.0005","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.0005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lPm7QPdNV_7oy0aW4iXVk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0005","costPer":"request","priority":0,"asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pay-per-request LLM text completion via OpenAI-compatible /v1/completions endpoint, billed in USDC per call with no API key required","exampleAgentPrompt":"Using DeepSeek V4 Flash with a 400k context window, generate a response to this conversation — system: 'You are a helpful assistant', user: 'Summarize the key points of transformer architecture' — limit the output to 512 tokens and pay per request in USDC with no API key.","exampleUseCases":[{"title":"Autonomous agent reasoning loop","prompt":"I'm building an agent that needs to call an LLM on every step of a reasoning loop without managing API keys or subscriptions — use DeepSeek V4 Flash to answer the user message 'What is the capital of France?' with max 128 tokens, billed to my USDC wallet."},{"title":"Long-context document summarization","prompt":"I have a 300,000-token document I need summarized — use the Kimi K2.6 model on OpenRelay since it has a 240k context window, send the full text as the user message, cap output at 1024 tokens, and charge my Base USDC balance."},{"title":"Cost-controlled chatbot backend","prompt":"Power my customer support chatbot with OpenRelay using MiniMax M2.7 — send the system prompt 'You are a polite support agent' and the user message 'How do I reset my password?', set temperature to 0.3, max_tokens to 256, and deduct the cost in USDC automatically."}],"resultDescription":"Returns an OpenAI-compatible chat.completion JSON object with the generated assistant message, finish reason (e.g. 'stop'), token usage breakdown (prompt_tokens, completion_tokens, total_tokens), model name, and a unique completion ID.","failureModes":["Insufficient USDC balance — payment via x402 fails and request is rejected before inference","Invalid model ID — returns error if model string doesn't match available models (call GET /v1/models to list valid IDs)","max_tokens exceeds model limit — request rejected if value exceeds 16384","Malformed messages array — missing required 'role' or 'content' fields causes validation error","Worker downtime — Cloudflare Workers cold-start or upstream model provider outage returns 5xx","Temperature out of range — values outside 0-2 are rejected"],"whenToPreferThis":"Choose this endpoint when your AI agent needs to call an LLM without managing API keys or subscriptions, and can pay per request in USDC on Solana or Base. It is ideal for autonomous agents operating on-chain, cost-sensitive workloads needing pay-as-you-go pricing ($0.10/1M tokens), or pipelines requiring very large context windows (up to 400k tokens). Prefer this over OpenAI direct when you need keyless, wallet-funded inference or x402 protocol compatibility.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:34:49.622Z","isFirstParty":false}