Skip to content
GUIDE

How to Use Claude Sonnet 4.5 in Cursor IDE via Claudexia (2026 Setup Guide)

Step-by-step guide: connect Cursor IDE to Claude Sonnet 4.5 / Opus 4.5 / Haiku through Claudexia — settings, model aliases, tab autocomplete, and pay-as-you-go billing.

Cursor is, by a comfortable margin, the most productive AI-native editor on the market in 2026. Claude Sonnet 4.5 is, by an equally comfortable margin, the strongest general-purpose coding model. The catch is that Cursor's built-in subscription bundles a fixed quota of frontier model calls and then meters you on top of that, which gets expensive fast for anyone who actually leans on the agent. The cleanest fix is to point Cursor at a pay-per-token Claude gateway like Claudexia, keep using the exact same Cmd+K, Cmd+L, and Composer flows, and pay only for the tokens you burn.

This guide walks through the full setup end-to-end: prerequisites, API key, custom OpenAI-compatible base URL, the model aliases we recommend for daily work, enabling Claude for tab autocomplete and Composer, and the handful of errors you are statistically likely to hit on the first try.

Why Cursor + Claude is the right pairing in 2026

Two reasons, both boring and both correct.

First, Claude Sonnet 4.5 (and the newer 4.6 / 4.7 revisions in the same family) consistently lead public coding benchmarks and, more importantly, internal evals at the teams that ship a lot of code. Claude is unusually good at multi-file edits, at not lying about what it just did, and at following project conventions when given a CLAUDE.md or AGENTS.md file.

Second, Cursor's UI is built around three primitives — inline edit (Cmd+K), chat (Cmd+L), and Composer (multi-file agent) — and all three benefit directly from a stronger underlying model. Swapping the model under those primitives is exactly what custom model support is for.

Prerequisites

Before you start, confirm two things:

  1. Cursor Pro is required. The free tier and the 7-day Pro trial do not allow custom OpenAI-compatible models. You need an active paid Cursor Pro seat to expose the "OpenAI API Key" and "Override OpenAI Base URL" fields. This is a Cursor restriction, not a Claudexia one.
  2. A Claudexia account with credit on it. Claudexia is pay-as-you-go, so a small top-up (5–10 USD equivalent in SBP, crypto, or card) is plenty to test the full flow.

That is the entire setup surface. No extensions, no proxies, no local servers.

Step 1 — Get your Claudexia API key

Sign in to the Claudexia dashboard, open API Keys, and create a key scoped to "Cursor" or whatever label helps you rotate it later. Copy the key once — you will paste it into Cursor in a moment. If you ever suspect the key has leaked, revoke it from the same screen and issue a new one; Claudexia keys are independent per-application by design.

Step 2 — Point Cursor at Claudexia (OpenAI-compatible mode)

Open Cursor and go to Settings → Models. Scroll down to the OpenAI API Key section. You are going to use this even though you are calling Claude — Cursor's "OpenAI" field is really an OpenAI-compatible endpoint slot, and Claudexia exposes a fully OpenAI-compatible API surface specifically so this integration works without custom code on your side.

Configure exactly these two fields:

  • OpenAI API Key: paste the Claudexia key from Step 1.
  • Override OpenAI Base URL: https://api.claudexia.tech/v1

Toggle the override on. Do not also enable Anthropic's native API in the same Cursor profile — pick one transport and stick with it. We recommend the OpenAI-compatible mode here strictly, because Cursor's custom model registration UI is wired against the OpenAI schema, and Claudexia translates OpenAI-style requests into Claude calls server-side.

Step 3 — Add custom model aliases

This is the step most people get wrong. Cursor will not auto-discover which Claude models are available behind your gateway; you have to tell it the exact model identifiers it should send. In the same Models panel, click + Add model and add the following aliases. Each one is a real, routable model name on the Claudexia side, so what you type here is what gets billed.

AliasWhat it routes toWhen to use it
cursor47Claude Sonnet 4.6Default daily driver for Cmd+L and Composer.
cursor46Claude Opus 4.7Hard reasoning, big refactors, planning passes.
cursor45Claude Sonnet 4.5Stable fallback if 4.7 has hiccups.
cursor46sSmaller / cheaper 4.6 variantCost-sensitive multi-file edits.
cursor45sSmaller / cheaper 4.5 variantCost-sensitive chat and inline edits.
cursor45hClaude Haiku (4.5 generation)Tab autocomplete, fast edits, classification.
cursorgpt54OpenAI gpt-4o (compat)Cross-model sanity checks and second opinions.

After adding the aliases, disable the stock Cursor models you do not plan to use (the bundled gpt-4, claude-3.5-sonnet, etc.). This guarantees your shortcuts always route through Claudexia rather than silently falling back to Cursor's metered pool.

Step 4 — Verify with a chat round-trip

Open a chat with Cmd+L, pick cursor47 from the model selector, and ask anything trivial — "reply with the word ok" is enough. You should get a response in under a second. If you do, the wiring is correct and you can move on.

If you do not get a response, jump to the troubleshooting section before adding more aliases — it is much easier to debug one model than seven.

Step 5 — Enable Claude for tab autocomplete and Composer

Two final toggles to flip:

  1. Tab autocomplete model. In Settings → Features → Cursor Tab, set the completion model to cursor45h. Haiku is fast enough that you will not feel the network hop, and the cost per accepted completion is negligible.
  2. Composer / agent model. In Settings → Features → Composer, set the default model to cursor47 for everyday agent runs and cursor46 for planning-heavy sessions. Composer respects the model you pick on a per-thread basis, so you can override it for a specific refactor without touching the global setting.

That is the whole setup. Inline edit (Cmd+K), chat (Cmd+L), Composer, and tab autocomplete all now run on Claude through Claudexia, billed per token at Anthropic-matched rates.

Troubleshooting

The two errors you will almost certainly see at least once:

  • HTTP 401 / "invalid API key". Your Claudexia key is wrong, was revoked, or has a stray whitespace character on the end. Re-copy from the dashboard and paste again. Cursor does not trim trailing whitespace.
  • HTTP 404 / "model not found". The alias you typed in Cursor does not match a model registered on the Claudexia side. Re-check the exact spelling — cursor47, not Cursor47 or cursor-47. Aliases are case-sensitive.
  • Long latency on the first request. Cold cache. Send one warm-up request and the next call will be fast. This is not a bug.
  • Tab autocomplete feels slow. You probably set Composer's model (Sonnet/Opus) as the autocomplete model. Switch the autocomplete model to cursor45h (Haiku) and it will feel instant again.

What it actually costs

For a single developer who uses Cursor heavily — chat plus Composer plus tab autocomplete all day — you can expect roughly 5–20 USD per month on Claudexia at 2026 rates, assuming you pick Haiku for autocomplete, Sonnet for default chat, and Opus only when you actually need it. Heavy agent users running long Composer sessions every day land closer to the top of that range; people who use Cursor mostly for inline edits land near the bottom.

That is meaningfully cheaper than buying additional frontier-model quota inside a Cursor Pro plan, and you get exact, line-item visibility into where the spend went.

Where to go next

For the full reference (including environment variables for headless setups, team-wide key management, and the exact list of currently routable model identifiers), see the canonical setup doc at /docs/guides/cursor. It is kept in sync with every Claude model release, so bookmark it rather than this post if you expect to revisit the configuration later.