deepseek / deepseek Chat APICallError #1548

Closed
opened 2026-02-16 17:31:28 -05:00 by yindo · 10 comments
Owner

Originally created by @magic-thomas on GitHub (Aug 31, 2025).

Originally assigned to: @rekram1-node on GitHub.

hello.

I have waited for this fixed for long time.

But not fixed even with opencode upgrade.

I want to use 'DeepSeek/DeepSeek Chat'. It might be R1-0528, I guess.

It gives APICallError always.

AI_APICallError: Invalid max_tokens value, the valid range of max_tokens is [1, 8192]

But 'DeepSeek/DeepSeek Reasoner' is working .

Am I missing something or is it a bug ?

Thanks.

Image
Originally created by @magic-thomas on GitHub (Aug 31, 2025). Originally assigned to: @rekram1-node on GitHub. hello. I have waited for this fixed for long time. But not fixed even with opencode upgrade. I want to use 'DeepSeek/DeepSeek Chat'. It might be R1-0528, I guess. It gives APICallError always. AI_APICallError: Invalid max_tokens value, the valid range of max_tokens is [1, 8192] But 'DeepSeek/DeepSeek Reasoner' is working . Am I missing something or is it a bug ? Thanks. <img width="774" height="330" alt="Image" src="https://github.com/user-attachments/assets/28ce6705-c5a6-47f4-b760-db9b9b59b70b" />
yindo closed this issue 2026-02-16 17:31:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 31, 2025):

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

  • #1735: max_tokens defaults to 32000 when using a custom provider - Similar max_tokens configuration issue where OpenCode defaults to 32000 tokens, which exceeds some model limits
  • #248: DeepSeek API not working - Reports DeepSeek API errors and authentication issues

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

@github-actions[bot] commented on GitHub (Aug 31, 2025): This issue might be a duplicate of existing issues. Please check: - #1735: max_tokens defaults to 32000 when using a custom provider - Similar max_tokens configuration issue where OpenCode defaults to 32000 tokens, which exceeds some model limits - #248: DeepSeek API not working - Reports DeepSeek API errors and authentication issues Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 31, 2025):

looks like we need to fix models.dev

@rekram1-node commented on GitHub (Aug 31, 2025): looks like we need to fix models.dev
Author
Owner

@rekram1-node commented on GitHub (Aug 31, 2025):

got a fix up for it, once it is merge ill let u know

@rekram1-node commented on GitHub (Aug 31, 2025): got a fix up for it, once it is merge ill let u know
Author
Owner

@magic-thomas commented on GitHub (Sep 3, 2025):

hi... I see opencode is upgraded. But not working yet. Is it not merged yet?

@magic-thomas commented on GitHub (Sep 3, 2025): hi... I see opencode is upgraded. But not working yet. Is it not merged yet?
Author
Owner

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

@magic-thomas if you see linked PR it is still up for review

@rekram1-node commented on GitHub (Sep 3, 2025): @magic-thomas if you see linked PR it is still up for review
Author
Owner

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

I pinged team and asked for review I can help you manually override this for time being if you'd like

@rekram1-node commented on GitHub (Sep 3, 2025): I pinged team and asked for review I can help you manually override this for time being if you'd like
Author
Owner

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

If you restart opencode it should be fixed for you

@rekram1-node commented on GitHub (Sep 3, 2025): If you restart opencode it should be fixed for you
Author
Owner

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

if you continue having issues lmk and i can help you clear the cache

@rekram1-node commented on GitHub (Sep 3, 2025): if you continue having issues lmk and i can help you clear the cache
Author
Owner

@magic-thomas commented on GitHub (Sep 4, 2025):

Hi.

It solved automatically..

Actually I restarted two times now.

After restarting at the first time, no luck.

After restart once more, it worked.

It happened with no upgrading this time and no deleting caches .

Weird but working now.

I just leave this for dev team.

I really love Opencode.

Thanks for keep caring and your efforts.

@magic-thomas commented on GitHub (Sep 4, 2025): Hi. It solved automatically.. Actually I restarted two times now. After restarting at the first time, no luck. After restart once more, it worked. It happened with no upgrading this time and no deleting caches . Weird but working now. I just leave this for dev team. I really love Opencode. Thanks for keep caring and your efforts.
Author
Owner

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

Yeah I think that is due to the order of how the cache is refreshed, when you restart it reads from cache and refreshes, so first restart didn't quite get it (I am assuming)

Thanks for sharing and I am happy you are enjoying opencode! LMK if you ever have issues, always happy to help

@rekram1-node commented on GitHub (Sep 4, 2025): Yeah I think that is due to the order of how the cache is refreshed, when you restart it reads from cache and refreshes, so first restart didn't quite get it (I am assuming) Thanks for sharing and I am happy you are enjoying opencode! LMK if you ever have issues, always happy to help
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1548