Skip to main content
Claude Platform on AWS is the Anthropic-operated Claude API with AWS authentication, IAM access control, and AWS Marketplace billing. Requests reach Anthropic’s API directly, so you get the same models and API features as the Claude API on the same release schedule. Client-side features that Claude Code turns on through Anthropic’s feature-flag service, such as /loop self-pacing, are off by default, and the advisor tool is not available. See the feature availability matrix for the full list. You authenticate with AWS credentials or a workspace API key, and you pay through AWS Marketplace. Use this guide to point Claude Code at a workspace you’ve already provisioned through Claude Platform on AWS. For the AWS subscription and workspace setup that comes before this, see the Claude Platform on AWS documentation.
Subscribing through AWS Marketplace provisions a new Anthropic organization tied to your AWS account. This organization is separate from any organization you already have with Anthropic, and credentials don’t transfer between them. Use the workspace ID and API keys from the AWS-linked organization, not from a pre-existing Claude Console account.

Prerequisites

Before configuring Claude Code, you need:
  • An active Claude Platform on AWS subscription through AWS Marketplace
  • A workspace in your AWS-linked Anthropic organization, with its workspace ID
  • An IAM principal with permission to invoke the Anthropic service, or an API key scoped to the workspace
  • AWS credentials in your environment, in ~/.aws/credentials, or from an attached IAM role if you want SigV4 authentication. The AWS CLI is required only for the SSO login flow.

Setup

1. Configure AWS credentials

Claude Code supports two authentication methods for Claude Platform on AWS. Choose the method that fits how your team manages access. Option A: AWS credentials with SigV4 Claude Code signs requests with SigV4 using the standard AWS credential chain: environment variables, shared credentials in ~/.aws/credentials, IAM roles, AWS SSO sessions, and any other sources the AWS SDK supports. For local use, log in with the AWS CLI before starting Claude Code. The example below uses an SSO profile, but any method that produces credentials in the standard locations works.
For CI and automation, give the runner an IAM role with permission to invoke the Anthropic service and set AWS_REGION. The credential chain picks the role up automatically. If your SSO credentials expire mid-session, configure awsAuthRefresh so Claude Code re-runs your login command and retries instead of failing. Automatic refresh on Claude Platform on AWS requires Claude Code v2.1.198 or later; earlier versions stop with a prompt to run /login, which can’t refresh AWS credentials. Add the command to your settings file, such as ~/.claude/settings.json:
Claude Code also runs this command at startup when it can’t validate your existing AWS credentials, and shows the command’s output in an Authentication panel until the login completes. Before v2.1.212, the panel was titled Cloud authentication. With awsAuthRefresh configured, /login shows a Claude Platform on AWS · refresh credentials option under Using 3rd-party platforms. Selecting it runs the configured command and re-reads your AWS credentials without restarting Claude Code. Option B: Workspace API key A workspace API key is a long-lived secret, useful when you don’t want to manage federated AWS credentials. Generate one in the AWS Console under Claude Platform on AWS → API keys and set it as ANTHROPIC_AWS_API_KEY:
The key is sent as x-api-key and takes precedence over SigV4, so any AWS credentials in your environment are ignored. API keys from a separate Claude Console organization won’t work here. Treat workspace API keys like any other production credential. The user settings file env block is a convenient way to scope the key to your machine without exporting it globally.
The /login and /logout commands don’t sign you into a Claude.ai subscription for Claude Platform on AWS. Authentication runs through your AWS credentials or workspace API key. The exception is the refresh credentials option /login shows when awsAuthRefresh is configured, which re-reads your AWS credentials as described above.

2. Configure Claude Code

Set the environment variables that route Claude Code through Claude Platform on AWS instead of the default Anthropic API.
ANTHROPIC_AWS_WORKSPACE_ID is required and is sent on every request as the anthropic-workspace-id header. Replace the example wrkspc_01ABCDEFGHIJKLMN value with your own workspace ID from your Claude Platform on AWS setup. The base URL is computed from AWS_REGION as https://aws-external-anthropic.{region}.api.aws. To override the URL directly, set ANTHROPIC_AWS_BASE_URL. Claude Platform on AWS is opt-in even when AWS credentials are present in your environment. Amazon Bedrock and Microsoft Foundry take precedence in provider routing, so unset CLAUDE_CODE_USE_BEDROCK and CLAUDE_CODE_USE_FOUNDRY if they’re set.

3. Pin model versions

Claude Platform on AWS uses the same model IDs as the direct Claude API. The default aliases fable, opus, sonnet, and haiku resolve to Claude Code’s built-in defaults for Claude Platform on AWS, which can lag the newest release. Without ANTHROPIC_DEFAULT_OPUS_MODEL, the opus alias resolves to Opus 5. Before v2.1.219, it resolved to Opus 4.8, and before v2.1.207 to Opus 4.7. If you deploy Claude Code to a team, pin the model IDs explicitly so a new release doesn’t move everyone at once:
For the full list of model IDs and aliases, see Models overview. For other model-related variables, see Model configuration. Prompt caching is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set ENABLE_PROMPT_CACHING_1H=1. The API bills 1-hour cache writes at a higher rate. See prompt caching pricing for the rates.

4. Launch and verify

Start Claude Code and confirm the routing:
The startup banner shows Claude Platform on AWS when the provider is active. Run /status to check the details: the API provider line reads Claude Platform on AWS, and the output includes your Workspace ID, the AWS region, and the Claude Platform on AWS base URL if you set an override.

Use the Agent SDK

The