Files
skills/skills/claude-api/shared/claude-platform-on-aws.md
Claude df62a2875e Update claude-api skill: harness audit, image coordinates, and SDK examples
Add guides for auditing agent harnesses and working with image coordinates, and expand the SDK examples. Update API guidance to match current behavior, including tool approvals, thinking-block checks, and platform support.

Co-authored-by: lance <lance@anthropic.com>
2026-12-03 04:29:47 +00:00

61 lines
5.0 KiB
Markdown

# Claude Platform on AWS
**Anthropic-operated** access to the Claude Developer Platform through AWS infrastructure - SigV4 authentication, AWS IAM access control, and AWS Marketplace billing. Because Anthropic operates it, **the API surface matches first-party with same-day parity** - for per-feature exceptions, see `shared/platform-availability.md` (the single source of truth; do not rely on an inline exception list here). Model IDs are the bare first-party strings (`claude-opus-5-5`, `claude-sonnet-5-5`) - **no provider prefix**.
> **Not the same as Amazon Bedrock.** Bedrock is partner-operated (AWS runs the service; release schedules vary, feature subset, `anthropic.`-prefixed model IDs). Claude Platform on AWS and Bedrock coexist; pick by whether you need AWS-native IAM/billing with full Anthropic API parity (this page) vs. Bedrock's own ecosystem.
---
## Client & install
| Language | Install | Client |
|---|---|---|
| Python | `pip install -U "anthropic[aws]"` | `from anthropic import AnthropicAWS` -> `AnthropicAWS()` |
| TypeScript | `npm install @anthropic-ai/aws-sdk` | `import AnthropicAws from "@anthropic-ai/aws-sdk"` -> `new AnthropicAws()` |
| Go | `go get github.com/anthropics/anthropic-sdk-go/v2` | `import anthropicaws "github.com/anthropics/anthropic-sdk-go/v2/aws"` -> `anthropicaws.NewClient(ctx, anthropicaws.ClientConfig{})` |
| C# | `dotnet add package Anthropic.Aws` | `new AnthropicAwsClient()` |
| Java | `com.anthropic:anthropic-java-aws`, beside `anthropic-java` at the same version | `import com.anthropic.aws.backends.AwsBackend;` -> `AnthropicOkHttpClient.builder().backend(AwsBackend.fromEnv()).build()` |
| Ruby | `gem install anthropic aws-sdk-core` | `Anthropic::AWSClient.new(aws_region: "...", workspace_id: "...")`, or `Anthropic::AWSClient.new` with the two values below in the environment. `AWS` is in capitals: `AwsClient` is a `NameError` |
| PHP | `composer require anthropic-ai/sdk aws/aws-sdk-php` | `new Anthropic\Aws\Client(awsRegion: '...', workspaceId: '...')`, or `new Anthropic\Aws\Client()` with the two values below in the environment |
| `ant` CLI | See `shared/anthropic-cli.md` -> Install and auth | No client to construct: with the two values below set, `ant` commands other than `ant beta:worker` go to Claude Platform on AWS. A missing workspace ID doesn't throw, so confirm with `ant auth status` |
After construction, **use the client exactly as you would `Anthropic()`** - `client.messages.create(...)`, `client.beta.sessions.*`, etc., with bare model IDs.
```python
from anthropic import AnthropicAWS
client = AnthropicAWS() # region + workspace_id from env; see below
client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
```
---
## Required configuration
Two values must be available (constructor args or environment) - **there is no default fallback** for either:
| Value | Env var | Notes |
|---|---|---|
| AWS region | `AWS_REGION` | Required. Unlike `AnthropicBedrock`, there is no `us-east-1` fallback. |
| Workspace ID | `ANTHROPIC_AWS_WORKSPACE_ID` | Required. Routes requests to your Claude workspace. |
Endpoint pattern: `https://aws-external-anthropic.{region}.api.aws/v1/...`. Requests are SigV4-signed with service name `aws-external-anthropic`.
## Authentication
The client resolves AWS credentials via the standard precedence chain: explicit constructor args -> environment (`AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`/`AWS_SESSION_TOKEN`) -> shared profile -> assumed role / instance metadata.
**Short-term API keys** are also supported for cases where SigV4 isn't practical (e.g., browser, simple scripts). Mint one with the per-language token-generator package; pass it as `api_key` on the client. Lifetime is the **lesser of** the requested duration, the underlying credential's expiry, and **12 hours**. For package names and IAM details, fetch the Claude Platform on AWS page in `shared/live-sources.md`.
---
## What to tell users
- Treat it as first-party: every section of this skill applies unchanged. Do **not** apply Bedrock's feature-availability mask. Three Managed Agents differences only: (1) a session can run autonomously (no user events) for at most **6 hours** before it needs reauthentication - send any user-role event to continue; (2) sessions on **self-hosted** environments **cannot attach memory stores** (rejected at session create) - cloud environments attach them as usual; (3) self-hosted workers authenticate with IAM/SigV4 or an AWS-Console API key plus the `AnthropicSelfHostedEnvironmentAccess` managed policy - Console-generated environment keys don't work against the AWS endpoint.
- Model IDs are bare (`claude-opus-5-5`). Do **not** add an `anthropic.` prefix.
- A missing region or `workspace_id` throws at client-construction time (no request is sent). A **403** means the request reached the server - check for a **wrong** `workspace_id` or a missing IAM action on the principal. See the IAM actions reference in `shared/live-sources.md`.