Skip to content

Commit 36a1940

Browse files
committed
Remvove some headers
1 parent 3c10d26 commit 36a1940

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sdk/src/impl/model-provider.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)