OhMyGPT
Coding Tools

Cursor

Use OhMyGPT models in Cursor chat and agent with your OhMyGPT key.

Cursor's chat and agent can run on any OhMyGPT model. Enter your OhMyGPT key and one base URL in Cursor's settings, add the model IDs you want, and they appear in the model picker next to Cursor's own.

Configure

  1. Open Cursor Settings → Models and expand API Keys.
  2. Paste your OhMyGPT key into OpenAI API Key and turn the key on.
  3. Turn on Override OpenAI Base URL and enter https://api.ohmygpt.com/v1.
  4. In the model list on the same page, add a custom model and type an OhMyGPT model ID exactly as GET /v1/models lists it, for example anthropic/claude-sonnet-5-5.
  5. Pick that model in the chat model selector.
SettingValue
OpenAI API Keyyour OhMyGPT key
Override OpenAI Base URLhttps://api.ohmygpt.com/v1
Modelan ID from Choose a model

Cursor sends these requests from its own servers, so your key and prompts pass through Cursor on their way to OhMyGPT.

What runs on OhMyGPT

  • Chat and agent requests for the model IDs you added.
  • Cursor's built-in OpenAI models, while the override is on. Turn the override off to use them on your Cursor plan.

Tab completion and Cursor's other built-in models keep running on Cursor's own service.

Check the connection

Cursor sends Chat Completions requests. Send one to the free test model ohmygpt/mock:

curl https://api.ohmygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $OHMYGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "ohmygpt/mock", "messages": [{"role": "user", "content": "ping"}]}'
{
  "id": "chatcmpl-ohmygpt-mock",
  "object": "chat.completion",
  "model": "mock",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "This is a mock reply from OhMyGPT. Your integration works; switch to a real model when ready."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 15, "completion_tokens": 17, "total_tokens": 32 }
}

To check Cursor's side for free, add ohmygpt/mock as a custom model and send a chat message; the reply above appears in the chat. The mock is available once your account has been topped up.

Choose a model

Every chat model works with Cursor:

curl -s https://api.ohmygpt.com/v1/models \
  | jq -r '.data[] | select(.available and any(.protocols[]?; .id == "openai-completions")) | .id'

Use the full ID, including the creator prefix (anthropic/, openai/, zhipu/ and so on). Prices for each are on the Models page.

Troubleshooting

SymptomCauseFix
404 on every requestThe base URL is missing /v1, or ends in /chat/completionsEnter exactly https://api.ohmygpt.com/v1
401 with Invalid API keyThe key in OpenAI API Key is mistyped or was deletedCopy a key from API keys
404 saying the model does not existThe custom model name is not an OhMyGPT IDCopy the ID from GET /v1/models
Requests still go to OpenAIOverride OpenAI Base URL is offTurn it on
402The balance or the key's spending limit is used upTop up at Billing

Every response carries an X-Request-ID header, and Usage shows what each request cost.

On this page