Context Window & Compaction

Context Window & Compaction

The context window includes the conversation, model replies, tool output, and files read by an agent. Read the production value instead of assuming every model has 200K tokens:

curl -s https://api.nexotao.com/models | jq -r \
  '.models[] | [.model, .context_window] | @tsv'

Current Phase 1 windows

ContextModel IDs
10,000,000llama-4-scout-17b
1,050,000gpt-5.6-terra
1,000,000claude-opus-4-6, claude-sonnet-4-6, nova-2-lite, llama-4-maverick-17b, minimax-m2
400,000gpt-5.6-luna
300,000nova-lite, nova-pro
256,000mistral-large-3, devstral-2, qwen3-coder-30b, qwen3-coder-next, nemotron-super-120b, nemotron-nano-30b, kimi-k2-5
203,000glm-4-7
200,000claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5, glm-5
164,000deepseek-v3-2
128,000deepseek-r1, magistral-small, ministral-14b, ministral-8b, ministral-3b, nova-micro, llama-3-3-70b, gemma-3-27b, gpt-oss-120b, gpt-oss-20b
32,000qwen3-32b

The API is authoritative if these values change.

Claude Code setup

Use active Claude IDs so Claude Code can calibrate and compact correctly:

SettingValue
ANTHROPIC_BASE_URLhttps://api.nexotao.com
ANTHROPIC_AUTH_TOKENyour sk-nexo-... key
ANTHROPIC_MODELclaude-opus-4-6
ANTHROPIC_DEFAULT_OPUS_MODELclaude-opus-4-6
ANTHROPIC_DEFAULT_SONNET_MODELclaude-sonnet-4-6
ANTHROPIC_DEFAULT_HAIKU_MODELclaude-haiku-4-5
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS1

See Claude Code for the config generator.

Keep long sessions healthy

  • Let the client autocompact as it approaches the published window.
  • Run /compact before a large task or after reading many files.
  • Run /clear when the current task is complete and history is no longer useful.
  • For clients without compaction, trim or summarize old turns yourself.

If the prompt is too large, the gateway returns 400 upstream.context_length_exceeded; compact, summarize, or split the input. A 413 request.too_large means the HTTP body itself exceeds the gateway limit.