Cursor (independent) + OpenAI-compatible override: three fields that matter

Cursor is an independent editor. When it lets you bring your own OpenAI-compatible endpoint, the UI usually reduces to three values — labels move between releases, the fields do not:

  1. Base URL → https://api.china-aiapi.com/v1
  2. API key → from env LLM_API_KEY (paste once; prefer OS keychain / env over a plaintext note)
  3. Model id → MODEL_ID exactly as returned by GET /v1/models

Before opening Cursor settings

export LLM_API_KEY='…'
curl -sS https://api.china-aiapi.com/v1/models \
  -H "Authorization: Bearer $LLM_API_KEY" | head

In Cursor

  • Find the model / provider settings that mention OpenAI API key and Override OpenAI Base URL (or “OpenAI compatible”).
  • Paste the base URL ending at /v1.
  • Paste the key without a Bearer prefix.
  • Type MODEL_ID manually if the dropdown is empty — custom gateways often do not populate Cursor’s catalog.

Same pattern for OpenCode-style CLIs: whatever flag or config key means base_url + api_key + model.

If chat works but agent/tools fail, the model may lack tool-calling on that gateway route — try another MODEL_ID from /models rather than changing the URL again.


Disclosure: I work on the APIGOTO team; independent of OpenAI, Anthropic and Google. Cursor and OpenCode-style tools are independent products. Example endpoint: https://api.china-aiapi.com/v1 · www.china-aiapi.com

Comments · 0

Sign in to join the conversation.

Be the first to comment.