Agent can’t edit files with custom Anthropic API key

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

With the same project and the same Anthropic model:

ASK mode/Plan mode

Works as expected: it understands the context.

Agent mode (problem)

It understands my request, gives detailed analysis and even full code snippets.
However, it never actually edits or saves any files – it only describes what it “would do” and “had done”.
Even for very simple commands like “add a new function to the current file” or “split this component into two files and do the edits for me”, it only outputs the updated code in the chat, but the project files remain unchanged (no git diff).

In practice, Agent mode behaves as if it is in a read‑only mode, and this only happens when I use my custom Anthropic API Key.

Steps to Reproduce

  1. Open Settings → Models → API Keys:
    Turn on Override OpenAI Base URL and enter a third‑party compatible endpoint (e.g.https://…/v1).
    Enter your Anthropic API Key in the Anthropic section and enable it.
    In the model list below, add and enable claude-sonnet-4-6-thinking or claude-opus-4-6-thinking.

  2. Open any existing source file in your project (for example a .vue or .ts file).

  3. Switch to Agent mode on the right side and select the configured claude-sonnet-4-6-thinking or claude-opus-4-6 model-thinking.

  4. Ask the Agent to modify the file directly, for example:
    “Please split this function into two smaller functions and apply the changes to the current file.”
    “Please refactor this component according to your plan and write the changes into the files.”

Actual result:
The Agent produces a detailed plan and updated code snippets; But no real changes are applied to the project files (git diff remains empty).

Expected Behavior

I would expect Agent mode to behave the same as with built‑in models when using a custom Anthropic API Key: If I allow it, it should be able to create / modify / delete files in the project, not just propose changes in text.
If there are known limitations for third‑party / custom models, it would be helpful to have this clearly documented or indicated in the UI.

Operating System

Windows 10/11

Version Information

Version: 2.6.20 (user setup)
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.19045

For AI issues: which model did you use?

claude-sonnet-4-6-thinking / claude-opus-4-6-thinking

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, the issue is that you have both Override OpenAI Base URL enabled with a third-party endpoint and an Anthropic API Key set. When Override is enabled, all requests, including Anthropic ones, get routed through that proxy in an OpenAI-compatible format instead of using the native Anthropic Messages API. That proxy most likely doesn’t support tool calling for Claude, so the Agent describes changes in text but can’t actually edit files.

Fix:

  • Turn off Override OpenAI Base URL and fully clear that field.
  • Leave only Anthropic API Key enabled with your key.
  • Restart Cursor with a full quit using Cmd+Q.

You only need the Anthropic API Key. Cursor will send requests directly to the Anthropic API with full tool calling support.

If you need a proxy to reach Anthropic due to regional restrictions, that proxy must support OpenAI-format tool calling for Claude models, and not all proxies do.

A similar case was discussed here: Override Anthropic Base URL automatically switches on when using Anthropic BYOK

Let me know if that worked.

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