[Help/Bug] Using 3rd-Party APIs (Claude / Gemini), models can't use tools, code format is wrong, can't Apply

Hi everyone,

I recently configured Cursor to use 3rd-party APIs ([Please fill in the API provider you are using here, e.g., OpenRouter, Together AI, or other custom OpenAI-compatible endpoints]) to access the Claude and Gemini model families.

I found that basic chat conversations work fine; the models can understand my questions and provide text responses.

But the problems are:

When I try to use Cursor’s core features (like @ referencing files, generating code, or modifying code), these models (both Claude and Gemini) don’t perform well:

  1. Cannot use tools: They don’t seem to correctly understand or execute Cursor’s tool-calling requests. If I ask them to modify a file, they might just send back the entire modified file content instead of generating an applicable “diff”.

  2. Code format issues: The generated code is not in the format Cursor expects. There is no “Apply” button, or the “Apply” button is greyed out.

I’d like to ask:

  • Is this a known limitation? Are Cursor’s tool-calling and code “Apply” features only deeply integrated with OpenAI models (or the official, built-in Claude/Gemini integrations)?

  • Has anyone successfully configured Claude or Gemini running via a 3rd-party API to work correctly with tools and the “Apply” feature?

  • If it’s a configuration issue, are specific API parameters or a special System Prompt required to make them work correctly?

Thanks!