Amazon Bedrock Integration
Track Amazon Bedrock model costs using the AWS Cost Explorer API.
Overview
Grafient tracks your Amazon Bedrock spending by querying the AWS Cost Explorer API. This captures costs for all Bedrock models — Claude, Llama, Titan, Mistral, and any other model available through Bedrock — broken down by model and token direction (input/output).
Unlike providers with dedicated billing APIs, AWS uses its centralized Cost Explorer service for all cost data. Grafient queries this API daily to pull your Bedrock-specific costs.
Each Cost Explorer API request costs $0.01, charged to your AWS account. With daily syncs, this is approximately $0.30/month. See AWS pricing for details.
Prerequisites
- An AWS account with Amazon Bedrock usage.
- IAM permissions to create users and attach policies.
- A Grafient account on the Free, Pro, or Ultimate plan.
Step 1: Create an IAM User
- Go to the AWS IAM Console.
- Click Users in the sidebar, then Create user.
- Enter a name (e.g.
grafient-reader). - Click Next.
- Select Attach policies directly.
- Search for and attach the following AWS managed policy:
AWSBillingReadOnlyAccess— read-only access to Cost Explorer and billing data
- Click Next, then Create user.
If you prefer a more restrictive custom policy, create one with just the ce:GetCostAndUsage action:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ce:GetCostAndUsage",
"Resource": "*"
}
]
}
This limits the IAM user to only reading cost data — it cannot access any other AWS services or make changes.
Step 2: Generate Access Keys
- In the IAM Console, click the user you just created.
- Go to the Security credentials tab.
- Under Access keys, click Create access key.
- Select Third-party service as the use case.
- Check the confirmation box and click Next.
- Click Create access key.
- Copy both values — the Access Key ID and Secret Access Key. The secret is only shown once.
Store these credentials securely. The Secret Access Key is only displayed once during creation. If you lose it, you'll need to create a new access key pair.
Step 3: Add the Integration in Grafient
- In Grafient, navigate to Integrations in the sidebar.
- Click Add Integration.
- Select Amazon Bedrock as the provider.
- Enter the Access Key ID from Step 2.
- Enter the Secret Access Key from Step 2.
- Optionally add a label (e.g.
Production — AWS Bedrock). - Click Test Connection — a green checkmark confirms the credentials work and Cost Explorer is accessible.
- Click Add Integration to save.
What Happens Next
Once connected, Grafient will:
- Validate your credentials by making a test query to the Cost Explorer API.
- Backfill historical costs — up to 30 days on Free, or 365 days on Pro/Ultimate (AWS Cost Explorer retains 12 months of data).
- Sync daily via the automated cron job to pull the latest Bedrock costs.
Costs appear on the Dashboard grouped by model (e.g. Anthropic Claude3Sonnet, Meta Llama3-70B).
Data Collected
| Data Point | Description |
|---|---|
| Daily cost (USD) | Total Bedrock spend per day, broken down by model |
| Model breakdown | Cost per model, extracted from AWS usage types |
| Token direction | Costs split by input and output tokens where available |
Data Freshness
AWS Cost Explorer data has a 12–24 hour delay. Cost data from today will typically appear tomorrow. This is an AWS limitation — the billing pipeline does not process in real time.
The daily cron sync captures the latest available data. For the most current view, click Force Sync on your integration card.
Troubleshooting
"Test Connection" fails
- Verify IAM credentials: Make sure you copied both the Access Key ID and Secret Access Key correctly.
- Check IAM policy: The user needs
ce:GetCostAndUsagepermission. The easiest way is theAWSBillingReadOnlyAccessmanaged policy. - Activate Cost Explorer: If you've never used Cost Explorer, you may need to activate it first. Go to the Cost Explorer page and click "Launch Cost Explorer" if prompted. It can take up to 24 hours to become active.
No cost data after sync
- Check for Bedrock usage: If there has been no Bedrock API usage, there will be no cost data. Verify in the AWS Console under Bedrock > Model access.
- Cost Explorer activation delay: If you just activated Cost Explorer, data may take up to 24 hours to appear.
- Try Force Sync: Click the refresh icon on your integration card to trigger a manual sync.
Cost data looks incomplete
- Usage type filtering: Grafient filters for
Amazon Bedrockservice costs only. Other AWS services are excluded. - Data delay: Due to the 12–24 hour processing delay, yesterday's costs may not have arrived yet.
- On-Demand vs Provisioned: Both on-demand and provisioned throughput costs are captured if they appear under the Amazon Bedrock service in Cost Explorer.