ci(ai): Route Anthropic tests through OpenRouter - #154
Conversation
Co-Authored-By: Daniel Griesser <dgriesser@sentry.io>
🟡 AI SDK Integration Test ResultsStatus: 432 tests failing (no regressions) Summary
Test MatrixAgent Tests
Embedding Tests
LLM Tests
MCP Tests
Legend: ✅ Pass | ❌ Fail | ✅🔧 Fixed | ❌📉 Regressed | ✅🆕 New (pass) | ❌🆕 New (fail) | 🗑️ Removed | str=streaming blk=blocking a=async s=sync io=stdio sse=sse hi=highlevel lo=lowlevel Generated by AI SDK Integration Tests |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd9d21f. Configure here.
| const anthropic = createAnthropic({ | ||
| apiKey: process.env.OPENROUTER_API_KEY, | ||
| baseURL: "https://openrouter.ai/api", | ||
| }); |
There was a problem hiding this comment.
Wrong Vercel OpenRouter base URL
High Severity
@ai-sdk/anthropic treats baseURL as already versioned (default https://api.anthropic.com/v1) and appends /messages directly. Using https://openrouter.ai/api sends requests to /api/messages instead of /api/v1/messages, so Anthropic Vercel AI SDK tests fail against OpenRouter.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit fd9d21f. Configure here.
Wire the AI integration harness caller to OpenRouter so
Anthropic-compatible tests no longer need a direct Anthropic key.
**Action input**
`.github/workflows/ai-integration-test.yml` now passes
`openrouter-api-key: ${{ secrets.OPENROUTER_API_KEY }}` instead of
`anthropic-api-key`. The harness remains pinned to the merged OpenRouter
migration revision (`318143d106d4a847dfac3804bb2663d1b852cf28`) for
pipeline stability and supply-chain safety.
Companion:
getsentry/testing-ai-sdk-integrations#154
**Secrets**
This workflow uses the `AI Integrations Tests` environment. Add
`OPENROUTER_API_KEY` there (environment secret), not only as a plain
repo secret, then `ANTHROPIC_API_KEY` can be removed after this ships.
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Daniel Griesser <dgriesser@sentry.io>


Route Anthropic-compatible test traffic through OpenRouter so the integration suite no longer needs a direct Anthropic API key. The suite continues exercising Anthropic SDK, Vercel AI SDK, LangChain, LangGraph, and LiteLLM paths while using
OPENROUTER_API_KEYand OpenRouter's Anthropic-compatible endpoint.Credential contract
CI, local setup, and the composite action now accept
OPENROUTER_API_KEY/openrouter-api-keyinstead of the Anthropic credential.Provider routing
Anthropic clients receive
https://openrouter.ai/apiexplicitly. LiteLLM's Anthropic cases use its OpenRouter provider while preserving Anthropic model IDs.Callers / companion PRs
ai-integration-test.yml)sentry-javascript: notesting-ai-sdk-integrationscaller workflow foundab-test-gha: stale demo/fixture only, not a production callerSecrets needed
getsentry/testing-ai-sdk-integrationsrepo secret:OPENROUTER_API_KEY(for daily/PR workflows)getsentry/sentry-pythonenvironment secret onAI Integrations Tests:OPENROUTER_API_KEYANTHROPIC_API_KEYfrom those placesRequested by Daniel Griesser.