EN ▾

API documentation for developers

Get started with our uncensored LLM API in minutes. Use standard OpenAI-compatible tools to send raw, unfiltered text responses for your applications.

Authentication and Base URL

Your API key authenticates every request. Use https://api.nsfwtext.cc/v1 as your base URL. Pass the key in the Authorization header. This setup works with any OpenAI-compatible client.

curl https://api.nsfwtext.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Check server status now"}]
  }'

Generate your key instantly via Google or email. No phone number required. The key appears immediately after signup.

First Request

Send your first message to the uncensored model. Use the model ID uncensored for raw output. The endpoint accepts standard chat-completions payloads.

from openai import OpenAI

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

Replace placeholders with your actual key. The response contains the generated text directly. Errors return standard HTTP codes.

Streaming Responses

Receive tokens in real-time via Server-Sent Events. Enable streaming by setting stream to true. Token usage appears in the final chunk.

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)

Process each chunk as it arrives. This reduces perceived latency for long outputs. Handle partial sentences gracefully in your UI.

Function Calling and JSON Mode

Define tools for structured data extraction. Use response_format with {"type": "json_object"} for strict JSON output. This ensures reliable parsing in your backend.

import OpenAI from "openai";

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

Specify tool definitions in the tools array. The model returns tool calls or direct text. Validate the JSON structure before use.

Parameters and Context

Control generation with temperature, top_p, and seed. The context window supports 100,000 tokens total. Max output is 16,000 tokens per request.

Set max_tokens to prevent excessive usage. Use stop sequences to truncate output early. Adjust presence_penalty for variety.

Limits and Errors

Rate limits allow 300 requests per minute. Concurrency is capped at 8 simultaneous requests. Request bodies must stay under 8 MB.

Use 401 for invalid keys. 402 indicates insufficient prepaid credit. 429 signals rate limit exhaustion. Credit never expires, so you can top up anytime.

Frequently asked questions

What is the NSFW text API base URL?

Use HTTPS://api.nsfwtext.cc/v1 for all requests. This base URL works with standard OpenAI SDKs. Update your client configuration to point here.

How do I handle streaming responses?

Set stream to true in your request. The API returns Server-Sent Events. Parse each chunk to display tokens in real-time. Check the final chunk for token usage.

What happens if I run out of credit?

You receive a 402 error code. Top up using USDT or USDC. Credit is prepaid and never expires. Errors and refusals do not consume credit.

Get your API key instantly

Register, retrieve your key, and update your base URL. That is all you need to do.

Open account