- Newest
- Most votes
- Most comments
Currently, AWS does not provide a specific API for retrieving the pricing of foundation models in Amazon Bedrock. The pricing information for Amazon Bedrock is typically made available through the official AWS pricing page and documentation.
Amazon Bedrock pricing is based on several factors including:
- The specific foundation model being used
- The volume of input and output tokens
- Whether you're using On-Demand and Batch pricing or Provisioned Throughput
- The AWS Region where you're using the service
For example, the Writer models have different pricing tiers:
- Palmyra X4: $0.0025 per 1,000 input tokens and $0.010 per 1,000 output tokens
- Palmyra X5: $0.0006 per 1,000 input tokens and $0.006 per 1,000 output tokens
If you need programmatic access to pricing information for your applications, you might consider creating your own pricing database based on the published rates and updating it regularly. You could also contact AWS support or your account representative to inquire about any potential future plans for a pricing API.
While there is an API called ListFoundationModelAgreementOffers that retrieves offers associated with foundation models, it does not specifically provide pricing information in the way you're asking for.
Sources
API for Bedrock Foundation models pricings. | AWS re:Post
Pricing
Amazon Bedrock pricing - Amazon Bedrock
ListFoundationModelAgreementOffers - Amazon Bedrock
answered a year ago
You can get pricing information for Amazon Bedrock foundational models through the AWS Price List API. Here's what you need to know:
1. AWS Price List API
- You can use the AWS Price List API to programmatically query pricing information
- The service code for Amazon Bedrock is "Bedrock"
- Documentation: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-list-api.html
2. Pricing Information Access Methods:
- AWS Price List API (JSON and CSV formats)
- AWS Price List Bulk API
- AWS Pricing Calculator API
3. For real-time token counting and pricing estimation:
- You can use the model-specific token counting libraries
- For Claude models: use Anthropic's tokenizer
- For Titan models: use AWS's token counting utilities
- For other models: use their respective tokenizers
- Current pricing information can also be found in the AWS documentation.
Note: Pricing may vary by region and can change over time. It's recommended to always fetch the latest pricing information through the API rather than hardcoding values.
To implement this, you would need to:
- Set up AWS SDK access
- Use the Price List API client
- Query for "Bedrock" service pricing
- Filter for specific model pricing information
**[AWS Price List API] ** https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html
answered a year ago
Relevant content
asked a year ago
- AWS OFFICIALUpdated a year ago
