anthropic sonnet 4.5 1million token #1896

Closed
opened 2026-02-16 17:33:06 -05:00 by yindo · 19 comments
Owner

Originally created by @luisrudge on GitHub (Sep 30, 2025).

Originally assigned to: @rekram1-node on GitHub.

not sure how to use that model specifically... I keep getting

AI_APICallError: prompt is too long: 201401 tokens > 200000 maximum
Originally created by @luisrudge on GitHub (Sep 30, 2025). Originally assigned to: @rekram1-node on GitHub. not sure how to use that model specifically... I keep getting ``` AI_APICallError: prompt is too long: 201401 tokens > 200000 maximum ```
yindo closed this issue 2026-02-16 17:33:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 30, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #164: AI_APICallError: prompt is too long & OAuth token has been revoked - Same "prompt is too long" error with token limits exceeded
  • #491: AI_APICallError: input length and 'max_tokens' exceed context limit - Similar context limit error with Claude Sonnet 4
  • #500: AI_APICallError: prompt is too long: 209840 tokens › 200000 maximum - Exact same error format with token count exceeding 200k limit
  • #1092: AI_APICallError: prompt is too long - Same error when researching on web, mentions related issues #164 and AI response markdown rendering tables (#500)
  • #2464: AT_APICallError: prompt token count of 130389 exceeds the limit of 128000 - Similar token count exceeding limits error

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 30, 2025): This issue might be a duplicate of existing issues. Please check: - #164: AI_APICallError: prompt is too long & OAuth token has been revoked - Same "prompt is too long" error with token limits exceeded - #491: AI_APICallError: input length and 'max_tokens' exceed context limit - Similar context limit error with Claude Sonnet 4 - #500: AI_APICallError: prompt is too long: 209840 tokens › 200000 maximum - Exact same error format with token count exceeding 200k limit - #1092: AI_APICallError: prompt is too long - Same error when researching on web, mentions related issues #164 and #500 - #2464: AT_APICallError: prompt token count of 130389 exceeds the limit of 128000 - Similar token count exceeding limits error Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 30, 2025):

ill fix this

@rekram1-node commented on GitHub (Sep 30, 2025): ill fix this
Author
Owner

@seannetlife commented on GitHub (Oct 1, 2025):

smashing me right now too

@seannetlife commented on GitHub (Oct 1, 2025): smashing me right now too
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

i sent msg to team, not sure if there is a header that needs to be addrd or sometbing to enable the 1m context, otherwise we can just set it to 200k

if not fixed tonight ill do it tmr

@rekram1-node commented on GitHub (Oct 1, 2025): i sent msg to team, not sure if there is a header that needs to be addrd or sometbing to enable the 1m context, otherwise we can just set it to 200k if not fixed tonight ill do it tmr
Author
Owner

@luisrudge commented on GitHub (Oct 1, 2025):

i sent msg to team, not sure if there is a header that needs to be addrd or sometbing to enable the 1m context, otherwise we can just set it to 200k

if not fixed tonight ill do it tmr

could it be the model name? anthropic says you have to add [1m] to the model id

Image

https://docs.claude.com/en/docs/claude-code/model-config#extended-context-with-%5B1m%5D

@luisrudge commented on GitHub (Oct 1, 2025): > i sent msg to team, not sure if there is a header that needs to be addrd or sometbing to enable the 1m context, otherwise we can just set it to 200k > > if not fixed tonight ill do it tmr could it be the model name? anthropic says you have to add [1m] to the model id <img width="768" height="223" alt="Image" src="https://github.com/user-attachments/assets/a911cf3b-aff5-461e-bc42-45f9ba795b5b" /> https://docs.claude.com/en/docs/claude-code/model-config#extended-context-with-%5B1m%5D
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

yes you are correct, so we need to update models.dev

@rekram1-node commented on GitHub (Oct 1, 2025): yes you are correct, so we need to update models.dev
Author
Owner

@maxandrews commented on GitHub (Oct 1, 2025):

Is this confirmed to work yet? There's no indication in the model selector which version of 4.5 I'm using, nor is there a display of available context.
Image
Anthropic says in their docs you have to be a tier 4 API user to get access:

Image
@maxandrews commented on GitHub (Oct 1, 2025): Is this confirmed to work yet? There's no indication in the model selector which version of 4.5 I'm using, nor is there a display of available context. <img width="300" height="91" alt="Image" src="https://github.com/user-attachments/assets/9f33890a-007c-4636-96cd-75ffb4f067cc" /> Anthropic says in their docs you have to be a tier 4 API user to get access: <img width="761" height="206" alt="Image" src="https://github.com/user-attachments/assets/62330105-d106-4de9-9da3-83226787ea10" />
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

@maxandrews thx for sharing that I will fix models.dev in meantime

@rekram1-node commented on GitHub (Oct 1, 2025): @maxandrews thx for sharing that I will fix models.dev in meantime
Author
Owner

@luisrudge commented on GitHub (Oct 1, 2025):

I think it's worse than that because the regular sonnet 4.5 shows up as having 1mi token context for me, but it gives me the error I mentioned once I got above 200k

Image
@luisrudge commented on GitHub (Oct 1, 2025): I think it's worse than that because the regular sonnet 4.5 shows up as having 1mi token context for me, but it gives me the error I mentioned once I got above 200k <img width="126" height="64" alt="Image" src="https://github.com/user-attachments/assets/8dc7c295-0ac8-4924-ad7d-b632610b7471" />
Author
Owner

@luisrudge commented on GitHub (Oct 1, 2025):

@rekram1-node sorry yeah, your fix would address the usage issue! thanks

@luisrudge commented on GitHub (Oct 1, 2025): @rekram1-node sorry yeah, your fix would address the usage issue! thanks
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

no prob

@rekram1-node commented on GitHub (Oct 1, 2025): no prob
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

for those having issues the models.dev should be updated shortly, once it is consider wiping your cache locally and restarting opencode.

To wipe cache:

rm ~/.cache/opencode/models.json

This happens automatically but if u want changes to happen instantly just wipe cache :)

@rekram1-node commented on GitHub (Oct 1, 2025): for those having issues the models.dev should be updated shortly, once it is consider wiping your cache locally and restarting opencode. To wipe cache: rm ~/.cache/opencode/models.json This happens automatically but if u want changes to happen instantly just wipe cache :)
Author
Owner

@luisrudge commented on GitHub (Oct 1, 2025):

thanks! that'll fix the usage bar on the top right. any idea when we'll be able to use the 1mi model?

@luisrudge commented on GitHub (Oct 1, 2025): thanks! that'll fix the usage bar on the top right. any idea when we'll be able to use the 1mi model?
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

So for that you need to be tier 4 are you tier 4 @luisrudge ?

@rekram1-node commented on GitHub (Oct 1, 2025): So for that you need to be tier 4 are you tier 4 @luisrudge ?
Author
Owner

@luisrudge commented on GitHub (Oct 1, 2025):

oh sorry, I had no idea it required a different tier. I'm not cool enough for tier 4 😅

@luisrudge commented on GitHub (Oct 1, 2025): oh sorry, I had no idea it required a different tier. I'm not cool enough for tier 4 😅
Author
Owner

@seannetlife commented on GitHub (Oct 3, 2025):

i'm on the claude max subscription. still seeing only 200k context available. is that expected @rekram1-node ?

@seannetlife commented on GitHub (Oct 3, 2025): i'm on the claude max subscription. still seeing only 200k context available. is that expected @rekram1-node ?
Author
Owner

@rekram1-node commented on GitHub (Oct 3, 2025):

@seannetlife yes, p sure 1M is only available through api key last I checked

and even if u have one you need tier 4 or custom usage limits from anthropic

@rekram1-node commented on GitHub (Oct 3, 2025): @seannetlife yes, p sure 1M is only available through api key last I checked and even if u have one you need tier 4 or custom usage limits from anthropic
Author
Owner

@seannetlife commented on GitHub (Oct 3, 2025):

savage. i have an api with tier 4, but paying 200$ p/m for my max subscription and seems wild to not have the 1m

@seannetlife commented on GitHub (Oct 3, 2025): savage. i have an api with tier 4, but paying 200$ p/m for my max subscription and seems wild to not have the 1m
Author
Owner

@f0o commented on GitHub (Feb 3, 2026):

SO how to use 1M Claude 4.5 Sonnet for us that are Tier4 or custom rate limit?

Where can I ask opencode to add the context-1m-2025-08-07 beta header?

@f0o commented on GitHub (Feb 3, 2026): SO how to use 1M Claude 4.5 Sonnet for us that are Tier4 or custom rate limit? Where can I ask opencode to add the `context-1m-2025-08-07` beta header?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1896