{"uid":"cap_OwlMzL8Xq54JZA9l_T7PD","slug":"ai-chat-text-llm-chat-completion-b37bdedd","name":"AI Chat & Text – LLM Chat Completion","description":"LLM chat completion, flat $0.003 a call: send a prompt (plus optional system) or an OpenAI-style messages array and get the reply text with token usage. Models: gpt-oss-20b (default), qwen3-30b, glm-4.7-flash, llama-4-scout. Up to 16,000 characters in and 1,024 tokens out; json=true for JSON output.","url":"https://onchaincheck.dev/ai/chat?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"enum":["true","false"],"type":"string","description":"true asks for a single JSON object"},"model":{"enum":["gpt-oss-20b","gemma-4-26b","glm-4.7-flash","llama-4-scout"],"type":"string","description":"Model (default gpt-oss-20b)"},"prompt":{"type":"string","pattern":"^[\\s\\S]+$","maxLength":16000,"description":"The user message (or send an OpenAI-style messages array instead)"},"system":{"type":"string","pattern":"^[\\s\\S]*$","maxLength":16000,"description":"Optional system instructions"},"max_tokens":{"type":"string","pattern":"^\\d{1,4}$","description":"Most tokens to generate, up to 1024"},"temperature":{"type":"string","pattern":"^\\d(\\.\\d+)?$","description":"0 to 2 (default 0.6)"}}},"responseSchema":null,"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_MTPU490i-rL39whb-rgpd","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":"Send a prompt or OpenAI-style messages array to one of four LLMs and receive the generated reply text with token usage stats","exampleAgentPrompt":"Using the gpt-oss-20b model, answer this question with a system instruction that says 'you are a concise assistant': 'What are the three main causes of the French Revolution?' — and give me the response as plain text.","exampleUseCases":[{"title":"Structured data extraction from raw text","prompt":"I have this paragraph of messy customer feedback and I need you to extract the product name, rating, and complaint into a clean JSON object — use the Qwen3-30b model and turn on JSON output mode."},{"title":"Creative writing with a custom persona","prompt":"Write me a short fantasy tavern description in the style of a world-weary narrator — use the llama-4-scout model, set temperature to 1.2, and keep it under 200 words."},{"title":"Quick factual Q&A for an automated pipeline","prompt":"Ask the gpt-oss-20b model: 'What is the capital of New Zealand and what is its population?' — keep it brief, max 100 tokens."}],"resultDescription":"Returns the generated text reply from the selected LLM along with token usage statistics (prompt tokens, completion tokens, total tokens). If json=true is set, the response will be a single structured JSON object instead of free-form text.","failureModes":["Prompt or system exceeds 16,000 character limit — request rejected","max_tokens value exceeds 1024 — capped or error returned","Invalid model name provided — falls back to default or returns error","Payment not completed or insufficient USDC balance — 402 Payment Required","Malformed messages array — parsing error returned","Model temporarily unavailable — service error response","JSON mode requested but model output is not valid JSON — may return raw text"],"whenToPreferThis":"Choose this endpoint when you need a flat-rate ($0.003/call), pay-per-use LLM completion without committing to an OpenAI or Anthropic subscription. It's especially useful for agents that need occasional LLM calls within an x402 micropayment flow, want to switch between multiple open-source models (Qwen3, Llama-4, GLM-4), require structured JSON output from an LLM, or are running on-chain or crypto-native pipelines where USDC payments are native.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-17T18:44:29.010Z","isFirstParty":false,"canonicalSlug":"ai-chat-text-llm-chat-completion-b37bdedd"}