Get up and running with the Groq API in a few minutes.

Create an API Key

Please visit here to create an API Key.

Configure your API key as an environment variable. This approach streamlines your API usage by eliminating the need to include your API key in each request. Moreover, it enhances security by minimizing the risk of inadvertently including your API key in your codebase.

In your terminal of choice:

export GROQ_API_KEY=<your-api-key-here>

Requesting your first chat completion

Install the Groq Python library:

pip install groq

Performing a Chat Completion:

import os

from groq import Groq

client = Groq(

chat_completion =
            "role": "user",
            "content": "Explain the importance of fast language models",


Now that you have successfully received a chat completion, you can try out the other endpoints in the API.

Next Steps