All guides / Coding assistants

Use XHuoAPI in Cursor

Cursor lets you bring your own API key and redirect OpenAI-format requests to any OpenAI-compatible endpoint. The whole setup is three fields: API key, base URL, model ID.

Before you start

Verify first

Before touching the tool, confirm the key and model work with curl. This rules out half of the 'I configured it and nothing happens' cases.

curl https://api.xhuoapi.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v3.2","messages":[{"role":"user","content":"ping"}]}'

Steps

1

Open Settings with Cmd+Shift+J (macOS) or Ctrl+Shift+J (Windows/Linux), go to Models and find the API Keys section.

2

Paste your XHuoAPI key into the OpenAI API Key field. Cursor uses this field to authenticate against the overridden endpoint even if you never call an OpenAI model.

3

Tick Override OpenAI Base URL and enter the URL below in the field that appears.

https://api.xhuoapi.ai/v1
4

Back in the Models list, click Add model and type a model ID such as deepseek-v4-pro, then pick it from the model selector in chat.

Notes

Known limitation: with Override enabled, Cursor routes every OpenAI-family request to your endpoint, including subscription models picked from the built-in selector. Turn Override off temporarily when you want those. Cursor staff have confirmed this is the current behaviour.
Tab autocomplete is unaffected; it always uses Cursor's own backend.
Stop the base URL at /v1. Do not append /chat/completions; the client adds that path itself and you will get a 404 if you include it.
The model ID must match the pricing page exactly (deepseek-v4-pro, not DeepSeek V4 Pro). Case and hyphens matter.

Commonly used models

These are common choices for this kind of tool; click a model to see its price in each tier. The full list is on the pricing page.

Steps follow the tool's current official documentation; the UI may change after updates. Tell us if something no longer matches.