Switch your client in three lines
Get started with the uncensored Gemma API in minutes. This guide covers authentication, basic requests, streaming, and rate limits for direct integration.
Base URL and Authentication
The API follows the OpenAI chat-completions standard. Set your base URL to https://api.gemmansfw.top/v1 and include your API key in the Authorization header. You can generate a key instantly via Google or email on the Get API key page. No credit card is required for the initial trial.
curl https://api.gemmansfw.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."}]
}'Ensure the header format matches Authorization: Bearer YOUR_API_KEY. If the key is invalid, the API returns a 401 error. If your prepaid credit is exhausted, you receive a 402 error. The key works immediately upon creation.
The /v1/models Endpoint
Verify connectivity and available models by querying the models list. This endpoint confirms your authentication is correct and lists the model ID you should use for generation. The only available model ID is uncensored.
from openai import OpenAI
client = OpenAI(base_url="https://api.gemmansfw.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)Use this endpoint during initialization to confirm your client is connected to the correct server. The response confirms the model details and pricing structure without consuming request credits.
Chat Completions Endpoint
Send text data to the model using the POST /v1/chat/completions endpoint. The model ID is uncensored. You can pass a list of messages in the messages array. The API returns text completions without filtering for lawful adult, controversial, or fictional themes.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.gemmansfw.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);The request body must include the model field set to uncensored. The API responds with generated text. Errors during processing do not charge your credit. The context window supports 100,000 tokens total, and if max_tokens is not specified, the response can run to the end of the window.
Streaming Responses (SSE)
Enable real-time token delivery by setting stream: true in your request. The API returns Server-Sent Events (SSE). Each chunk contains partial text until the final chunk, which includes the total token usage statistics.
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)Stream responses reduce perceived latency for long outputs. Parse the SSE stream in your client to display tokens as they generate. This is ideal for chat interfaces or real-time data feeds where immediate feedback is required.
Function Calling and JSON Mode
The API supports structured outputs and tool integration. Use response_format: {"type": "json_object"} to force JSON output, ensuring reliable parsing for backend systems. You can also define tools in the request body for function calling capabilities.
This feature allows the model to return structured data instead of free-form text. Combine JSON mode with tool definitions to create robust integrations where the model acts as a logic engine. The uncensored model handles complex instructions without refusing based on content type.
Rate Limits and Context Window
Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. If you exceed these limits, the API returns a 429 Too Many Requests error. These limits reset every minute.
The context window allows 100,000 tokens for the combined prompt and completion. There is no separate output cap. The max_tokens parameter is optional, and if it is not set, the response can run to the end of the window. Errors and refusals (such as for minor sexual content) do not consume tokens or credits.
API facts in one table
Use this table to decide whether the API fits your project before you buy credit.
| Parameter | Details |
|---|---|
| Protocol | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Model ID | uncensored |
| API key | Bearer token in the Authorization header |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Base URL | https://api.gemmansfw.top/v1 |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| JSON mode | JSON object mode via response_format json_object |
| Tools / tool calls | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Streaming | Supported (stream: true), usage included at the end |
| Context window | 100,000 tokens, input and output combined |
| Other parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Requests per minute | 300 requests per minute per key |
| Parallel requests | 8 requests at the same time per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Max body | up to 8 MB per request |
| Credit expiry | paid credit never expires, no subscription |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Trial credit | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Keys | one active key per account; a new key replaces the old one |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
| Sign-in | Google or e-mail and password |
HTTP errors
The type field is stable, the message is for humans. Errors cost nothing.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
What happens if I make a mistake or get double charged?
Credit is topped up with crypto and never expires. If you encounter a billing error like a double charge, contact support through the Support page to fix it. Credits are not refunded, but errors are corrected.
Does the uncensored model filter all adult content?
The model does not refuse lawful adult, fictional, or controversial topics. However, a hard limit always applies to sexual content involving minors, which will be refused. All other lawful content passes through.
How do I top up my credit?
Top up using USDT (TRC20) or USDC (Base). Minimum top-up is $20, maximum is $500. You receive a +5% bonus for top-ups of $50, +10% for $100, and +15% for $200. No credit cards or PayPal are accepted.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.