Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Install and configure Groq SDK authentication for TypeScript or Python. Use when setting up a new Groq integration, configuring API keys, or initializing the groq-sdk in your project. Trigger with phrases like "install groq", "setup groq", "groq auth", "configure groq API key".
.claude/skills/jeremylongshore-groq-install-auth/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 17% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 231% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 238% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 106% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 83% | 0% |
Install the official Groq SDK and configure API key authentication. Groq provides ultra-fast LLM inference on custom LPU hardware through an OpenAI-compatible REST API at api.groq.com/openai/v1/.
The workflow is four steps: install the SDK, mint an API key, export it as an environment variable, and verify the connection by listing models. Each step is summarized below; deep detail lives in references/.
bashset -euo pipefail # TypeScript / JavaScript npm install groq-sdk # Python pip install groq
gsk_)Add the .gitignore template before writing any .env file so a key can never be committed:
bash# Set environment variable (recommended) export GROQ_API_KEY="gsk_your_key_here" # Or create .env file (add .env to .gitignore first) echo 'GROQ_API_KEY=gsk_your_key_here' >> .env
Run a short script that lists the models your key can access — a successful list proves authentication end-to-end. The essential TypeScript skeleton:
typescriptimport Groq from "groq-sdk"; const groq = new Groq({ apiKey: process.env.GROQ_API_KEY }); const models = await groq.models.list(); console.log(models.data.map((m) => m.id));
Full runnable TypeScript and Python verification scripts, with expected output: verification walkthrough.
A successful setup produces:
groq-sdk (Node) or groq (Python) installed in the project.GROQ_API_KEY available in the environment (or .env, with .env gitignored).Connected! Available models:
llama-3.3-70b-versatile (owned by Meta)
llama-3.1-8b-instant (owned by Meta)If the verification run prints a 401 instead of a model list, authentication failed — see Error Handling.
The SDK auto-reads GROQ_API_KEY from the environment when no apiKey is passed. Groq uses a single gsk_ key type with full API access (no read/write scopes). Constructor options (baseURL, maxRetries, timeout), the OpenAI-SDK compatibility path, and the key-format table are in the configuration reference.
| Error | Cause | Solution | |-------|-------|----------| | 401 Invalid API Key | Key missing, revoked, or mistyped | Verify key at console.groq.com/keys | | MODULE_NOT_FOUND groq-sdk | SDK not installed | Run npm install groq-sdk | | ModuleNotFoundError: No module named 'groq' | Python SDK missing | Run pip install groq | | ENOTFOUND api.groq.com | Network/DNS issue | Check internet connectivity and firewall |
Extended diagnostics (checking the exported variable, .env loading, key rotation): troubleshooting reference.
Example 1 — Node project from scratch:
bashnpm install groq-sdk export GROQ_API_KEY="gsk_your_key_here" node --env-file=.env verify.mjs # lists models → auth confirmed
Example 2 — Python project:
bashpip install groq export GROQ_API_KEY="gsk_your_key_here" python verify.py # prints accessible models
Example 3 — reuse an existing OpenAI codebase: point the OpenAI SDK at Groq by overriding baseURL to https://api.groq.com/openai/v1 and passing your gsk_ key. See the configuration reference.
Complete, runnable versions of the verification scripts are in the verification walkthrough.
After successful auth, proceed to the groq-hello-world skill to run your first chat completion. For SDK tuning (retries, timeouts, custom base URL), read the configuration reference.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 7,876 | 10,481 | +33% | 1 | 1 | 0% | 1,935 | 2,703 | +40% | 0 | 0 | — |
case-02 | fail→pass | 8,820 | 10,188 | +16% | 1 | 1 | 0% | 2,060 | 2,413 | +17% | 0 | 0 | — |
case-03 | pass→pass | 2,509 | 6,877 | +174% | 1 | 1 | 0% | 471 | 1,591 | +238% | 0 | 0 | — |
case-04 | pass→pass | 5,394 | 8,577 | +59% | 1 | 1 | 0% | 898 | 1,847 | +106% | 0 | 0 | — |
case-05 | pass→pass | 6,147 | 4,873 | -21% | 1 | 1 | 0% | 1,194 | 2,181 | +83% | 0 | 0 | — |
case-06 | pass→pass | 9,860 | 2,481 | -75% | 1 | 1 | 0% | 806 | 1,746 | +117% | 0 | 0 | — |
case-07 | pass→pass | 14,442 | 11,644 | -19% | 1 | 1 | 0% | 1,787 | 2,617 | +46% | 0 | 0 | — |
case-08 | pass→pass | 5,504 | 4,985 | -9% | 1 | 1 | 0% | 935 | 2,206 | +136% | 0 | 0 | — |
case-09 | pass→pass | 13,351 | 15,403 | +15% | 1 | 1 | 0% | 2,319 | 3,134 | +35% | 0 | 0 | — |
case-10 | pass→pass | 11,663 | 4,782 | -59% | 1 | 1 | 0% | 1,252 | 2,167 | +73% | 0 | 0 | — |
case-11 | pass→pass | 16,757 | 14,964 | -11% | 1 | 1 | 0% | 2,028 | 3,091 | +52% | 0 | 0 | — |
case-12 | pass→pass | 7,942 | 11,251 | +42% | 1 | 1 | 0% | 1,402 | 2,407 | +72% | 0 | 0 | — |
case-13 | pass→pass | 9,167 | 12,598 | +37% | 1 | 1 | 0% | 1,601 | 2,675 | +67% | 0 | 0 | — |
case-14 | pass→pass | 6,065 | 4,355 | -28% | 1 | 1 | 0% | 1,167 | 2,091 | +79% | 0 | 0 | — |
case-15 | pass→pass | 11,614 | 5,493 | -53% | 1 | 1 | 0% | 1,370 | 2,492 | +82% | 0 | 0 | — |
case-16 | pass→pass | 11,582 | 9,176 | -21% | 1 | 1 | 0% | 1,241 | 2,034 | +64% | 0 | 0 | — |
case-17 | fail→pass | 3,363 | 2,788 | -17% | 1 | 1 | 0% | 537 | 1,776 | +231% | 0 | 0 | — |
case-18 | pass→pass | 11,342 | 2,126 | -81% | 1 | 1 | 0% | 1,843 | 1,617 | -12% | 0 | 0 | — |
case-19 | pass→pass | 10,425 | 3,082 | -70% | 1 | 1 | 0% | 816 | 1,709 | +109% | 0 | 0 | — |
case-20 | pass→pass | 11,757 | 7,592 | -35% | 1 | 1 | 0% | 1,355 | 2,514 | +86% | 0 | 0 | — |
case-21 | pass→pass | 12,417 | 14,148 | +14% | 1 | 1 | 0% | 2,114 | 2,947 | +39% | 0 | 0 | — |
case-22 | fail→fail | 18,712 | 13,715 | -27% | 1 | 1 | 0% | 3,135 | 3,588 | +14% | 0 | 0 | — |
case-23 | pass→pass | 4,525 | 3,239 | -28% | 1 | 1 | 0% | 819 | 1,881 | +130% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.