Skip to content

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.

  1. Open Cursor Settings (Cmd+, / Ctrl+,)

  2. Go to Models → scroll to OpenAI API Key

  3. Paste your ai& API key into the OpenAI API Key field

  4. Enable Override OpenAI Base URL and set it to:

    https://api.aiand.com/v1

    The /v1 suffix is required — Cursor appends /chat/completions to whatever you provide.

  5. 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.2

    Toggle the model on, then click Verify — Cursor sends a test request to confirm the key and model work

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

From the shell, confirm your key authenticates and the model is available:

Terminal window
curl -sS https://api.aiand.com/v1/models \
-H "Authorization: Bearer $AIAND_API_KEY" \
| grep -o 'zai-org/glm-5.2'

A match means the key works and the model is on your org.

  • “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.
  1. Go to Settings → Models
  2. Disable Override OpenAI Base URL (or clear the field)
  3. 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.