EN ▾
Start now

Uncensored Chat Completions API Documentation

Get your uncensored LLM working immediately with our OpenAI-compatible API. This quickstart guide covers authentication, basic requests, and streaming for high-volume, low-cost development.

Base URL and Authentication

Start every request by pointing your SDK to our base URL and attaching your key. We use standard header authentication, so existing clients work without modification. Your key grants access to the uncensored model for lawful adult content and unrestricted creative work.

  • Base URL: https://api.grokaiapikey.com/v1
  • Header: Authorization: Bearer YOUR_API_KEY

Generate your key instantly via Google or email login. No phone number required. The key is unique per account, and generating a new one replaces the old active key immediately.

First Request

Send your first completion using the standard chat completions endpoint. This simple POST request demonstrates how to interact with the model for text generation. You can replace the system prompt to define the persona or behavior.

Ensure your request body includes the model field set to uncensored. The API returns a standard JSON response containing the generated text and token usage statistics.

Python SDK Integration

Use the official OpenAI Python library to integrate our API into your projects. This approach requires minimal code changes if you are migrating from other providers. Set the base URL to our endpoint and provide your API key.

The client handles authentication and serialization automatically. You can send multiple messages in the history to maintain context. This method is ideal for backend services and scripted workflows.

Node SDK Integration

Implement the API in Node.js using the standard OpenAI SDK package. This setup works seamlessly with JavaScript and TypeScript projects. Configure the client with our base URL and your secret key.

The SDK manages the request lifecycle and response parsing. You can easily add error handling for network issues or invalid requests. This pattern is perfect for web servers and real-time applications.

Streaming and Token Usage

Enable streaming for real-time token delivery to your users. This feature reduces perceived latency by sending data as it is generated. The SDK handles the event stream and updates your interface incrementally.

Token usage details appear in the final chunk of the stream. This allows you to track costs accurately without extra API calls. Streaming is supported for all standard requests.

Limits, Errors, and Context

Your account is subject to specific rate limits and context constraints. The model supports a context window of 100,000 tokens for both prompt and completion combined. You can set a maximum output of 16,000 tokens per request.

Common errors include 401 for invalid keys, 402 when credit runs out, and 429 for rate limits. The rate limit is 300 requests per minute per key. Errors do not consume your prepaid credit, ensuring you only pay for successful generations.

cURL

curl https://api.grokaiapikey.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate a list of ten common unix commands with brief descriptions"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.grokaiapikey.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)

Node.js

import OpenAI from "openai";

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

Streaming

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)

Common inquiries

What is the base URL for the API?

The base URL is HTTPS://api.grokaiapikey.com/v1. You must set this in your OpenAI-compatible client to route requests correctly. It supports standard headers and authentication methods.

How do I handle rate limits?

You are limited to 300 requests per minute per key. If you exceed this, the API returns a 429 error. You can also run up to 8 requests simultaneously per key.

Does the API support streaming?

Yes, streaming is supported via Server-Sent Events (SSE). Token usage information is included in the final chunk of the stream. This allows for real-time display of generated text.

Key generation in seconds

Register, copy your token, update the endpoint. That is all configuration required.

Start now