EN ▾
Get API key

Uncensored API for developers

https://api.qwennsfw.com/v1

Qwen 3.5 Context Window vs a 100k Token API

People searching for the qwen 3.5 context window usually want to know how much text fits in one request. The API on this site has a 100,000-token window shared by the prompt and the reply, and this page shows what that means in practice.

Updated

Key points

  • The window is 100,000 tokens, counting the prompt and the completion together.
  • A full-window request costs about $0.015 of input, because input is $0.15 per 1M tokens.
  • Chat history is resent on every turn, so cost grows faster than conversation length.
  • For a specific Qwen version's own window, check the vendor's current model documentation.
A long scroll of glowing token blocks unrolling into a bounded frame, illustrating a context window limit

The number and what it covers

Start with the limit that applies here. The context window of this API is 100,000 tokens, and it is a single budget: everything you send (system prompt, earlier messages, documents, tool definitions) plus everything the model writes back must fit inside it. If you send 90,000 tokens, the reply can use at most the remaining 10,000.

The Qwen model family has its own published windows, which differ by model and version. I will not state a figure for the qwen 3.5 context window, because those specifications belong on the vendor's model page and change between releases. This service is not the official Qwen API. It runs one open-weight model, chosen and operated by an independent provider, behind the model ID uncensored, so the number that matters for your integration is the one above.

How much text is 100,000 tokens?

A token is a piece of text, often a short word or part of a longer one. A common rule of thumb for English is that one token is about three quarters of a word, so 100,000 tokens is on the order of 75,000 words. Treat that as an estimate. Code, non-English text, numbers and unusual formatting use more tokens per word, and the exact count depends on the tokenizer.

For scale, that is roughly a short novel, or a few hundred pages of plain prose, though prompt and reply share the space. The better habit is to measure rather than estimate. Every non-streamed response includes a usage object with prompt and completion token counts, and streamed responses report usage at the end of the stream.

from openai import OpenAI

client = OpenAI(base_url="https://api.qwennsfw.com/v1", api_key="YOUR_KEY")
r = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Explain a context window in two sentences."}],
)
print(r.usage.prompt_tokens, r.usage.completion_tokens, r.usage.total_tokens)

Log those three numbers for a day of real traffic and you will know how close your application is to the limit, and what a typical request costs.

Prompt plus completion: planning the split

Because the budget is shared, long prompts shrink the room for answers. The max_tokens parameter is optional here, and when you omit it the completion can use the rest of the window. That is convenient, but it also means a runaway generation can be long. If you want bounded replies, set max_tokens yourself.

Prompt sizeRoom left for the reply
4,000 tokensup to 96,000
50,000 tokensup to 50,000
90,000 tokensup to 10,000
99,000 tokensup to 1,000

A practical rule is to keep the prompt under about 80% of the window when you expect substantial replies, which here means roughly 80,000 tokens. That leaves 20,000 tokens for output and a safety margin for tool definitions and formatting overhead. The maximum request body is 8 MB, which is far above what 100,000 tokens of text needs, so the token limit is the one you will meet first.

What long context costs

Prices are $0.15 per 1M input tokens and $0.50 per 1M output tokens. A single request is cheap even at the top of the window:

  • A prompt of 100,000 tokens with a tiny reply is 100,000 x $0.15 / 1M = $0.015 of input.
  • A prompt of 98,000 tokens with a 2,000-token reply is $0.0147 + $0.001 = $0.0157.

The real cost comes from repetition. A chat has no memory of its own: your application sends the whole history again on every turn. Consider a conversation with a 1,000-token system prompt where each exchange adds 300 tokens from the user and 400 from the model, so history grows by 700 tokens per turn. Run 100 turns.

  • Input at turn n is 1,000 + 700 x (n - 1). At turn 100 that is 70,300 tokens, still inside the window.
  • Summed over all 100 turns: 100 x 1,000 + 700 x (0 + 1 + ... + 99) = 100,000 + 3,465,000 = 3,565,000 input tokens.
  • Input cost: 3,565,000 x $0.15 / 1M = $0.53475.
  • Output: 100 x 400 = 40,000 tokens, costing $0.02.
  • Total: about $0.55 for the whole conversation.

The shape matters more than the total. The last turn alone costs about $0.0105 of input, while the first costs $0.00015. If you let history grow without bound, late turns dominate the bill. Current rates and top-up options are on the pricing page.

Keeping history inside the budget

You control what goes into the window. These approaches work with any OpenAI-compatible client:

Sliding window

Keep the system prompt and the last N turns, and drop the rest. It is the simplest method and works for casual chat. The cost is that the model forgets early details.

Summarize and replace

When history passes a threshold, say 30,000 tokens, ask the model to summarize the older part in a few hundred tokens, then replace those messages with the summary. You pay once for the summary call and save on every later turn.

Pin the facts

Put stable facts, such as character details, project rules or a glossary, in the system prompt or a short pinned note, instead of relying on them surviving in old messages. Roleplay and companion apps for adults often do this with a notes block that the application edits over time.

Retrieve instead of paste

For large documents, send only the passages relevant to the question. This API has no embeddings endpoint, so retrieval needs a separate component from another provider or your own code, but the model call stays small and cheap.

Long context in practice: quality and limits

A big window does not guarantee equal attention to every part of it. Models of every size tend to handle details in the middle of a very long prompt less reliably than details near the beginning or end. I have no benchmark numbers for this model to offer, so test with your own material: place a known fact at several positions in a long prompt and see whether the answer finds it. Put the instruction and the question at the end of a long document, and repeat key constraints close to the question.

Throughput limits apply on top of the window. A full key allows 8 concurrent requests and 300 requests per minute, and a trial key 2 and 60. A streamed request occupies its concurrency slot until the stream ends, and a long-context request can take noticeably longer than a short one, so budget your concurrency accordingly. Over a limit, the API answers HTTP 429 with the code rate_limited or concurrency; on temporary overload the 429 carries Retry-After: 5.

Do not rely on how an overlong request is handled: build the trimming logic into your application and count tokens before sending. Failed requests are not charged. The docs show the request format, and the key page offers a one-click $0.50 trial, valid 7 days, to test long prompts without paying first. For background on the model itself, see the uncensored model explainer. The content rule is fixed: lawful adult use only, and no sexual content involving minors.

Estimating tokens before you send

Counting exactly requires the model's own tokenizer, which you may not have in your application. For budgeting, a cheap estimate is enough. For English text, about four characters per token is a usual rough figure, so a 200,000-character document is on the order of 50,000 tokens. Use a safety factor, because code and non-English text run higher.

def rough_tokens(text: str) -> int:
    return len(text) // 3  # conservative: assumes 3 characters per token

WINDOW = 100_000
reserve_for_reply = 4_000

def fits(history: list[str]) -> bool:
    used = sum(rough_tokens(m) for m in history)
    return used + reserve_for_reply <= WINDOW

The function errs on the high side on purpose. Overestimating by 30% wastes some room, while underestimating risks a failed call. After each real response, compare your estimate with usage.prompt_tokens and adjust the divisor to fit your content. A week of this calibration gives you an estimate good enough to drive trimming and summarizing rules.

For a customer-facing app, it is also sensible to cap user input separately. A single pasted 8 MB file is the maximum body the API accepts, but you rarely want to pay for a prompt that large, so cut inputs at a size that suits the task.

Questions and answers

How big is the context window of this API?

100,000 tokens, shared by the prompt and the completion. A prompt of 90,000 tokens leaves up to 10,000 for the reply.

Is that the same as the Qwen 3.5 window?

Not necessarily. This is not the official Qwen API and it runs one open-weight model of its own, so check the vendor's documentation for their model's specification.

Do I have to set max_tokens?

No. It is optional, and the completion can use the rest of the window. Set it if you want shorter, bounded replies.

What does a full 100k prompt cost?

About $0.015 of input at $0.15 per 1M tokens, plus $0.50 per 1M for whatever the model writes back.

What happens if my prompt is too long?

Do not send it. Trim history or summarize before sending so the prompt plus the reply fits in 100,000 tokens; failed requests are not charged.

Your key is one form away

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

Get API keyRead the docs