First request in five minutes
Get your first uncensored text generation running in under five minutes using the OpenAI-compatible endpoint. This guide covers authentication, basic requests, and streaming with our prepaid token model.
Install the SDK
Begin by installing the official OpenAI SDK for your preferred language. Since our endpoint follows the standard /v1/chat/completions protocol, you can use the same client libraries you already know. For Python, use pip install openai. For Node.js, run npm install openai. This ensures compatibility with the base structure of our API while allowing you to override the connection details in the next step.
Configure Base URL
By default, the SDK points to OpenAI's servers. You must point it to our base URL to use the uncensored model. Create a new client instance and set the base_url to https://api.ollamansfw.cc/v1. You also need to provide the API key you generated on our site. The model ID to request is simply "uncensored". This configuration is all that is needed to switch from the standard OpenAI endpoint to our independent service.
Send a Chat Completion
Make your first request to test connectivity and response quality. Send a POST request to the chat completions endpoint with a simple prompt. The API will return a text response from the uncensored model. Ensure you are using the correct model ID "uncensored" in your request payload. This step confirms that your prepaid credit is active and the endpoint is responding to standard OpenAI-style JSON payloads.
Handle Streaming Responses
For lower latency, enable streaming by setting stream to true. The API returns chunks of text as they are generated. This is ideal for real-time applications where you want to display tokens as they appear. Note that token usage statistics are provided in the final chunk of the stream. This approach reduces perceived latency for the end user while maintaining the same cost structure per token.
Use JSON Mode
If your application requires structured data, set response_format to {"type": "json_object"}. The model will attempt to return strictly valid JSON. This is useful for parsing complex outputs or feeding data directly into downstream systems. While the model is tuned for natural language, JSON mode improves consistency for structured tasks. Ensure your prompt clearly instructs the model to output JSON to minimize formatting errors.
Limits and Errors
Monitor your request limits to avoid interruptions. The API allows 300 requests per minute and 8 concurrent requests per key. If you exceed these, you will receive a 429 error. Authentication errors return 401, and insufficient credit returns 402. The context window is 100,000 tokens total, with no separate output cap. Errors and refusals do not consume your prepaid credit.
cURL
curl https://api.ollamansfw.cc/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."}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.ollamansfw.cc/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.ollamansfw.cc/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)What the API supports
A quick checklist for developers: format, limits, features, billing.
| Spec | Value |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Model | uncensored |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| API key | Authorization: Bearer YOUR_KEY |
| Base URL | https://api.ollamansfw.cc/v1 |
| Structured output | JSON object mode via response_format json_object |
| Other parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Context window | 100,000 tokens (prompt + completion together) |
| 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 |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Request size | up to 8 MB per request |
| Rate limit | 300 requests per minute per key |
| Parallel requests | 8 requests at the same time per key |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Top-up | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Credit expiry | paid credit never expires, no subscription |
| Free trial | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Content | adult content allowed; sexual content involving minors is refused |
| Sign-in | sign in with Google or with e-mail + password |
| Key management | one key per account, regenerate any time (the old one stops working) |
Errors and what to do
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 | out of credit; add credit and retry |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
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 |
Questions and answers
What happens if I exceed the rate limit?
You will receive a 429 status code. The limit is 300 requests per minute and 8 concurrent requests per key. If you hit the concurrent limit, wait until previous requests finish before sending new ones.
Does the API support image generation?
No, this is a text-only API. We do not offer image, audio, or video generation. You can use our text API to generate prompts or descriptions, but image rendering must be handled by a separate service.
How do I top up my credit?
You can top up using USDT (TRC20) or USDC (Base) via crypto. Minimum top-up is $20, and there are no monthly fees. Credit never expires, and errors do not consume your balance.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.