Skip to content
English

Switch theme

// 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

  1. Sign up / log in at console.groq.com.
  2. Open API Keys → Create API Key.
  3. Export it as GROQ_API_KEY (the Groq SDKs read it automatically).
  4. 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 verificationNot mentioned in the docs.
Phone numberNot mentioned in the docs we checked (以官方为准).
Credit card / paymentNot needed for the Free plan; a payment method is only needed to upgrade to the Developer plan.

03Base URL and a minimal call

Base URL:https://api.groq.com/openai/v1
Environment variable:GROQ_API_KEY · Example model:openai/gpt-oss-20b

curl

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)

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.

Our free-API tracker:Usable on the Free plan with per-model limits; a payment method is only needed to upgrade to Developer.
RPM 30 · RPD 1,000 · TPM 8K
checked 2026-10-22 · details →

05Groq API prices

All model prices →
ModelInput / 1M tokensOutput / 1M tokensSource
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

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

All facts checked against these pages on 2026-10-26. If anything differs, the official page wins.

09Related

Other API key guides

Data updated: Model API prices · HF model metadata(UTC+8)