{"uid":"cap_ZXgzDyKYWiLGN6VKE4EjO","slug":"locus-x402-groq-chat-completions-ac792853","name":"Locus x402 Groq Chat Completions","description":"Locus public pay-per-use API","url":"https://groq.x402.stage.paywithlocus.com/groq/chat","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"number"},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{}}]},"model":{"type":"string"},"tools":{"type":"array","items":{}},"top_p":{"type":"number"},"messages":{"type":"array","items":{"type":"object","required":["role"],"properties":{"name":{"type":"string"},"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","required":["type"],"properties":{"text":{"type":"string"},"type":{"type":"string"},"image_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}},"additionalProperties":true}},"additionalProperties":true}},{"type":"null"}]},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true}},"tool_call_id":{"type":"string"}},"additionalProperties":true}},"temperature":{"type":"number"},"tool_choice":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"response_format":{"type":"object","additionalProperties":true},"reasoning_format":{"type":"string"},"max_completion_tokens":{"type":"number"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MYa7YKXaerqcXiOs_6djF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pay-per-use LLM chat completions API (Llama, Qwen, GPT-OSS models) billed at $0.005 USDC per call via x402 micropayments","exampleAgentPrompt":"Using the Locus x402 metered API, send a chat message to Llama 3.3 asking it to summarize the pros and cons of electric vehicles, set max_completion_tokens to 512, and pay the $0.005 USDC fee automatically.","exampleUseCases":[{"title":"Automated report drafting agent","prompt":"Use the pay-per-use Groq endpoint to generate a one-paragraph executive summary of our Q3 sales data using Llama 4 Scout — cap the output at 300 tokens and return it as plain text."},{"title":"Structured JSON extraction pipeline","prompt":"Send this customer feedback text to GPT-OSS 120B via the Locus metered API and have it return a JSON object with keys 'sentiment', 'topics', and 'action_items' — use response_format json_schema and limit to 400 tokens."},{"title":"Tool-calling agent with open-source LLM","prompt":"I need to run a tool-calling session with Qwen 3.6 27B — pass my get_weather and search_web function definitions and let the model decide which to call based on the user message 'What's the weather in Tokyo right now?', with tool_choice set to auto and max 256 tokens."}],"resultDescription":"Returns a standard OpenAI-compatible chat completion object containing the model's generated message content, optional tool call selections, token usage statistics, and finish reason. If reasoning_format is set to 'parsed' or 'raw', includes a reasoning field with chain-of-thought output. Response format can be plain text, json_object, or a validated json_schema output.","failureModes":["Payment authorization failure if x402 header is missing or USDC balance is insufficient","Model ID not recognized — must use one of the supported models (Llama 3.1/3.3, GPT-OSS 20B/120B, Llama 4 Scout, Qwen 3.6 27B)","max_completion_tokens not provided — required for x402 signed authorization ceiling","Token limit exceeded if max_completion_tokens is set too low for the requested task","Rate limiting or capacity errors from Groq backend during high load","Malformed messages array causes 400 validation error","Tool definitions exceeding 128 items are rejected"],"whenToPreferThis":"Choose this endpoint when you need pay-as-you-go LLM inference with no subscription, billed automatically in USDC via x402 micropayments. Ideal for agents that need to call open-source models (Llama, Qwen, GPT-OSS) sporadically without committing to a monthly plan. Prefer this over direct Groq API when you need automatic per-call billing settled on-chain, or when building agentic pipelines that must track and authorize exact spend ceilings per request.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:37:33.751Z","isFirstParty":false}