Sonnet 1 million context
Question
Hi! Cool tool, much less buggy than Claude Code. I'm trying to make the switch but I can't figure out how to use Sonnet with 1 million context window. The prior issues wrt. the larger context models are a bit unclear. How can I get this set up?
I am using API key.
This issue might be a duplicate of existing issues. Please check:
- #7126: Claude Pro vs Anthropic Claude API - Discusses how to use Claude models through different subscription methods (Pro vs API token)
- #7458: Model selection not applied after restart - Reports issues with Claude model configuration not persisting properly
- #7713: Commands Model Variant Specification - Related to model configuration and variant selection options
- #7602: Native Model Fallback/Failover Support - Discusses model configuration and switching between different models
Additionally, for questions about model setup and configuration in OpenCode, you may want to check the documentation or search closed issues that have been resolved.
"provider": {
"anthropic": {
"models": {
"claude-sonnet-4-5[1M]": {
"id": "claude-sonnet-4-5-20250929",
"name": "Claude Sonnet 4.5 [1M]",
"headers": {
"anthropic-beta": "context-1m-2025-08-07"
},
"limit": {
"context": 1000000,
"output": 64000
}
}
}
}
}
this can be added in our opencode.json config ... with a note ... it was working before the whole Anthropic chaos from yesterday. I'm hoping at some point this will be addressed.
Thank you, that works!