Skip to content

ci(ai): Route Anthropic tests through OpenRouter - #154

Merged
HazAT merged 1 commit into
mainfrom
feat/route-anthropic-through-openrouter
Jul 31, 2026
Merged

ci(ai): Route Anthropic tests through OpenRouter#154
HazAT merged 1 commit into
mainfrom
feat/route-anthropic-through-openrouter

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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_KEY and OpenRouter's Anthropic-compatible endpoint.

Credential contract

CI, local setup, and the composite action now accept OPENROUTER_API_KEY / openrouter-api-key instead of the Anthropic credential.

Provider routing

Anthropic clients receive https://openrouter.ai/api explicitly. LiteLLM's Anthropic cases use its OpenRouter provider while preserving Anthropic model IDs.

Callers / companion PRs

Secrets needed

  1. getsentry/testing-ai-sdk-integrations repo secret: OPENROUTER_API_KEY (for daily/PR workflows)
  2. getsentry/sentry-python environment secret on AI Integrations Tests: OPENROUTER_API_KEY
  3. After both merge, drop ANTHROPIC_API_KEY from those places

Requested by Daniel Griesser.

Co-Authored-By: Daniel Griesser <dgriesser@sentry.io>
@github-actions

Copy link
Copy Markdown

🟡 AI SDK Integration Test Results

Status: 432 tests failing (no regressions)

Summary

Metric main PR Change
Total Tests 847 847
Passed 139 139
Failed 432 432

Test Matrix

Agent Tests

SDK Basic Agent Test Conversation ID Agent Test Long Input Agent Test Tool Call Agent Test Tool Error Agent Test Vision Agent Test
cloudflare/langgraph anthropicopenai anthropicopenai anthropicopenai anthropicopenai anthropicopenai anthropicopenai
cloudflare/vercel blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai
nextjs/mastra
nextjs/vercel blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai
node/langgraph anthropicopenai anthropicopenai anthropicopenai anthropicopenai anthropicopenai anthropicopenai
node/manual
node/mastra
node/vercel blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai blk, class, anthropicblk, class, openaiblk, function, anthropicblk, function, openaistr, class, anthropicstr, class, openaistr, function, anthropicstr, function, openai
python/langgraph a, anthropica, openais, anthropics, openai a, anthropica, openais, anthropics, openai a, anthropica, openais, anthropics, openai a, anthropica, openais, anthropics, openai a, anthropica, openais, anthropics, openai a, anthropica, openais, anthropics, openai
python/manual as as as as as as
python/openai-agents
python/pydantic-ai a, fallbacka, single a, fallbacka, single a, fallbacka, single a, fallbacka, single a, fallbacka, single a, fallbacka, single

Embedding Tests

SDK Basic Embeddings Test
browser/google-genai
browser/langchain
browser/openai
cloudflare/google-genai
cloudflare/langchain
cloudflare/openai
cloudflare/vercel
nextjs/google-genai
nextjs/langchain
nextjs/openai
nextjs/vercel
node/google-genai
node/langchain
node/openai
node/vercel
python/google-genai a, blks, blk
python/langchain a, blks, blk
python/litellm a, blks, blk
python/manual a, blks, blk
python/openai a, blks, blk

LLM Tests

SDK Basic Error LLM Test Basic LLM Test Conversation ID LLM Test Long Input LLM Test Multi-Turn LLM Test Vision LLM Test
browser/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
browser/google-genai blkstr blkstr blkstr blkstr blkstr blkstr
browser/langchain blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai
browser/openai blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses
cloudflare/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
cloudflare/google-genai blkstr blkstr blkstr blkstr blkstr blkstr
cloudflare/langchain blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai
cloudflare/openai blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses
nextjs/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
nextjs/google-genai blkstr blkstr blkstr blkstr blkstr blkstr
nextjs/langchain blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai
nextjs/openai blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses
node/anthropic blkstr blkstr blkstr blkstr blkstr blkstr
node/google-genai blkstr blkstr blkstr blkstr blkstr blkstr
node/langchain blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai blk, anthropicblk, openaistr, anthropicstr, openai
node/manual
node/openai blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses blk, chatblk, responsesstr, chatstr, responses
python/anthropic a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str
python/google-genai a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str a, blka, strs, blks, str
python/langchain a, blk, anthropica, blk, openaia, str, anthropica, str, openais, blk, anthropics, blk, openais, str, anthropics, str, openai a, blk, anthropica, blk, openaia, str, anthropica, str, openais, blk, anthropics, blk, openais, str, anthropics, str, openai a, blk, anthropica, blk, openaia, str, anthropica, str, openais, blk, anthropics, blk, openais, str, anthropics, str, openai a, blk, anthropica, blk, openaia, str, anthropica, str, openais, blk, anthropics, blk, openais, str, anthropics, str, openai a, blk, anthropica, blk, openaia, str, anthropica, str, openais, blk, anthropics, blk, openais, str, anthropics, str, openai a, blk, anthropica, blk, openaia, str, anthropica, str, openais, blk, anthropics, blk, openais, str, anthropics, str, openai
python/litellm a, blk, completion, anthropica, blk, completion, openaia, blk, responses, anthropica, blk, responses, openaia, str, completion, anthropica, str, completion, openaia, str, responses, anthropica, str, responses, openais, blk, completion, anthropics, blk, completion, openais, blk, responses, anthropics, blk, responses, openais, str, completion, anthropics, str, completion, openais, str, responses, anthropics, str, responses, openai a, blk, completion, anthropica, blk, completion, openaia, blk, responses, anthropica, blk, responses, openaia, str, completion, anthropica, str, completion, openaia, str, responses, anthropica, str, responses, openais, blk, completion, anthropics, blk, completion, openais, blk, responses, anthropics, blk, responses, openais, str, completion, anthropics, str, completion, openais, str, responses, anthropics, str, responses, openai a, blk, completion, anthropica, blk, completion, openaia, blk, responses, anthropica, blk, responses, openaia, str, completion, anthropica, str, completion, openaia, str, responses, anthropica, str, responses, openais, blk, completion, anthropics, blk, completion, openais, blk, responses, anthropics, blk, responses, openais, str, completion, anthropics, str, completion, openais, str, responses, anthropics, str, responses, openai a, blk, completion, anthropica, blk, completion, openaia, blk, responses, anthropica, blk, responses, openaia, str, completion, anthropica, str, completion, openaia, str, responses, anthropica, str, responses, openais, blk, completion, anthropics, blk, completion, openais, blk, responses, anthropics, blk, responses, openais, str, completion, anthropics, str, completion, openais, str, responses, anthropics, str, responses, openai a, blk, completion, anthropica, blk, completion, openaia, blk, responses, anthropica, blk, responses, openaia, str, completion, anthropica, str, completion, openaia, str, responses, anthropica, str, responses, openais, blk, completion, anthropics, blk, completion, openais, blk, responses, anthropics, blk, responses, openais, str, completion, anthropics, str, completion, openais, str, responses, anthropics, str, responses, openai a, blk, completion, anthropica, blk, completion, openaia, blk, responses, anthropica, blk, responses, openaia, str, completion, anthropica, str, completion, openaia, str, responses, anthropica, str, responses, openais, blk, completion, anthropics, blk, completion, openais, blk, responses, anthropics, blk, responses, openais, str, completion, anthropics, str, completion, openais, str, responses, anthropics, str, responses, openai
python/manual a, blks, blk a, blks, blk a, blks, blk a, blks, blk a, blks, blk
python/openai a, blk, chata, blk, responsesa, str, chata, str, responsess, blk, chats, blk, responsess, str, chats, str, responses a, blk, chata, blk, responsesa, str, chata, str, responsess, blk, chats, blk, responsess, str, chats, str, responses a, blk, chata, blk, responsesa, str, chata, str, responsess, blk, chats, blk, responsess, str, chats, str, responses a, blk, chata, blk, responsesa, str, chata, str, responsess, blk, chats, blk, responsess, str, chats, str, responses a, blk, chata, blk, responsesa, str, chata, str, responsess, blk, chats, blk, responsess, str, chats, str, responses a, blk, chata, blk, responsesa, str, chata, str, responsess, blk, chats, blk, responsess, str, chats, str, responses

MCP Tests

SDK Basic MCP Tool Call Test MCP Multiple Tool Calls Test MCP Prompt Get Test MCP Resource Read Test MCP Tool Error Test
node/mcp sseio sseio sseio sseio sseio
python/fastmcp a, blk, ssea, blk, io a, blk, ssea, blk, io a, blk, ssea, blk, io a, blk, ssea, blk, io a, blk, ssea, blk, io
python/mcp a, blk, sse, hia, blk, sse, loa, blk, io, hia, blk, io, lo a, blk, sse, hia, blk, sse, loa, blk, io, hia, blk, io, lo a, blk, sse, hia, blk, sse, loa, blk, io, hia, blk, io, lo a, blk, sse, hia, blk, sse, loa, blk, io, hia, blk, io, lo a, blk, sse, hia, blk, sse, loa, blk, io, hia, blk, io, lo

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

@HazAT
HazAT marked this pull request as ready for review July 31, 2026 17:53
@HazAT
HazAT merged commit 318143d into main Jul 31, 2026
14 of 15 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd9d21f. Configure here.

HazAT added a commit to getsentry/sentry-python that referenced this pull request Jul 31, 2026
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>
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