Last year, I wrote a post showcasing how to tokenize words using the Anthropic SDK to track token usage. While this method continues to work, it’s not necessary since the Amazon Bedrock team added token metrics to the SDK response metadata. In this guide, we’ll explore the SDK and how to get those token counts. Install the AWS SDK To begin, install boto3, the AWS SDK for Python, using pip: