Guide

How to use the AshnaAI API in Cursor

Create an AshnaAI API key, open Cursor Settings → Models, paste the key, then set Override OpenAI Base URL to https://api.ashna.ai/v1/api. Chat uses POST /chat/completions.

AshnaAI

How to use the AshnaAI API in Cursor

What you will set up

Cursor talks OpenAI Chat Completions. You will create one key, paste it in Models, override the OpenAI base URL, then pick a catalog id. Official notes: Cursor Models. Claude Code uses Messages instead: How to use the AshnaAI API in Claude Code.

Step 1: Create an AshnaAI API key

Cursor stores this as the OpenAI API key.

  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 2: Open Cursor Models

This is the panel that holds the OpenAI override.

  1. Open Cursor Settings.
  2. Go to Models.
  3. Stay on that page for the next two fields.

Step 3: Paste the key and override the base URL

Both fields must be set. The override is what routes Cursor to AshnaAI.

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

Step 4: 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.
  2. Choose glm-5.3-flash, or type another catalog id.
  3. Send one message.
  4. If the new row is missing, restart Cursor once and check the base URL again.

Fields that have to match

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

Cursor Models fields for the AshnaAI API
FieldValue
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
Example model idglm-5.3-flash
AshnaAI HTTP API plus Cursor Models z.ai/blog/glm-5.3-flash

Try it now

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

  1. Create a key in Account → API.
  2. Set Override OpenAI Base URL to https://api.ashna.ai/v1/api
  3. Send one chat with glm-5.3-flash.

Frequently asked questions

What OpenAI base URL does Cursor need?
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.
Why is GET /models empty or 401?
401 is a missing or truncated key. An empty list usually means the override dropped /v1/api. Confirm the key in Account → API.
Can I type a model id Cursor did not list?
Yes. Enter any catalog or custom-agent id. Unknown ids still pass through.
Is this the same as VS Code?
Same API, different UI. VS Code uses Language Models → Custom Endpoint. Walkthrough: How to use the AshnaAI API in VS Code.

Tags

#API#Cursor#developers

Found this article helpful? Share it with your network.