// Models · API key guide
Groq API key: how to get one
GroqCloud has a Free plan – create a key and call open-weight models such as gpt-oss with the OpenAI SDK.
4 stepsofficial docs onlychecked 2026-10-26
01How to get a Groq API key
- Sign up / log in at console.groq.com.
- Open API Keys → Create API Key.
- Export it as GROQ_API_KEY (the Groq SDKs read it automatically).
- Call https://api.groq.com/openai/v1 with a model from the Free plan, e.g. openai/gpt-oss-20b.
Official key page: https://console.groq.com/keys – console labels may change; follow what the official page shows.
02Real-name, phone and credit card requirements
| Real-name / ID verification | Not mentioned in the docs. |
|---|---|
| Phone number | Not mentioned in the docs we checked (以官方为准). |
| Credit card / payment | Not needed for the Free plan; a payment method is only needed to upgrade to the Developer plan. |
03Base URL and a minimal call
https://api.groq.com/openai/v1GROQ_API_KEY · Example model:openai/gpt-oss-20bcurl
curl https://api.groq.com/openai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [{"role": "user", "content": "你好"}]
}' Python
# pip install openai
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["GROQ_API_KEY"], base_url="https://api.groq.com/openai/v1")
resp = client.chat.completions.create(
model="openai/gpt-oss-20b",
messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content) 04Free quota
All free AI APIs →Free plan with per-model limits, e.g. openai/gpt-oss-120b / 20b and qwen/qwen3.8-27b: 30 RPM, 1K RPD, 8K TPM, 200K TPD. Limits are per organisation; exact current limits are on the limits page in your account.
05Groq API prices
All model prices →| Model | Input / 1M tokens | Output / 1M tokens | Source |
|---|---|---|---|
Llama 3.1 8B Instructmeta-llama/llama-3.1-8b-instruct | $0.05 | $0.08 | official · 2026-11-30 |
GPT-OSS 20Bgpt-oss-20b | $0.075 | $0.3 | official · 2026-10-10 |
gpt-oss-safeguard-20bopenai/gpt-oss-safeguard-20b | $0.075 | $0.3 | official · 2026-11-30 |
GPT-OSS 120Bgpt-oss-120b | $0.15 | $0.6 | official · 2026-10-10 |
Llama 3.3 70B Instructmeta-llama/llama-3.3-70b-instruct | $0.59 | $0.79 | official · 2026-11-30 |
MiniMax M2.7minimax/minimax-m2.7 | $0.6 | $1.8 | official · 2026-11-30 |
Qwen3.8-27Bqwen3.8-27b | $0.8 | $4 | official · 2026-10-10 |
Standard (non-batch) list prices from our price database; cheapest first, max 8 rows. Prices change – the official page wins.
06Keep your API key safe
- Use Projects in the console to separate keys and limits per app.
- Keep the key in an environment variable or a secrets manager – never hard-code it, never commit it to Git, never paste it into a screenshot, chat or issue.
- Never put a long-lived key in front-end, mobile or desktop client code – anyone can extract it. Call the API from your own server.
- One key per project or environment, so a leak can be revoked without breaking everything else.
- If a key leaks, delete it in the console immediately and create a new one, then check usage and billing.
- Do not buy keys from resellers or “API relays” and do not paste your key into websites you do not trust.
07FAQ
FAQ
Is the Groq API key free?
Yes, on the Free plan with rate limits; no payment method needed until you upgrade.
What is the Groq base URL?
https://api.groq.com/openai/v1 (OpenAI-compatible).
08Official sources
- GroqCloud · Quickstart console.groq.com
- GroqCloud · Rate Limits console.groq.com
All facts checked against these pages on 2026-10-26. If anything differs, the official page wins.