Groq api Quickstart
Connect your uncensored LLM to the groq API quickly using standard OpenAI-compatible tools. This guide covers authentication, basic requests, and streaming with the 'uncensored' model.
Prerequisites and Dependencies
Start by generating your groq API key on the dashboard. You can sign in with Google or use an email and password. No phone number is required. The key appears immediately for copy-pasting.
Ensure your environment supports the official OpenAI SDKs. Our base URL is HTTPS://api.apigroq.com/v1. This works with any client that accepts standard OpenAI endpoints. You do not need to install extra middleware.
Authenticating Your groq API Key
Pass your key in the Authorization header as a Bearer token. This authenticates every request to the uncensored AI service. If the key is invalid, you receive a 401 error. If you lack credits, you get a 402 error.
- Header:
Authorization: Bearer YOUR_API_KEY - Do not expose keys in client-side code.
Sending Your First Completion
Send a POST request to /v1/chat/completions. Use the model ID uncensored. This model answers without content refusals for lawful adult use. Set top_p to 1 and temperature to 0 for consistent results.
curl https://api.apigroq.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list dependencies in requirements.txt"}]
}'The response returns text only. No embeddings or images are generated. Errors do not consume your prepaid credit.
Handling Streaming Responses
Use Server-Sent Events for real-time token delivery. Set stream: true in your request. Each chunk contains partial text. The final chunk includes token usage details.
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)This approach reduces perceived latency for large responses. Your client must handle the data: prefix and parse JSON objects.
Python SDK Integration
Install the official OpenAI Python package. Configure the client with our base URL and your key. This allows direct usage of the uncensored LLM without OpenRouter.
from openai import OpenAI
client = OpenAI(base_url="https://api.apigroq.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)The SDK handles retries and JSON parsing automatically. You can also enable JSON mode by setting response_format to {"type": "json_object"}.
Node SDK and Limits
Use the Node.js OpenAI client similarly. Set the base URL to our endpoint. Monitor your rate limits closely.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apigroq.com/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);You are limited to 300 requests per minute per key. You can have 8 concurrent requests. The request body must stay under 8 MB. The context window is 100,000 tokens total. Max output is 16,000 tokens unless specified otherwise.
Frequently asked questions
How do I generate a groq API key for this uncensored service?
Go to the dashboard and click 'Get API key'. You can authenticate via Google or email/password. The key is displayed immediately and can be used with any OpenAI-compatible SDK.
What happens if I hit the rate limit on the groq API?
You will receive a 429 status code. The limit is 300 requests per minute per key. You can also have 8 concurrent requests. Wait a moment and retry with exponential backoff.
Which payment methods do you accept?
Crypto only: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500. Bonus credit applies from $50.
Get your API key in minutes
Sign up, retrieve your key, and update your base URL. That is all the configuration required.