EN ▾
Get API key

Text API quickstart

Integrate the Flux Uncensored text API into your NSFW content pipelines with these essential code snippets. This OpenAI-compatible endpoint handles prompt generation, script writing, and text extraction with zero refusals for lawful adult content.

Base URL
https://api.fluxuncensored.top/v1
Model
uncensored

Base URL and Authentication

All requests target https://api.fluxuncensored.top/v1. Authentication uses a standard Authorization: Bearer <key> header. Obtain your key via the dashboard using Google or email. The API is strictly text-based, serving the uncensored model for chat completions. It does not generate images, audio, or video, making it ideal for preprocessing prompts or post-processing outputs in your pipeline.

First Request

Send a standard chat completion request to test connectivity. The endpoint accepts text input and returns text output. Ensure your payload includes the model ID and messages array. This basic call verifies your authentication and establishes the baseline for more complex pipeline steps. The model responds without content refusals for lawful adult themes, ensuring your NSFW scripts are delivered as intended.

Python SDK Integration

Use the official OpenAI Python library for seamless integration. Configure the base URL and API key before initializing the client. This approach allows you to leverage existing tools in your Python NSFW content generation workflows. The SDK handles serialization and response parsing automatically, letting you focus on prompt engineering and content logic for your specific use case.

Node SDK Implementation

Install the @anthropic-ai/node or openai Node package and configure the base URL. This enables direct integration into your Node.js pipelines for script generation or text extraction. Set the API key in the client configuration. This method is efficient for server-side NSFW content processing, allowing you to handle large volumes of text requests with minimal overhead in your application architecture.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE), delivering tokens incrementally. This reduces perceived latency for users generating long NSFW stories or scripts. Token usage details are included in the final chunk, allowing you to track costs accurately without waiting for the full completion to arrive.

Limits, Errors, and Context

The context window is 100,000 tokens total, and output can run to the end of the window. Rate limits are 300 requests per minute and 8 concurrent requests per key. Errors and refusals are free. A hard limit blocks sexual content involving minors. Use JSON mode for structured data or function calling for tool integration. These constraints ensure predictable performance for your NSFW text pipelines.

cURL

curl https://api.fluxuncensored.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."}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.fluxuncensored.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)

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.fluxuncensored.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);

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)

Capabilities and limits

If your tool speaks the OpenAI API, these are the details that matter.

SpecValue
ProtocolOpenAI Chat Completions schema; official openai SDKs work unchanged
Modeluncensored
API keyBearer token in the Authorization header
MethodsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.fluxuncensored.top/v1
Context window100,000 tokens (prompt + completion together)
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Completion lengthup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
JSON modeJSON object mode via response_format json_object
StreamingSupported (stream: true), usage included at the end
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Request sizeup to 8 MB per request
Concurrencyup to 8 in parallel per key
Rate limit300/min per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Volume bonus+5% from $50, +10% from $100, +15% from $200
Token pricesinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
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
Subscriptionpaid credit never expires, no subscription
Keysone active key per account; a new key replaces the old one
Content policyuncensored for adults; the only hard rule: no sexual content involving minors
Sign-insign in with Google or with e-mail + password

When a request fails

The type field is stable, the message is for humans. Errors cost nothing.

StatusTypeReason
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditout of credit; add credit and retry
403content_blockedsexual content involving minors — refused, not billed
404not_foundunknown endpoint
413request_too_largebody over 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busytemporary overload, retry shortly

Questions and answers

What is the maximum output length per request?

There is no separate output cap. If you do not set the max_tokens parameter, the response can run to the end of the window. The total context window, including both prompt and completion, is 100,000 tokens.

How do I handle authentication errors?

If your key is invalid or expired, the API returns an error indicating authentication failure. Ensure you are using the correct base URL and that your API key is active. You can generate a new key via the dashboard if needed, as each account allows only one active key at a time.

Are refusals common for adult content?

Refusals are rare for lawful adult content. The model is tuned to answer without refusals for NSFW topics. The only hard limit is the absence of sexual content involving minors, which is always blocked. Errors and refusals do not incur charges.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key