Skip to content
Connect a clientCursor

Cursor

Configure the Guard URL, key, and model in Cursor.

Set up with your own AI
Model protocol

Claude, Kimi, Composer and Grok

Cursor can call an OpenAI-compatible address, and Guard serves one. Put the key into the editor's own settings and the built-in agent starts working through Guard.

1. Open model settings

  1. Cursor → Settings → Models.
  2. Scroll past the model list and expand API Keys.

2. Enter the key and address

  1. Paste your gd-… into OpenAI API Key and turn on the switch next to it.
  2. Turn on Override OpenAI Base URL and set the address below.
text
https://api.guardrelay.ai/v1

3. Add a model

Type the id you need into Add or search model and add it, then make sure its switch is on.

id for CursorContextWhen to use
claude-sonnet-5-51Mdefault
claude-sonnet-51Mexplicit Sonnet 5 version
claude-opus-5-51Mnewest Opus: complex code and long agent runs
claude-opus-51Mcomplex code and long agent runs
claude-opus-4-81Mthe previous flagship
claude-haiku-5-51Mnewest Haiku: fast and cheap
claude-haiku-4-5200Kprevious Haiku version
claude-fable-51Mseparate model
claude-fable-5-11Mseparate model

Loose spellings such as sonnet-5, opus-5 or Claude-Sonnet-5 are accepted too: the server normalizes them.

id for CursorContextWhen to use
k31Mdefault: a long history or a large document
k3-256k256K262,144-token window; the same base rate as k3
kimi-for-coding1MK2.8 Preview: code and tool work
kimi-for-coding-highspeed256Kthe separate K2.7 Code HighSpeed model

Type the id exactly, with no shortening and no spelling of your own: Cursor will not fill in a short form.

Grok 4.7 has eight ids: low, medium, high, xhigh, and Fast are encoded in the full string; the Guard window is 256K. The eight Grok 4.6 ids remain available; Grok 4.5 is removed. Composer has two ids. Copy the full string from Models.

The full table for every family is on the Models page.

4. Open a new chat

New Chat → pick the added model in the list next to the input → send a request. Restarting Cursor is not needed.

What you can do

The built-in agent works with supported capabilities: long conversations, reading and searching project files, editing and creating code, running terminal commands and showing the output, images and attachments, replies in a strict format. Responses stream, and you can stop and continue them. Image, attachment and strict-format support depends on the selected family and API; for example, Composer does not accept images.

Web search and opening pages by link are done by Cursor on its own and returned to the model — no separate charge for that.

When a repeat request costs less

Cursor sends a large service block with every message — tool descriptions and the agent’s working rules. On a confirmed cache hit, this repeated input is charged at the lower cache-read rate.

A sufficiently large first request may write the cache, and later matching requests may read it at a lower rate. Hits and savings are not guaranteed: check cached tokens, tariff and final cost in request history.

Cursor payment and Guard usage

Your Cursor subscription pays for the editor. Requests made with your gd-… are charged to the Guard balance and do not count against Cursor limits — see your Guard account.

If it does not work

What you seeWhat to do
The model you chose is not availableThat id is not in the Guard catalog. Check the table above or the Models page.
An error about a resource that cannot be foundMake sure the address ends with /v1 and has no extra path.
An authorization errorThe key was not copied in full, or the OpenAI API Key switch is off.
A built-in Cursor model answersIn the list next to the input pick the model you added.
An old chat behaves as beforeSettings apply to new chats — open New Chat.

GLM 5.3 in Cursor

Install and open a project

  1. Install Cursor, sign in, and use File → Open Folder to open a separate test folder without secrets.
  2. Get a Guard key. Availability of Use OpenAI API Key depends on your Cursor plan; Guard documentation does not require buying a new plan.

Get a Guard key

Get a universal gd-… key from the direct API link in @guardapi and choose an API package. Do not put the key in a project, repository, task prompt, or screenshot. Balance and usage are available in your Guard account.

Add the model and endpoint

  1. Open Cursor Settings → Models. Select Add Custom Model, enter glm-5.3 in Custom model name, and select Add. Add glm-5.3-flash separately if needed.
  2. Expand API Keys, enter the gd-… key in OpenAI API Key, and enable Use OpenAI API Key.
  3. Enable Override OpenAI Base URL and enter https://api.guardrelay.ai/glm/v1 without /chat/completions.
  4. Open New Chat and select glm-5.3 beside the input field.
Cursor fieldValue
Custom model nameglm-5.3
OpenAI API Keygd-…
Use OpenAI API Keyenabled
Override OpenAI Base URLenabled
Base URLhttps://api.guardrelay.ai/glm/v1
Final requestPOST https://api.guardrelay.ai/glm/v1/chat/completions

Quick check and continuation

  1. In a new chat without files, send: Reply with exactly GLM_OK and remember the word PINE.
  2. In the same chat, send: What word were you asked to remember? Expect PINE.
  3. For a project check, open a test README.md, ask Cursor to read one line, and approve no other actions.

Models and confirmed capabilities

Model IDWhen to use it
glm-5.3Default model; text and coding tasks.
glm-5.3-flashFast model; at API level it accepts PNG and PDF through all three protocols, and MP4 through Chat Completions only.
  • Cursor with GLM is not yet verified; Agent, tools, and continuation are not claimed here.
  • The client itself executes file, edit, and terminal tools. This profile does not connect Z.AI tools or MCP automatically.
  • The Chat API permits MP4 with glm-5.3-flash, but PNG, PDF, or MP4 upload through Cursor UI is not confirmed.
  • The profile uses OpenAI-compatible Chat Completions. The GLM server prompt is off by default for ordinary API access; client setup does not enable it.
  • Native TXT, DOCX, and XLSX are outside the confirmed GLM contract. Use PDF for documents, or PNG with glm-5.3-flash for images.

If the connection fails

SymptomWhat to check
401 invalid_api_keyThe client received the complete active gd-… key; the variable is set in the same process that starts the client.
404 model_not_foundThe model ID is exactly glm-5.3 or glm-5.3-flash; old GLM IDs, aliases, Turbo, and FlashX are unsupported.
404 or incorrect pathBase URL is https://api.guardrelay.ai/glm/v1. The client appends /chat/completions; do not add it twice.
400 invalid_requestThe documented API format is selected; reasoning, temperature, MCP, or other unconfirmed fields were not copied from an older profile.
402 insufficient_balanceCheck available balance and unfinished reservations in your Guard account.
API key settings are unavailableThis is a Cursor plan or account restriction. Do not buy a new plan for this guide; use confirmed Cline or VS Code Claude Code instead.

Gemini in Cursor

Install and open a project

  1. Install Cursor, sign in, and use File → Open Folder to open a separate test folder without secrets.
  2. Get a Guard key. Availability of Use OpenAI API Key depends on your Cursor plan; Guard documentation does not require buying a new plan.

Get a Guard key

Get a universal gd-… key from the direct API link in @guardapi and choose an API package. Do not put the key in a project, repository, task prompt, or screenshot. Balance and usage are available in your Guard account.

Add the model and endpoint

  1. Open Cursor Settings → Models. Select Add Custom Model, enter gemini-4-argon in Custom model name, and select Add. Add the other IDs from the table below separately if needed.
  2. Expand API Keys, enter the gd-… key in OpenAI API Key, and enable Use OpenAI API Key.
  3. Enable Override OpenAI Base URL and enter https://api.guardrelay.ai/v1 without /chat/completions.
  4. Open New Chat and select gemini-4-argon beside the input field.
Cursor fieldValue
Custom model namegemini-4-argon
OpenAI API Keygd-…
Use OpenAI API Keyenabled
Override OpenAI Base URLenabled
Base URLhttps://api.guardrelay.ai/v1
Final requestPOST https://api.guardrelay.ai/v1/chat/completions

Quick check and continuation

  1. In a new chat without files, send: Reply with exactly GUARD_GEMINI_OK and remember the word PINE.
  2. In the same chat, send: What word were you asked to remember? Expect PINE.
  3. For a project check, open a test README.md, ask Cursor to read one line, and approve no other actions.

Gemini models and capabilities

Model IDInput and window
gemini-4-argonText, images, PDF; 1,048,576-token window, shared by input and answer.
gemini-3.8-flashText, images, PDF; 1,048,576-token window for input.
  • Cursor itself handles files and commands; it sends the chat history with every request.
  • The Guard catalog takes text, images, and PDF as input and returns text. How to send a file or an image depends on the client's interface; this guide does not describe attachments.
  • The profile uses OpenAI-compatible Chat Completions. The server prompt is a separate setting of the Gemini family: it applies only when the key has the entitlement and the option is on; client setup does not enable it.

If the connection fails

SymptomWhat to check
401 invalid_api_keyThe client received the complete active gd-… key; the variable is set in the same process that starts the client.
404 model_not_foundThe model ID is an exact ID from the table above or the short name gemini; other spellings are unsupported.
404 or incorrect pathBase URL is https://api.guardrelay.ai/v1. The client appends /chat/completions; do not add it twice.
400 invalid_requestThe documented API format is selected; extra settings from an older profile were not copied: reasoning, temperature, MCP, and others.
402 insufficient_creditCheck available balance and unfinished reservations in your Guard account.
API key settings are unavailableThis is a Cursor plan or account restriction. Do not buy a new plan for this guide; use Cline or VS Code with Claude Code instead.

Muse in Cursor

Install and open a project

  1. Install Cursor, sign in, and use File → Open Folder to open a separate test folder without secrets.
  2. Get a Guard key. Availability of Use OpenAI API Key depends on your Cursor plan; Guard documentation does not require buying a new plan.

Get a Guard key

Get a universal gd-… key from the direct API link in @guardapi and choose an API package. Do not put the key in a project, repository, task prompt, or screenshot. Balance and usage are available in your Guard account.

Add the model and endpoint

  1. Open Cursor Settings → Models. Select Add Custom Model, enter muse-wonder-1.0 in Custom model name, and select Add. Add the other IDs from the table below separately if needed.
  2. Expand API Keys, enter the gd-… key in OpenAI API Key, and enable Use OpenAI API Key.
  3. Enable Override OpenAI Base URL and enter https://api.guardrelay.ai/v1 without /chat/completions.
  4. Open New Chat and select muse-wonder-1.0 beside the input field.
Cursor fieldValue
Custom model namemuse-wonder-1.0
OpenAI API Keygd-…
Use OpenAI API Keyenabled
Override OpenAI Base URLenabled
Base URLhttps://api.guardrelay.ai/v1
Final requestPOST https://api.guardrelay.ai/v1/chat/completions

Quick check and continuation

  1. In a new chat without files, send: Reply with exactly GUARD_MUSE_OK and remember the word PINE.
  2. In the same chat, send: What word were you asked to remember? Expect PINE.
  3. For a project check, open a test README.md, ask Cursor to read one line, and approve no other actions.

Muse models and capabilities

Model IDInput and window
muse-wonder-1.0Text, images, PDF; 1,048,576-token window.
muse-spark-1.3Text, images, PDF; 1,048,576-token window.
muse-spark-1.2Text, images, PDF; 1,048,576-token window.
  • Cursor itself handles files and commands; it sends the chat history with every request.
  • The Guard catalog takes text, images, and PDF as input and returns text. How to send a file or an image depends on the client's interface; this guide does not describe attachments.
  • The profile uses OpenAI-compatible Chat Completions. The server prompt is a separate setting of the Muse family: it applies only when the key has the entitlement and the option is on; client setup does not enable it.

If the connection fails

SymptomWhat to check
401 invalid_api_keyThe client received the complete active gd-… key; the variable is set in the same process that starts the client.
404 model_not_foundThe model ID is an exact ID from the table above or the short name muse; other spellings are unsupported.
404 or incorrect pathBase URL is https://api.guardrelay.ai/v1. The client appends /chat/completions; do not add it twice.
400 invalid_requestThe documented API format is selected; extra settings from an older profile were not copied: reasoning, temperature, MCP, and others.
402 insufficient_creditCheck available balance and unfinished reservations in your Guard account.
API key settings are unavailableThis is a Cursor plan or account restriction. Do not buy a new plan for this guide; use Cline or VS Code with Claude Code instead.

Codex in Cursor

Install Cursor, sign in to your account, and open a project. Get your gd-… key from the Guard bot. Cursor routes GPT-model requests through OpenAI API Key and a Base URL override shared by OpenAI models; this setup uses Chat Completions.

For a connection check, use a plain chat without files and ask “Reply: connection established”. To check project work, create a separate guard-test folder in File Explorer or Finder, open it in your editor, and create README.md containing “This is a Guard test project”. The file-reading example below uses that folder.

Model IDName
gpt-6-astraGPT-6 Astra
gpt-6.1-solGPT-6.1 Sol
gpt-6-solGPT-6 Sol
gpt-6-lunaGPT-6 Luna
gpt-5.6-solGPT-5.6 Sol
gpt-5.6-terraGPT-5.6 Terra
gpt-5.6-lunaGPT-5.6 Luna

Set up Cursor

  1. Open a test folder without secrets and with a README.md through File → Open Folder. Then open Cursor Settings → Models. Select Add Custom Model, enter the exact gpt-6-astra value in Custom model name, then select Add. If that ID is already in the list, do not add it again.
  2. Expand API Keys below. Paste your gd-… key from the bot into OpenAI API Key. Cursor hides saved keys and shows Secret saved; this is expected. Enable Use OpenAI API Key.
  3. Enable Override OpenAI Base URL and set the displayed Base URL to exactly https://api.guardrelay.ai/codex/v1, without a trailing slash. Leave the field to save it.
  4. Open New Chat, select gpt-6-astra beside the input, and send: Read README.md and explain in two sentences what this test project does. Do not change anything. If Cursor asks for permission, allow only a read of that file.
  5. Continue in the same chat with: Name one fact from README.md that supports your explanation. Open a new chat for a different task.
Cursor fieldValue
Custom model namegpt-6-astra
OpenAI API Keygd-…
Use OpenAI API Keyenabled
Override OpenAI Base URLenabled
Base URLhttps://api.guardrelay.ai/codex/v1
Final requestPOST https://api.guardrelay.ai/codex/v1/chat/completions

After checking file reading, you can request a change: “Add a Test section and one descriptive line to README.md.” Review the proposed edit and approve it if it matches your task. Command, file and tool permissions are controlled by the client; connecting Guard does not require granting unrestricted access to your whole computer.

Sections

On this page