xonecas.io
64875
Mc

mini-coder / commit 9111058

fix: use Bearer auth with oauth beta header for Anthropic inference

OAuth tokens require Authorization: Bearer (authToken) plus the
anthropic-beta: oauth-2025-04-20 header. The x-api-key approach only
works for the models listing endpoint, not inference.

xonecas2026-03-16 9111058e843e80ab3e6dc28e051ac3638c8c4d83 parent ace4e6c

1 file changed

src/llm-api/providers.ts+4−1
@@ -188,7 +188,10 @@ async function resolveAnthropicModel(modelId: string): Promise<LanguageModel> {
188188 token,
189189 provider: createAnthropic({
190190 fetch: fetchWithLogging,
191- apiKey: token,
191+ authToken: token,
192+ headers: {
193+ "anthropic-beta": "oauth-2025-04-20",
194+ },
192195 }),
193196 };
194197 }