Integrate the uncensored ai api quickly
Start using the uncensored AI API in minutes by pointing your existing OpenAI-compatible client to our base URL. This quickstart covers authentication, chat completions, streaming, and tool calling with concrete examples.
Authentication and base URL
Yes, you can authenticate instantly using the base URL provided on the dashboard. Our service uses standard API key headers compatible with any OpenAI SDK. You receive your key immediately after signing up with Google or email. No phone number is required for the initial setup.
Set the base_url to https://api.isgrokuncensored.com/v1. Pass your key in the Authorization header. The system validates credentials before processing any tokens. Errors like 401 indicate an invalid or missing key. Check the dashboard if the key fails.
Chat completions endpoint
Send a POST request to /v1/chat/completions to get text responses. The endpoint accepts standard message arrays and returns generated text. It does not support images, audio, or embeddings. Use the model ID uncensored for all requests. This ensures you are using the correct open-weight model.
Input tokens cost $0.15 per million, while output tokens cost $0.50 per million. Prepaid credit deducts only for actual usage. Errors and refusals do not consume your balance. You can send up to 8 MB per request body. This limit covers most standard text interactions.
Streaming responses and token usage
Enable streaming by setting stream to true in your request. You receive Server-Sent Events (SSE) for real-time token delivery. The final chunk contains the total token usage statistics. This allows you to track costs in real time. It is essential for building responsive chat interfaces.
Parse the SSE data to update your UI incrementally. The model generates text continuously until the context window fills or a stop sequence triggers. Max output is 16,000 tokens per request. You must specify max_tokens to exceed the default 2,048 tokens. This prevents unexpected billing from long responses.
Function calling and JSON mode
Use the tools parameter to enable function calling capabilities. Define your tool schema in the request body. The model will return structured arguments for your functions. This works seamlessly with standard OpenAI-compatible clients. You can also force JSON output using response_format. This is useful for parsing structured data.
Set response_format to {"type": "json_object"} to get pure JSON. This mode disables conversational filler text. It is ideal for programmatic integrations. You can combine tools and JSON mode for complex workflows. The API handles the parsing internally. You only need to validate the output structure.
Model parameters: temperature and top_p
Adjust temperature to control randomness. Higher values produce more creative outputs. Lower values make responses more deterministic. The default is usually 1.0. You can set it between 0 and 2. Use top_p for nucleus sampling. This limits the probability mass of considered tokens. It works alongside temperature to refine output quality.
Other supported parameters include stop sequences, seed for reproducibility, and penalties like presence_penalty. These allow fine-tuning of the generation process. You can experiment with different combinations. The API respects all standard OpenAI parameters. This ensures easy migration from other providers. Test different values to find the best fit for your use case.
Limits, errors, and context window
The context window supports 100,000 tokens total. This includes both prompt and completion tokens. You can send large documents for analysis. Rate limits allow 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests. Exceeding these limits returns a 429 error. Retry with exponential backoff.
Handle errors gracefully in your code. A 402 error means your prepaid credit is exhausted. Top up using crypto to continue service. A 401 error indicates an authentication issue. Check your key validity. The API does not charge for failed requests due to validation errors. This protects your balance from accidental spikes.
cURL
curl https://api.isgrokuncensored.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Return the current UTC timestamp"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.isgrokuncensored.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.isgrokuncensored.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)Frequently asked questions
What is the base URL for the uncensored AI API?
The base URL is HTTPS://api.isgrokuncensored.com/v1. You must set this in your OpenAI-compatible SDK configuration. It replaces the default OpenAI endpoint. This ensures requests go to our servers. The URL supports both streaming and non-streaming requests. Use it for all chat completions.
How do I handle streaming responses with the uncensored LLM?
Set the stream parameter to true in your request. You will receive Server-Sent Events (SSE) containing partial text. Parse each chunk to update your interface. The final chunk includes token usage data. This allows real-time display of generated text. It is efficient for large responses.
What happens if I exceed the rate limit?
You receive a 429 status code. The API allows 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests. Implement exponential backoff in your client. This prevents overwhelming the server. Retry the request after a short delay. The API does not charge for rate-limited requests if they fail validation.
Get your API key now
Sign up, copy your key, and update your base URL. That is all you need to configure.