it ▾

Uncensored API. OpenAI Compatible.keyapigrok.com

Start hereAPI reference

Developer Quickstart: Integrate the Uncensored Model

Drop the uncensored model into your existing stack with one base URL change. This guide shows you exactly how to integrate the API using standard OpenAI SDKs.

https://api.keyapigrok.com/v1uncensored

Base URL and Authentication

Start by pointing your client to our dedicated endpoint. Replace the default provider URL with https://api.keyapigrok.com/v1 and pass your key in the Authorization header. Just sign in with Google or email and copy the key immediately.

POST /v1/chat/completions: Parameters and Payloads

Send your first request using the standard chat completion endpoint. The model ID is uncensored and it accepts all standard parameters like temperature and stop sequences.

Here is a basic request structure:

curl https://api.keyapigrok.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Set the debug level to three"}]
  }'

The system processes text in and text out. It does not support images or audio. You can adjust the temperature for creativity or set it low for deterministic output.

Python SDK Integration

Use the official OpenAI Python library to interact with the API. Set the base URL to our domain and provide your key. This ensures you can use existing code with minimal changes.

from openai import OpenAI

client = OpenAI(base_url="https://api.keyapigrok.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 response object contains the generated text in content. You can iterate over the result or use it directly in your application logic.

Node SDK Integration

Integrate the API in your Node.js projects by configuring the OpenAI client. Point the API base URL to our server and pass your key.

import OpenAI from "openai";

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

This approach works with any Node.js framework. You can handle the response asynchronously and process the text output as needed.

Streaming Responses and Token Usage

Enable streaming by setting stream: true in your request. You will receive Server-Sent Events (SSE) for real-time output. The final chunk includes the 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 allows you to display text as it generates. It reduces perceived latency for users. You can parse the SSE data to update your UI incrementally.

Error Handling and Rate Limits

Handle errors gracefully by checking the status code. A 401 means your key is invalid. A 402 indicates you need more credit. A 429 means you hit the rate limit of 300 requests per minute.

The context window is 100,000 tokens for prompt and completion combined. The max output is 16,000 tokens. Requests over this limit are refused. Errors do not consume your credit.

FAQ

What is the grok API key?

It is a bearer token that authenticates your requests to our API. You get it immediately after signing up with Google or email. Use it in the Authorization header for all requests.

Does it work with the OpenAI SDK?

Yes, it is fully OpenAI compatible. You just need to change the base URL to <code>https://api.keyapigrok.com/v1</code> and use the model ID <code>uncensored</code>. The rest of your code remains the same.

How do I top up my credit?

You can top up using USDT (TRC20) or USDC (Base). Payments range from $20 to $500. You get bonus credit for larger amounts. Credit never expires.

Key generation in seconds

Sign up, copy the key, update the endpoint. That is the full configuration.