UPDATED FOR 2026
⚡ Groq · API Development · LLM Infrastructure

How to Get a Groq API Key (Free, Step by Step)

2 min
Setup Time
Free
Tier Available
4
Simple Steps
3
Common Fixes
Prashant Lalwani
October 09, 2026 · 6 min read
Groq API Setup Free Tier
Groq console API keys page showing how to create a new Groq API key for free

Creating a Groq API key takes two minutes. The mistakes come afterward: pasting the key into code you upload, losing it because it's only shown once, or testing with a model name that no longer exists.

Where this lands

The Groq console makes key creation simple, and the free tier is enough to test an app. It works poorly if you hard-code the key, lose it before copying it, or rely on a model name from an old tutorial. Limits and model names change, so check the docs before you plan around them.

Steps

  1. Go to the Groq console and sign up with email, Google or GitHub.
  2. Open API Keys in the left menu.
  3. Click Create API Key, give it a clear name, and submit.
  4. Copy the key right away. It's shown once, and you can't view it again.

⚠️ Don't skip step 4: Groq only shows your API key once. If you close the modal without copying it, you'll have to delete that key and create a new one. There's no way to recover a key you've lost.

Store it safely

Use an environment variable, never your source code.

# macOS / Linux
export GROQ_API_KEY="your_key_here"

# Windows (PowerShell)
$env:GROQ_API_KEY="your_key_here"
Terminal showing environment variable setup for Groq API key and a successful API test call

Test it

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": "Say hello."}]}'

If you get "model not found", pick a current model name from the docs. Then continue with how to use the Groq API.

The "it doesn't work" problem

401 Unauthorized

The key is wrong, has extra spaces or was deleted. Check for trailing spaces and verify the key wasn't revoked in the console.

429 Too Many Requests

You hit a rate limit. See Groq api free limits for current thresholds and how to work within them.

Works in terminal, not in your app

The environment variable isn't set in that session. Set it in your app's runtime environment too, not just in your shell.

How to avoid it: copy the key carefully, keep separate keys per project, and delete any key you suspect has leaked.

💡 Pro tip: Name each key after its project (e.g., "chatbot-prod", "research-dev"). If one leaks, you revoke just that one — every other project keeps running.

Why people choose Groq

Groq runs models on its own chip design for fast responses. Read what is the Groq chip, the Groq LPU benchmarks, and Groq for startups if you want the background.

Comparing your options

Key Habit Safe Risk If It Leaks Effort
Environment variable Yes Low Low
Hard-coded in code No High Lowest
One key per project Yes Easy to replace Medium

✅ Bottom line: Creating a Groq API key is the easy part. The real skill is treating it like a password — stored in environment variables, rotated per project, and revoked immediately if it leaks. Do that and you've got fast, cheap, secure LLM inference in minutes.

Frequently asked questions

You can create a key for free and use the free tier within its limits. Groq's free tier is generous enough for testing and small apps, though rate limits apply.
You can, but separate keys are safer because a leak only affects one. Creating a new key per project takes 30 seconds and makes it trivial to revoke access if something goes wrong.
Delete it in the console right away and create a new one. The old key stops working immediately, so any leaked copies become useless.
The key is wrong, has extra spaces or was deleted. Check for trailing spaces, verify the key wasn't revoked in the console, and regenerate if needed.
The environment variable isn't set in that session. Your terminal and your app run in separate processes, so setting the variable in one doesn't automatically share it with the other. Set it in your app's runtime environment too.

Further reading