Failed to connect to API key exchange endpoint: fetch failed

Where does the bug appear (feature/product)?

Cursor SDK

Describe the Bug

At random, I will get this kind of error “Failed to connect to API key exchange endpoint: fetch failed”

Steps to Reproduce

Send a message. Wait a few minutes. Send another message to the same session.

Expected Behavior

I’d expect it to not have such an error

Operating System

MacOS

Version Information

Cursor SDK 1.0.26

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. fetch failed here means the request to the key exchange endpoint isn’t reaching us at the network level on the client side, not a server error. It’s usually a transient blip during a cold TCP/TLS/DNS handshake after an idle pause, which matches your “at random / sometimes works”.

To figure out if this is normal network flakiness or something getting stuck inside the SDK process, I need one key detail:

When you hit this error, if you immediately retry send in the same long running process, do the next requests succeed, or do they keep failing until you restart the process? This is the most important signal.

A couple more details:

  • Your Node.js version
  • Whether there’s a proxy, VPN, or corporate firewall between the process and the network

Quick workaround: retry send the error is marked as retryable, and if it gets stuck, restarting the process usually restores things. Upgrading to 1.0.28 unfortunately doesn’t fix this specific case.

Let me know the answers above and we’ll figure out what’s going on.