EN ▾
Start now

API Reference: Chat Completions

Integrate the uncensored AI API into your application with a single code change. This guide covers the OpenAI-compatible endpoints, streaming, and tool calling you need to build unrestricted generation into your stack.

Quickstart: First Request

Send your first chat completion request in under a minute. The endpoint accepts standard OpenAI payloads and returns unrestricted text responses. Initialize the client with your API key and the base URL. Then call the chat completions endpoint with the model ID set to "uncensored". The model generates text without content refusals for lawful adult use.

You can verify the connection by listing available models. This confirms the server is reachable and your credentials are valid. The response confirms the model ID and endpoint availability.

Authentication and Base URL

Use your API key for every request to the base URL https://api.geminisemcensura.com/v1. The key is generated instantly when you sign up via Google or email. Pass it in the Authorization header as a Bearer token. If you generate a new key, the old one becomes invalid immediately. This simplifies credential management for your applications. You can regenerate keys directly from the dashboard without losing your prepaid credit.

Parameters: Temperature, Top P, and Stop

Control generation randomness with standard parameters. Set temperature to adjust creativity. Lower values produce more deterministic outputs. Higher values introduce variation. Use top_p for nucleus sampling to limit the token pool. The stop parameter halts generation when a specific sequence appears. This is useful for controlling output length or structure.

These parameters work exactly as they do in the OpenAI SDK. You can fine-tune the response style without changing the model. The uncensored model respects these constraints while maintaining its lack of content refusals. Adjust them to fit your specific use case.

Streaming Responses (SSE)

Enable streaming by setting stream to true. The server returns a sequence of Server-Sent Events. Each event contains a partial chunk of the generated text. This allows you to display output in real-time. It reduces perceived latency for end-users.

The final chunk includes the token usage statistics. You can track input and output tokens for billing accuracy. Errors during streaming are sent as a final event with an error object. Handle these events to manage network interruptions gracefully.

Tool Calling and JSON Mode

Use function calling to integrate external tools. Define functions in the tools parameter. The model returns structured arguments for the specified function. You execute the function and send the result back to the model. This enables complex multi-step workflows. JSON mode enforces strict JSON output. Use response_format with json_object for reliable parsing.

The uncensored model handles tool definitions without refusing based on topic. It supports standard OpenAI tool schemas. This ensures compatibility with existing tool-use libraries. You can build agents that interact with APIs or databases seamlessly.

Limits and Quotas

The API enforces strict rate limits to ensure stability. You are allowed 300 requests per minute per key. Concurrency is limited to 8 simultaneous requests. The maximum request body size is 8 MB. The context window supports 100,000 tokens for input and output combined. The default max output is 2,048 tokens unless you specify otherwise.

If you exceed the rate limit, you receive a 429 error. The response includes a retry-after header. Monitor your usage to avoid interruptions. These limits apply to all endpoints, including streaming requests. Plan your batch jobs accordingly.

cURL

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

Python

from openai import OpenAI

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

FAQ

Is the gemini sem censura API compatible with the official OpenAI SDKs?

Yes, it is fully OpenAI-compatible. You only need to change the base URL and API key in your client configuration. The endpoint structure and response format match the standard chat completions API.

What happens if I get a 402 error?

A 402 error indicates that your prepaid credit is exhausted. Since we use a prepaid model, you must top up your account to continue making requests. You can add credit using USDT or USDC via crypto. The trial credit expires after 7 days if not used.

Does the uncensored model refuse content?

The model does not refuse lawful adult, fictional, or controversial topics. The only hard limit is sexual content involving minors, which is always refused. This makes it suitable for creative writing, roleplay, and unrestricted research applications.

Get your API key in minutes

Register, retrieve your key, and update the base URL. That is all.

Start nowView documentation