EN ▾
Get API key

MiniMax 2.5 Context Window vs Our 100k Token Limit

If you came looking for the minimax 2.5 context window, note that this service runs a different model, an independent open-weight one, with a context window of 100,000 tokens. This page explains what that number means in practice and how to stay inside it.

Updated

Key points

  1. Context window: 100,000 tokens, counting the prompt and the completion together.

  2. max_tokens is optional; the reply can use whatever room the prompt leaves.

  3. A full 100,000-token prompt costs $0.015 in input tokens, before any output.

  4. Chat history is resent on every turn, so trimming or summarizing old turns saves money.

Sliding window of glass panels illustrating a long context window

What the window is on this service

Questions about the minimax 2.5 context window usually come from developers sizing a long-chat or long-document project. For the official MiniMax models, read the limits in MiniMax's own documentation; this site does not host them and cannot speak for them. What I can state exactly is how our endpoint behaves.

The model behind https://api.minimaxnsfw.com/v1 has a context window of 100,000 tokens. That budget covers the prompt (system message, history, your new message, tool definitions) plus the completion the model writes back. If your prompt is 80,000 tokens, the reply has at most 20,000 tokens of room. The parameter max_tokens is optional, so you can leave it out and let the reply use the remaining space, or set it to cap the length yourself.

The request body has its own ceiling of 8 MB, which you will rarely hit with text before you hit the token limit. If you have not set up a key yet, the API key page walks through sign-up and the $0.50 trial.

Turning tokens into words and pages

A token is a chunk of text, often a short word or part of a longer one. Exact counts depend on the tokenizer, and you only learn the real number from the usage block the API returns. As a planning rule for English prose, three-quarters of a word per token is a common estimate. By that rule 100,000 tokens is on the order of 70,000 words, which is a short novel or a very long stack of chat messages.

Treat these as rough guides:

  • A typical chat message of two or three sentences: 50 to 100 tokens.
  • A single-spaced page of prose: roughly 600 to 800 tokens.
  • Source code, JSON and non-English text usually use more tokens per visible character than plain English.

The practical advice: measure with your own data. Send a representative request, read usage.prompt_tokens, and use that ratio from then on instead of the rule of thumb.

Why long chats cost more than you expect

The API is stateless. Each request must contain the whole conversation you want the model to see, so every turn resends the history. Input cost therefore grows with each exchange even though your new message stays short.

Take a chat with a 1,000-token system prompt where every turn adds 600 tokens of history (300 from the user, 300 from the reply). The prompt at turn k is 1,000 + 600 x (k - 1) tokens. Over 100 turns:

  • Input tokens summed across all requests: 100 x 1,000 + 600 x (99 x 100 / 2) = 3,070,000 tokens, which is $0.4605 at $0.15 per 1M.
  • Output tokens: 100 x 300 = 30,000 tokens, which is $0.015 at $0.50 per 1M.
  • Total for the session: $0.4755, about 48 cents.
  • The last prompt is 1,000 + 600 x 99 = 60,400 tokens, comfortably inside the window.

Here is what single requests cost at different prompt sizes, each with a 1,000-token reply ($0.0005):

Prompt tokensInput costRequest total
5,000$0.00075$0.00125
20,000$0.003$0.0035
50,000$0.0075$0.008
100,000 (the limit, leaving no reply room)$0.015over the window with any reply

A prompt of 99,000 tokens plus a 1,000-token reply costs $0.01485 + $0.0005 = $0.01535 and exactly fills the window. Prices are on the pricing page.

Keeping a conversation under the limit

Three habits keep long sessions healthy. First, pin what must never be lost, such as the system prompt and a character or style sheet, at the start of the message list. Second, drop or compress the oldest turns when the prompt nears a threshold you set, for example 70,000 tokens. Third, leave headroom for the reply so you never ask for a completion the window cannot hold.

This sliding-window helper uses the prompt size reported by the previous response and drops the oldest non-system messages in pairs:

from openai import OpenAI

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

LIMIT = 100_000
RESERVE = 4_000          # room kept free for the reply
messages = [{"role": "system", "content": "You are a patient story partner."}]
last_prompt_tokens = 0

def chat(user_text):
    global last_prompt_tokens
    messages.append({"role": "user", "content": user_text})
    # crude trim: drop the oldest user/assistant pair while the last prompt was too big
    while last_prompt_tokens > LIMIT - RESERVE and len(messages) > 3:
        del messages[1:3]
        last_prompt_tokens -= 1_500   # rough guess per dropped pair
    resp = client.chat.completions.create(model="uncensored", messages=messages)
    last_prompt_tokens = resp.usage.prompt_tokens + resp.usage.completion_tokens
    reply = resp.choices[0].message.content
    messages.append({"role": "assistant", "content": reply})
    return reply

The per-pair estimate is crude on purpose. A cleaner design counts tokens locally with a tokenizer and a safety margin, because no local tokenizer is guaranteed to match the server's counts exactly. Keep a margin of at least 5 to 10 percent.

Summarizing instead of deleting

Plain trimming makes the model forget. For stories, roleplay and long-running assistants, a rolling summary works better: when history crosses your threshold, ask the model to condense the oldest part into a few hundred tokens, then replace those turns with the summary as one message.

  1. Choose a cut point, for example the oldest 40,000 tokens of history.
  2. Send those turns with an instruction such as "Summarize the facts, names, decisions and open threads in under 400 words."
  3. Replace the turns with a single message containing the summary, placed right after the system prompt.
  4. Continue the chat. Repeat when the history grows past the threshold again.

The summary call costs a one-off amount of input tokens, but every later request then carries a few hundred tokens instead of tens of thousands. At $0.15 per 1M, shaving 30,000 tokens off each of the next 50 requests saves 1.5M input tokens, or $0.225.

Long context is not perfect recall

A big window lets you fit material in. It does not guarantee that the model uses every detail equally well. Open-weight models of this kind tend to attend best to the start and the end of the prompt, and details buried in the middle of a very long input can get less weight. I have no benchmark to quote for this particular model, so test it with your own material: plant a fact deep in a long prompt and ask about it.

If recall matters, state key facts again near the end of the prompt, keep instructions short, and put the question after the material rather than before it. For structured output, JSON mode (response_format: {"type": "json_object"}) helps keep long extractions parseable.

Concurrency matters for large prompts too. A full key allows 8 requests at once and 300 per minute; a trial key allows 2 and 60. Streamed requests hold their slot until the stream finishes. The docs list the headers that report these limits.

Questions and answers

How many tokens fit in one request?

100,000 tokens in total, counting the prompt and the completion together. A larger prompt leaves less room for the reply.

Is the 100k window the same as the official MiniMax 2.5 window?

This service does not host the official MiniMax models, so do not assume the numbers match. Check MiniMax's documentation for their limits.

Do I have to set max_tokens?

No, it is optional. Without it the reply can use all remaining room in the window; set it if you want to cap length or cost.

What happens to cost when I use the whole window?

A 100,000-token prompt costs $0.015 in input tokens at $0.15 per 1M, plus $0.50 per 1M for whatever the model writes.

Your key is one form away

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

Get API key