Prompts and scripts over one endpoint
Get started with the flux nsfw uncensored chat api in minutes. This guide covers authentication, basic requests, streaming, and JSON mode to integrate text generation into your NSFW media pipelines.
Authentication: API Key Setup
Sign up on the Get API key page using Google or email. No phone number is required. Your API key is shown immediately and is the only key active per account. If you generate a new key, the old one is replaced. Keep this key secure; it authenticates all requests to the base URL.
The flux nsfw api uses standard OpenAI-compatible authentication. Include your key in the Authorization header as a bearer token. If you receive a 401 error, your key is invalid or missing. There is no subscription fee; you pay only for tokens used.
Basic Chat Completion Request
Send text in, get text out. The base URL is https://api.fluxnsfw.top/v1. Use the model ID uncensored for content that does not refuse lawful adult topics. The following curl example demonstrates a standard chat completion request.
curl https://api.fluxnsfw.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."}]
}'Key parameters include temperature, top_p, stop, seed, presence_penalty, and frequency_penalty. The model supports a 100,000-token context window. Ensure your prompts fit within this limit. Errors and refusals are free, so you can test safely.
Python SDK Integration
Use the official OpenAI Python SDK to interact with the flux nsfw api. Set the base_url and api_key attributes before making calls. This approach allows you to reuse existing code from other OpenAI projects with minimal changes.
from openai import OpenAI
client = OpenAI(base_url="https://api.fluxnsfw.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)Python developers can leverage the SDK's ease of use for batch processing or script generation. Remember that the model ID is uncensored. The SDK handles tokenization and JSON serialization automatically. This is ideal for building backend services that generate prompts for image or video generation tools.
Node.js SDK for Real-Time Apps
For Node.js environments, configure the OpenAI SDK with the flux nsfw base URL. This setup is suitable for web applications that need to generate text dynamically. The SDK supports both synchronous and asynchronous requests.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.fluxnsfw.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);Use this integration to power chat interfaces or automated script writers. The uncensored model handles diverse topics without standard refusals. Ensure you handle errors gracefully, especially when dealing with rate limits or insufficient credit.
Streaming Responses for Real-Time Use
Enable streaming by setting stream: true in your request. The API returns data via Server-Sent Events (SSE). Token usage is reported in the last chunk. This is useful for real-time applications where users see output as it is generated.
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 reduces perceived latency for large outputs. Each chunk contains a portion of the response. Monitor the usage field in the final chunk to track token consumption accurately. This method is efficient for long-form content generation.
JSON Mode, Limits, and Errors
Use response_format: {"type": "json_object"} for structured output. This is critical for generating prompts that other tools can parse. The flux nsfw api ensures consistent JSON formatting when requested.
Limits: 300 requests per minute, 8 concurrent requests per key. Errors: 401 for invalid keys, 402 for no credit, 429 for rate limits. The context window is 100k tokens total, with no separate output cap. If max_tokens is unset, the response can run to the end of the window. Credit never expires, and prepaid balances are transparent.
Specs at a glance
Before you integrate, here is exactly what you get with a key.
| Item | Value |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Model ID | uncensored |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Authentication | Bearer token in the Authorization header |
| Base URL | https://api.fluxnsfw.top/v1 |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Structured output | response_format: {"type": "json_object"} |
| SSE streaming | Supported (stream: true), usage included at the end |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Completion length | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Context window | 100,000 tokens (prompt + completion together) |
| Concurrency | 8 requests at the same time per key |
| Requests per minute | 300/min per key |
| Max body | up to 8 MB per request |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Credit expiry | paid credit never expires, no subscription |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Trial credit | $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 |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Keys | one active key per account; a new key replaces the old one |
| Content | adult content allowed; sexual content involving minors is refused |
| Account | Google or e-mail and password |
When a request fails
Every error is JSON with a type you can switch on. You are never charged for an error.
| Code | Type | Meaning |
|---|---|---|
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 | unknown endpoint |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | temporary overload, retry shortly |
Questions and answers
Does the flux nsfw api generate images or video?
No. This is a text-only chat-completions API. It generates text for prompts, scripts, and post-processing. It does not produce images, audio, or video files.
How do I top up my credit?
Tops up are crypto-only: USDT (TRC20) or USDC (Base). Minimum $20, maximum $500 per transaction. Credit never expires and errors are free.
What is the hard content limit?
The model refuses sexual content involving minors. All other lawful adult, fictional, or controversial topics are allowed without refusal.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.