Client setup

Cursor Custom API Setup Guide

Configure Override OpenAI Base URL in Cursor IDE to connect ZhenAPI for official Claude, GPT, Gemini and DeepSeek models, with Verify troubleshooting.

Cursor supports custom OpenAI-compatible gateways via Override OpenAI Base URL. Pointing Cursor at ZhenAPI (https://api.zhenapi.ai/v1) lets you run full-strength official Claude, GPT, Gemini, DeepSeek and GLM models on a transparent pay-as-you-go basis in Cursor Chat and Inline Edit (Ctrl+K / Cmd+K).

Important — Choose a General Group: Cursor sends standard OpenAI-compatible requests. Do not pick groups labeled "Claude Code only" or "Codex only" (those discounted channels validate official CLI headers and will return 403 in Cursor). Always pick an External / General / Official / Special channel group.

Step 1: Create an API Key in the Console

  1. Sign in to the ZhenAPI Console, open API Keys, and click Create Key.
  2. Select a general-purpose group matching the model family you want to use:
    • Anthropic Claude: choose Claude Max (External) or Claude Official;
    • OpenAI GPT: choose Codex Pro (External) or GPT Official;
    • Reasoning & value: choose DeepSeek, Gemini (Special) or Zhipu GLM.
  3. Copy your sk-... API key, then open the Pricing page to copy the exact model ID supported by that group (for example claude-sonnet-4-6, deepseek-reasoner or glm-5.4).

Step 2: Configure Models & Base URL in Cursor

  1. Open Cursor and navigate to Cursor Settings → Models.
  2. Click + Add Model, enter the exact model ID from the Pricing page, and uncheck built-in models that do not belong to your key's group.
  3. Scroll down to the OpenAI API Key section:
    • Paste your ZhenAPI sk-... key;
    • Expand Override OpenAI Base URL, enable it, and enter (include /v1 with no trailing slash):
Override OpenAI Base URL
1https://api.zhenapi.ai/v1
  1. Click Save and then Verify. Once verified, select your added model in the Cursor chat picker.

Common Issues & Troubleshooting

Symptom / ErrorCauseFix
Clicking Verify fails with model not found or 404 / 400Cursor tests connectivity using the first checked model in your Models list. If gpt-4o is checked while your key belongs to a Claude or DeepSeek group, verification fails.Uncheck every model not offered in your selected group so only your group's custom model IDs remain enabled, then click Verify again.
403 Forbidden or client restriction messageYour key is assigned to a "Claude Code only" or "Codex only" channel group.Edit the key on the API Keys page and switch its group to an External or Official channel — the change takes effect immediately without replacing the key.
Cursor Agent / Composer restricts custom OpenAI keysCertain Cursor releases restrict native Composer agent modes to Cursor Pro subscriptions.Run Claude Code directly inside Cursor's integrated terminal (Claude Code Guide) or install the Cline / Roo Code extension (Cline Guide) for unrestricted multi-file autonomous coding at our lowest channel rates.
403 INSUFFICIENT_BALANCE or 429Workspace balance is below the estimated input floor or the key's custom quota cap was reached.Top up on the Wallet page or raise the key's quota limit. See Error Codes for details.