File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ function createAnthropicOAuthModel(
105105 headers . set ( 'Authorization' , `Bearer ${ oauthToken } ` )
106106
107107 // Add required beta headers for OAuth (same as opencode)
108+ // These beta headers are required to access Claude 4+ models with OAuth
108109 const existingBeta = headers . get ( 'anthropic-beta' ) ?? ''
109110 const betaList = existingBeta . split ( ',' ) . map ( ( b ) => b . trim ( ) ) . filter ( Boolean )
110111 const mergedBetas = [
@@ -118,9 +119,10 @@ function createAnthropicOAuthModel(
118119 ] . join ( ',' )
119120 headers . set ( 'anthropic-beta' , mergedBetas )
120121
121- // Add Claude Code identification headers
122- headers . set ( 'anthropic-dangerous-direct-browser-access' , 'true' )
123- headers . set ( 'x-app' , 'cli' )
122+ // Note: opencode does NOT include these headers, so we remove them:
123+ // - anthropic-dangerous-direct-browser-access
124+ // - x-app
125+ // Only the oauth beta headers and authorization are needed
124126
125127 return globalThis . fetch ( input , {
126128 ...init ,
You can’t perform that action at this time.
0 commit comments