EN ▾

Uncensored LLM API. Pay per token.grokaiapi.com

HomeDocs

Grok ai api Documentation

Build your NSFW or unrestricted AI applications with a single uncensored model and simple pay-as-you-go pricing.

https://api.grokaiapi.com/v1uncensored

Authentication & Base URL

Start by generating your API key via the dashboard or continuing with Google.

Point your client to https://api.grokaiapi.com/v1 and pass the key in the Authorization header. This base URL works with any OpenAI-compatible SDK, letting you swap in our uncensored model without rewriting your integration logic.

The /v1/chat/completions Endpoint

Send POST requests to /v1/chat/completions to get instant text responses.

Our API follows standard OpenAI specs, so you can integrate it quickly into your existing stack. The model ID is simply uncensored, ensuring you get direct access to our unrestricted model without proxy routers.

curl https://api.grokaiapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "What is the current version of the model?"}]
  }'

Python SDK Integration

Use the official Python SDK to handle requests with minimal code.

Configure the base URL and API key, then call the chat completions endpoint. This approach keeps your code clean and allows you to focus on building your application features rather than managing HTTP connections manually.

from openai import OpenAI

client = OpenAI(base_url="https://api.grokaiapi.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 SDK Setup

Implement the integration in Node.js by setting the environment variables correctly.

The SDK handles the request lifecycle automatically, making it easy to add our uncensored LLM to your backend services. You can manage the conversation history and context window directly through standard array structures.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.grokaiapi.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 Responses & Token Counts

Enable streaming by setting stream: true in your request body.

Receive real-time token outputs via Server-Sent Events. The final chunk contains the total token usage, allowing you to track costs accurately without extra API calls. This feature is essential for building responsive chat interfaces that feel instant.

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)

Limits, Errors, and Context

Our API supports a 100,000 token context window for long-running conversations.

Handle errors like 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. You are limited to 300 requests per minute and 8 concurrent requests per key. Keep your request bodies under 8 MB to ensure smooth performance.

FAQ

Do I need to rent a GPU server for the grok AI API?

No, our API is fully hosted on our own servers. You simply pay per token, avoiding the complexity and cost of managing your own infrastructure.

Is this the official Grok API from xAI?

No, we are an independent service. Our model is an open-weight, uncensored LLM that follows OpenAI specs, but it is not the official Grok model from xAI.

How does the uncensored model handle content?

Our model does not refuse lawful adult, fictional, or controversial topics. It is designed for freedom and privacy, making it ideal for NSFW chatbots and unrestricted AI applications.

Unlock your API key

Sign up, grab your key, and update your base URL. It takes seconds.