Cursor with Anthropic API token unable to use “@branch” shortcut

Describe the Bug

When using a custom Anthropic api key, I’m unable to use the “@branch” shortcut to reference my current branches changes: Cursor – @Git

It will display an “unauthorized api key” error and refuse to start the chat until I remove the shortcut or turn off the API key.

Steps to Reproduce

  • Configure valid Anthropic api key
  • Start a feature branch and commit some changes
  • Try to start a new chat and use the “@branch” shortcut.
  • Submit chat

Expected Behavior

Expecting the @branch shortcut to work with a custom API key.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.3.4 (Universal)
VSCode Version: 1.99.3
Commit: bfb7c44bcb74430be0a6dd5edf885489879f2a20
Date: 2025-07-29T03:47:21.131Z (1 day ago)
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, this error means that you have overridden the base URL for the OpenAI API key. Try disabling it, and everything should work fine.

Hi @deanrie! Thanks for responding to this already. I checked and I don’t have the base URL overridden. Only the Anthropic API key toggle and key is enabled. Here is the request ID for the latest error I generated:

  • Request ID: e9d708dd-ce25-469b-a511-6a46f4224b92

Screenshot 2025-07-30 at 6.52.50 AM

1 Like

I think I traced it to the error just being misleading. It’s caused by the context size overloading Claude’s context window and preventing the chat from starting. If I grab the full diff from the branch manually (e.g. .diff) and paste that into the chat, I get: “Your message is too long. Please try again with a shorter message and fewer/smaller attached items.”.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.