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

Key Takeaways

  • Download the Cursor desktop app from cursor.com/download, or install the agent CLI with one curl or PowerShell command.
  • AshnaAI routes through Override OpenAI Base URL in Cursor Settings → Models — set it to https://api.ashna.ai/v1/api.
  • Discovery uses GET /models. Chat uses POST /chat/completions.
  • Pick glm-5.3-flash or type any catalog id in the model picker.

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.
Sourcing & Methodology

Mapped to Cursor download and CLI installation docs, Cursor Models Override OpenAI Base URL, and the public AshnaAI HTTP API (GET /v1/api/models, POST /v1/api/chat/completions).

Topics

#API#Cursor#developers

Found this article insightful?

Share it with fellow builders, founders, and AI practitioners.

Frequently asked questions

Everything You Need to Know

https://api.ashna.ai/v1/api Include /v1/api. Cursor then calls GET /models and POST /chat/completions.

No. Cursor’s override posts Chat Completions. Codex uses POST /responses. Claude Code uses Messages.

Yes. Enter any catalog or custom-agent id. Unknown ids still pass through to AshnaAI.

Continue ReadingView all

Related Articles & Guides