Switch your client in three lines
Integrate the uncensored Gemini API alternative into your existing stack using standard OpenAI-compatible endpoints. This quickstart covers authentication, streaming, structured output, and tool use for the 'uncensored' model.
Authentication: Setting Your API Key
Start by generating your API key on the Get API key page via Google or email. This key authenticates all requests to the base URL https://api.nsfwgemini.top/v1. Unlike corporate gateways, we use a prepaid credit model charged by real token usage, with errors and refusals remaining free. Your key is the sole identifier for your account, allowing 300 requests per minute and up to 8 concurrent connections.
curl https://api.nsfwgemini.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'Keep your key secure. If you lose it, generate a new one on the dashboard; the old key becomes invalid immediately. There are no monthly subscriptions, and prepaid credit never expires, so you can pause usage indefinitely without penalty.
Endpoint: POST /v1/chat/completions
Send your prompts to POST /v1/chat/completions using any standard OpenAI-compatible SDK. The endpoint accepts a JSON body with model, messages, and optional parameters. We support streaming via Server-Sent Events (SSE) and non-streaming responses. For non-streaming requests, the final chunk includes token usage statistics, allowing you to track costs accurately.
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwgemini.top/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)Our API adheres to standard OpenAI protocols, making migration from other providers straightforward. You simply point your client to our base URL and provide your key. The system handles the routing to our uncensored model, ensuring your prompts define the output without corporate policy interference.
Model ID: Using 'uncensored'
Set the model parameter to "uncensored". This open-weight model runs on our dedicated servers and is tuned to answer without content refusals for lawful adult use. It is not GPT, Claude, Gemini, or any other vendor's model. The context window supports 100,000 tokens for prompt and completion combined, with no separate output cap.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.nsfwgemini.top/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);If you do not specify max_tokens, the response can run to the end of the window. This model excels in creative writing, roleplay, and controversial topics, delivering raw text output suitable for integration into bots, apps, or custom workflows.
Streaming Responses via SSE
Enable streaming by setting stream: true. The API returns Server-Sent Events (SSE) for real-time token delivery. This is ideal for chat interfaces where latency matters. Each chunk contains a portion of the generated text. The final chunk includes the full token usage details, allowing you to calculate costs precisely.
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)Streaming reduces perceived latency significantly. Since we charge by token usage, you can start displaying content to users immediately while the model continues generating. Errors during streaming are handled gracefully, and you are not charged for tokens that fail to transmit.
Structured Output: JSON Mode
Use response_format: {"type": "json_object"} to enforce JSON output. This ensures the model returns strictly formatted JSON, ideal for parsing in your application. Combine this with temperature and top_p to control creativity versus determinism. JSON mode is particularly useful for extracting structured data from unstructured text or generating configuration objects.
Function calling is also supported via the tools and tool_choice parameters. You can define custom functions that the model can invoke, enabling complex workflows and tool integration within your uncensored LLM API setup.
Function Calling & Tool Use
Define tools in your request body to allow the model to invoke external functions. Use tool_choice to force or auto-select tool usage. This enables dynamic interactions where the model can fetch data or trigger actions based on user input. Function calling works seamlessly with streaming and JSON modes.
Parameters like temperature, top_p, stop, seed, presence_penalty, and frequency_penalty give you fine-grained control over generation. Adjust temperature for creativity or consistency, and use seed for reproducible results. These tools ensure the API fits your specific use case, whether it's creative writing or technical automation.
Questions and answers
What happens if I exceed the rate limit?
You will receive a 429 Too Many Requests error. The limit is 300 requests per minute per key, with a maximum of 8 concurrent requests. Wait a few seconds and retry, or upgrade your usage plan if available.
How are errors handled in the API?
Errors return standard HTTP status codes: 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Token usage is only charged for successful completions, so errors and refusals are free.
Can I use this API for commercial projects?
Yes, you can use the output for commercial purposes as long as the content is lawful. The model does not refuse lawful adult, fictional, or controversial topics. Just ensure your use case complies with local laws and avoids prohibited content like sexual content involving minors.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Technical specifications
A quick checklist for developers: format, limits, features, billing.
| Item | Value |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Model ID | uncensored |
| Base URL | https://api.nsfwgemini.top/v1 |
| Authentication | Bearer token in the Authorization header |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Streaming | Yes — server-sent events; the last chunk carries token usage |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Max context | 100,000 tokens, input and output combined |
| JSON mode | response_format: {"type": "json_object"} |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Rate limit | 300 requests per minute per key |
| Parallel requests | up to 8 in parallel per key |
| Request size | 8 MB request body |
| Bonus credit | +5% from $50, +10% from $100, +15% from $200 |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Free trial | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Subscription | no monthly fee; paid credit does not expire |
| Keys | one active key per account; a new key replaces the old one |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
| Account | sign in with Google or with e-mail + password |
Error codes
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | unknown endpoint |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | temporary overload, retry shortly |