Guide

How to use the AshnaAI API in Cursor

Download Cursor for macOS, Windows, or Linux, install the Cursor CLI from your terminal, create an AshnaAI API key, then set Override OpenAI Base URL to https://api.ashna.ai/v1/api.

AshnaAI

How to use the AshnaAI API in Cursor

What you will set up

Cursor talks OpenAI Chat Completions. You will install Cursor (desktop app and optional CLI), create one AshnaAI API key, paste it in Models, override the OpenAI base URL, then pick a catalog id. Desktop download: cursor.com/download. Models reference: Cursor Models. Claude Code uses Messages instead: How to use the AshnaAI API in Claude Code.

Step 1: Install Cursor (desktop app)

Most AshnaAI setup happens inside the Cursor editor under Settings → Models. Download the app for your platform first.

  1. Open cursor.com/download.
  2. Choose macOS, Windows, or Linux and download the installer.
  3. Run the installer and open Cursor once so Settings → Models is available.
  4. Use the AshnaAI API key from Step 3 in Settings → Models.

Step 2: Install the Cursor CLI (optional)

The Cursor CLI (binary name agent) runs the same agent from any terminal — useful for scripts, CI, or working outside the editor. Official install guide: Cursor CLI installation.

macOS, Linux, and WSL
▸ curl https://cursor.com/install -fsS | bash
Windows PowerShell
irm 'https://cursor.com/install?win32=true'//cursor.com/install?win32=true' | iex
Add ~/.local/bin to PATH (bash)
▸ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
▸ source ~/.bashrc
Add ~/.local/bin to PATH (zsh)
▸ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
▸ source ~/.zshrc
Verify the install
▸ agent --version
  • The AshnaAI API override in Step 4 applies to Chat inside the Cursor editor.
  • To update the CLI later, run agent update.

Step 3: Create an AshnaAI API key

Cursor stores this as the OpenAI API key in Settings → Models.

  1. Open Account → API.
  2. Choose Create key and name it Cursor.
  3. Copy the secret immediately. It is shown once.
  4. Keep it out of git, a gist, and a screenshot.

Step 4: Paste the key and override the base URL

Both fields must be set in the editor. The override is what routes Cursor Chat to AshnaAI.

  1. Open Cursor Settings → Models.
  2. Paste the secret into the OpenAI API Key field.
  3. Enable Override OpenAI Base URL.
  4. Set the URL to https://api.ashna.ai/v1/api
  5. Save. Do not drop /v1/api — that is the usual empty model list.

Step 5: Pick a catalog id and send a chat

Cursor lists ids from GET /v1/api/models and chats with POST /v1/api/chat/completions.

  1. Open the Chat model picker in Cursor.
  2. Choose glm-5.3-flash, or type another catalog id manually.
  3. Send one message to confirm the route works.
  4. If models are missing, restart Cursor once and recheck the base URL.
  • Cursor does not always auto-discover every custom model from GET /models — typing the catalog id directly still works.

Fields that have to match

Paste these values. A typo on the base URL is the usual failure.

Cursor fields for the AshnaAI API
FieldValue
CLI install (macOS/Linux)curl https://cursor.com/install -fsS | bash
CLI install (Windows)irm 'https://cursor.com/install?win32=true' | iex
OpenAI API KeyBearer key from Account → API
Override OpenAI Base URLhttps://api.ashna.ai/v1/api
ModelsGET /v1/api/models
ChatPOST /v1/api/chat/completions
AshnaAI HTTP API plus Cursor Models and CLI www.ashna.ai/api-docs

Try it now

HTTP reference: AshnaAI API docs and chat completions. VS Code uses a Custom Endpoint instead: How to use the AshnaAI API in VS Code.

  1. Install Cursor and optionally the agent CLI.
  2. Create a key in Account → API.
  3. Set Override OpenAI Base URL to https://api.ashna.ai/v1/api and send one chat.

Frequently asked questions

How do I install the Cursor CLI?
On macOS, Linux, or WSL run curl https://cursor.com/install -fsS | bash. On Windows PowerShell run irm 'https://cursor.com/install?win32=true' | iex. Verify with agent --version. Docs: https://cursor.com/docs/cli/installation
Where do I download the Cursor desktop app?
https://cursor.com/download — pick macOS, Windows, or Linux and run the installer.
What OpenAI base URL does Cursor need for AshnaAI?
https://api.ashna.ai/v1/api Include /v1/api. Cursor then calls GET /models and POST /chat/completions.
Does Cursor use the Responses API?
No. Cursor’s override posts Chat Completions. Codex uses POST /responses. Claude Code uses Messages.
Can I type a model id Cursor did not list?
Yes. Enter any catalog or custom-agent id. Unknown ids still pass through to AshnaAI.

Tags

#API#Cursor#developers

Found this article helpful? Share it with your network.