# Groq — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Ultra-fast LLM inference — Llama 3.3, DeepSeek R1, Gemma 2, GPT-OSS, Qwen, Whisper, and PlayAI TTS. OpenAI-compatible API with industry-leading speed.

**Category:** AI / LLM | **Website:** [groq.com](https://groq.com) | **Docs:** [console.groq.com/docs](https://console.groq.com/docs)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/groq/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

> Also available via public x402 on Base (no account needed): [x402/groq.md](https://beta.paywithlocus.com/x402/groq.md)

> Also available via MPP (no account needed): [mpp/groq.md](https://beta.paywithlocus.com/mpp/groq.md)

## Endpoints

### Chat Completion

Create a chat completion with ultra-fast inference. Supports tool use, JSON mode, reasoning, web search, and document context. OpenAI-compatible format.

**Estimated cost:** $0.005 – $0.10 (varies by model and tokens)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model ID. Public metered x402 supports Llama 3.1/3.3, GPT-OSS 20B/120B, Llama 4 Scout, and Qwen 3.6 27B. |
| `messages` | array | Yes | Conversation messages array |
| `max_completion_tokens` | number | Yes | Maximum output tokens. Required for x402 so the signed authorization has a hard ceiling. |
| `temperature` | number | No | Sampling temperature (0-2) |
| `top_p` | number | No | Nucleus sampling (0-1) |
| `tools` | array | No | Tool/function definitions (max 128) |
| `tool_choice` | string/object | No | Tool selection: "auto", "none", "required", or specific function |
| `response_format` | object | No | Output format: json_object, json_schema, or text |
| `stop` | string/array | No | Stop sequences (up to 4) |
| `seed` | number | No | Seed for deterministic sampling |
| `reasoning_format` | string | No | Reasoning output: "hidden", "raw", or "parsed" |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/groq/chat \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","messages":"<array>","max_completion_tokens":"<number>","temperature":"<number>","top_p":"<number>","tools":"<array>","tool_choice":"<string/object>","response_format":"<object>","stop":"<string/array>","seed":"<number>","reasoning_format":"<string>"}'
```

### List Models

List all available Groq models with their context window sizes and metadata.

**Estimated cost:** $0.005 fee only

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/groq/models \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
