#13407: feat: add Anthropic Vertex AI provider extension
docs
agents
stale
Cluster:
Google and Amazon AI Providers
## Summary
Adds support for Anthropic Claude models (Opus 4.6, Sonnet 4.5) via Google Cloud Vertex AI as an OpenClaw extension plugin.
**Problem**: OpenClaw supports Claude via direct Anthropic API and Gemini via Vertex AI, but not Claude via Vertex AI. Using Claude through a GCP project with service account authentication avoids requiring direct Anthropic API keys.
**Solution**: A new extension plugin (`vertex-anthropic-auth`) that:
- Registers a custom `anthropic-vertex-messages` API type with streaming functions adapted from pi-ai's Anthropic provider
- Uses `@anthropic-ai/vertex-sdk` (`AnthropicVertex`) for Vertex AI endpoint routing and Google Cloud OAuth
- Authenticates via `google-auth-library` supporting service account keys, `GOOGLE_APPLICATION_CREDENTIALS`, and gcloud ADC
- Bridges plugin-registered providers into the model resolution pipeline (`models-config.ts`) and the pi-ai API registry
**Core changes to OpenClaw** (beyond the extension):
- `src/agents/models-config.ts`: Plugin providers are now integrated into `ensureOpenClawModelsJson`, including registering custom API streaming providers from the ESM context (solving the jiti/ESM module instance mismatch)
- `src/plugins/types.ts`: Added optional `apiProvider` field to `ProviderPlugin` for carrying stream functions
## Test plan
- [x] Direct streaming test: `streamAnthropicVertex` with Sonnet text response
- [x] Direct streaming test: `streamSimpleAnthropicVertex` with Opus thinking/reasoning
- [x] `openclaw agent --local` with `vertex-anthropic/claude-sonnet-4-5@20250929` - text response
- [x] `openclaw agent --local` with `--thinking medium` - reasoning mode
- [x] Auth profile resolution via auth-profiles.json (token type with `vertex-ai-managed` placeholder)
- [ ] Service account key file authentication (`SERVICE_ACCOUNT_KEY_FILE`)
- [ ] Token auto-refresh (google-auth-library handles internally)
Most Similar PRs
#19683: feat: add Helm chart for Kubernetes deployment and Vertex AI streaming
by harche · 2026-02-18
74.1%
#12624: feat: add google-vertex embedding provider for Vertex AI ADC auth
by swseo92 · 2026-02-09
70.9%
#19246: feat(media): add Google Vertex AI media provider
by ronaldslc · 2026-02-17
69.0%
#23700: feat: Claude CLI personal-use auth (no API key required) + native A...
by 88plug · 2026-02-22
68.8%
#2806: [AI-Assisted] Fix: Repair tool_use/tool_result pairing for Claude o...
by Arthur742Ramos · 2026-01-27
67.6%
#20530: feat: add Astrai as implicit provider (intelligent inference router)
by beee003 · 2026-02-19
67.4%
#17546: feat(memory): add native google-vertex embedding provider
by mike-hyperverse · 2026-02-15
66.8%
#18670: feat: add first-class Claude Code CLI auth path + CLI model UX hard...
by SmithLabsLLC · 2026-02-16
66.7%
#16099: feat: add opencode-cli as CLI backend provider
by imwxc · 2026-02-14
66.7%
#10108: fix: override stale Anthropic OAuth stealth headers for Opus 4.6
by CivilBooks · 2026-02-06
66.6%