Quickstart for NSFW GPT users
Get started with the NSFW GPT API in minutes using standard OpenAI-compatible endpoints. This quickstart covers authentication, making requests, handling streaming, and managing your credits.
Prerequisites
Before making your first request, you need an API key. Sign up on the Get API key page using Google or email. You receive a single active key immediately; generating a new key invalidates the previous one. You also need a prepaid balance. Credits are topped up via crypto (USDT on TRC20 or USDC on Base) and charged by real token usage. Errors and refusals are free. You can start with $0.50 of trial credit valid for 7 days, no card needed. Claim this credit with one click on your API key page.
Authentication
Our API is OpenAI-compatible. Pass your API key in the Authorization header as a bearer token. The base URL is https://api.nsfwgpt.cc/v1. This works with any OpenAI SDK or client by setting the base URL and API key. The model ID to use is uncensored. Ensure your client points to our specific base URL to avoid hitting standard OpenAI endpoints.
Sending a Request
Send a POST request to /v1/chat/completions. The model ID is uncensored. The context window is 100,000 tokens total. Below is a basic example using curl.
curl https://api.nsfwgpt.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 endpoint returns text. We do not support embeddings, images, or audio. If you need those, you must handle them separately and pass the results as text context.
Python SDK
Use the official openai Python package. Set the base URL and API key. The model is uncensored. Configure parameters like temperature or max_tokens as needed. There is no separate output cap (if max_tokens is not set, the response can run to the end of the window). Use this for local scripts or backend services.
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwgpt.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)Remember that our API key is single-active. If you rotate keys, update your environment variable.
Node SDK
Install the openai Node package. Initialize the client with your base URL and key. Send messages to the uncensored model. This works for server-side Node.js applications. You can use standard parameters like stop sequences or seed for reproducibility.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.nsfwgpt.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);Ensure your Node environment handles the JSON response properly. We support response_format for strict JSON output if needed.
Streaming Responses
Enable streaming by setting stream: true. The API returns Server-Sent Events (SSE). Each chunk contains partial text. The final chunk includes token usage statistics. This is ideal for UIs that display text as it is generated. It reduces perceived latency for long responses.
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)Handle the stream end event to close connections or process final token counts.
What the API supports
Before you integrate, here is exactly what you get with a key.
| Parameter | Details |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Model | uncensored |
| Base URL | https://api.nsfwgpt.cc/v1 |
| Authentication | Bearer token in the Authorization header |
| Max context | 100,000 tokens, input and output combined |
| 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 |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Function calling | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Parallel requests | 8 requests at the same time per key |
| Requests per minute | 300/min per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Request size | 8 MB request body |
| 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 |
| Payment | 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 |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Bonus credit | +5% from $50, +10% from $100, +15% from $200 |
| Account | Google or e-mail and password |
| Keys | one active key per account; a new key replaces the old one |
| Content policy | adult content allowed; sexual content involving minors is refused |
When a request fails
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| HTTP | Type | What to do |
|---|---|---|
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 | out of credit; add credit and retry |
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 |
Questions and answers
What are the rate limits?
You are limited to 300 requests per minute per key and 8 concurrent requests at the same time. The request body must be under 8 MB. If you hit the limit, you will receive a 429 error.
How do I handle errors?
Common errors include 401 (invalid API key), 402 (no credit), and 429 (rate limit). Errors and refusals do not consume your token credit. Check the response body for details.
What is the context window?
The total context window is 100,000 tokens for prompt and completion combined. There is no separate output cap. If you do not set max_tokens, the response can run to the end of the window.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.