Claude Code on Bedrock: cost, and who sees it
Run Claude Code through Amazon Bedrock, see where the spend lands on the AWS bill, why Anthropic's analytics never see it, and how to tie it to a repository.
Set CLAUDE_CODE_USE_BEDROCK=1, give Claude Code AWS credentials, and every token it uses is billed to your AWS account on the Amazon Bedrock line, at the price of the model in the Region you call. Anthropic's dashboards never see the session: its costs page says the metrics stay in your cloud. AWS takes the attribution as far as an application inference profile and the tags on it, a team or a cost centre; nothing on the bill names a session, a repository or a pull request. The setup is one block below; the rest of the page is where the dollars land and who can see them.
Claude Code with Bedrock: the setup in one block
Run claude, choose 3rd-party platform, then Amazon Bedrock. The wizard asks for an AWS profile detected from your ~/.aws directory, an Amazon Bedrock API key, an access key and secret, or credentials already in your environment, then your region, checks which Claude models the account can invoke, lets you pin them and writes the result to the env block of your user settings. Signed in already, type /setup-bedrock in full. Or set the variables yourself, from Anthropic's Bedrock page read 30 October 2026:
export CLAUDE_CODE_USE_BEDROCK=1 export AWS_REGION=us-east-1 export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8' export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6'
- Credentials. The AWS default chain:
aws configure, exported access keys, an SSO profile inAWS_PROFILE, or a Bedrock API key. "WhenAWS_BEARER_TOKEN_BEDROCKis set, Claude Code authenticates with the key and doesn't resolve the credential chain, even if other AWS credentials are present." Behind a gateway that holds the credentials,CLAUDE_CODE_SKIP_BEDROCK_AUTHskips AWS authentication andANTHROPIC_BEDROCK_BASE_URLpoints Claude Code at the gateway. - Region. Read in this order:
AWS_REGION,AWS_DEFAULT_REGION, theregionon the active AWS profile,us-east-1./statusshows the one resolved. "When using Amazon Bedrock, the/logoutcommand is unavailable since authentication is handled through AWS credentials." "The WebSearch tool is not available on Amazon Bedrock." - Model ids. On Bedrock a model is a cross-region inference profile: the Anthropic id behind a geography prefix,
us.anthropic.claude-opus-5-5, or a versioned one,us.anthropic.claude-sonnet-4-5-20250929-v1:0.ANTHROPIC_BEDROCK_REGION_PREFIX(us,eu,apac,jp,au,global; Claude Code v2.1.224 or later) chooses the prefix tried first. An application inference profile is passed as its ARN,arn:aws:bedrock:us-east-2:your-account-id:application-inference-profile/your-model-id. "TheANTHROPIC_DEFAULT_*_MODELenvironment variables configure one inference profile per model family. If your organization needs to expose several versions of the same family in the/modelpicker, each routed to its own application inference profile ARN, use themodelOverridessetting in your settings file instead." - The defaults, and the pin. Unpinned,
opusis Opus 5.5 (since Claude Code v2.1.280; Opus 5 before) and the small, fast model is Sonnet 4.5. Anthropic's warning: "Pin specific model versions when deploying to multiple users. Without pinning, model aliases such assonnetandopusresolve to Claude Code's built-in default for Amazon Bedrock, which can lag the newest release and may not yet be available in your account." And the one about money: "Opus models have a higher per-token price than Sonnet models, so if you don't pin a primary model, you're billed at the Opus rate." - Prompt caching is on. On a cloud provider "the cache lives in your cloud provider's serving infrastructure", and "At the provider's own endpoint, Amazon Bedrock and its Mantle endpoint, Google Cloud's Agent Platform, and Microsoft Foundry cache the block the same way the Claude API does."
DISABLE_PROMPT_CACHING=1turns it off;ENABLE_PROMPT_CACHING_1H=1asks for the hour, and "The 1-hour cache TTL is billed at a higher rate than the 5-minute default." One check: "Prompt caching may not be available in all Amazon Bedrock regions. If cache token counts stay at zero, check supported models, regions, and limits in the Amazon Bedrock documentation."
| AWS region | Prefix |
|---|---|
us-gov-* (AWS GovCloud) | us-gov. |
us-* | us. |
eu-* | eu. |
ap-* | apac. |
| All other regions | global. |
Claude Code Bedrock pricing: where the dollars land
"On Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry, Claude Code is billed per token to your cloud account, and spend controls live in your cloud provider's billing console." The costs page's table gives the cloud row three cells: see spend in "Your cloud billing console", limit it with "Your cloud's budget controls", attribute it per user with "OpenTelemetry or an LLM gateway". On the AWS side the unit of attribution is the inference profile. From AWS's inference profiles page and the Billing guide, read 30 October 2026:
- Application inference profiles are "Inference profiles that a user creates to track costs and model usage." "You can create an application inference profile with one or more Regions to track usage and costs when invoking a model." One per team, one per cost centre, one per product: each gets an ARN, and Claude Code is pointed at it through
ANTHROPIC_MODELormodelOverrides. - Tags on the profile. "Attach tags to an application inference profile to track costs when you submit on-demand model invocation requests." Activated in Billing and Cost Management, "AWS generates a cost allocation report as a comma-separated value (CSV file) with your usage and costs grouped by your active tags." "You can apply tags that represent business categories (such as cost centers, application names, or owners) to organize your costs across multiple services." "All tags can take up to 24 hours to appear in the Billing and Cost Management console."
- The price. "The price for using an inference profile is calculated based on the price of the model in the Region from which you call the inference profile."
- One account. Anthropic's own note on the Bedrock page: "Create a dedicated AWS account for Claude Code to simplify cost tracking and access control."
How far that gets: to the tag. A profile per team puts each team's tokens on its own line of the cost allocation report, by model and Region. No AWS page read on 30 October 2026 names a session, a repository or a pull request as a dimension of Bedrock cost; the dimensions are the account, the Region, the model, the inference profile and the tags on it. A developer's day across three repositories is one line.
What AWS publishes, and what this page does not repeat. The Anthropic section's "On-Demand and Batch pricing" on Amazon Bedrock pricing has two tables, "Global Cross-region Inference" and "Geo and In-region Cross-region Inference", each with a price per million tokens for input, output, batch input, batch output, 5-minute cache write, 1-hour cache write and cache read, per Claude model; below them sit two Reserved Tier tables priced per hour per 1K tokens a minute, and a Provisioned Throughput line that says to ask your account team. Two notes are plain text: at the head of the Anthropic section, "Starting October 7, 2026, cache read pricing for Claude Sonnet 5.5 is reduced by 50% from the prior rate." And in the page's Model Pricing introduction: "Amazon Bedrock offers select foundation models (FMs) from leading AI providers like Anthropic, Meta, Mistral AI, and Amazon for batch inference at a 50% lower price compared to on-demand inference pricing." Every price cell is filled by script from an AWS pricing feed, and on 30 October 2026 it gave this reader none, as plain HTML or rendered in a browser with the Anthropic tab open. So no AWS figure is on this page, and none is taken from a third party: read the table on AWS's page, in your Region. What the primary pages do say about its shape:
- Cache reads and writes are priced on Bedrock the way the first-party API prices them, by kind. AWS's prompt caching page: "tokens successfully read from cache are reported as cached tokens and billed at the model's cache-read rate. Tokens that aren't read from cache are billed at the standard input token rate. Depending on the model, tokens written to cache can be billed at a rate that is higher than the standard input token rate." Its Claude rows, Haiku 5.5 down to Haiku 4.5, list TTLs of 5 minutes, 1 hour, except Claude 3.7 Sonnet and Claude 3.5 Sonnet v2, 5 minutes only. Anthropic's first-party page: a cache read is "0.1x base input price (0.025x on Claude Fable 5.1 and Claude Mythos 5.1; 0.05x on Claude Opus 5.5 and Claude Sonnet 5.5)", and "caching pays off after one cache read for the 5-minute duration (1.25x write), or after two cache reads for the 1-hour duration (2x write)". Whether each Bedrock figure equals Anthropic's is on the AWS table, not here.
- Regional endpoints carry a premium. Anthropic's pricing page, under cloud platforms: "Regional and multi-region endpoints include a 10 percent premium over global endpoints." And: "Partner-operated platforms, Bedrock and Claude Models on Google Cloud (Google managed), have independent regional pricing." The AWS page separates its two tables accordingly; no AWS page read states the percentage.
- The invoice is the cloud's. "This section covers partner-operated cloud platforms, where the cloud provider invoices you."
Who sees Claude Code on Bedrock
Anthropic's analytics page, read 30 October 2026, lists two dashboards: Claude for Teams / Enterprise at claude.ai/analytics/claude-code and API (Claude Console) at platform.claude.com/claude-code. There is no cloud row, and the costs page says why:
Claude Code does not send metrics from your cloud back to Anthropic, so the analytics dashboards and the Claude Code Analytics API do not cover this usage.
So the spend report, the Console dashboard and the Claude Code Analytics API hold nothing from a Bedrock session. Neither does Anthropic's own operational telemetry: "By default, error reporting, telemetry, and bug reporting are disabled when using Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or Claude Platform on AWS." The data-usage page's cell for metrics on Bedrock reads "Default off. CLAUDE_CODE_USE_BEDROCK must be 1."
For per-user attribution the costs page gives three options, each yours to run: OpenTelemetry, a Claude apps gateway and an LLM gateway. Of the first: "This gives you per-user token counts, costs, and tool activity regardless of provider." The variables, the metrics and what the stream never carries: Claude Code OpenTelemetry. One caveat travels with every figure Claude Code itself prints: "By default, Claude Code computes every cost figure it shows developers at list price, so if your organization pays contracted rates, the figures in /usage, the status line, and OpenTelemetry don't match your bill." A modelPricing managed setting (Claude Code v2.1.242 or later) puts your contracted rates into /usage and the OpenTelemetry cost counter; the AWS bill is unchanged. The Console's own figures carry the same note: "Spend figures in the Console dashboard are estimates for analytics purposes. For actual costs, refer to your billing page."
The token mix a Bedrock bill is made of
A Bedrock invoice line is tokens times a rate per kind, and the kinds are far from equal. Thirty days of Claude Code on my Mac, 29 September to 28 October 2026, every session, read from Caprock's database on 28 October 2026. The sessions ran on a Claude.ai plan, not on Bedrock: this is the shape of the tokens an agent consumes, not a Bedrock bill.
- 97.6%
- of every token was a cache read
- 20.9 billion
- cache-read tokens, 20,873,061,218 exactly
- 33.8 million
- output tokens, 33,816,758 exactly
| Kind | Share |
|---|---|
| Fresh input, 34.5 million | 0.2% |
| Cache write, 439.4 million | 2.1% |
| Cache read, 20.9 billion | 97.6% |
| Output, 33.8 million | 0.2% |
Why the cache-read column decides the bill: at Anthropic's first-party ratio of a tenth of the input price, those cache reads weigh 61 times the fresh input; at the twentieth that Opus 5.5 and Sonnet 5.5 read at, 30 times. Output, the column people compare models on, is 0.2% of the tokens. Read a Bedrock price table from its cache-read column first; and in a Region where cache token counts stay at zero, every one of those tokens is billed at the input rate.
Claude Code on Vertex AI
Google Cloud's Agent Platform, Vertex AI until Google renamed it, is the same shape with Google's names. The login prompt still says Google Vertex AI; by hand:
export CLAUDE_CODE_USE_VERTEX=1 export CLOUD_ML_REGION=global export ANTHROPIC_VERTEX_PROJECT_ID=YOUR-PROJECT-ID
"Set CLOUD_ML_REGION to global, a multi-region location such as eu or us, or a specific region such as us-east5." Model ids are Anthropic's, with a date after @ for a pinned version, claude-haiku-4-5@20251001; the small, fast model defaults to claude-sonnet-4-5@20250929. "Prompt caching is enabled automatically." CLAUDE_CODE_SKIP_VERTEX_AUTH is the gateway switch. The visibility is the same as Bedrock's: billed per token to your Google Cloud project, spend controls in Google's console, and the costs page's sentence above names Google Cloud's Agent Platform beside Bedrock.
Beside the AWS bill: Caprock
Caprock, a free desktop app, reads the transcript Claude Code writes on the machine, under ~/.claude/projects, whichever endpoint answered the request. What it does with a Bedrock session, read from the code and not from a measurement, because no Bedrock session has run on my machine:
- Recorded as it ran. A session you start in a Bedrock shell lands by working directory in its repository's row, with its turns, tools and subagents, and the repository's cost is divided by the pull requests merged in the window. A session Caprock starts on one of your saved sign-ins runs without the cloud switch:
CLAUDE_CODE_USE_BEDROCKis one of the variables it removes, and Settings lists it by name when your login shell sets it. - The model id is mapped.
normalizeModelininternal/cost/cost.gotakesus.anthropic.claude-opus-5-5toclaude-opus-5-5and a Vertexclaude-haiku-4-5@20251001toclaude-haiku-4-5, then prices the turn from Caprock's dated table. - The price is Anthropic's first-party list: an estimate. The table is read from Anthropic's pricing page and carries no Bedrock or Vertex row; Caprock's risk register says so (OQ-02). A session on the API / Bedrock plan in Caprock is labelled at list price. A regional premium, a private offer or a Region's own rate is not applied: the AWS bill is the bill, and this figure sits beside it as what the same tokens cost at Anthropic's list. How a session is priced, step by step: the method.
- The join the bill lacks. The row is the repository, the pull request and the release, not the inference profile, so a tagged team's AWS line can be read against the pull requests its machines shipped in the same month.
Caprock for Teams sums the same across machines by work unit, per repository, pull request and release, on a server you run, however the tokens are paid for: an API key, a seat, Bedrock or Vertex. The cost allocation report keeps the dollars by tag; the ledger keeps the work they bought. Buying Caprock is one flat price for the team.
Which credential Claude Code uses when a key, a plan and a cloud switch are all set: Claude Code API key. The aliases, the defaults per provider and what each model cost on my machine: Claude Code models. Allocating the AWS line to pull requests, reporting it beside the bill and capping the loop: FinOps for coding agents.
Questions people ask
- How much does Claude Code cost on Bedrock?
- Per token, to your AWS account, at the price of the model in the Region you call. The Amazon Bedrock pricing page lists input, output, batch, 5-minute and 1-hour cache write and cache read prices per million tokens for each Claude model, in a global table and a geo/in-region one; its cells are drawn by script and rendered no figure on 30 October 2026, so this page quotes none. Anthropic's pricing page: regional and multi-region endpoints carry a 10 percent premium over global. Unpinned, Claude Code runs Opus 5.5 and bills at the Opus rate.
- Does Claude Code on Bedrock send data to Anthropic?
- Anthropic's costs page: "Claude Code does not send metrics from your cloud back to Anthropic, so the analytics dashboards and the Claude Code Analytics API do not cover this usage." Its data-usage page: "By default, error reporting, telemetry, and bug reporting are disabled when using Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or Claude Platform on AWS." The OpenTelemetry export, if you configure it, goes to the collector you name. Read 30 October 2026.
- How do I attribute Bedrock spend per team?
- Create an application inference profile per team, tag it, activate the tag as a cost allocation tag in Billing and Cost Management, and point each team's Claude Code at the profile's ARN with ANTHROPIC_MODEL or modelOverrides. AWS then groups the Bedrock charges by tag in the monthly cost allocation report and Cost Explorer. That reaches the team; nothing on the AWS side names a session, a repository or a pull request. Caprock reads those from the machines.
- Does Bedrock charge for prompt caching like the Anthropic API?
- In the same kinds. AWS's prompt caching page: tokens read from cache are billed at the model's cache-read rate, tokens not read from cache at the standard input rate, and tokens written to cache can be billed above the input rate depending on the model; the Claude models from Haiku 4.5 on list 5-minute and 1-hour TTLs (Claude 3.7 Sonnet and 3.5 Sonnet v2, 5 minutes only). The AWS pricing table has a column for each; its figures are on that page. Anthropic's first-party ratios are 0.1x for a read (0.05x on Opus 5.5 and Sonnet 5.5), 1.25x for a 5-minute write and 2x for an hour.
- How do I use Claude Code with Vertex AI?
- Google now calls it Google Cloud's Agent Platform. Set CLAUDE_CODE_USE_VERTEX=1, CLOUD_ML_REGION (global, a multi-region such as eu or us, or a region such as us-east5) and ANTHROPIC_VERTEX_PROJECT_ID, with Google Cloud credentials, or choose 3rd-party platform at the login prompt. Model ids are Anthropic's with @date for a pinned version. Prompt caching is on automatically. Billing and visibility are the same as Bedrock's: your Google Cloud project, not Anthropic's dashboards.
- Can Caprock show what a Claude Code session on Bedrock cost?
- An estimate at Anthropic's first-party list, not the AWS charge. Caprock reads the session from the transcript on the machine, maps the Bedrock model id to its dated price table and prices the tokens at list; the table carries no Bedrock or Vertex row, so a regional premium or a private offer is not applied. The AWS bill is the bill. No Bedrock session has been measured on the author's machine; the behaviour is read from the code.
Sources
- Claude Code docs — Claude Code on Amazon Bedrock (the wizard, credentials, the variables, model pinning, inference profile prefixes, prompt caching, the IAM note), read 30 October 2026 as the page's .md route
- Claude Code docs — Claude Code on Google Cloud's Agent Platform, formerly Vertex AI (the variables, region forms, model ids, caching), read 30 October 2026
- Claude Code docs — Manage costs effectively (the cloud providers section and the options table, the list-price sentence), read 30 October 2026
- Claude Code docs — Track team usage with analytics (the dashboard table: two plans, no cloud row; the Console estimate note), read 30 October 2026
- Claude Code docs — Environment variables (CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_SKIP_BEDROCK_AUTH, ANTHROPIC_BEDROCK_BASE_URL, AWS_BEARER_TOKEN_BEDROCK, the Vertex pair), read 30 October 2026
- Claude Code docs — Data usage (default behaviours by API provider: telemetry off on Bedrock), read 30 October 2026
- Claude Code docs — Prompt caching (where the cache lives on a cloud provider), read 30 October 2026
- Anthropic — Pricing (the first-party model table Caprock's price list is read from; cloud platform pricing: the 10 percent regional premium, independent partner pricing; cache multipliers), read 30 October 2026
- AWS — Amazon Bedrock pricing (the Anthropic section's column headings, section names and notes; every price cell is drawn by script and rendered no figure on the day), read 30 October 2026
- AWS Bedrock User Guide — Set up a model invocation resource using inference profiles (the three uses, application profiles, pricing by calling Region), read 30 October 2026
- AWS Bedrock User Guide — Create an application inference profile (one or more Regions, the tags field), read 30 October 2026
- AWS Bedrock User Guide — Tagging Amazon Bedrock resources (allocate costs, the monthly cost allocation report), read 30 October 2026
- AWS Billing User Guide — Organizing and tracking costs using AWS cost allocation tags (activation, the CSV report, the 24-hour delay), read 30 October 2026
- AWS Bedrock User Guide — Prompt caching (billing for cached tokens, the Claude models and their TTLs), read 30 October 2026
- Caprock source — internal/cost/cost.go, normalizeModel: a Bedrock id loses its us.anthropic. prefix and a Vertex id its @date before the price lookup
- Caprock source — internal/subs/subs.go, CredentialEnv: the cloud switches a session on a saved sign-in runs without, named in Settings
- Caprock's dated price table: Anthropic's first-party list, its notes saying Bedrock and Vertex partner pricing is not covered
- Caprock — risk register, OQ-02: partner pricing stays out until there is demand
- Caprock's measured figures: tokens by kind, 29 September to 28 October 2026, one developer's Mac on a Claude.ai plan; the charts on /teams/ read the same file (src/content/charts.ts)
Try it
The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.
Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.
Or run it yourself:
Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app