--- id: aws-bedrock-token-generator version: "1.1.0" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # aws-bedrock-token-generator — A lightweight library for generating short-term bearer tokens for AWS Bedrock API authentication License: permissive · Maintenance: aging · Downloads: 1.1M/mo ## What it is and what it does This package wraps AWS credential handling to generate time-limited bearer tokens suitable for authenticating with AWS Bedrock services. Rather than embedding long-term AWS credentials in client applications, you call provide_token() once per session to obtain a short-lived token that encodes a presigned URL with embedded temporary credentials. The token format is bedrock-api-key-&Version=1, with a default expiration of 12 hours (configurable up to that maximum). It integrates with botocore's credential providers, so it works with IAM roles, environment variables, assume-role chains, and other standard AWS credential sources. The library is designed for scenarios where you need to pass authentication to a Bedrock client without exposing raw AWS credentials—for example, when building web services, SDKs, or multi-tenant applications. It handles the complexity of credential expiry negotiation (the actual token lifetime is the minimum of your requested expiry and the underlying AWS credentials' remaining lifetime) and follows AWS security best practices by defaulting to short-lived tokens. Use it for: - Generate temporary tokens for web applications that need to call AWS Bedrock without embedding long-term credentials. - Create short-lived tokens for distributing to third-party clients or SDKs that require Bedrock API access. - Build multi-tenant SaaS platforms where each tenant receives a scoped, time-limited token instead of shared credentials. - Implement token-based authentication in microservices that delegate Bedrock calls to a central credential manager. - Rotate credentials frequently by regenerating tokens on a schedule without redeploying application code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates short-term bearer tokens for AWS Bedrock API authentication, eliminating the need to expose long-term credentials in client code. Yes, if you are building applications that call AWS Bedrock and need to avoid embedding long-term credentials. The package is lightweight, has low install friction, carries a permissive license, and is maintained by AWS. However, it is still in Beta (first release 2025-07-01) and marked as aging (381 days since latest release), so verify token expiry and refresh behavior matches your use case before production deployment. ## Install pip install aws-bedrock-token-generator uv add aws-bedrock-token-generator poetry add aws-bedrock-token-generator ## Installing aws-bedrock-token-generator Before you install: Low friction: pure Python wheel with a single runtime dependency (botocore). Repository is active and maintained, though the package itself is recent (first release 2025-07-01) and marked Beta in development status. License in practice: Apache License 2.0 (permissive) allows commercial use, modification, and redistribution with minimal restrictions—suitable for most production environments. Quickstart: pip install aws-bedrock-token-generator from aws_bedrock_token_generator import provide_token token = provide_token() # uses AWS_REGION env var and default credential chain print(f"Token: {token}") Requires AWS credentials available to botocore (via environment variables, IAM role, or credential file) and AWS_REGION environment variable for default usage. Verify before relying: - Whether token refresh/renewal is supported or tokens must be regenerated after expiry. - Performance characteristics when generating tokens at scale or high frequency. - Compatibility with non-standard AWS credential providers or custom credential chains. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags AWS Bedrock token generation, bearer token authentication AWS, temporary credentials bedrock, AWS API token generator, bedrock API authentication, short-term token creation, presigned URL token, aws-integration, token-auth, credential-management [View on SkillFed](https://skillfed.io/packages/aws-bedrock-token-generator) · [View on PyPI](https://pypi.org/project/aws-bedrock-token-generator/)