Cloud Providers
These variables point Claude Code at a cloud provider instead of the Anthropic API.
Switch a provider on with a CLAUDE_CODE_USE_* variable. Then set the region, credentials, and endpoints for it.
They also cover LLM gateways that sit in front of a provider.
This page lists 78 variables. Set CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX, or the Foundry switch to 1. Then set region, project, and endpoint variables. To turn one off, unset the CLAUDE_CODE_USE_* variable. You can override a stale shell export with an empty string in settings.json env.
Example
{
"$schema": "https://clawdipedia.cc/schemas/claude-code-settings.json",
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "us-east-1"
}
}
Claude Code now talks to Amazon Bedrock in us-east-1.
Variables
The table is sorted by name. See Environment Variables for what each column and badge means.
| Variable | Status | What it does | Values and default | Notes |
|---|---|---|---|---|
ANTHROPIC_ | Documented: An official docs page names this item. | Overrides the Claude Platform on AWS endpoint URL. | Text. A set value also changes first-party checks for this provider | Provider anthropic. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Gives the workspace ID for Claude Platform on AWS. Claude Code shows it as Workspace ID and passes workspace to the AWS client. | Text, headers by default. The client gets workspace only when this var is set and an anthropic- header exists in the default headers. Header source not traced | Provider anthropic. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Overrides the Amazon Bedrock endpoint URL. | Text. Defaults are https:// for requests and https:// for the control plane | Provider bedrock. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Overrides the Amazon Bedrock Mantle endpoint URL. | Text. Default is https:// | Provider mantle. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Sets the cross-region inference profile prefix that Claude Code tries first. Ignored in us- regions. | One of us, eu, apac, jp, au, or global. Claude Code rejects any other value. Without it, Claude Code derives us, eu, apac, or global from the AWS region. Claude Code never picks jp and au for you | Provider bedrock. Project env can set it before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Sends the value in the X- header. The status view shows it as Bedrock service tier. | Text. Code does not check the value | Provider bedrock. Project env can set it before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Sets the full base URL of the Foundry resource. | Text. Wins over ANTHROPIC_. Without both, the URL is undefined | Provider foundry. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Sets the Foundry resource name. Claude Code builds https:// from it. | Text. Claude Code checks it as a resource name. An invalid value with no base URL raises an error | Provider foundry. Not set from project env before trust |
ANTHROPIC_ | Undocumented: Only the program shows this item. It can change without notice. | Overrides the endpoint for the Claude Platform on Google Cloud provider. | Text. Default is https://. A set value counts as a custom endpoint in first-party checks | Provider anthropic. Not set from project env before trust |
ANTHROPIC_ | Undocumented: Only the program shows this item. It can change without notice. | Sets the GCP location for the Claude Platform on Google Cloud provider. | Text. Claude Code passes it to the client setup. The status view shows global when it is unset | Provider anthropic. Not set from project env before trust |
ANTHROPIC_ | Undocumented: Only the program shows this item. It can change without notice. | Sets the GCP project for the Claude Platform on Google Cloud provider. | Text. Falls back to GOOGLE_ in the status view. Also feeds Google auth when no other project var is set | Provider anthropic. Not set from project env before trust |
ANTHROPIC_ | Undocumented: Only the program shows this item. It can change without notice. | Sets the workspace ID for the Claude Platform on Google Cloud provider. The status view shows it. | Text. Claude Code passes it to the client setup with the project and location | Provider anthropic. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Overrides the AWS region for the Haiku-class model on Bedrock. | Text | Providers bedrock and mantle. Project env can set it before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Overrides the Vertex endpoint URL. | Text, comes by default. A set value also turns off the default for fine-grained tool streaming on Vertex | Provider vertex. Not set from project env before trust |
ANTHROPIC_ | Documented: An official docs page names this item. | Sets the GCP project for Vertex requests. | Text. It is the last choice after GCLOUD_, GOOGLE_, and their lowercase forms | Provider vertex. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Gives the standard AWS access key. Claude Code reads it into the Bedrock credential set. It also uses it with the secret key for AWS-based federation. | Text | Providers bedrock and mantle. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Gives the standard AWS config file path. Claude Code uses it in the AWS cache key and as an input of the auth refresh check. | Text. Key is config file, credentials file, and profile. A host-managed provider check also tests it | Providers bedrock and mantle. Not set from project env before trust |
AWS_ | Undocumented: Only the program shows this item. It can change without notice. | Gives the standard AWS container credentials URL. Claude Code includes it in the inputs that refresh cached AWS credentials. | Text | Providers bedrock and mantle. Not set from project env before trust |
AWS_ | Undocumented: Only the program shows this item. It can change without notice. | Gives the standard AWS container credentials path. Claude Code includes it in the inputs that refresh cached AWS credentials. | Text | Providers bedrock and mantle. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Gives the standard AWS region. It is the fallback for AWS_. Claude Code defaults to us- when neither is valid. | Text. Order is AWS_, then this var, then the shared config, then us- | Providers bedrock and mantle. Project env can set it before trust |
AWS_ | Documented: An official docs page names this item. | Sets a global AWS endpoint override. Claude Code uses it as a fallback STS URL and counts it as a Bedrock base URL source. | Text. Fallback after AWS_ for STS and after the Bedrock-specific names for Bedrock | Bedrock and AWS STS. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Overrides the Bedrock endpoint URL. Claude Code lists it as a Bedrock base URL source for provider checks. | Text. In the Bedrock variable list after ANTHROPIC_ and AWS_ | Bedrock. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Overrides the Bedrock runtime endpoint URL. Claude Code lists it as a Bedrock base URL source for provider checks. | Text. In the Bedrock variable list right after ANTHROPIC_ | Bedrock. Not set from project env before trust |
AWS_ | Undocumented: Only the program shows this item. It can change without notice. | Sets the AWS STS endpoint. Claude Code reads it first, then AWS_, then https://. | Text. Also used by the gateway STS role-assume code | Bedrock and AWS STS. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Selects the AWS shared config profile for Bedrock credentials and region lookup. | Text. Part of the credential fingerprint and of the aws cache key | Bedrock. Project env can set it before trust |
AWS_ | Documented: An official docs page names this item. | Sets the AWS region for Bedrock. Claude Code reads it first, then AWS_, then the shared config, then us-. | Text. An invalid value gives source env- and falls back to the default | Bedrock. Project env can set it before trust |
AWS_ | Undocumented: Only the program shows this item. It can change without notice. | Gives the role for AWS web identity login. Claude Code also uses it as a credential source marker for Bedrock auth refresh. | Text | Bedrock |
AWS_ | Documented: An official docs page names this item. | Gives the AWS secret key for Bedrock. It pairs with AWS_ and AWS_. | Text. Claude Code also writes it into an env object built from a Bedrock access key setup | Bedrock. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Gives the temporary AWS session token that goes with the access key pair for Bedrock. | Text. Claude Code also writes it into an env object built from a Bedrock access key setup | Bedrock. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Sets the path of the AWS shared credentials file for Bedrock. | Text. Path string. Part of the credential fingerprint and the aws cache key | Bedrock. Not set from project env before trust |
AWS_ | Documented: An official docs page names this item. | Selects the FIPS STS endpoint for the gateway role assume code. | Text. True only for the exact string true | Gateway STS (AWS identity federation) |
AWS_ | Documented: An official docs page names this item. | Gives the path of the web identity token file for AWS role login. Claude Code also uses it as a credential source marker. | Text. Path string | Bedrock |
CLAUDE_ | Undocumented: Only the program shows this item. It can change without notice. | Makes the CCR agent proxy write a gh shim onto PATH. | On or off. Claude Code sets 1 for the session when the tool config has gh. A failed write logs a warning | Claude Code on the web with agent proxy. Not set from project env before trust |
CLAUDE_ | Undocumented: Only the program shows this item. It can change without notice. | Makes the CCR agent proxy append a governed git config. | On or off. Claude Code sets 1 for the session when the tool config has git. A failed append logs a warning | Claude Code on the web with agent proxy. Not set from project env before trust |
CLAUDE_ | Undocumented: Only the program shows this item. It can change without notice. | Lists the governed git hosts for the CCR agent proxy. | A comma-separated list, host by default. Claude Code ignores bad entries and logs the count. An empty value gives the default host | Claude Code on the web with agent proxy. Not set from project env before trust |
CLAUDE_ | Documented: An official docs page names this item. | Sets how long Claude Code waits for the AWS default credential chain before the request fails. | A number of milliseconds, 60000 by default. Whole number from 1 to 2147483647 ms | Bedrock, Mantle, Claude Platform on AWS |
CLAUDE_ | Documented: An official docs page names this item. | Stops Claude Code from treating a Bedrock streaming response without Content- as application/. | On or off. Code sets the header only when the provider is Bedrock and the header is empty | Bedrock |
CLAUDE_ | Documented: An official docs page names this item. | Skips the check that a Bedrock stream has the vnd. content type. | On or off. Without it the request fails and the error names this variable | Bedrock |
CLAUDE_ | Documented: An official docs page names this item. | Marks that a host app manages provider routing. | On or off. Part of a host-managed marker list with ANTHROPIC_ and CLAUDE_. Also gates gateway mode | Host apps such as Desktop |
CLAUDE_ | Documented: An official docs page names this item. | Skips client-side auth for Claude Platform on AWS, for gateways that sign requests themselves. Claude Code keeps your own Authorization header. | On or off. Also skips the AWS credential setup at startup. The status view shows that auth is skipped | Claude Platform on AWS. Project env can set it before trust |
CLAUDE_ | Undocumented: Only the program shows this item. It can change without notice. | Skips Google credentials for Claude Platform on Google Cloud. The client runs with skip and keeps your own Authorization header. | On or off, Credentials by default. Also skips the Application Default Credentials setup and refresh hints | Claude Platform on Google Cloud. Project env can set it before trust |
CLAUDE_ | Documented: An official docs page names this item. | Turns off the in-process cache of AWS default-chain credentials. Claude Code then resolves the chain on each API request. | On or off. It also skips the credential lookup in the retry check | Bedrock and other AWS paths |
CLAUDE_ | Documented: An official docs page names this item. | Skips AWS auth for Amazon Bedrock, for example behind an LLM gateway. Requests use the no-auth scheme. | On or off. Also stops the startup credential refresh for Bedrock | Bedrock. Project env can set it before trust |
CLAUDE_ | Documented: An official docs page names this item. | Skips Azure auth for Microsoft Foundry. Claude Code sends a placeholder token and keeps your own Authorization header. | On or off. Ignored when ANTHROPIC_ or ANTHROPIC_ is set. Docs note a change in v2.1.203 | Microsoft Foundry. Project env can set it before trust |
CLAUDE_ | Documented: An official docs page names this item. | Skips AWS auth for Amazon Bedrock Mantle, for example behind an LLM gateway. Claude Code keeps your own Authorization header. | On or off. Claude Code reads an AWS_ value first. Also skips the startup credential refresh | Bedrock Mantle. Project env can set it before trust |
CLAUDE_ | Documented: An official docs page names this item. | Turns off the saved memory of models the startup checks found your account cannot invoke on Bedrock and Vertex. | On or off. When set, Claude Code does not build the key for the saved file, so it reads and writes nothing | Bedrock and Vertex startup model checks |
CLAUDE_ | Documented: An official docs page names this item. | Skips Google auth for Google Cloud Agent Platform (Vertex), for example behind an LLM gateway. | On or off. The Google auth builder gets the skip kind. Also stops the startup credential refresh | Vertex. Project env can set it before trust |
CLAUDE_ | Documented: An official docs page names this item. | Selects Claude Platform on AWS as the provider. | On or off. Provider order: gateway, Bedrock, Foundry, this, Google Cloud, Mantle, Vertex. Allowed in project env before trust | Claude Platform on AWS |
CLAUDE_ | Undocumented: Only the program shows this item. It can change without notice. | Selects the Anthropic Google Cloud provider. Docs have no row for it. Auth errors are handled like Vertex. | On or off. Provider order puts it after Claude Platform on AWS. Allowed in project env before trust | Anthropic Google Cloud provider |
CLAUDE_ | Documented: An official docs page names this item. | Selects Amazon Bedrock as the provider. | On or off. Wins over Foundry, Vertex, and others. With CLAUDE_ it routes anthropic. models to Mantle | Amazon Bedrock |
CLAUDE_ | Documented: An official docs page names this item. | Selects Microsoft Foundry as the provider. | On or off. Wins over Claude Platform on AWS, Vertex, and Mantle. Allowed in project env before trust | Microsoft Foundry |
CLAUDE_ | Undocumented: Only the program shows this item. It can change without notice. | Marks a host-managed gateway session. Claude Code needs ANTHROPIC_ and a token. Without them, it warns and ignores the flag. | On or off. Needs ANTHROPIC_ or a descriptor token. Some paths also need CLAUDE_ | Desktop and host-managed gateway |
CLAUDE_ | Documented: An official docs page names this item. | Selects the Amazon Bedrock Mantle endpoint. | On or off. With Bedrock on, anthropic. model ids route to Mantle. Allowed in project env before trust | Amazon Bedrock Mantle |
CLAUDE_ | Documented: An official docs page names this item. | Selects Google Cloud's Agent Platform (Vertex) as the provider. | On or off. Last in the provider order before first party. Allowed in project env before trust | Google Vertex |
CLAUDE_ | Documented: An official docs page names this item. | Lets the gateway server reach loopback addresses. Otherwise it blocks them as SSRF. | On or off. The error text says to set 1 in the gateway environment | claude gateway server |
CLAUDE_ | Documented: An official docs page names this item. | Sets how long open requests may finish after a shutdown signal. | A number of milliseconds, 25000 by default. Plain digits 1 to 2147000000 | claude gateway server |
CLAUDE_ | Documented: An official docs page names this item. | Sets the log level of the gateway server. | info by default. debug, info, warn, or error, any case | claude gateway server |
CLAUDE_ | Documented: An official docs page names this item. | Treats the forward proxy as the egress boundary. The gateway passes hostnames and does not resolve them itself. | On or off. Needs HTTPS_ or HTTP_ and no NO_. Warns when it clashes with CLAUDE_ | claude gateway server |
CLOUD_ | Documented: An official docs page names this item. | Sets the Vertex AI region. | - | - |
CLOUDSDK_ | Undocumented: Only the program shows this item. It can change without notice. | Picks the active gcloud config name. Claude Code reads it to find the GCP project and account. | Text | - |
CLOUDSDK_ | Undocumented: Only the program shows this item. It can change without notice. | Gives a gcloud access token. Its presence counts as a cloud credential for provider checks. | Text (a secret) | - |
CLOUDSDK_ | Undocumented: Only the program shows this item. It can change without notice. | Sets the gcloud config directory that Claude Code reads. | - | - |
GCLOUD_ | Documented: An official docs page names this item. | Gives the Google Cloud project id for Vertex AI. It is the first choice. | Text. Order is GCLOUD_, GOOGLE_, lowercase forms, then ANTHROPIC_ | Vertex. Not set from project env before trust |
gcloud_ | Undocumented: Only the program shows this item. It can change without notice. | Gives the lowercase GCP project id. It is a fallback after the uppercase names for the Vertex project. | Text. Non-empty string. Order: GCLOUD_, GOOGLE_, this, google_, then ANTHROPIC_ | Vertex AI |
GOOGLE_ | Documented: An official docs page names this item. | Gives the path of the Google credentials file. Claude Code uses it for Vertex auth, and the Google auth library also uses it. | Text. Lowercase form is also read. Part of the Vertex client cache key | Vertex. Not set from project env before trust |
google_ | Undocumented: Only the program shows this item. It can change without notice. | Gives the lowercase GCP credentials path. It is a fallback after GOOGLE_. | Text. Non-empty string | Vertex AI |
GOOGLE_ | Documented: An official docs page names this item. | Gives the Google Cloud project id for Vertex AI. It comes after GCLOUD_. | Text. Lowercase form is also read. Also passed to the Google Cloud client | Vertex. Not set from project env before trust |
google_ | Undocumented: Only the program shows this item. It can change without notice. | Gives the lowercase GCP project id. It is a fallback in the Vertex project lookup. | Text. Non-empty string. Order: GCLOUD_, GOOGLE_, gcloud_, then this | Vertex AI |
GOOGLE_ | Undocumented: Only the program shows this item. It can change without notice. | Must be 1 to let Google pluggable auth run an executable. | Other values throw an error | Google auth library |
GOOGLE_ | Undocumented: Only the program shows this item. It can change without notice. | The Google auth library sets it in the env of a pluggable auth executable. It holds the audience. | - | Google auth library |
GOOGLE_ | Undocumented: Only the program shows this item. It can change without notice. | The Google auth library sets it in the env of a pluggable auth executable when it impersonates a service account. | - | Google auth library |
GOOGLE_ | Undocumented: Only the program shows this item. It can change without notice. | The Google auth library sets it to 0 in the env of a pluggable auth executable. | - | Google auth library |
GOOGLE_ | Undocumented: Only the program shows this item. It can change without notice. | The Google auth library sets it in the env of a pluggable auth executable when an output file is set. | A path | Google auth library |
GOOGLE_ | Undocumented: Only the program shows this item. It can change without notice. | The Google auth library sets it in the env of a pluggable auth executable. It holds the subject token type. | - | Google auth library |
K_ | Undocumented: Only the program shows this item. It can change without notice. | Detects Google Cloud Run jobs and services in the bundled Google auth library. | - | - |
K_ | Undocumented: Only the program shows this item. It can change without notice. | Detects Google Cloud Run in the bundled Google auth library and in Claude Code's environment report. | - | - |
METADATA_ | Undocumented: Only the program shows this item. It can change without notice. | Controls how the bundled Google auth library detects the GCE metadata server. | - | - |
VERTEX_ | Undocumented: Only the program shows this item. It can change without notice. | Sets the Google Cloud region for one model family. One variable exists for each suffix. | Text. The first table entry whose model prefix matches the model id wins, then CLOUD_, then us- | Google Cloud Agent Platform (CLAUDE_) |
How It Works
Claude Code picks one provider when it starts.
The provider decides which auth path, endpoint, and model IDs it uses.
If a shell profile exports a provider switch you cannot remove, set it to an empty string in the env block.
Claude Code treats an empty value as unset for provider selection.
Related Pages
- Environment Variables: how Claude Code reads variables and which value wins.
- Models and Effort: pin model IDs for a provider.
- Auth and Accounts
- Network and Proxy
- Undocumented Items: every item that only the program shows.
Source: the program (variable names found in the 2.1.312 binary) and the Environment Variables page of the official docs.