Skip to content

BYOK Anthropic doesn't send Bearer token #910

@ahimberg

Description

@ahimberg

Copilot SDK version 0.2.0
Language tested: .net (c#)

When using BYOK, Type = Anthropic

SessionConfig.Provider.BearerToken is not sent on the llm request, only the ApiKey is sent
If you attempt to omit the ApiKey (tried to see if it would send Bearer in that case), you get this error:
Anthropic API key is required

We use a proxy server, that requires a bearer auth token, looks up the apikey, and proxies the call to the actual model server with the apikey.
This works fine with provider.Type openai but not anthropic. In anthropic mode the bearer token is never passed.

Custom headers should also be supported (generic custom headers maybe could enable a workaround for this, we could set Authorization), we use with the proxy to track what scenario the call is attached to with a custom header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions