# Groq API **Provider:** Groq **Category:** ai **Base URL:** `https://api.groq.com/openai/v1` **Auth:** bearer โ€” `Authorization: Bearer gsk_...` **Rate Limit:** 30 requests/min (free) ยท Higher on pay-as-you-go **Free Tier:** Yes โ€” [object Object] **Pricing:** Pay per use (pay-as-you-go) **Docs:** https://console.groq.com/docs ## Description Groq runs open-source LLMs at speeds previously impossible: 800+ tokens per second on their custom Language Processing Unit (LPU) hardware. The API is OpenAI-compatible, so any code targeting OpenAI's chat completions endpoint works with a one-line change. Models include Llama 3.3 70B, Llama 3.1 8B, Mixtral 8x7B, and Gemma 2. Ideal for latency-critical applications like voice assistants, real-time chat, and interactive coding tools. ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | POST | `https://api.groq.com/openai/v1/chat/completions` | Chat completions (OpenAI-compatible) | | GET | `https://api.groq.com/openai/v1/models` | List available models and their context lengths | ## Authentication Generate an API key at console.groq.com. Pass it as a Bearer token in the Authorization header. The endpoint is OpenAI-compatible. ``` Authorization: Bearer gsk_... ``` ## Sample Request ```bash curl "https://api.groq.com/openai/v1/chat/completions" \ -H "Authorization: Bearer $GROQ_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"llama-3.3-70b-versatile","messages":[{"role":"user","content":"Explain quantum computing in one paragraph."}]}' ``` ## Sample Response ```json { "id": "chatcmpl-abc123", "model": "llama-3.3-70b-versatile", "choices": [{ "message": { "role": "assistant", "content": "Quantum computing harnesses..." }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 18, "completion_tokens": 87, "total_tokens": 105 }, "x_groq": { "id": "req_abc", "usage": { "queue_time": 0.0002 } } } ``` ## Pricing Details Llama 3.1 8B Instant: $0.05/M input, $0.08/M output. Llama 3.3 70B Versatile: $0.59/M input, $0.79/M output. Llama 3.1 70B: $0.59/M input, $0.79/M output. Batch API: 50% off. --- *Source: [API Map](https://apimap.dev/apis/groq/) โ€” CC BY 4.0*