Skip to content

feat (provider/anthropic-aws): new @ai-sdk/anthropic-aws provider (v1.0.0)#15533

Merged
gr2m merged 6 commits into
release-v6.0from
rohan/anthropic-aws-provider-v6
May 21, 2026
Merged

feat (provider/anthropic-aws): new @ai-sdk/anthropic-aws provider (v1.0.0)#15533
gr2m merged 6 commits into
release-v6.0from
rohan/anthropic-aws-provider-v6

Conversation

@R-Taneja
Copy link
Copy Markdown
Contributor

@R-Taneja R-Taneja commented May 21, 2026

Summary

New @ai-sdk/anthropic-aws package for Claude Platform on AWS — Anthropic's Messages API hosted inside AWS at aws-external-anthropic.{region}.api.aws. Same wire format and feature set as @ai-sdk/anthropic with AWS-native auth (SigV4 or AWS-provisioned API key) and AWS Marketplace billing.

This is the v6 (LanguageModelV3) backport of the corresponding main-branch PR (#15230), to be released as v1.0.0 stable. Per the team's release plan in #15459's pattern (which mirrors what @ai-sdk/quiverai did via PRs #15463 / #15461):

  1. This PR lands first, publishing @ai-sdk/anthropic-aws@1.0.0
  2. Then the main PR gets pre.json updated to register @ai-sdk/anthropic-aws@1.0.0 and its changeset bumped to major, which will publish v2.0.0 on the canary tag

What's in the package

  • createAnthropicAws() factory + default anthropicAws instance
  • Two auth paths: AWS SigV4 (default, integrates with IAM/IRSA/SSO) or AWS-provisioned API key
  • Provider settings: region, workspaceId, apiKey, accessKeyId, secretAccessKey, sessionToken, baseURL, headers, fetch, credentialProvider, generateId
  • Provider surface: call sig, languageModel, chat, messages, textEmbeddingModel (deprecated throw), tools
  • Templated base URL: https://aws-external-anthropic.{region}.api.aws/v1
  • Required headers: anthropic-version: 2023-06-01 + anthropic-workspace-id
  • SigV4 service name: aws-external-anthropic

Differences from the main (v7) variant

The v7 anthropic package exposes AnthropicFiles and AnthropicSkills from its /internal entrypoint. v6 does not have those classes. The Files API and Skills API methods (provider.files(), provider.skills()) are intentionally omitted from this v6 release for that reason — users who need them should adopt v7. Everything else is at parity: same auth, same wire format, same surface.

Spec version: LanguageModelV3 / ProviderV3 (vs V4 on main). Otherwise the implementation is identical to main.

Test plan

  • pnpm --filter @ai-sdk/anthropic-aws build — clean cjs + esm + dts
  • pnpm --filter @ai-sdk/anthropic-aws test48 / 48 passing (25 fetch helper + 23 provider — main has 50 because of the 2 files/skills tests that don't apply here)
  • End-to-end smoke test against a real Claude Platform on AWS workspace (deferred until workspace creds are provisioned; already validated on main via real-workspace smoke tests that surfaced + fixed an anthropic-version header bug)

Files changed

.changeset/anthropic-aws-provider.md                          (major bump for 1.0.0)
content/providers/01-ai-sdk-providers/07-anthropic-aws.mdx    (docs)
examples/ai-functions/package.json                            (+ @ai-sdk/anthropic-aws dep)
examples/ai-functions/src/generate-text/anthropic-aws/*.ts    (basic, sigv4, tool-call examples)
packages/anthropic-aws/**                                     (new package)
tsconfig.json                                                 (new project reference)

….0.0)

New @ai-sdk/anthropic-aws package exposing createAnthropicAws for Claude
Platform on AWS — Anthropic's Messages API hosted in AWS at
aws-external-anthropic.{region}.api.aws.

Same wire format and feature set as @ai-sdk/anthropic (model IDs,
streaming, prompt caching, tool use, computer use, anthropic-beta
headers) with AWS SigV4 or AWS-provisioned API key authentication.
Reads AWS_REGION, ANTHROPIC_AWS_WORKSPACE_ID, and ANTHROPIC_AWS_API_KEY
from the environment by default.

Tests: 48 passing (25 fetch + 23 provider).
Build: clean cjs + esm + dts.

Backport of #15230. Files API and Skills API are intentionally
omitted from this v6 release — those AnthropicFiles / AnthropicSkills
classes do not exist on this branch. The v7 (main) variant of this
package exposes them.
R-Taneja added a commit that referenced this pull request May 21, 2026
…r v2.0.0

Sets up the v7/main canary publish for @ai-sdk/anthropic-aws@2.0.0,
following the pattern from #15461 (quiverai):

- .changeset/pre.json: register @ai-sdk/anthropic-aws@1.0.0 as the
  initial version (matches what the sibling v6 PR publishes once it
  merges; see #15533).
- .changeset/anthropic-aws-platform.md: changeset bump set to major,
  which combined with the 1.0.0 initial version will publish 2.0.0
  on the canary tag.

Sequence (per team direction):
1. v6 backport (#15533) merges → @ai-sdk/anthropic-aws@1.0.0 ships stable
2. This PR merges → @ai-sdk/anthropic-aws@2.0.0-canary.X ships
Bring v6 in line with two tweaks made on the main PR (#15230):

- 07-anthropic-aws.mdx: add 'Agent Skills' to the two feature lists
  (intro and Models section). Agent Skills usage works on v6 too via
  beta headers + container.skills request param, even though the
  provider.skills() helper is v7-only.
- anthropic-aws-fetch.ts: drop three inline comments (the two
  'avoid caching globalThis.fetch' notes and the 'Use the combined
  headers directly as HeadersInit' note). Code behavior unchanged.

48/48 tests still pass.
@R-Taneja R-Taneja requested review from gr2m and shaper May 21, 2026 22:05
@R-Taneja R-Taneja marked this pull request as ready for review May 21, 2026 22:05
v6's TypeScript lib config doesn't expose Symbol.asyncIterator on
ReadableStream, so the for-await loop didn't typecheck. Switch to the
explicit reader.read() loop — same semantics, no asyncIterator
requirement. 48/48 tests still pass.
Mirrors the same example from the main PR (#15230). Demonstrates
Anthropic's hosted web search tool routed through Claude Platform on
AWS — anthropicAws.tools.webSearch_20250305() — to validate that the
'all tool use capabilities are available' claim from the Anthropic doc
holds for server-executed tools, not just user-defined ones.

Note: web search may need to be enabled on your workspace; if so, ask
your Anthropic rep.
…ersion

Matches the smoke-tested version on main. Both webSearch_20250305 and
webSearch_20260209 are exported from v6's anthropic-tools, so this is
a drop-in.
@gr2m gr2m merged commit 4dd238c into release-v6.0 May 21, 2026
47 checks passed
@gr2m gr2m deleted the rohan/anthropic-aws-provider-v6 branch May 21, 2026 22:30
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
@ai-sdk/anthropic-aws 1.0.0 github npm

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.

2 participants