AIDiscount优汇智
Home / Blog

How to Use a Custom OpenAI-Compatible API in Cursor, Cline and Continue

Step-by-step setup for using your own API key and base URL in Cursor, Cline and Continue, with the settings to check when a model does not respond.

2026-11-25 · 3 min read · AIDiscount team

CursorClineContinueCoding tools

Cursor, Cline and Continue can all send requests to any OpenAI-compatible API. You need three things:

  • Base URL: https://aidiscount.ai/v1
  • API key: a key that starts with sk-, created on the API Keys page after you sign up
  • Model ID: copied exactly from the model marketplace, for example deepseek-v4.1-flash or glm-5.3

Cline (VS Code)

  1. Open the Cline panel and click the settings (gear) icon.
  2. Set API Provider to OpenAI Compatible.
  3. Set Base URL to https://aidiscount.ai/v1.
  4. Paste your key into API Key.
  5. Enter the model ID in Model ID.
  6. Save, then send a short task such as "List the files in this folder".

Cline uses tool calls heavily. Pick a model whose marketplace page lists tool calling support.

Cline also has an Anthropic provider with a custom base URL option. If you prefer the Anthropic format, use the base URL https://aidiscount.ai (without /v1).

Continue (VS Code and JetBrains)

Continue reads models from its config file. Open it from the Continue panel (gear icon, then the config file), and add a model entry:

name: My Config
version: 0.0.1
schema: v1
models:
  - name: AIDiscount
    provider: openai
    model: YOUR_MODEL_ID
    apiBase: https://aidiscount.ai/v1
    apiKey: ${{ secrets.AIDISCOUNT_API_KEY }}
    roles:
      - chat
      - edit
      - apply

Replace YOUR_MODEL_ID with an ID from the marketplace. You can paste the key directly into apiKey instead of using a secret, but then do not commit the file to a repository.

Autocomplete needs a fast, cheap model. If you set up a separate model with the autocomplete role, choose a small model to keep costs down.

Cursor

  1. Open Cursor Settings and go to Models.
  2. Under API Keys, turn on OpenAI API Key and paste your AIDiscount key.
  3. Turn on Override OpenAI Base URL and enter https://aidiscount.ai/v1.
  4. Click Verify.
  5. Add the model ID with Add model, enable it, and select it in the chat panel.

Two limits are worth knowing:

  • Requests from Cursor go through Cursor's servers before they reach the base URL. This is why the URL must be publicly reachable, and why a local address such as localhost does not work.
  • Some Cursor features, such as Tab completion, always use Cursor's own models. A custom key applies to chat and to the models you add.

Cursor's menus move between versions. If the labels above do not match, look for the OpenAI key and base URL settings under Models.

If the model does not respond

SymptomLikely cause
404 or "Not Found"The base URL is missing /v1, or /v1 is doubled.
401 or "Invalid API key"Wrong key, extra spaces when pasting, or the key was deleted.
"Model not found"The model ID has a typo or uses a different provider's naming. Copy it from the marketplace.
403 "Insufficient balance"Top up your balance or buy a plan.
Agent stops or loops on tool callsThe model is weak at tool use. Try a larger model.

See How to fix common AI API errors for more detail.

Keep an eye on cost

Coding agents send the whole conversation and many file contents with every step, so they use far more input tokens than a normal chat. Check the Usage page in your dashboard after a few sessions. How to cut AI API costs covers ways to bring the bill down.

Try it with AIDiscount. One API key works with OpenAI- and Anthropic-compatible tools. Pay as you go, no monthly fee.
Create a free accountRead the API docs

Related guides

Languages

English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Français · Deutsch · Português · Русский