Skip to content

feat: add Claude Platform on AWS provider (anthropic-aws)#340

Open
Insung Park (magarage) wants to merge 1 commit into
langchain-ai:mainfrom
searchdoc:feat/claude-platform-on-aws
Open

feat: add Claude Platform on AWS provider (anthropic-aws)#340
Insung Park (magarage) wants to merge 1 commit into
langchain-ai:mainfrom
searchdoc:feat/claude-platform-on-aws

Conversation

@magarage

Copy link
Copy Markdown

Summary

Adds a dedicated anthropic-aws provider for Claude Platform on AWS — the Anthropic-managed offering fronted by AWS (API-key auth, AWS Marketplace billing).

The existing anthropic provider cannot target this endpoint: Claude Platform on AWS requires every request to carry an anthropic-workspace-id header identifying the workspace, and the current ChatAnthropic setup never sends it. Pointing ANTHROPIC_BASE_URL at the AWS gateway alone gets rejected. This PR wires that header in via a separate provider so the first-party anthropic provider is untouched.

What it does

  • New provider anthropic-aws (selectable in --init, or auto-detected from ANTHROPIC_AWS_API_KEY), separate from the first-party anthropic provider.
  • Env names mirror the official Anthropic AWS SDK/CLI:
    • ANTHROPIC_AWS_API_KEY → sent as x-api-key
    • ANTHROPIC_AWS_WORKSPACE_ID (wrkspc_…) → required, sent as the anthropic-workspace-id header
    • AWS_REGION (falls back to AWS_DEFAULT_REGION) → base URL is derived as https://aws-external-anthropic.{region}.api.aws
    • ANTHROPIC_AWS_BASE_URL → optional explicit override (proxy/testing)
  • Startup validation with clear errors when the workspace ID or region/base URL is missing.
  • --init wizard: adds region + workspace-ID steps (skipped when already resolvable); shows them in the setup checklist.
  • Diagnostics: ANTHROPIC_AWS_API_KEY is redacted like other secrets; workspace ID / region / base URL are shown verbatim (not secrets).
  • README documents the provider and setup.

Example

OPENWIKI_PROVIDER=anthropic-aws
ANTHROPIC_AWS_API_KEY=<your-key>
ANTHROPIC_AWS_WORKSPACE_ID=wrkspc_XXXXXXXXXXXXXX
AWS_REGION=us-west-2
# optional override:
# ANTHROPIC_AWS_BASE_URL=https://proxy.example/anthropic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant