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
- Sign in to the ZhenAPI Console, open API Keys, and click Create Key.
- Select a general-purpose group matching the model family you want to use:
- Anthropic Claude: choose
Claude Max (External)orClaude Official; - OpenAI GPT: choose
Codex Pro (External)orGPT Official; - Reasoning & value: choose
DeepSeek,Gemini (Special)orZhipu GLM.
- Anthropic Claude: choose
- Copy your
sk-...API key, then open the Pricing page to copy the exact model ID supported by that group (for exampleclaude-sonnet-4-6,deepseek-reasonerorglm-5.4).
Step 2: Configure Models & Base URL in Cursor
- Open Cursor and navigate to Cursor Settings → Models.
- 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.
- Scroll down to the OpenAI API Key section:
- Paste your ZhenAPI
sk-...key; - Expand Override OpenAI Base URL, enable it, and enter (include
/v1with no trailing slash):
- Paste your ZhenAPI
1https://api.zhenapi.ai/v1
- Click Save and then Verify. Once verified, select your added model in the Cursor chat picker.
Common Issues & Troubleshooting
| Symptom / Error | Cause | Fix |
|---|---|---|
Clicking Verify fails with model not found or 404 / 400 | Cursor 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 message | Your 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 keys | Certain 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 429 | Workspace 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. |