vi ▾
Get API key

Quickstart: Send your first uncensored request

Get your uncensored LLM API key and send your first request in minutes. This guide walks you through installing the SDK, configuring the base URL, and making your first API call with the Groq API key generate process.

Install the Official SDK

Start by installing the official OpenAI-compatible SDK for your preferred language. This library handles authentication and request formatting automatically. For Python, run pip install openai. For Node.js, use npm install openai. This ensures you are using the standard tools that work with our openai compatible api endpoint without needing custom HTTP clients.

from openai import OpenAI

client = OpenAI(base_url="https://api.groqapikeygenerate.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)
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.groqapikeygenerate.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);

Configure Your Base URL

Point your SDK client to our specific base URL to access the uncensored model. You must set the base_url to https://api.groqapikeygenerate.com/v1. This directs requests to our infrastructure instead of the standard OpenAI servers. Ensure you also set your api_key from the dashboard. This configuration is critical for accessing the uncensored llm model with ID uncensored.

Set Your API Key

Retrieve your key from the dashboard after signing in with Google or email. Paste this key into your environment variables or SDK configuration. The key authenticates your prepaid credit usage. If the key is invalid, you will receive a 401 error. Keep this key secure, as it controls your token spending. You can generate a new key at any time, which replaces the old one immediately.

Send a Chat Completion Request

Send a simple text prompt to test the connection. Use the POST /v1/chat/completions endpoint with the model ID uncensored. This returns a text response without content filters for lawful adult use. You can adjust parameters like temperature and top_p to control creativity. This step confirms your nsfw llm integration is working correctly.

curl https://api.groqapikeygenerate.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate an API key for my new project"}]
  }'

Handle Streaming Responses

Enable streaming for real-time token generation. Set stream=true in your request. The API returns chunks as they are generated, improving perceived latency. Monitor the final chunk for usage data to track token consumption. This method is ideal for chat interfaces where users expect immediate feedback. It works seamlessly with the official SDKs.

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)

Use Function Calling and JSON Mode

Leverage structured outputs for your applications. Use response_format={"type":"json_object"} to force JSON output. You can also define tools for function calling. This allows your app to extract data or trigger actions directly. The model supports these features without requiring external parsing libraries. Configure tool_choice to control how the model uses available tools.

Common questions

How do I generate an API key for this service?

Sign up using Google or an email address on the dashboard. Your API key is displayed immediately upon creation.

What is the context window size?

The model supports a 100,000 token context window for both input and output combined. You can generate up to 16,000 tokens per request. If you do not set <code>max_tokens</code>, the default output limit is 2,048 tokens.

What happens if I hit a rate limit?

You are limited to 300 requests per minute and 8 concurrent requests per key. If you exceed this, you will receive a <code>429</code> error. Ensure your application handles retries appropriately to avoid disrupting your user experience.

Get your key now

Sign up, grab your key, update the endpoint. That’s it.

Get API key