SSD Nodes Learn Hosting plans →
Guides Matt ConnorBy Matt Connor

Claude API auth: key, Bedrock, Vertex, Foundry

Authenticate a Claude API client on a VPS with an Anthropic key, AWS IAM, Google ADC or Microsoft Entra, and store server credentials safely.

The Claude API authentication routes

Claude API authentication comes down to one decision: which credential your client puts on the wire. Anthropic lists the direct Claude API plus five cloud platforms: Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud (Google managed), Claude Models on Google Cloud (Anthropic managed), and Microsoft Foundry. The direct Anthropic API accepts an API key or a short-lived token in an Authorization: Bearer header, and still accepts API keys in the legacy x-api-key header. Amazon Bedrock supports AWS request signing and Bedrock API keys, and no Anthropic key exists anywhere in that setup. Google Cloud sends a short-lived Google access token. Microsoft Foundry takes an Azure-issued key or a Microsoft Entra token. The four sections below cover these credential setups, with the separate Anthropic-managed AWS and Google Cloud offerings explained alongside their cloud counterparts.

This guide is for wiring an SDK (software development kit) into a service running on a Linux server. If you are configuring the Claude Code command line tool instead, the variables and the flow are different: see pointing Claude Code at Bedrock or Vertex. If the service does not exist yet, build it first with a first Claude API app on a VPS and come back here for the credential.

Everything below was checked against Anthropic's platform documentation in August 2026 and re-checked against each provider's documentation on 16 October 2026; the Bedrock model access details were re-checked against AWS documentation on 19 October 2026. Anthropic's pages for all four routes, for API keys and for API versions were re-checked on 27 October 2026. Anthropic's pages for Microsoft Foundry, both Bedrock endpoints, the Google-managed route, Claude Platform on AWS, authentication, Workload Identity Federation and API versions were re-checked on 10 November 2026, along with the Ruby SDK's changelog. Model identifiers, prices, SDK versions and endpoint shapes all move, so this guide links the provider pages for those instead of printing values that go stale.

Route 1: an Anthropic API key

This is the direct path, and the only one where Anthropic issues the secret. Requests go to the Messages endpoint on Anthropic's API host, and every request carries three headers.

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model": "MODEL_ID", "max_tokens": 64, "messages": [{"role": "user", "content": "Hello"}]}'

Replace MODEL_ID with a current identifier from Anthropic's models overview. A healthy response is JSON holding a content array and a usage object. A wrong or expired key returns HTTP 401 with authentication_error. A missing anthropic-version header is a separate failure, because that header is required on every request; the SDKs set it for you. As of October 2026, Anthropic's documentation presents Authorization: Bearer as the main way to send the key and calls x-api-key legacy, but both are accepted, so the command above still works. The current SDK major versions send the key as Authorization: Bearer too, so a proxy or gateway that reads X-Api-Key needs changing when you upgrade. The 2023-06-01 version in the command is still accepted; Anthropic's newest API version is 2026-10-21, which those SDK versions send by default and which rejects a few older request parameters such as temperature.

Client construction is the shortest of these setups, because there is nothing to construct. Every official SDK reads ANTHROPIC_API_KEY from the environment on its own.

import os
from anthropic import Anthropic

client = Anthropic()  # reads ANTHROPIC_API_KEY from the environment

message = client.messages.create(
    model=os.environ["CLAUDE_MODEL"],
    max_tokens=64,
    messages=[{"role": "user", "content": "Hello"}],
)
print(message.usage)

Keeping the model identifier in the environment beside the key is worth doing. Model names change on a schedule you do not control, and redeploying code to edit one string is avoidable work.

Keys are created in the Console, where you choose an expiry at creation time: presets of 3 hours, 1 day, 7 days or 30 days, a custom duration, or Never, subject to your organization's maximum expiration policy. Expiry is fixed at creation and cannot be changed later. Anthropic emails the key's creator before a long-lived key expires, but a key with a short lifetime expires with no warning mail at all. An expired key returns 401 and cannot be reactivated, so the fix is always a new key.

There is no region to choose on the direct API, and the bill goes straight to your Anthropic organization. Workspaces scope a key to one project, which is the cleanest way to see what a single service spends. Scope a server's key to its workspace when you create it: a personal or service account key that is not scoped to a workspace has to send an anthropic-workspace-id header on every request, or the API answers 400 with invalid_request_error. For a service, choose a service account key, because a personal key stops working when the person who created it leaves the organization. For the arithmetic behind that bill, see how per-token API pricing compares against a subscription.

One more option belongs here, because it removes the static secret entirely. Workload Identity Federation lets a workload trade an OpenID Connect (OIDC) token from an identity provider you already trust for a short-lived Anthropic token at POST /v1/oauth/token, and the SDK refreshes that token before it expires. No sk-ant-api... string is ever minted or copied anywhere. It fits Kubernetes, GitHub Actions and cloud VMs, which already carry a platform identity. A plain VPS usually has no such issuer, so on that box an API key in a file is the honest answer, and the rest of this guide treats it that way.

Route 2: AWS credentials on Amazon Bedrock

On Bedrock you hold no Anthropic key at all. With AWS credentials, the SDK signs each HTTP request with AWS Signature Version 4 (SigV4), and AWS decides whether that caller may invoke the model.

pip install -U "anthropic[bedrock]"
aws sts get-caller-identity

aws sts get-caller-identity prints the account number and the ARN (Amazon Resource Name) of whatever identity your credentials resolve to. Run it before anything else when using SigV4. For SigV4, the SDK resolves constructor credentials, environment credentials and the standard AWS credential chain; region selection is separate. In Python's AnthropicBedrock client, a Bedrock API key supplied as api_key or through AWS_BEARER_TOKEN_BEDROCK raises ValueError if you also pass aws_access_key, aws_secret_key, aws_session_token or aws_profile. Without those explicit arguments, the key selects bearer authentication instead of the AWS credential chain. The TypeScript client gives the Bedrock API key precedence over explicit AWS credentials. The STS command does not test bearer authentication.

What changes in client construction is the class and one argument.

from anthropic import AnthropicBedrock

client = AnthropicBedrock(aws_region="us-east-1")

AnthropicBedrock drives Bedrock's InvokeModel integration. As of October 2026, Anthropic also documents Claude in Amazon Bedrock, a Messages API endpoint at https://bedrock-mantle.{region}.api.aws/anthropic/v1/messages for Claude Opus 4.7 and later models, reached through an AnthropicBedrockMantle client from the same package. It supports AWS credentials and Bedrock bearer tokens; model access requirements differ between the two endpoints, as explained below.

Watch the upgrade in that pip install -U line. As of 27 October 2026, the latest SDK sends API version 2026-10-21 by default, including through Bedrock, and Anthropic documents that the ARN-versioned model IDs it lists for Claude Opus 4.6 and earlier do not support that version on Bedrock and can return a 400 error. If a service calls one of those models, keep the SDK on the version it runs today and pin it, or move the service to a Claude 4.7 or later model first.

Region stops being decoration here. Bedrock endpoints are per region, the Claude models on offer differ from region to region, and the region is part of the SigV4 signature, so a signature computed for one region is rejected by another. Set AWS_REGION explicitly in the service environment, because the SDKs do not agree on what happens when you leave it out. As documented in October 2026, the Python AnthropicBedrock client reads AWS_REGION or AWS_DEFAULT_REGION, then the region of your boto3 session or AWS profile (including ~/.aws/config), and raises ValueError if none resolves. The TypeScript client reads AWS_REGION, falls back to us-east-1 when it is unset, and does not read ~/.aws/config for the region. That is why the AWS CLI can list Claude models successfully on the same box where a Node process calls the wrong region: the CLI read your config file and the client did not.

On an EC2 instance you attach an IAM (identity and access management) role and no secret ever lands on disk, because the instance metadata service hands the SDK temporary credentials. A VPS outside AWS has neither an instance role nor a metadata service. You are then choosing between an IAM user's long-lived access key pair sitting on the box, which is the same class of secret as an Anthropic key, and federation: authenticate against your identity provider, call AWS STS (security token service), and use the temporary credentials it returns. Bedrock also accepts Bedrock API keys, which are bearer tokens passed through AWS_BEARER_TOKEN_BEDROCK, and AWS documents two kinds. A short-term key lasts up to 12 hours, or the length of the session that generated it if that is shorter, inherits the permissions of the IAM identity that generated it, and is the kind AWS recommends for production. A long-term key lasts until an expiry you choose when you create it (for example 30 or 90 days with --credential-age-days), or does not expire if that API parameter is omitted; the Console creates an IAM user behind it, and AWS recommends it only for exploration. A long-term key works only in the region where it was generated; using it in another region returns Credential should be scoped to a valid region.

The bill lands on your AWS account rather than with Anthropic, which is usually the whole reason to be here. Regional endpoints carry a 10% premium over the global endpoint, as documented in October 2026. Claude Platform on AWS is a separate product: Anthropic operates it, AWS bills it through AWS Marketplace, and it authenticates with SigV4 or with an API key generated in the AWS Console (keys from the Claude Console do not work there), through an AnthropicAWS client that Anthropic marks as beta. One Bedrock error is worth recognising because it looks like a permissions problem and is not: Invocation of model ID ... with on-demand throughput isn't supported. Retry your request with the ID or ARN of an inference profile that contains this model. That is model routing, and no credential change will fix it.

Route 3: Google credentials on Vertex AI

Anthropic's documentation now calls this route Claude Models on Google Cloud (Google managed), which Google runs as part of its Agent Platform, Google's new name for what grew out of Vertex AI. The aiplatform.googleapis.com host, the anthropic[vertex] extra and the AnthropicVertex class shown below are unchanged.

Google Cloud uses Application Default Credentials (ADC), a fixed search order the Google auth libraries follow to find a credential without you naming one. ADC checks GOOGLE_APPLICATION_CREDENTIALS first, then the file written by gcloud auth application-default login, then the service account attached through the metadata server.

pip install -U "anthropic[vertex]"
gcloud auth application-default login

On a workstation that login writes $HOME/.config/gcloud/application_default_credentials.json and you are finished. On a server, avoid storing a human user's credentials; the command also supports service account impersonation. Outside Google Cloud there is no Google metadata server either, so use GOOGLE_APPLICATION_CREDENTIALS to point ADC at a Workload Identity Federation configuration file or a service account key file. A service account key JSON file is a long-lived secret and needs exactly the handling described later in this guide. Inside Google Cloud, attach a service account to the VM and there is no file to protect. Whichever identity ADC finds needs an IAM role that includes the aiplatform.endpoints.predict permission, such as Agent Platform User (roles/aiplatform.user).

from anthropic import AnthropicVertex

client = AnthropicVertex(project_id="my-project", region="global")

Two things change if you drop below the SDK to raw HTTP. The model identifier moves out of the request body and into the URL path, and anthropic_version moves out of the header and into the body. As of 27 October 2026, Anthropic's documentation accepts either vertex-2023-10-16 there or the newer API version 2026-10-21. The credential is an ordinary Google access token. In the command below, gcloud auth print-access-token uses the gcloud CLI's own login rather than ADC, so run gcloud auth login or gcloud init first on the machine where you test it.

curl https://aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/global/publishers/anthropic/models/${MODEL_ID}:rawPredict \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -d '{"anthropic_version": "vertex-2023-10-16", "max_tokens": 64, "messages": [{"role": "user", "content": "Hello"}]}'

Region is a first-class argument. global routes dynamically for availability, us and eu are multi-region identifiers, and a name such as us-east5 pins a single region. As of October 2026, Anthropic documents single-region endpoints only for Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints. Multi-region and regional endpoints cost 10% more than global, as documented in October 2026. Billing runs through the Google Cloud project, so quota and invoices are Google's.

As of 27 October 2026, Anthropic also documents a second Google Cloud offering, and its request shape is different. In Claude Models on Google Cloud (Anthropic managed), Anthropic operates the Claude API itself at claude.googleapis.com, reached through an AnthropicGoogleCloud client. It still authenticates with Google Cloud credentials, including ADC, but the request looks like the direct API: model stays in the body and the version travels in the anthropic-version header. Access comes from its own IAM roles (roles/claude.user and related), setup creates a new Anthropic organization for the project, and usage bills through Google Cloud Marketplace. If your request URLs contain aiplatform and end in :rawPredict, you are on the Google-managed route this section describes.

Route 4: Microsoft Foundry is the Azure route

If you searched for Claude on Azure, this is the section you wanted, and a supported route does exist. Claude runs in Microsoft Foundry (formerly Azure AI Foundry), billed through the Azure Marketplace in Claude Consumption Units. You create a Foundry resource, deploy a Claude model inside it, and call an Azure-hosted endpoint at https://{resource}.services.ai.azure.com/anthropic/v1/*.

Two credentials work. The first is an Azure-issued key from the deployment's Details tab in the Foundry portal, sent in an api-key or x-api-key header. The second is a Microsoft Entra token, which is the better choice on a server because Azure role-based access control then governs who may call the endpoint.

ACCESS_TOKEN=$(az account get-access-token --resource https://ai.azure.com --query accessToken -o tsv)

curl https://${RESOURCE}.services.ai.azure.com/anthropic/v1/messages \
  -H "content-type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model": "DEPLOYMENT_NAME", "max_tokens": 64, "messages": [{"role": "user", "content": "Hello"}]}'

The model field carries your deployment name, not a model identifier. The two match by default, and they stop matching the moment you name a deployment yourself, which is the usual cause of a Deployment not found error on an otherwise correct request. The Python and TypeScript SDKs read ANTHROPIC_FOUNDRY_API_KEY and ANTHROPIC_FOUNDRY_RESOURCE from the environment. As documented on 10 November 2026, Foundry support covers all seven official SDKs: C#, Go, Java, PHP, Python, Ruby and TypeScript. Go uses a dedicated foundry package (go get github.com/anthropics/anthropic-sdk-go/v2/foundry), and Ruby gained a dedicated Anthropic::FoundryClient in version 2.5.0 of the gem, released on 4 November 2026. Before that release, Ruby code had to point the generic client at the Foundry base URL.

Pointing a generic client at the Foundry base URL still has a sharp edge, whether that is Ruby code written before 2.5.0 or the ant CLI, which Anthropic's own Foundry examples call that way. If you do not pass credentials to the generic client explicitly and ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is still set in the environment, the client picks it up and sends your Anthropic credential to a Microsoft endpoint. Unset the variable, or pass the Foundry key or token to the client explicitly. In Ruby, moving to Anthropic::FoundryClient, which takes the Foundry key or an Entra token provider, is the cleaner fix. An Entra access token gets a random default lifetime of 60 to 90 minutes, so a long-running process has to refresh it rather than capture one at start.

How long does the credential on your server live?

ChartDocumented credential lifetime by route, hours
The data behind this chart
[
  {
    "label": "Anthropic key, 30-day preset",
    "max_lifetime_hours": 720
  },
  {
    "label": "Anthropic key, 7-day preset",
    "max_lifetime_hours": 168
  },
  {
    "label": "AWS STS assumed role",
    "max_lifetime_hours": 12
  },
  {
    "label": "Bedrock short-term API key",
    "max_lifetime_hours": 12
  },
  {
    "label": "Entra ID access token, default upper bound",
    "max_lifetime_hours": 1.5
  },
  {
    "label": "Federated Anthropic token, default",
    "max_lifetime_hours": 1
  }
]

These are ceilings and defaults published by each provider and read in October 2026, not measured figures. They matter for one reason: they tell you how long a leaked credential keeps working while you are still finding out that it leaked. The federated Anthropic token at the bottom of the chart lasts up to 1 hour by default, also bounded by twice the remaining lifetime of the identity provider's token. A Microsoft Entra access token has no single default: Microsoft gives each one a random lifetime between 60 and 90 minutes (75 on average), shown on the chart at its 1.5 hour upper bound, and that default also varies with the client, the resource and whether Conditional Access is enabled in the tenant. When both the client and the resource support Continuous Access Evaluation, Entra may stretch the lifetime to 24 to 28 hours and revoke the token in near real time on events such as account disablement instead. A tenant token lifetime policy can set it anywhere from 10 minutes to 23:59:59. The SDKs refresh federated Anthropic tokens automatically; on Foundry, configure an Entra token provider to refresh tokens rather than passing a fixed token string. A federation rule can set its own token lifetime anywhere from one minute to 24 hours, and the Console's Connect workload wizard prefills 10 minutes, so read the rule rather than assume the default. An assumed role and a Bedrock short-term API key both sit at 12 hours. A Bedrock long-term API key has no place on the chart because it has no fixed ceiling: it lasts until the expiry chosen when it was created, or does not expire if CredentialAgeDays was omitted from the API call, which is why AWS recommends it only for exploration. A key created with the 30-day preset stays valid for 720 hours, and that is the credential which sits in a file on your server for a month.

Where the credential lives on a VPS

Put the secret in a file only root can read, and let systemd hand it to the process. This part outlives every SDK version, so it is worth doing once and properly.

sudo useradd --system --home /opt/claude-app --shell /usr/sbin/nologin claudeapp
sudo install -d -m 700 -o root -g root /etc/claude-app
sudo install -m 600 -o root -g root /dev/null /etc/claude-app/env
sudoedit /etc/claude-app/env

The file holds plain KEY=value lines. No export, no quotes, no shell syntax, because systemd parses it itself rather than running it through a shell.

ANTHROPIC_API_KEY=sk-ant-api03-REPLACE-ME
CLAUDE_MODEL=REPLACE-ME
[Unit]
Description=Claude API service
After=network-online.target

[Service]
User=claudeapp
EnvironmentFile=/etc/claude-app/env
ExecStart=/opt/claude-app/venv/bin/python -m claude_app
Restart=on-failure

[Install]
WantedBy=multi-user.target

systemd reads EnvironmentFile= as root, before it drops to User=claudeapp, so the service account never needs read access to the file. Mode 600 owned by root is enough, which is why the install command above sets it that way. Start it with sudo systemctl enable --now claude-app, then confirm with systemctl status claude-app that the unit reached active (running) rather than restarting in a loop.

Four things to avoid, each for a reason you can check yourself:

  • Do not write the key with Environment= inside the unit file. A unit under /etc/systemd/system is world readable, so systemctl cat claude-app prints the secret back to any local user.
  • Do not commit it. .gitignore keeps a new file out of a commit and does nothing about a file already committed, because git history keeps whatever it was given.
  • Do not bake it into a container image. ENV values persist in image configuration, and build arguments are visible in image history or provenance metadata. Deleting the file in a later layer does not remove it from the earlier one. Pass secrets at run time with --env-file or a mounted file instead.
  • Do not treat the process environment as private from root. sudo cat /proc/$(pgrep -u claudeapp -f claude_app | head -1)/environ | tr '\0' '\n' prints the key back. The file-reading command itself needs sudo; a shell input redirection runs before sudo and uses your current account's permissions. The goal is to keep the secret away from every other account on the box, not from root, who can read it whatever you do.

That last point sets the boundary of what this design buys you. The root-only file protects the stored key, but any code running as the service account can read the process environment, and child processes inherit it. It is the wrong container when the process runs code you did not write, because anything the process can execute can read its own environment. Keeping secrets out of an AI agent's reach covers that case, which is a different problem with a different answer.

How do I rotate the key without downtime?

Rotate forward, and revoke last. The single-service restart below briefly interrupts service; uninterrupted availability requires another instance to handle requests during the restart.

  1. Create the new key in the Console, in the same workspace as the old one.
  2. Write it into /etc/claude-app/env with sudoedit.
  3. Run sudo systemctl restart claude-app.
  4. Confirm the service is answering requests, then revoke the old key in the Console.

EnvironmentFile is read when the unit starts, so a running process keeps the value it was given at launch. systemctl daemon-reload re-reads unit files and does not touch a running process's environment, so only a restart picks up the new key. Revoking in step 1 instead of step 4 buys you an outage that lasts until step 3.

The cloud routes rotate at the provider. An IAM user supports two active access keys at once, so create the second, deploy it, then delete the first. A Google service account key rotates the same way. A Foundry resource carries two keys, and regenerating one stops its old value working immediately, so move the service onto the other key before you regenerate the one it was using. Entra tokens and federated Anthropic tokens need no manual token rotation, and that is the strongest argument for using them where you can.

While you are in the Console, set a spend limit on the workspace. A leaked key is expensive before it is anything else, and capping what an agent on a VPS can spend walks through the controls.

Why does my client return 401 or 403?

401 with authentication_error on the direct API. The key is wrong, revoked, or past its expiry. Expiry is the one people miss, because the code did not change and the request worked yesterday. Check the key's expiry column in the Console, or read expires_at from the Admin API, where it is null for keys with no expiry. A personal key also stops working when its owner leaves the organization.

The SDK ignores your federation setup and uses a key instead. ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN sit above federation in the credential precedence order, so either one shadows it. The sharp version of this: a variable exported as an empty string still occupies its slot, so ANTHROPIC_API_KEY="" makes the SDK authenticate with an empty key rather than fall through. Use unset ANTHROPIC_API_KEY.

401 with the bare message Authentication failed on federation. That message is deliberately identical for every possible cause, so a caller cannot probe your rule configuration by reading error text. The real reason is recorded on the authentication history page in the Console. Start there rather than guessing at the JWT.

403 on Foundry. The token authenticated but your Azure account lacks a role that permits the call. Assign an Azure RBAC role such as Foundry User (formerly Azure AI User) or Cognitive Services User to the identity making the request.

Anything on Bedrock. For SigV4 authentication, run aws sts get-caller-identity as the service user first. It answers whether the box has usable AWS credentials at all, which separates a credential problem from a model access problem or a region mismatch. As of 29 October 2026, AWS enables access to many models on first use in commercial regions with the required AWS Marketplace permissions, but some models require separate account-level access. Anthropic models called through the InvokeModel route need a one-time use case form per account (or once for a whole AWS Organization, though opt-in regions need it again) first, and until it clears the call returns AccessDeniedException. AWS documents that the form does not apply to the bedrock-mantle endpoint. The first call to a model in an account also makes Bedrock start the AWS Marketplace subscription in the background, and that subscription needs an identity holding the aws-marketplace:Subscribe, aws-marketplace:Unsubscribe and aws-marketplace:ViewSubscriptions permissions. Missing permissions do not necessarily fail that first call: AWS documents that calls may succeed for up to 15 minutes while the subscription is set up, and once the subscription fails, later calls return the same AccessDeniedException. A service that worked for its first few minutes and then started failing points here rather than at its credentials. After you grant the permissions, AWS allows up to 2 minutes for the subscription to complete. A model that is not offered in the region you call fails however good the credentials are.

FAQ

Do I need an Anthropic API key to use Claude on Bedrock or Vertex?

No. On Amazon Bedrock the SDK signs requests with AWS credentials using SigV4 or sends a Bedrock API key, and on Google Cloud it sends a Google access token found through Application Default Credentials. No Anthropic-issued secret exists in either setup, and usage bills to the cloud account rather than to Anthropic. This is also why an Anthropic key left in ANTHROPIC_API_KEY is a hazard on those hosts: a generic client pointed at a cloud endpoint will happily send it there.

Is Claude available on Azure?

Yes, through Microsoft Foundry, formerly Azure AI Foundry. You create a Foundry resource, deploy a Claude model into it, and call https://{resource}.services.ai.azure.com/anthropic/v1/messages with either an Azure-issued key in an api-key header or a Microsoft Entra bearer token. Usage bills through the Azure Marketplace in Claude Consumption Units. The model field in the request body must carry your deployment name, which matches the model identifier only if you kept the default name when you created the deployment; the name cannot be changed afterwards.

Where should I store the Claude API key on a Linux server?

In a file owned by root with mode 600, loaded through EnvironmentFile= in a systemd unit. systemd reads that file as root before it switches to the unit's User=, so the service account needs no access to it. Keep it out of the repository, out of the unit file itself (which is world readable and printed by systemctl cat), and out of container image configuration, layers and build metadata.

Why did my Claude API request start returning 401 when nothing changed?

A key that reached the expiry chosen when it was created returns 401. Expiry is set at creation, cannot be edited afterwards, and short-lived keys expire with no warning email. An expired key cannot be reactivated, so create a replacement, write it into the environment file, restart the service, and revoke the old key afterwards. If the key is definitely current, check that a stale credential is not shadowing it: ANTHROPIC_API_KEY set to an empty string still wins precedence over the federation and profile sources below it.

Was this article useful?

#claude#api#authentication#bedrock#vertex#secrets-management