Anthropic models don't work correctly in Agent mode with OpenRouter

Describe the Bug

Anthropic models don’t work correctly in Agent mode, when called with OpenRouter

Steps to Reproduce

  1. Issue an API key at OpenRouter: https://openrouter.ai/settings/keys
  2. In cursor settings → Models turn on “Open API key”, insert the key
  3. Override OpenAI Base URL: https://openrouter.ai/api/v1
  4. Click Verify
  5. In the models list add a custom model anthropic/claude-sonnet-4 and activate it
  6. start a new chat, choose the model for the chat, choose Agent mode, prompt something

Cursor outputs raw, unprocessed text output from the model, tool calls are not processed. It also prints an error: Model anthropic/claude-sonnet-4 doesn’t have good agent support yet. Start a new thread using Manual mode for better results.

Expected Behavior

Cursor uses the model in Agent mode, processes the tool calling correctly and formatting the output accordingly

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.0.0
VSCode Version: 1.96.2
Commit: 53b99ce608cba35127ae3a050c1738a959750860
Date: 2025-06-04T19:21:39.410Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin x64 24.5.0

Additional Information

I have not tested it with models from other vendors run with openrouter

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Same issue, when mapping gpt-4.1 model to claude model at endpoint, cursor chose gpt-4.1 it works.