Skip to main content
writer-0.1 has a -token context window for the prompt and the output together.

How the output is bounded

The output allowance is your output limit (max_tokens, max_completion_tokens or max_output_tokens), or tokens without one. The gateway lowers it to the model’s maximum of tokens and to the room left after the prompt. The gateway counts the prompt with the model’s tokenizer. If the prompt leaves no room for an answer, the request fails with 400 context_length_exceeded. The gateway never truncates or drops messages, so shorten the prompt yourself: summarize earlier turns, or send only the parts of a document the answer needs.

Request limits

  • Up to messages per request.
  • Up to of JSON. Larger bodies fail with 413 request_too_large.

Tips for long prompts

  • Stream. The model takes longer to start answering when it reads a large document. Streaming shows progress as soon as the plan starts, and avoids HTTP client timeouts on long answers.
  • Put the instruction first and the document after it, in the user message.
  • Set a smaller output limit when you don’t need a long answer. Before calling the model, the gateway holds credits for the prompt plus the output allowance, and the token rate limit counts both. A smaller limit lowers both; you’re still charged only for the tokens used. See Rate limits.
Coding agents that resend a whole conversation can reach the context window. OpenCode compacts history before that by default. See OpenCode and coding agents.
Last modified on December 5, 2026