| name | groq-hello-world |
| description | Create a minimal working Groq chat completion example. Use when starting a new
Groq integration, testing your setup after installing the SDK, or learning the
basic Groq API request/response pattern before building something larger.
Trigger with phrases like "groq hello world", "groq example",
"groq quick start", "simple groq code".
|
| allowed-tools | Read, Write, Edit |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","groq","api","testing"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Groq Hello World
Overview
Build a minimal chat completion with Groq's LPU inference API. Groq uses an OpenAI-compatible endpoint, so the API shape is familiar -- but responses arrive 10-50x faster than GPU-based providers. This skill gets you from an installed SDK to a working, verified request; deeper variants (streaming, Python, model selection) live in references/.
Prerequisites
groq-sdk installed (npm install groq-sdk)
GROQ_API_KEY environment variable set
- Completed
groq-install-auth setup
Instructions
Use Write to create the example file, then run it to confirm your key and SDK work. Start with the single basic request below; reach for the reference variants only once this succeeds.
Step 1: Basic Chat Completion (TypeScript)
import Groq from "groq-sdk";
const groq = new Groq();
async function main() {
const completion = await groq.chat.completions.create({
model: "llama-3.3-70b-versatile",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "What is Groq's LPU and why is it fast?" },
],
});
console.log(completion.choices[0].message.content);
.();
}
().(.);