{"uid":"cap_VLkZX5IAwVWzVuGaCuF87","slug":"chat-completions-api-llama-3-1-8b-x402-8e253670","name":"Chat Completions API (Llama 3.1 8B, x402)","description":"LLM inference API: OpenAI-compatible chat completions, send messages, get choices and usage. Cheap LLM inference for agents (Llama 3.1 8B), no key, no streaming.","url":"https://dominion-data.x402-evm-math.workers.dev/v1/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"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_307Rob6QplQOcuNM5zaSS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"OpenAI-compatible chat completions endpoint powered by Llama 3.1 8B, enabling LLM inference via pay-per-call USDC micropayment with no API key required.","exampleAgentPrompt":"Ask the Llama 3.1 8B chat completions model: 'Explain the difference between impermanent loss and price impact in DeFi in two sentences.' — use the pay-per-call endpoint, no API key needed.","exampleUseCases":[{"title":"Lightweight agent reasoning step","prompt":"I need a cheap LLM call to classify this user message as 'question', 'complaint', or 'feedback' — use the Llama 3.1 8B chat completions endpoint and tell me which category fits: 'Your checkout process is confusing and I gave up.'"},{"title":"On-chain data summarization","prompt":"Take this raw Uniswap V3 pool data and ask the Llama 3.1 8B model to write a one-paragraph plain-English summary of what the liquidity distribution looks like — keep it under 100 words."},{"title":"Automated prompt chaining for agent pipeline","prompt":"In my agentic workflow, after I fetch the SEC filing, send the extracted text as a user message to the Llama 3.1 8B chat completions API and ask it to identify the top three risk factors mentioned in the document."}],"resultDescription":"Returns an OpenAI-compatible JSON response containing an array of completion choices (each with a message object holding the assistant's generated text), a usage object with prompt_tokens, completion_tokens, and total_tokens, a model identifier, and a unique completion ID.","failureModes":["Payment failure: x402 payment not completed or insufficient USDC balance returns a 402 error","Malformed request body: missing or incorrectly typed fields return a 400 error","Model overload or timeout: Cloudflare Worker timeout returns a 503 or 524 error","Empty or null messages array causes an inference error","Streaming not supported: requests with stream:true may be rejected or silently ignored"],"whenToPreferThis":"Choose this endpoint when you need cheap, keyless LLM inference in an agentic pipeline that already handles x402 USDC micropayments, and when Llama 3.1 8B quality is sufficient (classification, summarization, simple reasoning). Prefer it over OpenAI or Anthropic APIs when minimizing cost per call matters most, no API key provisioning is desired, and the OpenAI message format compatibility is a hard requirement. Not ideal for tasks requiring GPT-4-level reasoning, long context, streaming output, or multimodal inputs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T00:30:27.018Z","isFirstParty":false,"canonicalSlug":"chat-completions-api-llama-3-1-8b-x402-8e253670"}