Switch your client in three lines
Get your API key and start sending requests in minutes. This quickstart covers the basics of connecting your client code to our uncensored text generation API.
Authentication
Our API uses standard API key authentication. You can get a key by signing up with Google or an email address on the Get API key page. The key is displayed immediately and is unique to your account. Pass this key in the Authorization header as a bearer token. If the key is invalid, you will receive a 401 error. If you run out of prepaid credit, you will receive a 402 error. We do not require a credit card for the trial account, which includes $0.50 in valid credit for 7 days. Claim this credit with one click on your API key page.
Base URL: https://api.openainsfw.top/v1
Basic Request Example
Send a simple text completion request using the standard chat-completions endpoint. This example uses the model ID uncensored, which serves our open-weight model tuned for minimal refusal.
You can use any OpenAI-compatible SDK or HTTP client. Simply update the base URL to point to our endpoint and set your API key.
curl https://api.openainsfw.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."}]
}'The model returns text output. It does not support embeddings, images, or audio. Errors and refusals (except for the hard limit on minor sexual content) do not consume your prepaid credit.
Python SDK
Use the official openai Python package to interact with our API. Configure the client with the correct base URL and API key. This approach ensures you are using the same client code structure as major vendors, making migration straightforward.
from openai import OpenAI
client = OpenAI(base_url="https://api.openainsfw.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)The model ID is always uncensored. You can adjust parameters like temperature or top_p to control randomness. The API handles streaming and parsing automatically when using the SDK methods.
Node SDK
For JavaScript or TypeScript projects, use the openai Node.js package. Set the baseURL to our endpoint and provide your API key. This allows you to use familiar methods like chat.completions.create.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.openainsfw.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);Ensure your Node.js environment supports the SDK version you prefer. The API responds with standard JSON objects containing the generated text in the choices array. You can also use raw fetch if you prefer not to include the SDK dependency.
Streaming Responses
Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream of chunks. Each chunk contains a small portion of the generated text.
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)Token usage information is provided in the last chunk of the stream. This allows you to track costs in real-time. Streaming is useful for applications that benefit from low latency, such as chat interfaces. The context window supports up to 100,000 tokens total, with no separate output cap per request.
Rate Limits and Errors
Each API key is limited to 300 requests per minute and 8 concurrent requests. The request body size is capped at 8 MB. If you exceed these limits, you will receive a 429 error. We allow one active key per account; generating a new key replaces the old one.
Common errors include 401 for invalid keys and 402 for insufficient credit. Errors do not consume your prepaid credit. For refunds on mistakes like double charges, use the Support page. Credit never expires.
What the API supports
Everything the endpoint can and cannot do, in one place — check it before you top up.
| Spec | Value |
|---|---|
| Protocol | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Base URL | https://api.openainsfw.top/v1 |
| Authentication | Authorization: Bearer YOUR_KEY |
| Model | uncensored |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Max context | 100,000 tokens, input and output combined |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Structured output | JSON object mode via response_format json_object |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Concurrency | up to 8 in parallel per key |
| Requests per minute | 300/min per key |
| Request size | up to 8 MB per request |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Token prices | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Credit expiry | paid credit never expires, no subscription |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| 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 policy | adult content allowed; sexual content involving minors is refused |
| Keys | one key per account, regenerate any time (the old one stops working) |
| Sign-in | sign in with Google or with e-mail + password |
Errors and what to do
Every error is JSON with a type you can switch on. You are never charged for an error.
| Code | Type | Meaning |
|---|---|---|
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 | 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 | 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 model is running?
We run a single open-weight uncensored model identified by the ID 'uncensored'. It is not GPT, Claude, or any other vendor's model. It is tuned to answer without content refusals for lawful adult use.
How do I pay?
We accept only USDT (TRC20) or USDC (Base). You can top up any whole amount from $20 to $500. Credit does not expire, and errors are free.
Is there a free tier?
New accounts get $0.50 in trial credit valid for 7 days. Claim this credit with one click on your API key page. No credit card is needed. After that, you must top up with crypto to continue using the API.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.