Cursor
Use Cursor's OpenAI base-URL override for compatible OpenAI-family models.
Use Cursor's OpenAI base-URL override for compatible OpenAI-family models.
Cursor AI code editor
What works
Ask and Agent requests can use API-AI for compatible OpenAI-family models, including streamed ApplyPatch requests. Cursor still controls its agent runtime and specialized hosted features.
Client limitation
Cursor documents BYOK for chat models only. Its built-in Anthropic/Claude model IDs do not use the OpenAI override, while Tab completion and Cursor-hosted features keep their normal routing.
Setup
Update Cursor and prepare a dedicated key
Use the latest stable Cursor. Create a dedicated API-AI key, limit its models and spend, and fund the balance before verification.
Open Models settings
In Cursor Settings → Models, paste the dedicated API-AI key under OpenAI API Key.
Override the OpenAI base URL
Enable Override OpenAI Base URL and set https://api-ai.app/v1. Cursor requires a compatible OpenAI model ID; choose one from the model catalog.
Save and select a compatible model
Save the OpenAI key and base URL. Add the compatible model ID you chose as a custom model if it is not listed, then run a new Ask or Agent request. Disable the override when you want Cursor's normal OpenAI routing again.
Verify the connection
Confirm the request in your dashboard
The request should show
Connection details
- Protocol
- openai-chat
- Endpoint
- https://api-ai.app/v1
Key security
Cursor assembles requests through its own service, so do not restrict the key to your workstation IP. Prefer a dedicated key with model, rate, spend, expiry, and scope controls.