Cursor + OpenRouter + Anthropic (Claude) ⇒ 500 before tokenization

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When using Cursor with OpenRouter as the base URL, any Anthropic Claude model (e.g. anthropic/claude-3.5-sonnet) returns a 500 “Internal Server Error”. The same calls succeed via curl (token usage visible in OpenRouter activity). Other providers (OpenAI GPT-4.1/4o, Qwen, Mistral) work in Cursor with the same OpenRouter setup.

Environment
• App: Cursor (macOS)
• Base URL override: OpenRouter
• API key: OpenRouter user API key (works with curl)
• Models that work in Cursor via OpenRouter: openai/gpt-4o, openai/gpt-4.1, qwen/qwen3-coder, mistralai/mistral-*
• Models that fail in Cursor via OpenRouter:
• anthropic/claude-3.5-sonnet → HTTP 500
@preset/anthropic-claude-3-5-sonnet → HTTP 500
• anthropic/claude-3.7-sonnet → HTTP 500
• claude-3.7-sonnet (no provider prefix) → HTTP 400 “not a valid model ID” (expected)

User-visible error in Cursor

ERROR_OPENAI: Unable to reach the model provider
Request failed with status code 500:
{“error”:{“message”:“Internal Server Error”,“code”:500}}

Request IDs example:
• 1450a1b7-249b-40ad-82d8-1bbc2373ed20
• 7578f57c-8b68-4ac2-8dbd-887a7fe6c084

What OpenRouter shows for the failing Cursor calls
• Entries appear with model anthropic/claude-3.5-sonnet (and preset variant).
• Tokens = 0 and Cost = Included — suggests failure before Anthropic tokenization.
• Same minute, cURL calls to the exact same model succeed with non-zero tokens (screenshots provided).

Steps to Reproduce

Minimal repro (works with curl, fails in Cursor)

Curl (works):

curl https://openrouter.ai/api/v1/chat/completions
-H “Authorization: Bearer $OPENROUTER_API_KEY”
-H “Content-Type: application/json”
-d ‘{
“model”: “anthropic/claude-3.5-sonnet”,
“messages”: [{“role”:“user”,“content”:“hi”}],
“temperature”: 0.2
}’

Cursor settings (fails):
• Settings → API Keys → Override OpenAI Base URL: OpenRouter URL (NOT ALLOWED TO POST “LINK” AGAIN)
• OpenAI API Key: same OpenRouter key as above
• Chat model selector: anthropic/claude-3.5-sonnet (also tried @preset/anthropic-claude-3-5-sonnet)
• Prompt: hi (no tools, no attachments, no JSON mode)

Expected Behavior

Expected
Same behavior as curl: a normal Claude response and a non-zero token count in OpenRouter activity.

Actual
HTTP 500 returned to Cursor; OpenRouter logs show 0 tokens; other providers work in the same session.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.4.6
VSCode Version: 1.99.3
Commit: 8bdbd55db6885f3d79f73cdacca5fcedef93d360
Date: 2025-08-15T02:08:45.149Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.1.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Thanks for the report. Can you try updating to the latest version and see if the issue persists?