{"uid":"cap_12-5HIaWkY1y7OehXF42L","slug":"telnyx-x402-llama-3-1-8b-chat-completions-17a71178","name":"Telnyx x402 Llama 3.1 8B Chat Completions","description":"Chat completions via Telnyx Inference (meta-llama/Meta-Llama-3.1-8B-Instruct). OpenAI-compatible. $0.002237 USDC per call.","url":"https://x402.telnyx.com/v1/chat/completions/_t/llama-3.1-8b?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"integer","const":1,"description":"Fixed to one completion per paid call."},"model":{"type":"string","const":"meta-llama/Meta-Llama-3.1-8B-Instruct","description":"Model identifier; fixed to meta-llama/Meta-Llama-3.1-8B-Instruct on this route."},"tools":{"type":"array","items":{"type":"object"},"maxItems":16},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant","tool"],"type":"string"},"content":{"type":"string","maxLength":8000}}},"maxItems":32,"description":"OpenAI-style chat messages."},"max_tokens":{"type":"integer","maximum":512,"minimum":1},"temperature":{"type":"number","maximum":2,"minimum":0}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-xxx","usage":{"total_tokens":16,"prompt_tokens":12,"completion_tokens":4},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002237","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.002237/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002237","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002237","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dMVkVipbCvK1PlUdTRH3n","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002237","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generate chat completions using Meta-Llama-3.1-8B-Instruct via Telnyx's x402 pay-per-request USDC gateway","exampleAgentPrompt":"Ask the Llama 3.1 8B model on Telnyx to explain what a Merkle tree is in simple terms — keep the response under 200 tokens and use a temperature of 0.7.","exampleUseCases":[{"title":"Per-request LLM inference for agent pipeline","prompt":"Send this conversation history to the Llama 3.1 8B model on Telnyx and get a short assistant reply — I want to pay per call in USDC instead of maintaining a subscription, keep max tokens at 256."},{"title":"On-demand Q&A with stablecoin micropayment","prompt":"Ask Telnyx's Llama 3.1 8B: 'What are the top 3 causes of the French Revolution?' and pay the per-request USDC fee automatically — limit the answer to 300 tokens."},{"title":"Tool-calling agent with budget LLM","prompt":"Use the Telnyx x402 Llama 8B endpoint to process this tool-use conversation — pass the system prompt, user message, and my tool definitions, set temperature to 0 and max_tokens to 512."}],"resultDescription":"Returns an OpenAI-compatible chat completion JSON object containing the assistant's reply message, finish reason (e.g. 'stop'), token usage breakdown (prompt, completion, total tokens), and a unique completion ID. The choices array contains exactly one completion.","failureModes":["Insufficient USDC balance causes HTTP 402 payment required","Messages array exceeds 32 items returns validation error","Content exceeds 8000 character limit per message","max_tokens above 512 rejected by schema validation","Invalid role value in messages array causes 422 error","Model identifier mismatch (must be meta-llama/Meta-Llama-3.1-8B-Instruct) causes routing error","Temperature outside 0-2 range returns validation error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, fast, open-weight LLM (Llama 3.1 8B) with no subscription commitment, paying only per call in USDC via the x402 micropayment protocol. Ideal for agentic workflows that need to control LLM spend at the request level, or for apps that want an OpenAI-compatible chat API without storing credentials. Prefer larger models (like Llama 70B or GPT-4) for complex reasoning tasks; use this for simpler generation, summarization, or classification where cost efficiency matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T00:33:05.947Z","isFirstParty":false,"canonicalSlug":"telnyx-x402-llama-3-1-8b-chat-completions-17a71178"}