OpenRouter tests context rot and token-saving strategies for AI agents
Start here
OpenRouter published two measured studies on how long AI-agent sessions degrade and how to cut their token costs. In a 40-step coding session replayed under six context setups, a timestamp at the top of the system prompt broke prompt caching and made the session cost 7.8 times more ($0.658 vs $0.084). Capping each tool result once when it enters history was cheapest at $0.054, with input tokens down 36% and 95% still cached; re-trimming old tool outputs every step cut input tokens 60% but cost 3.1 times more, and re-summarizing an earlier summary dropped accuracy to 1 of 4. In a separate long-session test on five 1M-context models, single-fact recall held at 100% up to about 900K tokens, but counting three failed test runs fell from 67% correct at about 20K tokens to 27% at about 600K. Dropping old turns cut accuracy at 2M characters from 49/60 to 9/60, and one run invented a ticket ID. Chunked compaction with scaledown/summarize raised accuracy to 54/60, cut the average prompt from 605K to 112K tokens and average request cost from $0.224 to $0.041, though OpenRouter says it only acts when a prompt exceeds the window and does not fix context rot inside it. OpenRouter notes the token test ran on one model with OpenAI's automatic caching, so savings will differ by provider; Anthropic models also need cache_control breakpoints, and sticky routing sessions expire after 60 minutes without a request.
Generated from reports · updated 14 h ago
Developments
2 developments
- December 1 08:00 · 1 reportsOpenRouter publishes context rot test and compaction tutoriaOpenRouter Announcements:OpenRouter tests context rot across five 1M-context models and offers a compaction fix
- December 1 08:00 · 1 reportsPublishes measured guide to reducing agent token usageOpenRouter Announcements:OpenRouter measures how to cut AI agent token usage across six context setups
Report timeline
Follow the reports to see the event from different sides.
- OpenRouter AnnouncementsPicksOpenRouter measures how to cut AI agent token usage across six context setups
OpenRouter replayed one 40-step coding session through its API under six context setups to measure tokens, cache hits, cost and accuracy. A timestamp at the top of the system prompt broke prompt caching and made the same session cost 7.8 times more ($0.658 vs $0.084), while capping each tool result once when it enters history was cheapest at $0.054 with input down 36% and 95% still cached. Re-trimming old tool outputs on every step cut input tokens by 60% but cost 3.1 times more, and re-summarizing an earlier summary dropped accuracy to 1 of 4.
- OpenRouter AnnouncementsPicksOpenRouter tests context rot across five 1M-context models and offers a compaction fix
OpenRouter ran the same synthetic coding-agent session on five 1M-context models and found that single-fact recall stayed at 100% up to about 900K tokens, while counting three failed test runs fell from 67% correct at about 20K tokens to 27% at about 600K. Dropping old turns to shrink the prompt cut accuracy at 2M characters from 49/60 to 9/60, and one run invented a ticket ID that never appeared in the session. Chunked compaction with scaledown/summarize raised accuracy to 54/60, cut the average prompt from 605K to 112K tokens, and lowered average request cost from $0.224 to $0.041.
Heat for this event
- Current, comparable range
- 4
- Peak, comparable range
- 6December 2 03:00
- Change in 24 hours
- –
The trend compares the same participants over hours observed continuously, so its range can be narrower than the current heat count. Hover or tap the chart for hourly heat; the arrow keys move through it.