AWS Bedrock + GCP Vertex
Enterprise cloud providers — Bearer/SigV4 auth, region routing, dialect dispatch.
Canonical contract:
packages/sdk/docs.md— "Bedrock provider" + "Vertex AI provider".
The SDK ships two built-in profiles for enterprise cloud LLM providers — Bedrock (AWS) and Vertex (GCP). Both reuse the existing transport architecture (ADRs D105/D106) — ProviderProfile is data-only, transport is orthogonal.
Bedrock
Claude models on AWS. v1 uses Bearer-only auth (no SigV4) — see ADR D286.
const agent = await Agent.create({
apiKey: process.env.AWS_BEARER_TOKEN_BEDROCK ?? "__bedrock_lazy_token__",
model: { id: "bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0" },
});The model id has 3 parts:
bedrock/— provider prefix (stripped before sending)us.(oreu.,apac.,jp.,global.) — region prefix → routes to the right Bedrock regional endpoint (ADR D290)anthropic.claude-...— the model id Bedrock expects
Auto-token via AWS credential chain
For long-running services, install the optional peers and the SDK auto-generates a Bearer from your standard AWS credentials:
pnpm add @aws/bedrock-token-generator @aws-sdk/credential-providersThe SDK reads from env vars → AWS_PROFILE → ~/.aws/credentials → IMDS, in that order, mints a Bearer, and caches it for 1.5h (ADR D295).
Common gotcha
The AWS account must complete the "Anthropic use case details" form in the Bedrock Console — separate from "Model access". Without it, every call returns ResourceNotFoundException: Model use case details have not been submitted. The error mapper surfaces an actionable message.
Vertex AI
Both Claude and Gemini available. ADC auth via google-auth-library (required peer, ADR D288).
pnpm add google-auth-library
gcloud auth application-default login
export GOOGLE_CLOUD_PROJECT="your-project-id"Two dialects:
// Claude on Vertex (Anthropic Messages API via :rawPredict)
model: { id: "vertex/anthropic/claude-sonnet-4-5-20250929" }
// Gemini on Vertex (OpenAI-compat endpoint)
model: { id: "vertex/google/gemini-2.0-flash-001" }The SDK dispatches between dialects at stream time (ADR D291/D292). Both reuse existing clients (OpenAIClient rewriter for Gemini, dedicated VertexAnthropicClient for Claude).
Global location
vertex/anthropic/... with VERTEX_LOCATION=global forces baseUrl aiplatform.googleapis.com (no region prefix) — fixes the cline#10287 routing issue (ADR D293).
Deferred to v1.x
| Feature | ADR |
|---|---|
| Bedrock streaming (Event Stream binary parser) | D302 |
| Bedrock Converse + Computer Use | D296 |
| Vertex WIF (Workload Identity Federation) walkthrough | D297 |
| SigV4 transport for Bedrock | D298 |