EN ▾

OpenAI-compatible API for NSFW text generation

Claim trial key

Unrestricted AI Text Generator: First Request to Streaming

An unrestricted ai text generator that you reach through an API is a model that answers without content refusals for lawful adult use, called with the same code you would use for any OpenAI-style service. Here is the path from first request to streamed output.

Last updated

A glass valve releasing ribbons of light from a terminal, illustrating unrestricted text generation by API

Summary

  • Point any OpenAI SDK at the base URL and use the model name uncensored.
  • The system prompt sets tone and format, and does most of the work.
  • Use temperature 0.7 to 1.0 for prose and lower for structured output.
  • Streaming with stream: true shows text as it is written and holds a concurrency slot until it ends.

Before you start

You need three things: an account, an API key and a place to run a few lines of code. Sign up with Google, or with email and password, then open the API key page. New users can claim $0.50 of trial credit there with one click. It needs no payment method and is valid for 7 days.

Store the key in an environment variable named API_KEY. Never put it in front-end code or a public repository. If it leaks, regenerate it on the same page and the old key stops working at once.

A word on the word unrestricted: this model is tuned to answer without content refusals for lawful adult use. It is still bound by the law, and sexual content involving minors is never allowed.

Your first request

The base URL is https://api.uncensoredaitext.com/v1 and the model is uncensored. Authentication is a bearer token.

curl https://api.uncensoredaitext.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [
      {"role": "user", "content": "Write the opening paragraph of a noir story set in a flooded city."}
    ]
  }'

The same call in Python:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredaitext.com/v1",
    api_key=os.environ["API_KEY"],
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Write the opening paragraph of a noir story set in a flooded city."}],
)
print(resp.choices[0].message.content)

And in Node, using the official openai package:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.uncensoredaitext.com/v1",
  apiKey: process.env.API_KEY,
});

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Write the opening paragraph of a noir story set in a flooded city." }],
});
console.log(resp.choices[0].message.content);

The API also accepts POST /v1/responses and lists models at GET /v1/models. Details are in the docs.

A system prompt for tone

With no filter layer between you and the model, the system prompt is how you control the output. A good one is short and specific. It names the voice, the format, the length and the things to avoid.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredaitext.com/v1",
    api_key=os.environ["API_KEY"],
)

SYSTEM = (
    "You are a fiction writer with a dry, hard-boiled voice. "
    "Write in first person, past tense. Use concrete detail, short sentences "
    "and no moralising. Do not add disclaimers or notes about the text. "
    "Keep each answer between 150 and 250 words."
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": SYSTEM},
        {"role": "user", "content": "A detective finds a locked door in the harbour office."},
    ],
)

If the output drifts, tighten the prompt instead of raising the temperature. Put hard rules last and phrase them as instructions ("Write in past tense") rather than prohibitions ("Don't use present tense"). Add a stop sequence with stop if you need output to end at a marker.

Temperature and other settings

Temperature, top_p, stop, seed and the frequency and presence penalties are passed through to the model. Start with these defaults and adjust one at a time.

Tasktemperaturetop_pNote
Story or dialogue0.8 to 1.00.95Higher for variety, lower if names or facts drift
Product copy, rewriting0.5 to 0.70.9Stays closer to the input
Structured output0.0 to 0.31.0Pair with JSON mode
Repetitive outputunchangedunchangedAdd a small frequency or presence penalty such as 0.3

Change temperature or top_p, not both at once. Use seed while you test prompts so you can tell a prompt change from random variation. max_tokens is optional, and the completion can use whatever remains of the 100,000-token window.

Streaming the response

Long outputs feel slow if you wait for the full text. Set stream: true and the API sends server-sent events as tokens are produced, with usage reported at the end.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredaitext.com/v1",
    api_key=os.environ["API_KEY"],
)

stream = client.chat.completions.create(
    model="uncensored",
    stream=True,
    messages=[{"role": "user", "content": "Write a 300-word scene on a night train."}],
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
print()

For a web page, stream from your own server to the browser instead of calling the API from client code, so the key never leaves your server. Check the box in the checklist below before you publish anything.

A streamed request holds its concurrency slot until the stream ends. A full key has 8 slots and a trial key has 2, so close streams you no longer need.

Keeping a conversation going

The API keeps no state between calls. For a chat, send the earlier messages with every request, oldest first, and append the new reply to your list after each turn.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredaitext.com/v1",
    api_key=os.environ["API_KEY"],
)

messages = [{"role": "system", "content": "You are a patient co-author. Plain prose, no disclaimers."}]

def say(text):
    messages.append({"role": "user", "content": text})
    r = client.chat.completions.create(model="uncensored", messages=messages)
    reply = r.choices[0].message.content
    messages.append({"role": "assistant", "content": reply})
    return reply

print(say("Start a story about a lighthouse keeper."))
print(say("Now make the storm arrive."))

Input tokens grow with every turn, because the whole list is sent each time. Trim old messages or replace them with a short summary once the list gets long. The window of 100,000 tokens is large, but you pay for every input token you send.

If the first request fails

Most first-run problems come from a handful of mistakes.

  • Wrong base URL. The path must end in /v1. Leaving it off, or adding /chat/completions to the base URL in an SDK, gives a not found error.
  • Bad or revoked key. The request is rejected as unauthorised. Check that the header reads Authorization: Bearer YOUR_KEY, with one space. If you regenerated the key, the old one stopped working at once.
  • Empty balance. Trial credit lasts 7 days. Check GET /v1/balance or the X-Balance-USD response header.
  • Too many at once. A burst of parallel calls on a trial key returns 429 with code concurrency. Cap your pool at 2 on a trial key.

If the reply comes back but reads badly, the cause is almost always the prompt. Print the exact messages list you sent, check that the system message is first, and make sure an old test prompt is not still in the history.

Every response includes an X-Request-Id header. Log it. If you ever contact support, that one value lets them find your request.

A checklist before you ship

Run through this list once your first requests work:

  1. Keep the key in a server-side environment variable, never in browser code.
  2. Log X-Request-Id and X-Balance-USD for every call.
  3. Handle HTTP 429 by waiting and retrying, with a limit on the number of retries.
  4. Set a length instruction in the system prompt so outputs do not run long without reason.
  5. Test with a fixed seed and then without it, so you know how much your output varies.
  6. Decide what happens if the stream is cut half way: show what arrived, or retry the whole request.

Limits, errors and cost

A full key allows 8 concurrent requests and 300 requests per minute. The trial key allows 2 and 60. Past a limit you get HTTP 429 with code rate_limited or concurrency. On temporary overload the API also returns 429 with Retry-After: 5, so wait five seconds and retry.

Cost is small for text. A 2,000-token prompt with a 500-token reply costs $0.0003 + $0.00025 = $0.00055. The rates, $0.15 per 1M input tokens and $0.50 per 1M output tokens, are on the pricing page. Failed or refused requests are not charged.

To compare models on the same site before you commit, read choosing the right uncensored AI model.

Common questions

Does unrestricted mean anything goes?

No. The model answers without content refusals for lawful adult use, but it must follow the law, and content involving minors is never allowed.

Which model name do I use?

Use uncensored as the model ID in every request.

Can I use the official OpenAI SDK?

Yes. Change the base URL and the key, and keep the rest of your code.

How long can the output be?

The context window is 100,000 tokens for prompt plus completion. The completion can use what is left, and max_tokens is optional.

API key ready in seconds

Sign up, copy the key, update your base URL. That is the entire setup.