Anthropic Beta Headers
Issue: OpenRouter headers are not being passed down to downstream providers.
Anthropic has beta features that require a specific header/value to turn on. If I were to use the anthropic provider, pass the headers, the feature is on as I would expect. Unfortunately, if I were to switch to using the openrouter provider, it doesn't. I'm assuming the header is only passed to the open router server, and it's not being forwarded to the downstream provider.
Also, I understand that only certain downstream providers respect the beta header (Anthropic & Bedrock iirc). I tried specifying anthropic specifically, and still no luck.
What works:
createAnthropic({
apiKey: env.anthropicApiKey,
headers: {
'anthropic-beta':
'output-128k-2025-02-19,interleaved-thinking-2025-05-14',
},
})
What doesn't:
createOpenRouter({
apiKey: env.openrouterKey,
headers: {
'anthropic-beta':
'output-128k-2025-02-19,interleaved-thinking-2025-05-14',
},
})
+1, seems like is OpenRouter that is not passing the headers at all.
This would be fantastic to also support Fine grained tool call streaming through OpenRouter
any updates on this, I would like the support for Fine grained tool call streaming
I do would also really like fine grained tool call streaming. I might just switch to anthropic provider over it
This is definitely required asap to align with latest anthropic suggestions around tools!