Cursor
Connect Cursor to RealRelay.ai through the OpenAI base URL override: check your plan, set the key and base URL, add a custom model and test Chat and Agent. Experimental.
- Protocol
- OpenAI Chat Completions
- Base URL
https://www.realrelay.ai/v1- Official docs
- cursor.com
- Checked against the tool’s docs
- 2026-10
Overview
Cursor is a code editor built around an AI chat and an agent that edits your project. With your own key, Cursor sends Chat and Agent requests to an OpenAI-compatible address, so it connects to RealRelay.ai's /v1/chat/completions endpoint.
An API key from the API keys page of the console.
The base URL with
/v1.A model ID exactly as
GET /v1/modelslists it, for examplez-ai/glm-5.2. You add each model by hand.A Cursor plan that allows your own API keys: Premium, Super or Ultra, or the legacy Pro, Pro+ and Ultra plans. Free and Plus do not. On Teams and Enterprise, Cursor still charges its token rate on requests made with your key.
This guide is experimental. The base URL override is not described in Cursor's documentation; the steps come from Cursor staff answers on the Cursor forum and can change between versions. Some Cursor versions also send request bodies that differ from standard Chat Completions, and RealRelay.ai does not rewrite them, so Agent mode may fail where Chat works. Tab completion always uses Cursor's own models.
Install
Download Cursor from cursor.com/downloads. On macOS (12 or later) open the .dmg; on Windows (10 or later) run the .exe. On Linux, use Cursor's package repository or the AppImage from the same page.
1curl -fsSL https://downloads.cursor.com/keys/anysphere.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/cursor.gpg > /dev/null2echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/cursor.gpg] https://downloads.cursor.com/aptrepo stable main" | sudo tee /etc/apt/sources.list.d/cursor.list > /dev/null3sudo apt update4sudo apt install cursor1sudo tee /etc/yum.repos.d/cursor.repo << 'EOF'2[cursor]3name=Cursor4baseurl=https://downloads.cursor.com/yumrepo5enabled=16gpgcheck=17gpgkey=https://downloads.cursor.com/keys/anysphere.asc8EOF9sudo dnf install cursorOpen Cursor and sign in to your Cursor account. Your own key is used on top of the account, not instead of it.
Configure
- 1
Open the model settings
Open Cursor Settings and go to Models.
- 2
Enter your key
Turn on OpenAI API Key and paste your RealRelay.ai key.
Cursor Settings → Models → OpenAI API Key sk-*** - 3
Override the base URL
Turn on Override OpenAI Base URL. The field is filled with OpenAI's address when you enable it; replace it with RealRelay.ai's.
Cursor Settings → Models → Override OpenAI Base URL https://www.realrelay.ai/v1 - 4
Add the model
Type the exact model ID into the model search field and click Add Custom Model. Repeat for each model you want. You do not need Refresh Model List.
Cursor Settings → Models → Add Custom Model z-ai/glm-5.2 - 5
Select it
Pick the new model in the Chat or Agent model menu.
Every request goes through Cursor's servers before it reaches RealRelay.ai, and your key travels with it. Cursor says it does not store the key. Cursor's Zero Data Retention policy does not cover requests made with your own key.
The override applies to all OpenAI-family requests, including some of Cursor's own models. To go back to Cursor's models, turn the override off.
Verify
- 1
Call the endpoint directly
Run this with your key first. A JSON reply with a
choicesarray means the address, key and model work.Terminal 1curl -sS "https://www.realrelay.ai/v1/chat/completions" \2 -H "Authorization: Bearer sk-***" \3 -H "Content-Type: application/json" \4 -d '{"model": "z-ai/glm-5.2", "max_tokens": 16, "messages": [{"role": "user", "content": "Reply with OK"}]}' - 2
Send a Chat message
Select your custom model in Chat and ask a short question. A reply, and a matching request in the console's usage logs, confirm the override.
- 3
Test Agent mode
Switch to Agent with the same model and ask for a small file change. If the file is created, tool calls work end to end. If the agent only describes the change, see Troubleshooting.
Cursor Agent Create a file named relay-check.txt that contains the word OK.
Models
Cursor does not read RealRelay.ai's model list. Add every model you want with Add Custom Model, using the ID exactly as RealRelay.ai lists it, then choose it in the model menu. Cursor does not ask for a context window or output limit.
For Agent mode, pick a model with tool calling and a context window of at least 64K tokens; the catalog shows both for each model. See Choosing a model.
Troubleshooting
An error that the model does not work with your plan or key. Your plan does not allow your own keys. Free and Plus are not enough; see Cursor's plans page.
Add Custom Model does nothing. The name matches a model Cursor already has, and requests would go through Cursor instead of your key. RealRelay.ai IDs carry a prefix such as
z-ai/, so copy the full ID.401 or "invalid API key". Check that the override field holds RealRelay.ai's address and not the default OpenAI one, and that the key is pasted without spaces.
400 mentioning
tools,typeorinput. Your Cursor version sent a request body that is not standard Chat Completions. RealRelay.ai does not convert these. Try Chat instead of Agent, or another Cursor version.The agent describes edits but does not make them. The model's tool calls are not reaching Cursor intact. Try a different model with tool calling.
read ECONNRESETbehind a proxy. Switch Cursor's network mode to HTTP/1.1, then quit and restart Cursor.Cursor Settings → Network → HTTP Compatibility Mode HTTP/1.1Cursor's own models stopped working. The override is still on. Turn it off while you use them.
