EN ▾
Get API key

NSFW LLM System Prompt: Structure and Working Examples

A system prompt does most of the steering when you use a model tuned to answer without content refusals. Here is a structure that works, plus examples for lawful adult fiction and roleplay.

Updated

Empty theatre stage with spotlight and glowing speech bubble, representing a system prompt setting the scene

What the system prompt does on an uncensored model

An nsfw llm system prompt has a different job from the one you write for a cautious assistant. A model tuned to answer without content refusals will not stop you, which also means it will not quietly steer toward a safe default. If your prompt is vague, the output is vague. The system prompt becomes the place where you decide the genre, the voice, the pacing and the limits.

This article assumes lawful adult use: fiction, roleplay and companion-style apps for adults. The model on this API is an open-weight model run by an independent provider, and it is tuned to answer without content refusals. One rule is fixed and no prompt changes it: no sexual content involving minors. Put your own limits in the prompt too, because a clear boundary written by you works better than relying on the model's guess.

The examples below stay non-explicit on purpose. The structure is what carries over to any adult story you write, and the details of the scene are yours to add.

A five-layer structure

Long, rambling prompts tend to be followed unevenly. Short, ordered ones work better. Use five layers and keep each to a few sentences.

  1. Role. Who the model is: narrator, game master, a named character, a co-author.
  2. Setting. The world, the time, the people present, and what the user's character can do.
  3. Style. Point of view, tense, sentence length, how much description versus dialogue.
  4. Boundaries. What the story will not include and what happens if the user pushes toward it.
  5. Output format. Length, whether to end on a question, whether to stay out of the user's character's head.

Order matters because models weigh the start and end of a prompt heavily. Put role first and the most important format rule last.

A sixth habit is worth adding: write the prompt as instructions for a person, not as a list of keywords. Plain sentences such as "keep the pace slow and let silences matter" give the model something to imitate, while a pile of adjectives produces generic prose. Read your prompt aloud. If a human collaborator would find it confusing, the model will too.

Example: a narrator for an adult romance story

Here is a prompt for an interactive story between adult characters. It sets up tone and pacing and keeps scenes at a level you control.

You are the narrator of an interactive romance set in a rain-soaked port city in the 1920s. All characters are adults. Write in second person present tense, addressed to the user's character, Mara. Use literate, restrained prose with sensory detail and short, charged dialogue. Move the story forward in each reply by introducing one new detail, tension or choice. Never write Mara's words or decisions for her. Keep replies between 150 and 250 words and end on a moment that invites her response. Do not summarise or add moral commentary.

Notice what is missing: no list of forbidden topics and no apologetic framing. It names the tone, the point of view and the pacing. The line "All characters are adults" is short and clear, and it keeps the story inside your rules from the first message.

Example: a persistent character for a companion app

For an app where a user talks with one persona over weeks, the prompt carries identity and memory. Keep stable facts in the system message and let the conversation history carry the rest.

You are Elin, a dry-witted ship's navigator in her thirties. You are talking with the user in private, as a friend who knows them well. Stay in character at all times. Speak in short, natural sentences with occasional teasing. Remember details the user mentions and bring them up later. You never claim to be human if the user sincerely asks if you are an AI. Respect the user's boundaries immediately when they state them, and change the subject when asked. Everyone in these conversations is an adult.

The honesty line is a design choice you can keep or drop, but many developers want it, and it is easy to state clearly. The line about respecting boundaries protects your users and also keeps sessions pleasant, which helps retention more than any amount of cleverness elsewhere.

Sending it from code

The system prompt is the first message with role system. Send it on every request, because the API does not keep state between calls. Here is a minimal chat loop using the OpenAI Python SDK with the uncensored model ID:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.nsfwflux.top/v1",
    api_key="YOUR_KEY",
)

SYSTEM = (
    "You are the narrator of an interactive mystery for adults. "
    "Write in second person present tense. Keep replies to 150-250 words. "
    "Never write the user's actions for them. End on a choice."
)

history = [{"role": "system", "content": SYSTEM}]

while True:
    user = input("You: ")
    history.append({"role": "user", "content": user})
    r = client.chat.completions.create(
        model="uncensored",
        messages=history,
        temperature=0.9,
        top_p=0.95,
        presence_penalty=0.3,
        stop=["\nUser:"],
    )
    reply = r.choices[0].message.content
    history.append({"role": "assistant", "content": reply})
    print(reply)

With a 100,000-token context window you can keep a long history before trimming. When you do trim, drop the oldest user and assistant turns and keep the system message at the top. If the history gets long, write a short summary into the system prompt instead of losing the plot.

Settings that pair well with a prompt

The prompt and the sampling parameters work together. These starting points are common for creative work, and you should adjust them from your own results:

  • temperature 0.8 to 1.0 for varied prose, lower if the story wanders.
  • top_p around 0.9 to 0.95.
  • presence_penalty and frequency_penalty between 0.2 and 0.5 if the model repeats favourite phrases.
  • seed fixed while you compare prompt versions, so differences come from the prompt and not from chance.

Cost is small for text work like this. A turn with a 3,000-token prompt and a 300-token reply costs 3,000 x $0.15 / 1,000,000 = $0.00045 for input plus 300 x $0.50 / 1,000,000 = $0.00015 for output, a total of $0.0006. A thousand such turns cost $0.60. The pricing page has the full rates.

Fixing common problems

The model writes your character's actions

Add a direct rule near the end of the prompt: "Never write the user's character's words, thoughts or actions." Models follow rules at the end of a prompt more reliably than rules buried in the middle.

The tone drifts after twenty turns

Long chats dilute the original instructions. Repeat a one-line style reminder as a second system message every ten turns, or fold the key style rules into the latest user message.

Replies get longer and longer

The model mirrors length. State a word range and enforce it with max_tokens as a hard ceiling. Since max_tokens is optional on this API, set it when you need a cap.

The story is flat

Ask for one new element per reply, as in the narrator example. Stories stall when nothing is asked to change.

Characters sound alike

Give each a speech habit in the prompt: clipped sentences, a favourite phrase, formal address. Two or three traits are enough.

The model asks permission or hedges

If you see phrases like "would you like me to continue", remove them with a format rule: "Do not ask whether to continue. Do not comment on the story." Hedging usually comes from the example text in your own prompt, so check that your examples do not model it.

Facts about the character are forgotten

Long history pushes early facts out of attention even within a 100,000-token window. Keep a short fact sheet in the system message and update it from your app when something important changes, such as a name, a promise or a location.

Next steps

Start with the narrator prompt above, change one layer at a time and compare the results at a fixed seed. If you need a key, the API key page lets you claim $0.50 of trial credit with one click after sign-up, which is plenty for dozens of prompt experiments. For more on calling the API from your own tools, see the docs and the integration guide.

Questions and answers

Does the system prompt override the minors rule?

No. The rule against any sexual content involving minors is fixed, and no prompt changes it. State that all characters are adults in your own prompt as well.

Should the system prompt be long?

Not usually. Five short layers of role, setting, style, boundaries and format work better than a long list. Add detail only where the output goes wrong.

Do I resend the system prompt each request?

Yes. The API does not keep conversation state, so send the full message list, starting with the system message, on every call.

How do I test prompt changes fairly?

Fix the seed and the sampling parameters, change one thing, and compare several replies side by side.

Your key is one form away

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

Get API key