Skip to content
Try chatGet API key

Cursor

Cursor is an AI code editor. Its model settings let you bring an OpenAI key and replace the OpenAI base URL, which is how it connects to Bayle.

Copies this page's setup instructions, to paste into your coding agent.
Show the prompt
Help me set this up to use Bayle AI, an OpenAI-compatible API. Full guide: https://docs.bayle.ai/guides/coding-tools/cursor/

Goal: point Cursor (https://cursor.com) at Bayle by overriding the OpenAI base URL. This is a settings screen, so walk me through it step by step and wait for me at each one.

1. Make sure Cursor is installed. If not, send me to https://cursor.com/download.
2. Before I turn anything on, tell me what this changes:
   - My own key works for chat models only; Tab completion keeps using Cursor's built-in models.
   - Cursor builds the final prompt on its own servers, so requests go from Cursor's servers to Bayle, and my key is sent along with each request.
   - The override applies to everything Cursor sends with an OpenAI key, so OpenAI models selected in Cursor also go to Bayle while it is on.
   Continue only after I confirm.
3. Pick a model:
   curl -s "https://api.bayle.ai/models?type=text" \
     | jq -r '.data[] | select(.model_spec.capabilities.supportsFunctionCalling) | .id'
   Show me the list and let me choose.
4. Tell me to open Cursor Settings, then Models, and:
   - under API Keys, put my Bayle key in the "OpenAI API Key" field. Tell me to paste it myself; do not ask me to type it into this chat.
   - turn on "Override OpenAI Base URL" and enter https://api.bayle.ai
   - add a custom model with the chosen id and enable it
   - click verify, then choose the model in chat.
5. Verify: run one curl to POST https://api.bayle.ai/chat/completions with the chosen model and show me the result, then ask me to send a short message in Cursor's chat with it.

Rules:
1. The base URL is https://api.bayle.ai exactly as written. Append no path to it.
2. Read the key from the BAYLE_API_KEY environment variable. Never write the key itself into a file you create, a command, a commit or the chat. Where the tool keeps the key in its own settings screen, tell me where to paste it. If BAYLE_API_KEY is not set, stop and ask me to create a key at https://chat.bayle.ai/developers and export it.
3. Take model ids only from GET https://api.bayle.ai/models (no key needed). Never guess one.
4. Finish with one real test request, show me the result and list the files you changed.

Download Cursor for macOS, Windows or Linux from the official download page. The official docs cover setup.

Don't have a Bayle key yet?Get API key
  1. Open Cursor Settings → Models.
  2. Under API Keys, enter your Bayle key in the OpenAI API Key field.
  3. Turn on Override OpenAI Base URL and enter https://api.bayle.ai.
  4. Add a custom model with the id MODEL_ID, and enable it.
  5. Verify, then choose the model in chat.
Terminal window
curl -s "https://api.bayle.ai/models?type=text" \
| jq -r '.data[] | select(.model_spec.capabilities.supportsFunctionCalling) | .id'

Cursor’s own privacy settings cover Cursor’s handling of your code. What happens once a request reaches Bayle is described in Privacy.