All integrations

Use Cursor with a custom OpenAI-compatible endpoint

Cursor can send its model requests to a custom OpenAI-compatible base URL. Pointed at A2Agent it runs GLM, Kimi, DeepSeek, Qwen or MiniMax through the same key that serves your other editors.

Setup

  1. 1

    Create an API key

    Sign up and create a key in the dashboard. Trial credit covers the first requests.

  2. 2

    Override the OpenAI base URL in Cursor

    Cursor exposes a custom OpenAI base URL alongside an API key field in its model settings. Set both, then add the model id you intend to call.

    Base URL:  https://a2agent.me/v1
    API Key:   sk-your-a2agent-key
    Model:     glm-5.1
  3. 3

    Verify the endpoint before switching your workflow over

    Cursor validates the key against the endpoint when you save. A curl first tells you whether a rejection is the key, the model id or the editor.

    curl https://a2agent.me/v1/chat/completions \
      -H "content-type: application/json" \
      -H "authorization: Bearer sk-your-a2agent-key" \
      -d '{
        "model": "glm-5.1",
        "messages": [{"role": "user", "content": "Reply with OK"}]
      }'

What differs from the official endpoint

A custom base URL only redirects what the editor routes through it

Editors that host their own models generally send only part of their traffic to a custom OpenAI endpoint, keeping features such as inline completion on their own infrastructure. Check which features your version routes before assuming the whole editor is running on the gateway — the billing dashboard is the honest answer: whatever appears there is what came through.

Add the model id yourself

Custom endpoints do not advertise a model list to the editor, so the id has to be typed in. Take it from the models page and keep the case exactly — the gateway matches ids without folding case.

One key, several protocol faces

The same credential serves the Anthropic Messages API and the Gemini face, so a Cursor key also drives Claude Code or a Gemini-shaped client without a second sign-up.

Per-token billing, no seat fee

The gateway charges per token against a balance. There is no monthly fee and no minimum spend, which is a different shape from a per-seat editor subscription.

Models worth starting with

Any model in the catalogue works through this client. These are the ones with a full page covering pricing, context window and setup.

Questions

Where does Cursor take a custom endpoint?

In its model settings, alongside the API key field. Use https://a2agent.me/v1 as the base URL.

Will every Cursor feature go through the gateway?

Not necessarily. Editors commonly keep some features on their own infrastructure and route only chat-style requests to a custom endpoint. Your billing dashboard shows exactly what reached the gateway.

Which model id do I enter?

Any id from the models page, such as glm-5.1 or deepseek-v4-pro. Ids are case-sensitive.

Can I keep my existing subscription too?

Yes. The custom endpoint is a setting you can switch off, and billing here is purely per token against a balance.

Trial credit on sign-up, billed per token, no minimum spend.