EN ▾
Start now

GLM NSFW API: A Hosted Option for Adult Fiction Apps

We know of no official glm nsfw api, and large vendors' hosted models generally apply content policies of their own. If you build adult fiction, roleplay or companion apps for lawful adult use, a hosted text API tuned not to refuse is the practical alternative. Here is what it does and does not do.

Last updated

A theatre stage with masks and glowing dialogue bubbles, representing roleplay and fiction writing

Summary

  • Hosted models from major vendors enforce content policies. Check each vendor's usage terms before you build on them.
  • This API runs one open-weight model tuned to answer without content refusals for lawful adult use. It is not a GLM service.
  • Hard limit: no sexual content involving minors. Text only, no images, audio or video.
  • OpenAI-compatible, $0.15 per 1M input tokens and $0.50 per 1M output tokens, crypto top-ups.

Why filtered models get in the way of adult fiction

Developers who write interactive fiction, romance serials, companion characters or mature storytelling tools run into the same wall: the model drops out of the scene, lectures, or returns a refusal in the middle of a plot. Large vendors set usage policies for their hosted models, and those policies apply to your API traffic too. We do not summarize any vendor's policy here. Read the current terms of the service you are considering, and test with the kind of prompts your product actually sends.

For adult-oriented products that is a business risk, not an inconvenience. A refusal at the wrong moment breaks the experience, and an account flagged for policy reasons can lose access. Teams in that position look for an endpoint whose operator allows lawful adult content.

What this API is

This is a hosted, OpenAI-compatible text API. It runs one open-weight model, ID uncensored, operated by an independent provider and tuned to answer without content refusals for lawful adult use. Base URL: https://api.glmnsfw.com/v1.

It is not the official API of any model vendor, GLM included, and it is not a router that forwards your prompts to other companies. You get one model behind a standard interface, so existing OpenAI SDK code works after you change the base URL and key.

  • Endpoints: POST /v1/chat/completions, POST /v1/responses, GET /v1/models.
  • Context: 100,000 tokens, prompt plus completion. That is room for a long character sheet and a very long conversation.
  • Features: streaming, tool calling, JSON mode, and the usual sampling settings.
  • Privacy: prompts are not used for training.

The limits, stated plainly

An honest description includes what is off the table.

  • No sexual content involving minors. This is a hard limit with no exceptions, whatever the framing, fictional or not.
  • Lawful adult use only. You are responsible for what your product does with the output, and for complying with the law where you operate and where your users are.
  • Text only. No image, audio or video generation, no embeddings and no fine-tuning.
  • Age gating is yours. If your app serves mature content, verify that users are adults on your side.

The NSFW chatbot myths vs. facts article covers common misunderstandings in more depth.

A working example: a story companion

The pattern below sets up a fiction-writing assistant for adults. The system prompt defines the role and the boundaries, and the user message carries the scene. The content here stays neutral on purpose; your product decides the rest.

from openai import OpenAI

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

system = (
    "You are a co-author for an adults-only interactive fiction app. "
    "Stay in the story, keep continuity with earlier scenes, and match the "
    "tone the user sets. All characters are adults."
)

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

def turn(user_text):
    history.append({"role": "user", "content": user_text})
    resp = client.chat.completions.create(
        model="uncensored",
        messages=history,
        temperature=0.9,
        top_p=0.95,
    )
    text = resp.choices[0].message.content
    history.append({"role": "assistant", "content": text})
    return text

print(turn("Open a slow-burn romance between two rival chefs in a small coastal town."))

Two details help in practice. First, state in the system prompt that all characters are adults, which keeps the model and your own review process aligned. Second, keep the full history in messages; with a 100,000-token window you can carry a long story before you need to summarize.

Building the boundaries into your own app

The API tuning removes model-side refusals. It does not replace product decisions that belong to you. Teams that ship adult fiction responsibly tend to put these in place.

  • Age verification before access. Gate the product itself, because a line in a system prompt is not an age check.
  • Clear content settings. Let users choose intensity and topics they want, and store those choices as part of the system prompt for the session.
  • A fixed adults-only rule for characters. Put it in the system prompt, as in the example above, and reject user input that tries to change it.
  • Input checks of your own. A small classifier or keyword screen on user messages catches requests that fall outside your rules and the law before they reach the model.
  • Retention choices. Decide how long you keep chat logs and tell users. The API does not use prompts for training, but your own database is your responsibility.
  • A report path. Give users a way to flag a bad output, and review those flags.

None of this is exotic. It is the same discipline a social platform applies to user content, applied to generated text.

Settings for creative writing

Fiction benefits from a higher temperature, around 0.8 to 1.0, with top_p near 0.95. If the model repeats phrases across a long story, raise the frequency or presence penalty a little. Use seed only when you want to replay a scene. Stream the output with stream: true so users see text as it is written, and remember a streamed request holds one concurrency slot until it ends.

curl https://api.glmnsfw.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "uncensored", "stream": true, "temperature": 0.9, "messages": [{"role": "user", "content": "Continue the scene at the harbor café."}]}'

Keeping long stories coherent

The 100,000-token window is generous, but long stories still drift. Three habits keep them steady without wasting tokens.

  1. Keep a short "story bible" at the top of the system prompt: names, ages, relationships, setting and tone, in a few lines.
  2. When history passes a size you choose, such as 60,000 tokens, ask the model to summarize older scenes into a paragraph and replace them. The summary call is an ordinary request and costs a fraction of a cent.
  3. Re-state the active scene goal in each user turn when the plot stalls.

With a 60,000-token history, each turn sends about that many input tokens: 0.06 x 0.15 = $0.009 per turn for input. Summarizing before the history grows keeps that number from climbing.

Prompt patterns for roleplay and companion apps

Persona quality comes from structure, not length. A compact system prompt usually beats a page of adjectives.

  • Identity block. Name, age (an adult), role, speaking style, and three or four traits.
  • Relationship and setting. Who the user is to the character, where the scene takes place, and what happened last.
  • Rules of play. Reply length, point of view, whether to use actions in asterisks, and when to ask a question back.
  • Memory line. One or two facts the character must not forget, refreshed from your database each turn.
  • Out-of-character switch. A phrase users can type to pause the story and talk plainly.

Keep the persona text stable across turns so it stays at the start of the prompt, and put new facts at the end. A character that gets re-described every turn drifts, and the extra tokens add cost for no gain.

Cost and getting started

Rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens. A story app resends history, so input grows. A turn with 8,000 input tokens and 600 output tokens costs 0.008 x 0.15 + 0.0006 x 0.50 = $0.0012 + $0.0003 = $0.0015. A thousand such turns cost about $1.50. Failed or refused requests are not charged, and credit never expires.

Top up with any whole amount from $20 to $500 in USDT on TRC20 or USDC on Base, with a bonus of +5% from $50, +10% from $100 and +15% from $200. See the pricing page for the table. New users can try it first: sign up, then claim $0.50 of trial credit with one click on the API key page. The trial lasts 7 days and needs no card. Request details are in the docs.

FAQ

Is there an official GLM NSFW API?

Not that we know of; check the vendor's current docs. Hosted models from major vendors follow their own content policies. This service is an independent API with a different model, tuned for lawful adult use.

What content is not allowed?

No sexual content involving minors, under any framing. The service is also for lawful use only.

Does it generate images?

No. It is a text API only, with no image, audio or video generation.

Are prompts used for training?

No. Prompts are not used for training.

Get your API key

Sign up, retrieve your key, and update your base URL. Setup is that simple.

Start with trial credit

Enter email and password to receive your key instantly.