EN ▾
Start now

NSFW Chatbot LLM API Cost: Per User and Per Month

The nsfw chatbot llm api cost that surprises people is not the replies, it is the history. Every turn re-sends the whole conversation, so input tokens dominate a long roleplay. Here are the numbers for a typical session and a month of users.

Last updated

Long and trimmed chains of chat bubble cubes flowing into a glass gauge, showing conversation cost

Summary

  • Chat APIs are stateless, so each turn pays for the full history again as input tokens.
  • A 100-turn roleplay with untrimmed history costs about $0.2556; with a 20-turn window, about $0.1086.
  • At 1,000 users and 100 turns each, trimming turns about $256 a month into about $109.
  • A $20 top-up covers about 184 trimmed 100-turn sessions, and credit never expires.

The short answer

Under the pricing of $0.15 per 1M input tokens and $0.50 per 1M output tokens, a 100-turn roleplay session costs roughly a quarter of a dollar if you send the whole history every time, and roughly a tenth of a dollar if you keep a rolling window of recent turns. Replies are cheap. Re-reading the past is where the money goes.

The rest of this article shows the arithmetic, so you can swap in your own prompt length and reply size. The structure of the app itself is covered in the NSFW chatbot build guide.

Why history drives the bill

The chat completions endpoint is stateless. The server does not remember your last message; you send the system prompt and every earlier turn on each request. Input tokens grow by one exchange per turn, while output stays about the same size.

For the examples below, assume:

  • System prompt (persona and rules): 800 tokens
  • User message: 60 tokens
  • Assistant reply: 250 tokens, so each finished exchange adds 310 tokens to the history

Input for turn n is 800 + (n - 1) x 310 + 60. Here is how that looks and what each turn costs at $0.15 per 1M input tokens, plus 250 output tokens at $0.50 per 1M ($0.000125):

TurnInput tokensInput costTurn total
1860$0.000129$0.000254
103,650$0.000548$0.000673
5016,050$0.002408$0.002533
10031,550$0.004733$0.004858

By turn 100 one reply costs about 19 times more than the first, and almost all of that is input.

Example A: 100 turns with the full history

Input tokens form a simple series: the first turn sends 860 tokens, the hundredth sends 31,550, and the sum across 100 turns is (860 + 31,550) / 2 x 100 = 1,620,500 tokens.

  • Input: 1,620,500 x $0.15 / 1,000,000 = $0.2431 (exactly $0.243075)
  • Output: 100 x 250 = 25,000 tokens x $0.50 / 1,000,000 = $0.0125
  • Session total: about $0.2556

There is also a ceiling. With these sizes, prompt plus completion reaches the 100,000-token window around turn 320, and past that the request no longer fits. Trimming is a cost tool and also a requirement for very long sessions.

Example B: the same session with a 20-turn window

Now keep only the last 20 exchanges (6,200 tokens of history) plus the system prompt.

  • Turns 1 to 20 still grow: 20 x 860 + 310 x (0 + 1 + ... + 19) = 17,200 + 58,900 = 76,100 input tokens.
  • Turns 21 to 100 each send 800 + 6,200 + 60 = 7,060 tokens: 80 x 7,060 = 564,800.
  • Total input: 640,900 tokens x $0.15 / 1,000,000 = $0.0961 (exactly $0.096135).
  • Output is unchanged at $0.0125.
  • Session total: about $0.1086.

The window cut the bill by more than half, and the cost per turn is flat after turn 20. What you lose is long memory, which you can replace with a short summary of older events or a small list of facts the character must remember. A 300-token summary adds only $0.000045 per turn at the input price ($0.15 x 300 / 1,000,000).

Scaling to a month of users

Take 1,000 monthly active users who each play one 100-turn session in the month. Everything scales linearly:

StrategyPer session1,000 users
Full history$0.2556about $256
20-turn window$0.1086about $109

Prepaid credit makes planning simple. A $20 top-up covers 20 / 0.108635 = about 184 trimmed sessions. A $100 top-up arrives as $110 with the 10% bonus, which is about 1,012 sessions (110 / 0.108635). Bonuses are +5% from $50, +10% from $100 and +15% from $200. Failed or refused requests are not charged, and credit never expires, so a slow month does not waste anything. See the pricing page for the details. Payments are crypto only (USDT on TRC20 or USDC on Base).

Real usage is uneven. A few heavy users send most of the turns, so replace the 100-turn average with your own distribution once you have data.

What moves the number

  • System prompt length. Every turn pays for it again. Cutting 800 tokens to 500 saves 300 x $0.15 / 1,000,000 = $0.000045 per turn, or $0.0045 over 100 turns.
  • History window. The biggest lever, as Example B shows.
  • Reply length. Output costs more per token ($0.50 against $0.15), but replies are short compared with history. Halving a 250-token reply saves $0.0000625 per turn directly, plus it keeps future history smaller.
  • Retries and regenerations. If your UI lets users reroll a reply, each reroll is another full request. Count them in your estimate.
  • Bad requests. Failed or refused requests are not charged, so errors do not inflate the bill.

Set max_tokens as a safety cap, and log the usage block from every response so your estimate comes from measured numbers. A simple guardrail helps too: sum each user's tokens per day, and when one account passes a limit you choose, shorten its window or slow its replies. Heavy users are the ones who move your bill, and a cap protects the budget without touching everyone else.

from openai import OpenAI

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

def turn_cost(messages):
    reply = client.chat.completions.create(
        model="uncensored",
        messages=messages,
        max_tokens=400,
    )
    usage = reply.usage
    cost = usage.prompt_tokens * 0.15 / 1_000_000 + usage.completion_tokens * 0.50 / 1_000_000
    print(f"in={usage.prompt_tokens} out={usage.completion_tokens} cost=${cost:.6f}")
    return reply.choices[0].message.content

Capacity: will the limits hold?

A full key allows 8 concurrent requests and 300 requests per minute. A streamed reply holds its concurrency slot until the stream ends, so concurrency is usually the tighter limit for chat. As an illustration, if each streamed reply takes 12 seconds, each slot serves 5 replies a minute, and 8 slots serve 40 replies a minute. Measure your own reply time and divide.

When traffic exceeds the limit, the API returns HTTP 429 with the code concurrency or rate_limited, so put a small queue in front of the client. At 1,000 users and 100 turns each, the month is 100,000 requests, or about 3,333 a day. At the illustrative 40 replies a minute, that is 3,333 / 40 = about 83 minutes of full load per day if traffic were perfectly even, so evenings and weekends are what you size for, not the average. The docs list the response headers that report your limits and balance. To try the numbers on real prompts, the API key page has a $0.50 trial: at about $0.0049 for a turn near the end of a long session, it covers a lot of test turns.

Example C: light, regular and heavy users

Averages hide a lot. A typical roleplay app has many people who try it for a few turns and a few who play for hours. With the 20-turn window, the same arithmetic gives three session sizes:

SessionInput tokensOutput tokensCost
20 turns76,1005,000$0.0139
100 turns640,90025,000$0.1086
500 turns3,464,900125,000$0.5822

The 500-turn row is 76,100 + 480 x 7,060 = 3,464,900 input tokens, which at $0.15 per 1M is $0.5197, plus $0.0625 for output. Now mix a population: 70% light users, 25% regular, 5% heavy. The average session costs 0.7 x $0.013915 + 0.25 x $0.108635 + 0.05 x $0.582235 = about $0.066. For 1,000 users that is about $66 a month, noticeably below the flat 100-turn estimate, because most users never reach 100 turns.

The reverse risk exists too. If your product encourages marathon sessions, the heavy row dominates, so track usage per user and watch the tail.

Frequently asked questions

How much does one NSFW chatbot message cost?

With an 800-token system prompt and a 250-token reply, the first turn costs about $0.00025 and turn 100 of an untrimmed chat costs about $0.0049. Cost depends mostly on how much history you send.

Does a longer context window cost more?

Only if you fill it. You pay for tokens actually sent and generated. A full 100,000-token prompt costs $0.015 in input per request, so trimming matters.

Are failed or refused requests billed?

No. Failed or refused requests are not charged.

How should I pay and does credit expire?

Top up any whole amount from $20 to $500 in crypto, with USDT on TRC20 or USDC on Base. Credit never expires and there is no subscription.

Retrieve your API key in one step

Register, grab your key, and update your base URL. That’s all there is to it.

Begin with trial credit

Enter email and password to display your key instantly.