Cursor
Cursor supports overriding the OpenAI base URL with your own API key — commonly called BYOK (Bring Your Own Key). ai& exposes an OpenAI-compatible /v1/chat/completions endpoint, so any tool-calling model in our catalog can drive Cursor’s Agent mode.
Prerequisites
Section titled “Prerequisites”- Cursor installed
- An ai& API key with access to a tool-calling model
-
Open Cursor Settings (
Cmd+,/Ctrl+,) -
Go to Models → scroll to OpenAI API Key
-
Paste your ai& API key into the OpenAI API Key field
-
Enable Override OpenAI Base URL and set it to:
https://api.aiand.com/v1The
/v1suffix is required — Cursor appends/chat/completionsto whatever you provide. -
Click + Add Model in the model list and enter a model ID from the catalog that supports tool calling, e.g.:
zai-org/glm-5.2Toggle the model on, then click Verify — Cursor sends a test request to confirm the key and model work
Using Agent mode
Section titled “Using Agent mode”Once verified, switch to Agent mode (the robot icon in the sidebar, or Cmd+. / Ctrl+.). The agent can:
- Read and edit files in your workspace
- Run terminal commands
- Use multi-turn tool calls to complete tasks
Verify the connection
Section titled “Verify the connection”From the shell, confirm your key authenticates and the model is available:
curl -sS https://api.aiand.com/v1/models \ -H "Authorization: Bearer $AIAND_API_KEY" \ | grep -o 'zai-org/glm-5.2'(Invoke-RestMethod https://api.aiand.com/v1/models ` -Headers @{ Authorization = "Bearer $env:AIAND_API_KEY" }).data.id ` | Select-String "zai-org/glm-5.2"A match means the key works and the model is on your org.
Troubleshooting
Section titled “Troubleshooting”- “Invalid API key” — check that you copied the full key from the ai& dashboard, and that it hasn’t been revoked.
- “Model not found” — the model ID must match the catalog exactly, including the provider prefix (
zai-org/,moonshotai/, etc.). - Agent mode doesn’t use tools — make sure the model you selected supports tool calling. Not all models in the catalog do.
- Verify fails despite correct key/model — Cursor sometimes sends the verification request with
model: "default". Workaround: disable all other models in the list first, then verify. - Requests blocked or 403 — if you’re behind a corporate proxy or VPN, it may be interfering. Try on a direct connection first.
Switching back to Cursor-hosted models
Section titled “Switching back to Cursor-hosted models”- Go to Settings → Models
- Disable Override OpenAI Base URL (or clear the field)
- Cursor’s hosted models (GPT-4o, Claude, etc.) become available again
Your BYOK key is stored locally by Cursor and is not sent anywhere except the overridden endpoint.