Cursor
About
Cursor is an advanced AI-powered IDE that combines intelligent code completion, inline explanations, and automatic code editing directly inside the editor.
This guide explains how to connect AI/ML API to Cursor using the Azure OpenAI-compatible flow. Youβll get a clean setup with one endpoint, support for slashes in deployment names.
π Quick Setup
Base URL
https://api.aimlapi.com
API Key
Your AI/ML API key (create at aimlapi.com/app/keys)
Deployment
google/gemini-2.5-pro (slashes allowed)
Alias (Model ID)
gpt-4o (Bypasses the restriction and makes Cursor work with any model)
Do not add /v2/azure or /openai to the Base URL.
β
Prerequisites
AI/ML API key
Cursor IDE (latest)
Internet access to
api.aimlapi.com
Installation & Configuration
1) Configure Cursor (Azure path)
Open Cursor β Settings β Models β Azure and fill in:
Base URL
Deployment Name
API Key Paste your AI/ML API key exactly (avoid spaces).
Click Verify to confirm.



2) Keep the model picker clean
In Cursorβs Chat model selector, only enable:
This alias (Model ID) will send traffic to your deployment (google/gemini-2.5-pro).

3) How Cursor calls AI/ML API
Example request generated by Cursor:
Notes:
Deployment Nameis inserted into/deployments/<NAME>/....api-versionis handled by Cursor automatically.Base URL stays exactly
https://api.aimlapi.com.



4) Optional smoke test
You should receive a JSON response with choices[0].message.content.
5) Common pitfalls
Deployment not found β Check Base URL & Deployment Name.
Invalid API key β Re-copy the key, ensure itβs in the Azure section.
Wrong model list β Toggle Azure off/on, click Verify, restart Cursor.
Slashes in names β Allowed in Deployment, but keep alias short (e.g.
gpt-4o).
6) Tips for teams
Standardize the alias (Model ID) (
gpt-4o) so everyone sees the same thing in Cursor.Document your Base URL + Deployment in team wiki to avoid drift.
You can swap deployments later without changing the alias in UI.
β
Summary (copy/paste)
Base URL:
https://api.aimlapi.comAPI Key: your AI/ML API key
Deployment:
google/gemini-2.5-pro(slashes allowed)Alias (Model ID):
gpt-4o
With this setup, Cursor talks to AI/ML API using the Azure flow, while you keep the UI clean and consistent
Last updated
Was this helpful?