Skip to content

Conversation

@davidmhewitt
Copy link

Fixes #1079

profile: str | None,
data: str | None,
) -> dict[str, str]:
bedrock_bearer = os.getenv("AWS_BEARER_TOKEN_BEDROCK")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding api_key as a client argument and defaulting to that environment variable would be better than only supporting it through the environment variable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I've added it as the last argument to to the client constructor to preserve the existing ordering. Let me know if that makes sense, given the _strict_response_validation arg (and associated comment) above it.

@karpetrosyan
Copy link
Collaborator

karpetrosyan commented Dec 8, 2025

LGTM! Note that it also needs ruff format. Could you please run/commit it?

Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why the AWS naming around this functionality is inconsistent? i.e. why is the env var "bearer token" but the actual value is an "api key"?

@davidmhewitt
Copy link
Author

Do you know why the AWS naming around this functionality is inconsistent? i.e. why is the env var "bearer token" but the actual value is an "api key"?

Not sure!

I would guess they called it API key on the user-facing docs side to be consistent with other LLM providers that use that terminology. Then someone implementing the feature in the SDK decided to name the env var in the way that describes the way the token is transported 🤷‍♂️

I'd be happy to rename all the variables/params to one or the other here if it helps

@davidmhewitt davidmhewitt force-pushed the david/support-bedrock-bearer-auth branch from 8c2088d to 1beed86 Compare December 15, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnthropicBedrock: AWS_BEARER_TOKEN_BEDROCK env var not supported

4 participants