DEV Community

Cover image for Using Claude Code with AWS Credits (via Amazon Bedrock)

Using Claude Code with AWS Credits (via Amazon Bedrock)

I've installed Claude Code and I had a free trial week. After a while the subscription expired and, I wondered if there was a way to pay for Claude Code usage using AWS credits applied to my AWS account...

What does this matter? Because when we participate in the AWS Community, or attend AWS Events, it is possible to receive AWS Promotional Credits to apply in our account

And the short answer is yes!, with a very simple setup.

You just need to set three environment variables and the magic happens:

export CLAUDE_CODE_USE_BEDROCK=1
export AWS_PROFILE=my-aws-profile
export AWS_REGION=us-east-1
Enter fullscreen mode Exit fullscreen mode

1. Let's see: Subscription is over

This was my current status after ending my Claude Pro free week.

Claude Code interface showing Sonnet 4.6 with Claude Pro subscription expired message

We can read Sonnet 4.6 · Claude Pro and also the message:

Your account does not have access to Claude Code. Please run /login.

At this point, Claude Code requires a Claude Pro subscription to continue using it.

2. Using AWS Credits

After setting the three variables:

export CLAUDE_CODE_USE_BEDROCK=1
export AWS_PROFILE=my-aws-profile
export AWS_REGION=us-east-1
Enter fullscreen mode Exit fullscreen mode

Claude Code interface showing Sonnet 4.5 using API usage billing through Amazon Bedrock

Now the message is different:

Sonnet 4.5 · API Usage Billing

Sonnet 4.5 · API Usage Billing

This means the usage is now billed per API usage through AWS, instead of requiring a Claude Pro subscription.

If your AWS account has credits, those credits can be applied to the Bedrock usage.

3. Changing the models

Another useful feature is the /model command.

Using:

Claude Code model selection menu showing available models including Sonnet and Haiku

you can change the model used by Claude Code.

Some models are more powerful, while others are more cost-effective for small tasks.

For example:

  • Claude Sonnet → better for complex coding tasks
  • Claude Haiku → faster and cheaper for simple prompts

This makes it easy to balance performance and cost depending on the task.

But... let's see that there is an uncomfortable message at the bottom:

The model us.anthropic.claude-sonnet-4-5-20250929-v1:0 is not available on your bedrock deployment...

In the next section, we will see how to solve it:

4. First usage of Anthropic models with Amazon Bedrock

When you have a brand new AWS account, the first time you want to use any Anthropic model you must first fill out a form describing your use case.

This is required only once per account, but it is good to be aware of it.

Enable Anthropic model usage in Bedrock

and then

Filling form to enable Anthropic model usage

That's all.

And, after only two minutes, the message in the botton line changed from

The model us.anthropic.claude-sonnet-4-5-20250929-v1:0 is not available on your bedrock deployment...

to

Hello! I'm ready to help you with the ShopMind project.

Another tip: monitoring Bedrock costs

Another useful tip is how to watch the Bedrock cost. It should be trivial at first, but when you start using your AWS account and apply your first credits, you may not be fully aware of what you are really using versus what you are actually spending daily or monthly.

That is a subtle difference, but let's review it.

In the following screen, I'm spending $ 0.00, but… where is my usage?

AWS Cost Explorer showing $0 spending because promotional credits are applied

In the first Cost Explorer screen, the usage is hidden by the applied credits. In this case, I had credits from the AWS re:Invent 2025 expo.

AWS Cost Explorer showing $0 spend because credits are applied

To see the real usage (even if the credits are covering the cost), you can activate a filter on the left side. Select Charge type and then choose Usage.

AWS Cost Explorer filter showing Charge type set to Usage

With this filter applied, Cost Explorer will show the actual usage, and you can understand how close you are to consuming your credits without waiting until the end of the month or the billing cycle.

AWS Cost Explorer showing actual usage after applying the filter

Why this is useful

Many developers already receive AWS credits through programs like AWS Community Builders, hackathons, startup programs, or educational accounts.

With this configuration, instead of paying for a Claude Pro subscription, you can run Claude Code directly through Amazon Bedrock and consume those credits.

For builders working with AWS infrastructure, this is a very convenient way to experiment with Claude Code while keeping everything inside the AWS ecosystem.

This is the short answer for personal usage...

What about the Enterprise Level?

At the enterprise level, using Claude Code through Amazon Bedrock also brings several advantages related to governance, compliance, and security. Some of them are the following:

  • Centralized billing and cost control through the AWS account and Cost Explorer.

  • Use of AWS IAM and IAM Identity Center to control who can access and use AI models.

  • No external API keys required, since authentication is handled through AWS credentials.

  • Integration with AWS governance tools, such as CloudTrail and CloudWatch, for auditing and monitoring usage.

  • Ability to apply existing AWS credits to AI workloads, including Amazon Bedrock usage.

  • Alignment with enterprise security policies, since the traffic stays within the AWS environment.

... and more!

All these ones are true, but, beyound the scope of this post :)

See you in the next one!

I hope that this tip helps you get more value from your AWS credits while using Claude Code.

— Pablo

Top comments (0)