AGENT SKILL

groq-common-errors

Diagnose and fix Groq API errors with real error codes and solutions. Use when encountering Groq errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "groq error", "fix groq", "groq not working", "debug groq", "groq 429".

License 许可
MIT
最近更新
2026-07-13
Stars
★ 1
Forks
0

01 前言 Front Matter

name
groq-common-errors
tags
[ "saas", "groq", "debugging" ]
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
version
1.0.0
description
Diagnose and fix Groq API errors with real error codes and solutions. Use when encountering Groq errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "groq error", "fix groq", "groq not working", "debug groq", "groq 429".
allowed-tools
Read, Grep, Bash(curl:*)
compatible-with
claude-code, codex, openclaw

03 SKILL.md 正文

Groq Common Errors

Overview

Comprehensive reference for Groq API error codes, their root causes, and proven fixes. Groq returns standard HTTP status codes with structured error bodies and rate-limit headers.

Error Response Format

{
  "error": {
    "message": "Rate limit reached for model `llama-3.3-70b-versatile`...",
    "type": "tokens",
    "code": "rate_limit_exceeded"
  }
}

Quick Diagnostic

set -euo pipefail
# 1. Verify API key is valid
curl -s https://api.groq.com/openai/v1/models \
  -H "Authorization: Bearer $GROQ_API_KEY" | jq '.data | length'

# 2. Check specific model availability
curl -s https://api.groq.com/openai/v1/models \
  -H "Authorization: Bearer $GROQ_API_KEY" | jq '.data[].id' | sort

# 3. Test a minimal completion
curl -s https://api.groq.com/openai/v1/chat/completions \
  -H "Authorization: Bearer $GROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"llama-3.1-8b-instant","messages":[{"role":"user","content":"ping"}],"max_tokens":5}' | jq .

Error Reference

401 — Authentication Error

Authentication error: Invalid API key provided

Causes: Key missing, revoked, or malformed. Fix:

# Verify key is set and starts with gsk_
echo "${GROQ_API_KEY:0:4}"  # Should print "gsk_"

# Test key directly
curl -s -o /dev/null -w "%{http_code}" \
  https://api.groq.com/openai/v1/models \
  -H "Authorization: Bearer $GROQ_API_KEY"
# Should return 200

429 — Rate Limit Exceeded

Rate limit reached for model `llama-3.3-70b-versatile` in organization `org_xxx`
on tokens per minute (TPM): Limit 6000, Used 5800, Requested 500.

Causes: RPM (requests/min), TPM (tokens/min), or RPD (requests/day) limit hit.

Rate limit headers returned:

Header Description
retry-after Seconds to wait before retrying
x-ratelimit-limit-requests Max requests per window
x-ratelimit-limit-tokens Max tokens per window
x-ratelimit-remaining-requests Requests remaining
x-ratelimit-remaining-tokens Tokens remaining
x-ratelimit-reset-requests When request limit resets
x-ratelimit-reset-tokens When token limit resets

Fix:

import Groq from "groq-sdk";

async function handleRateLimit<T>(fn: () => Promise<T>): Promise<T> {
  try {
    return await fn();
  } catch (err) {
    if (err instanceof Groq.APIError && err.status === 429) {
      const retryAfter = parseInt(err.headers?.["retry-after"] || "10");
      console.warn(`Rate limited. Waiting ${retryAfter}s...`);
      await new Promise((r) => setTimeout(r, retryAfter * 1000));
      return fn(); // Single retry
    }
    throw err;
  }
}

400 — Bad Request

Invalid parameter: model 'mixtral-8x7b-32768' is not available

Causes: Deprecated model ID, invalid parameters, or schema violation.

Common deprecated model IDs:

Deprecated Replacement
mixtral-8x7b-32768 llama-3.1-8b-instant or llama-3.3-70b-versatile
gemma2-9b-it llama-3.1-8b-instant
llama-3.1-70b-versatile llama-3.3-70b-versatile

Fix: Check current models at console.groq.com/docs/models or call GET /openai/v1/models.

413 — Request Too Large

Maximum context length is 131072 tokens. However, your messages resulted in 140000 tokens.

Fix: Reduce prompt size or split into smaller requests. All current Llama models have 128K context.

500 / 503 — Server Errors

Internal server error / Service temporarily unavailable

Causes: Groq infrastructure issue, model overloaded. Fix: Retry with backoff, fall back to a different model, check status.groq.com.

SDK-Specific Errors

TypeScript:

import Groq from "groq-sdk";

try {
  await groq.chat.completions.create({ /* ... */ });
} catch (err) {
  if (err instanceof Groq.APIError) {
    console.error(`Status: ${err.status}, Message: ${err.message}`);
  } else if (err instanceof Groq.APIConnectionError) {
    console.error("Network error:", err.message);
  } else if (err instanceof Groq.RateLimitError) {
    console.error("Rate limited:", err.message);
  } else if (err instanceof Groq.AuthenticationError) {
    console.error("Auth failed:", err.message);
  }
}

Python:

from groq import Groq, APIError, RateLimitError, AuthenticationError

try:
    client.chat.completions.create(...)
except RateLimitError as e:
    print(f"Rate limited: {e.message}")
except AuthenticationError as e:
    print(f"Auth error: {e.message}")
except APIError as e:
    print(f"API error {e.status_code}: {e.message}")

Escalation Path

  1. Check status.groq.com for ongoing incidents
  2. Collect request ID from error response (x-request-id header)
  3. Run groq-debug-bundle skill to gather diagnostics
  4. Contact Groq support with request ID and debug bundle

Resources

Next Steps

For comprehensive debugging, see groq-debug-bundle.

04 同仓库更多 Skills

jukeyman
jukeyman/jukeyman-skills

zustand-store-creator

Create zustand store creator operations. Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like "zustand store creator", "zustand creator", "zustand".

★ 1
jukeyman
jukeyman/jukeyman-skills

zero-trust-config-helper

Configure with zero trust config helper operations. Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like "zero trust config helper", "zero helper", "zero".

★ 1
jukeyman
jukeyman/jukeyman-skills

zapier-integration-helper

Assist with zapier integration helper operations. Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like "zapier integration helper", "zapier helper", "zapier".

★ 1
jukeyman
jukeyman/jukeyman-skills

yaml-config-validator

Validate yaml config validator operations. Auto-activating skill for DevOps Basics. Triggers on: yaml config validator, yaml config validator Part of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like "yaml config validator", "yaml validator", "yaml".

★ 1
jukeyman
jukeyman/jukeyman-skills

xvary-stock-research

Thesis-driven equity analysis from public SEC EDGAR and market data; /analyze, /score, /compare workflows with bundled Python tools (Claude Code, Cursor, Codex).

★ 1
jukeyman
jukeyman/jukeyman-skills

xss-vulnerability-scanner

Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals. Triggers on: xss vulnerability scanner, xss vulnerability scanner Part of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like "xss vulnerability scanner", "xss scanner", "xss".

★ 1