OpenRouter NSFW: First request in five minutes
Get your first uncensored response in under five minutes using our OpenAI-compatible API. This guide covers base configuration, SDK integration, and streaming for rapid development.
Base URL and Authentication
Start by configuring your client with our base URL. Replace the standard OpenAI endpoint with https://api.openrouternsfw.cc/v1. You will need an API key, which you generate instantly via the Get API key page using Google or email. No phone number is required. Your key authenticates all requests. The system supports standard headers, so existing OpenAI SDKs work without modification. Just update the base URL and set your key. This ensures your code remains portable while leveraging our uncensored model for lawful adult content generation.
First Request
Verify connectivity with a simple chat completion. Use the model ID uncensored to invoke our open-weight model tuned for minimal refusals. The following example demonstrates a direct HTTP POST request. Ensure you include your API key in the Authorization header. This confirms your prepaid credit is active and the endpoint responds correctly. You can adjust the prompt content as needed for your specific use case.
curl https://api.openrouternsfw.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."}]
}'
This request returns a standard JSON response containing the generated text. If you encounter a 401 error, check your key. A 402 indicates insufficient credit, which you can top up via crypto. A 429 means you hit the rate limit. Keep these codes in mind while debugging your initial integration.
Python SDK Integration
For Python developers, the official openai package works directly with our API. Set the base_url parameter to our endpoint and provide your API key. The model ID remains uncensored. This approach minimizes code changes if you are migrating from another provider. The SDK handles tokenization and request formatting automatically. You can use this setup for batch processing or interactive scripts. Remember that errors like 402 or 429 are returned as standard HTTP errors, allowing your code to handle them gracefully.
from openai import OpenAI
client = OpenAI(base_url="https://api.openrouternsfw.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)
This method is ideal for backend services or data processing pipelines where structured responses are preferred over streaming. The context window supports up to 100,000 tokens total, allowing for substantial prompt history.
Node.js SDK Usage
Node.js developers can use the openai npm package similarly. Configure the client with our base URL and key. The request structure mirrors the Python example. Streaming is supported, but for simple completions, the standard response object is sufficient. This integration works well for web servers or CLI tools. Ensure your environment supports the required Node version for the SDK. The API key is passed securely in the header. You can test connectivity immediately after configuration.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.openrouternsfw.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);
This setup is robust for applications requiring reliable text generation. The prepaid credit model means you only pay for what you use, with no monthly fees. Errors are handled via standard HTTP status codes.
Streaming Responses
For real-time user experiences, enable streaming. Set stream: true in your request. The API returns Server-Sent Events (SSE) instead of a single JSON object. Each chunk contains partial text. The final chunk includes token usage statistics for billing verification. This is crucial for applications displaying text as it generates. Streaming reduces perceived latency for end-users. Ensure your client handles the SSE stream correctly. The model supports streaming for all standard parameters.
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 is ideal for chat interfaces or live dashboards. It works seamlessly with the uncensored model, providing continuous output without waiting for the full response to complete.
Limits, Errors, and Context
Monitor your usage to avoid service interruptions. The rate limit is 300 requests per minute per key, with a concurrency limit of 8 simultaneous requests. Request bodies must stay under 8 MB. If you receive a 401, your key is invalid. A 402 means you need to top up credit via crypto. A 429 indicates you exceeded the rate limit. The context window is 100,000 tokens total. There is no separate output cap. These limits ensure stable performance for high-volume developers.
Technical specifications
Before you integrate, here is exactly what you get with a key.
| Item | Value |
|---|---|
| API format | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Model ID | uncensored |
| Base URL | https://api.openrouternsfw.cc/v1 |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Authentication | Bearer token in the Authorization header |
| JSON mode | response_format: {"type": "json_object"} |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Max context | 100,000 tokens (prompt + completion together) |
| Function calling | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| SSE streaming | Supported (stream: true), usage included at the end |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Max body | 8 MB request body |
| Rate limit | 300/min per key |
| Concurrency | 8 requests at the same time per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Billing | prepaid credit, charged by real token usage; errors and refusals are free |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| 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 |
| Token prices | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Credit expiry | no monthly fee; paid credit does not expire |
| Top-up | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Account | Google or e-mail and password |
| Key management | one key per account, regenerate any time (the old one stops working) |
| Content | adult content allowed; sexual content involving minors is refused |
Errors and what to do
The type field is stable, the message is for humans. Errors cost nothing.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
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 | unknown endpoint |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
How do I top up my credit?
Tops up are crypto-only, accepting USDT (TRC20) or USDC (Base). You can deposit any whole amount between $20 and $500. Bonus credit is added for larger deposits, and the credit never expires.
What happens if I get a 402 error?
A 402 error indicates insufficient prepaid credit. You must add funds via the crypto payment gateway before making further requests. Errors and refusals do not consume credit, but successful completions do.
Is there a free trial?
Yes, new accounts receive $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 to start. You can generate an API key immediately using Google or email authentication.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.