ProviderInitError with Anthropic #1122

Closed
opened 2026-02-16 17:29:32 -05:00 by yindo · 12 comments
Owner

Originally created by @ds-brandao on GitHub (Aug 5, 2025).

Originally assigned to: @thdxr on GitHub.

Issue

Whenever I try to use Claude with my own API Key, I get the following error. I am not sure why.

Image
Originally created by @ds-brandao on GitHub (Aug 5, 2025). Originally assigned to: @thdxr on GitHub. # Issue Whenever I try to use Claude with my own API Key, I get the following error. I am not sure why. <img width="686" height="568" alt="Image" src="https://github.com/user-attachments/assets/89cff43e-3549-4312-abb5-67c588db6165" />
yindo closed this issue 2026-02-16 17:29:32 -05:00
Author
Owner

@andreyfesunov commented on GitHub (Aug 6, 2025):

+1 for Deepseek, and nothing useful in logs:

ERROR 2025-08-06T14:05:21 +4ms service=tui failed to send message: POST "http://127.0.0.1:45983/session/ses_7804c9534ffep6oEz0sfzrT8eF/message": 400 Bad Request {"name":"ProviderInitError","data":{"providerID":"deepseek"}}

@andreyfesunov commented on GitHub (Aug 6, 2025): +1 for Deepseek, and nothing useful in logs: ERROR 2025-08-06T14:05:21 +4ms service=tui failed to send message: POST "http://127.0.0.1:45983/session/ses_7804c9534ffep6oEz0sfzrT8eF/message": 400 Bad Request {"name":"ProviderInitError","data":{"providerID":"deepseek"}}
Author
Owner

@thdxr commented on GitHub (Aug 6, 2025):

can you show me what's in ~/.cache/opencode

@thdxr commented on GitHub (Aug 6, 2025): can you show me what's in `~/.cache/opencode`
Author
Owner

@giaplv57 commented on GitHub (Aug 6, 2025):

+1 for custom provider using OpenAPI Compatible

 ❯❯❯ ll ~/.cache/opencode
total 220K
drwxrwx---  4 giaple giaple    4.0K Wed 2025-08-06 12:06 .
drwxr-x--- 32 giaple wqdata 4.0K Wed 2025-08-06 12:05 ..
-rw-r--r--  1 giaple giaple    1.9K Wed 2025-08-06 12:06 bun.lock
-rw-rw----  1 giaple giaple    190K Wed 2025-08-06 12:05 models.json
drwxr-x---  8 giaple giaple    4.0K Wed 2025-08-06 12:06 node_modules
-rw-rw----  1 giaple giaple      67 Wed 2025-08-06 12:06 package.json
drwxrwx---  2 giaple giaple    4.0K Wed 2025-08-06 12:05 tui
-rw-rw----  1 giaple giaple       1 Wed 2025-08-06 12:05 version

Some abnormal logs

INFO  2025-08-06T16:06:15 +0ms service=provider providerID=myprovider modelID=gpt-4.1-2025-04-14 getModel
INFO  2025-08-06T16:06:15 +1ms service=provider status=started providerID=myprovider getSDK
INFO  2025-08-06T16:06:15 +28ms service=bun pkg=@ai-sdk/openai-compatible version=beta installing package using Bun's default registry resolution
INFO  2025-08-06T16:06:15 +0ms service=bun cmd=["/home/giaple/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/giaple/.cache/opencode","@ai-sdk/openai-compatible@beta"] cwd=/home/giaple/.cache/opencode running
INFO  2025-08-06T16:06:17 +2679ms service=bun code=0 stdout=bun add v1.2.19 (aad3abea)

installed @ai-sdk/openai-compatible@1.0.0-beta.13

8 packages installed [2.64s]
 stderr=Resolving dependencies
Resolved, downloaded and extracted [6]
warn: incorrect peer dependency "zod@4.0.15"
Saved lockfile
 done
INFO  2025-08-06T16:06:18 +232ms service=provider status=completed duration=2939 providerID=myprovider getSDK
INFO  2025-08-06T16:06:18 +2ms service=server duration=3066 response
ERROR 2025-08-06T16:06:18 +69ms service=tui failed to send message: POST "http://127.0.0.1:39509/session/ses_77fdde7aefferB5zkf2KSRKQac/message": 400 Bad Request {"name":"ProviderInitError","data":{"providerID":"myprovider"}}
INFO  2025-08-06T16:06:23 +5671ms service=server duration=33389 response
@giaplv57 commented on GitHub (Aug 6, 2025): +1 for custom provider using OpenAPI Compatible ``` ❯❯❯ ll ~/.cache/opencode total 220K drwxrwx--- 4 giaple giaple 4.0K Wed 2025-08-06 12:06 . drwxr-x--- 32 giaple wqdata 4.0K Wed 2025-08-06 12:05 .. -rw-r--r-- 1 giaple giaple 1.9K Wed 2025-08-06 12:06 bun.lock -rw-rw---- 1 giaple giaple 190K Wed 2025-08-06 12:05 models.json drwxr-x--- 8 giaple giaple 4.0K Wed 2025-08-06 12:06 node_modules -rw-rw---- 1 giaple giaple 67 Wed 2025-08-06 12:06 package.json drwxrwx--- 2 giaple giaple 4.0K Wed 2025-08-06 12:05 tui -rw-rw---- 1 giaple giaple 1 Wed 2025-08-06 12:05 version ``` Some abnormal logs ``` INFO 2025-08-06T16:06:15 +0ms service=provider providerID=myprovider modelID=gpt-4.1-2025-04-14 getModel INFO 2025-08-06T16:06:15 +1ms service=provider status=started providerID=myprovider getSDK INFO 2025-08-06T16:06:15 +28ms service=bun pkg=@ai-sdk/openai-compatible version=beta installing package using Bun's default registry resolution INFO 2025-08-06T16:06:15 +0ms service=bun cmd=["/home/giaple/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/giaple/.cache/opencode","@ai-sdk/openai-compatible@beta"] cwd=/home/giaple/.cache/opencode running INFO 2025-08-06T16:06:17 +2679ms service=bun code=0 stdout=bun add v1.2.19 (aad3abea) installed @ai-sdk/openai-compatible@1.0.0-beta.13 8 packages installed [2.64s] stderr=Resolving dependencies Resolved, downloaded and extracted [6] warn: incorrect peer dependency "zod@4.0.15" Saved lockfile done INFO 2025-08-06T16:06:18 +232ms service=provider status=completed duration=2939 providerID=myprovider getSDK INFO 2025-08-06T16:06:18 +2ms service=server duration=3066 response ERROR 2025-08-06T16:06:18 +69ms service=tui failed to send message: POST "http://127.0.0.1:39509/session/ses_77fdde7aefferB5zkf2KSRKQac/message": 400 Bad Request {"name":"ProviderInitError","data":{"providerID":"myprovider"}} INFO 2025-08-06T16:06:23 +5671ms service=server duration=33389 response ```
Author
Owner

@andreyfesunov commented on GitHub (Aug 6, 2025):

can you show me what's in ~/.cache/opencode

ls ~/.cache/opencode
models.json package.json tui version

@andreyfesunov commented on GitHub (Aug 6, 2025): > can you show me what's in `~/.cache/opencode` ls ~/.cache/opencode models.json package.json tui version
Author
Owner

@ds-brandao commented on GitHub (Aug 6, 2025):

 opencode % ls
 models.json   package.json   tui  󰡯 version
@ds-brandao commented on GitHub (Aug 6, 2025): ``` opencode % ls  models.json  package.json  tui 󰡯 version ```
Author
Owner

@aashish2057 commented on GitHub (Aug 9, 2025):

also having this issue, failing on 0.4.2 and 0.3.112

@aashish2057 commented on GitHub (Aug 9, 2025): also having this issue, failing on 0.4.2 and 0.3.112
Author
Owner

@aashish2057 commented on GitHub (Aug 11, 2025):

mine is working as of 0.4.12

@aashish2057 commented on GitHub (Aug 11, 2025): mine is working as of 0.4.12
Author
Owner

@maxarndt commented on GitHub (Aug 13, 2025):

I face the same issue since upgrading from opencode 0.3.133 to opencode 0.4.26 with GitHub Copilot as backend.

Things I tried so far without success:

  • opencode auth logout followed by opencode auth login
  • rm -rf ~/.cache/opencode
@maxarndt commented on GitHub (Aug 13, 2025): I face the same issue since upgrading from `opencode 0.3.133` to `opencode 0.4.26` with GitHub Copilot as backend. Things I tried so far without success: - `opencode auth logout` followed by `opencode auth login` - `rm -rf ~/.cache/opencode`
Author
Owner

@ds-brandao commented on GitHub (Aug 13, 2025):

I am not sure what is the problem here. I haven't been able to use open code because of it :(

@ds-brandao commented on GitHub (Aug 13, 2025): I am not sure what is the problem here. I haven't been able to use open code because of it :(
Author
Owner

@ksm0709 commented on GitHub (Aug 14, 2025):

1+ from copilot, 0.4.45 version

ERROR 2025-08-14T11:48:58 +9ms service=default providerID=github-copilot name=ProviderInitError message=ProviderInitError cause=ResolveMessage: Cannot find module '/home/taeho/.cache/opencode/node_modules/@ai-sdk/openai-compatible' from '/$bunfs/root/opencode' fatal
Error: Unexpected error, check log file at  for more details
@ksm0709 commented on GitHub (Aug 14, 2025): 1+ from copilot, 0.4.45 version ``` ERROR 2025-08-14T11:48:58 +9ms service=default providerID=github-copilot name=ProviderInitError message=ProviderInitError cause=ResolveMessage: Cannot find module '/home/taeho/.cache/opencode/node_modules/@ai-sdk/openai-compatible' from '/$bunfs/root/opencode' fatal Error: Unexpected error, check log file at for more details ```
Author
Owner

@andrhlt commented on GitHub (Aug 19, 2025):

@maxarndt @ksm0709 I was getting same error with copilot - for me it was a corporate firewall issue. Looks like recent opencode update requires bun package upgrades from openai and zod that were being blocked. So I had to install these then, then logout of copilot and log back in, now working fine

@andrhlt commented on GitHub (Aug 19, 2025): @maxarndt @ksm0709 I was getting same error with copilot - for me it was a corporate firewall issue. Looks like recent opencode update requires bun package upgrades from openai and zod that were being blocked. So I had to install these then, then logout of copilot and log back in, now working fine
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1122