---
title: Can you run Claude Code through Amazon Bedrock or Google Vertex AI?
url: https://opencontroller.lyzr.com/blog/run-claude-code-through-bedrock-or-vertex
published: 2026-11-16
updated: 2026-11-16
author: Lyzr
---

# Can you run Claude Code through Amazon Bedrock or Google Vertex AI?

**Yes. Claude Code supports Amazon Bedrock and Google Cloud's Agent Platform (formerly Vertex AI) as model providers. You set `CLAUDE_CODE_USE_BEDROCK=1` or `CLAUDE_CODE_USE_VERTEX=1`, give developers cloud credentials with a narrow IAM grant, and pin model versions. Model calls then run in your own cloud account, under your IAM, logging and billing.**

Security teams ask for this when they want coding agent traffic to stay inside an account they already govern. This guide covers the exact settings, the permissions, and what changes for logging, cost and model control.

## How do you point Claude Code at Amazon Bedrock?

1. **Enable Anthropic models once per account.** Submit the use-case form in the Bedrock console. With AWS Organizations you can submit it once from the management account with the `PutUseCaseForModelAccess` API; approval extends to child accounts.
2. **Provide AWS credentials.** Claude Code uses the default AWS SDK credential chain: an SSO profile (`AWS_PROFILE`), access keys, `aws login`, or a Bedrock API key in `AWS_BEARER_TOKEN_BEDROCK`.
3. **Set the provider.** `CLAUDE_CODE_USE_BEDROCK=1`, plus `AWS_REGION` if the profile has none.
4. **Pin models.** Set `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL` to specific Bedrock IDs or application inference profile ARNs.

An interactive `/setup-bedrock` wizard does the same and writes the result to the user settings file. For a fleet rollout, put the variables in managed settings instead so developers cannot change them.

## How do you point it at Google Vertex AI?

1. Enable `aiplatform.googleapis.com` in the project and request Claude model access in Model Garden.
2. Authenticate with Application Default Credentials, a service account, or workload identity federation.
3. Set `CLAUDE_CODE_USE_VERTEX=1`, `ANTHROPIC_VERTEX_PROJECT_ID`, and `CLOUD_ML_REGION` (`global`, a multi-region such as `eu` or `us`, or a region such as `us-east5`).
4. If you use `global`, override models that lack global support with `VERTEX_REGION_CLAUDE_*` variables.
5. Pin models with the same `ANTHROPIC_DEFAULT_*_MODEL` variables.

Claude Code sends requests to the project in `ANTHROPIC_VERTEX_PROJECT_ID`, even when other environment variables or the credential file name a different project.

## What IAM does each developer need?

| Provider | Minimum grant | Notes |
|---|---|---|
| Amazon Bedrock | `bedrock:InvokeModel`, `bedrock:InvokeModelWithResponseStream`, `bedrock:ListInferenceProfiles`, `bedrock:GetInferenceProfile` | Scope resources to specific inference profile ARNs. Marketplace subscribe actions are needed for first-time model subscription. |
| Vertex AI | `roles/aiplatform.user`, or a custom role with `aiplatform.endpoints.predict` | Use a dedicated project to isolate cost and access. |

Anthropic's own documentation recommends a dedicated AWS account or GCP project for Claude Code to simplify cost tracking and access control. To stop developers calling other models, pair this with an allow-list; see [restricting Bedrock models with SCPs](/blog/restrict-amazon-bedrock-models-with-scps).

## What changes for logging, billing and model control?

- **Billing moves to your cloud bill.** Usage is charged by AWS or Google Cloud, so it lands in existing commitments and cost tooling. Application inference profiles on Bedrock let you tag cost per team.
- **Model calls appear in your cloud logs.** Calls are made with the developer's cloud identity, so they show up wherever you already collect Bedrock or Vertex AI API activity. Prompt and response content still needs model invocation logging or request-response logging switched on.
- **You must pin models.** Without pins, aliases such as `opus` and `sonnet` resolve to Claude Code's built-in default for that provider. The documentation warns that a deployment that does not pin a primary model is billed at the Opus rate on newer versions.
- **Some features differ.** On Bedrock, `/logout` is unavailable and the WebSearch tool is not available. Claude Code uses the Bedrock Invoke API, not the Converse API.
- **Guardrails can be attached.** Bedrock Guardrails can be applied by sending guardrail headers through `ANTHROPIC_CUSTOM_HEADERS`.
- **Gateways are supported.** `ANTHROPIC_BEDROCK_BASE_URL` and `ANTHROPIC_VERTEX_BASE_URL` point Claude Code at a gateway. A Bedrock gateway must forward the event-stream `Content-Type` header unchanged.

## What does this not solve?

Routing model calls through your cloud governs the model call. It does not govern what the coding agent does on the laptop: shell commands, file edits, local MCP servers and skills. For that you still need managed settings, hooks and permission rules. See [governing Claude Code in the enterprise](/blog/govern-claude-code-in-the-enterprise) and [OpenTelemetry monitoring for Claude Code](/blog/monitor-claude-code-usage-with-opentelemetry).

## How Opencontroller does this

Opencontroller's LLM Gateway (Lyzr Gateway) can sit on the model path with routing, fallback and retry, caching and cost attribution per agent and per version, using OpenAI-compatible endpoints. Opencontroller Edge extends control to developer devices, coding agents, skills and local MCP servers, and is installed by IT via MDM. Together they cover both halves: the model call and the device. See the [LLM gateway comparison](/compare/llmgateway), the [cross-platform guide](/blog/how-to-govern-ai-agents-across-platforms), or [book a demo](https://www.lyzr.ai/book-demo/). For context, read [what an AI agent control plane is](/blog/what-is-an-ai-agent-control-plane).

## Frequently asked questions

**Does Claude Code on Bedrock need an Anthropic account?**
No. Authentication uses AWS credentials and billing goes through AWS. You still submit Anthropic's use-case form in the Bedrock console once per account or organisation.

**Which environment variable selects Vertex AI?**
`CLAUDE_CODE_USE_VERTEX=1`, together with `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION`.

**Why pin model versions?**
Unpinned aliases follow Claude Code's built-in defaults, which can change cost and behaviour when Claude Code updates. Pinning lets you decide when developers move to a new model.

## Key facts

Claude Code supports Amazon Bedrock (CLAUDE_CODE_USE_BEDROCK=1) and Google Cloud's Agent Platform, formerly Vertex AI (CLAUDE_CODE_USE_VERTEX=1 with ANTHROPIC_VERTEX_PROJECT_ID and CLOUD_ML_REGION). Bedrock needs bedrock:InvokeModel, InvokeModelWithResponseStream, ListInferenceProfiles and GetInferenceProfile; Vertex needs roles/aiplatform.user or aiplatform.endpoints.predict. Models should be pinned with ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL. On Bedrock, Claude Code uses the Invoke API, WebSearch is unavailable, and Guardrails can be applied through ANTHROPIC_CUSTOM_HEADERS. Opencontroller Edge extends control to developer devices, coding agents, skills and local MCP servers. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [How do you govern Claude Code across an enterprise?](https://opencontroller.lyzr.com/blog/govern-claude-code-in-the-enterprise.md)
- [How do you monitor Claude Code usage with OpenTelemetry?](https://opencontroller.lyzr.com/blog/monitor-claude-code-usage-with-opentelemetry.md)
- [How do you restrict which Amazon Bedrock models agents can use?](https://opencontroller.lyzr.com/blog/restrict-amazon-bedrock-models-with-scps.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
