GeezerVison is showing github.com — 1M tokens for Opus 4.6 · Issue #12338 · anomalyco/opencode
1M tokens for Opus 4.6 #12338DescriptionDescription
It says: 185,336 19% ($0.00)
When I go over 200k tokens: prompt is too long: 203831 tokens > 200000 maximum
Have tried to turn on:

just tried it with a API key also doesnt allow me to go over 200k tokens.
Found out how to do it! PLEASE add the beta header: betas=["context-1m-2025-08-07"] @fwang
Plugins
OpenCode version
v1.1.52
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
MacOS
Terminal
Terminal Reacted by nil0ft, Bucur David, Emre Kaşgür, anna-domachowska, Wendell Misiedjan, theopicht, Phieu Dinh, Tema Smirnov, Stanislas, Ercin Dedeoglu and 15 more Reacted by Ted Robertson Reacted by Emre Kaşgür, Wendell Misiedjan and Rajesh Rajendran Activitygithub-actions commented on Feb 5, 2026 This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case differs from these existing issues. GeneCodeSavvy commented on Feb 5, 2026 okhsunrog commented on Feb 5, 2026 Could you test #12342 ? 1M token window works for me with Opus 4.6, at least I went over 300k tokens without any issues Reacted by Ted Robertson and Hudson Burke okhsunrog commented on Feb 5, 2026 I didn't add context-1m-2025-08-07 header but it still seem to work, can anyone else confirm that? Can you test both with Oauth and Anthropic API? ItsWendell commented on Feb 5, 2026 Just ran into this issue with OAuth Claude Code Max plan on version 1.1.52 @okhsunrog
 Reacted by Ercin Dedeoglu, Z1xus, Leonid Meleshin, chuck ma, Jason George and Tizian Maxime Weigt okhsunrog commented on Feb 5, 2026 ItsWendell commented on Feb 6, 2026 okhsunrog commented on Feb 6, 2026 ErcinDedeoglu commented on Feb 6, 2026 This is disrupting flow. It is impossible to use Opus-4.6 Reacted by Jason George Reacted by Andres Gutierrez, qqqq1112323, chuck ma, Jason George and Mattwmaster58 nukeop commented on Feb 8, 2026 This worked for like a day or so (correct 1M context), now it starts compacting the session even before hitting 200 000. It's very disruptive. Reacted by Ted Robertson and Le Duy Phuc MoaidHathot commented on Apr 3, 2026 I agree with @azaricstefan, I think we should also support the Opus 4.6 1M from the GitHub Copilot model hosting. MoaidHathot commented on Apr 3, 2026 @azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14
Add the following to your opencode.json
"provider": {
"github-copilot": {
"models": {
"claude-opus-4.6-1m": {
"name": "Claude Opus 4.6 (1M)",
"family": "claude-opus",
"attachment": true,
"reasoning": true,
"tool_call": true,
"temperature": true,
"modalities": {
"input": ["text", "image"],
"output": ["text"]
},
"cost": {
"input": 0,
"output": 0
},
"limit": {
"context": 1000000,
"output": 64000
}
}
}
}
},
Then, you need to have the following plugin. Just put this file (copilot-1m.ts) under /plugins in your OpenCode config directory:
import type { Hooks } from "@opencode-ai/plugin";
export default function (): Hooks {
return {
"chat.headers": async (incoming, output) => {
if (!incoming.model.providerID.includes("github-copilot")) return;
output.headers["Copilot-Integration-Id"] = "copilot-developer-cli";
},
};
}
Example config:
https://github.com/MoaidHathot/Neovim-Moaid/tree/main/config/opencode Reacted by Stefan Azarić Reacted by Stefan Azarić azaricstefan commented on Apr 3, 2026
@azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14 Add the following to your opencode.json
"provider": {
"github-copilot": {
"models": {
"claude-opus-4.6-1m": {
"name": "Claude Opus 4.6 (1M)",
"family": "claude-opus",
"attachment": true,
"reasoning": true,
"tool_call": true,
"temperature": true,
"modalities": {
"input": ["text", "image"],
"output": ["text"]
},
"cost": {
"input": 0,
"output": 0
},
"limit": {
"context": 1000000,
"output": 64000
}
}
}
}
},
Then, you need to have the following plugin. Just put this file (copilot-1m.ts) under /plugins in your OpenCode config directory:
import type { Hooks } from "@opencode-ai/plugin";
export default function (): Hooks {
return {
"chat.headers": async (incoming, output) => {
if (!incoming.model.providerID.includes("github-copilot")) return;
output.headers["Copilot-Integration-Id"] = "copilot-developer-cli";
},
};
}
Example config: https://github.com/MoaidHathot/Neovim-Moaid/tree/main/config/opencode
This worked! I tried adding just to opencode.json before but missed adding this hook in plugins. IlyaMaksheev commented on Apr 3, 2026
@azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14 Add the following to your opencode.json
Is it possible to make it work with Anthropic subscription? I was not able to do so. MoaidHathot commented on Apr 4, 2026
@azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14 Add the following to your opencode.json
Is it possible to make it work with Anthropic subscription? I was not able to do so.
@IlyaMaksheev, this fix is specific for the Github subscription and the way it works. For Anthropic I think you need a different solution, although @omd0 says there is an Anthropic plugins that works. Maybe that can help? omd0 commented on Apr 4, 2026 tredondo commented on Apr 10, 2026 @omd0 that commit applied only to Claude subscriptions. You can still use Anthropic with your own API keys. omd0 commented on Apr 11, 2026 rasmusjosefsson commented on May 19, 2026 github-actions commented on Jul 19, 2026 To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|