In short: if your day happens in the terminal and your tasks touch the whole repository, take Claude Code or Codex CLI. If you would rather see every edit and stay in a familiar editor, take Cursor, keeping one limit in mind: a third-party API connects there only on a paid plan. The rest of this post compares them by scenario and shows how to set each tool up with codexkey.
At a glance: how they differ
| Claude Code | Codex CLI | Cursor | |
|---|---|---|---|
| Interface | Terminal | Terminal | A VS Code fork |
| Made by | Anthropic | OpenAI | Cursor (Anysphere) |
| Default model | Claude | GPT | Claude, GPT, Gemini, your pick |
| The tool itself | Free | Free | Free Hobby plan with limits, paid plans from Pro |
| Custom API endpoint | Yes, through environment variables | Yes, through config.toml | Yes, but only on a paid plan |
The three tools suit different habits, so "which is better" is almost always the wrong question. The better one is: which is better for your scenario.
Terminal or IDE
Claude Code and Codex CLI never open an editor. You type in the shell and describe a task, and the agent reads the project files, edits them and, when needed, runs commands: tests, a build, a git commit. The whole exchange stays in text, in the terminal.
Cursor is built differently. It is a fork of VS Code with AI built into the interface. Edits arrive as an ordinary diff right in the open file, and you accept or reject them with one mouse move or a key. If you want to see what changes all the time and work by eye, Cursor is closer to ordinary development than a terminal agent.
A longer look at this axis, terminal against IDE, using Claude Code and Cursor as the example, is in Claude Code or Cursor in 2026.
Agency: who gets more autonomy
Claude Code and Codex CLI are close in design. Both read the whole repository, choose for themselves which files to open, edit several files in one pass and run any command in the terminal. They differ mostly in the default model family and in the ecosystem around the tool, while the working principle is shared.
Cursor's Composer is agentic too and can edit several files from one request. It is tied to the context of the project open in the editor, though, and does not get the freedom to run commands that full shell access gives a terminal agent.
Working with a large repository
On a large repository the gap between a terminal agent and an IDE shows most. A task such as "go through every API endpoint and add uniform error handling" means holding dozens of files in mind and checking after each step that nothing broke. Terminal agents with full shell access cope because they run the build and the tests after every edit and react to the result without you.
Benchmarks and measurements on specific tasks, covering Claude Code, Cursor and other tools, are collected in Comparing AI coding agents, and we do not repeat them here.
Price: subscription or tokens
Claude Code and Codex CLI are free by themselves: you install the CLI without a subscription and pay separately for the tokens of the model you connect through the API. That is pay-as-you-go, and the bill grows with actual use.
Cursor works differently. According to the official cursor.com/pricing page at the time of writing, the free Hobby plan gives a limited number of agent requests with no card, and full access starts with the Individual plan at $20 a month. Teams plans cost from $40 per user per month, and Enterprise is priced individually. If you want to pay for tokens directly and not for a subscription, one detail matters most: Cursor connects a third-party API endpoint only from the paid Pro plan up, and the Individual trial does not support that setting.
How to connect each tool to codexkey
All three tools work with the same codexkey API key, of the form sk_cdx_..., which you create under "API keys" in your account. Only the place where you paste it differs.
Claude Code
export ANTHROPIC_BASE_URL="https://api.codexkey.online"
export ANTHROPIC_AUTH_TOKEN="sk_cdx_your_key"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-sonnet-5"
The ANTHROPIC_DEFAULT_* lines are required. Without them Claude Code asks for its own default models and answers "There's an issue with the selected model". Put the variables in your shell profile, ~/.zshrc or ~/.bashrc. Details for every operating system are in the Claude Code documentation.
Codex CLI
Codex CLI installs through npm and is configured in ~/.codex/config.toml:
npm install -g @openai/codex
# ~/.codex/config.toml
model_provider = "codexkey"
model = "gpt-5.6-sol"
[model_providers.codexkey]
name = "codexkey"
base_url = "https://api.codexkey.online/v1"
env_key = "CODEX_KEY"
The key is exported as a separate variable, named in env_key:
export CODEX_KEY="sk_cdx_your_key"
One detail that is easy to forget: the base address for Codex CLI must end in /v1, because the tool expects an OpenAI-compatible endpoint. The full instructions, Windows included, are in the Codex CLI documentation.
Cursor
In Cursor a third-party API is set up in the interface and not in a file: Settings → Models → Override OpenAI Base URL. Enter https://api.codexkey.online/v1 and the API key from your codexkey account. Again, this works only on a paid plan.
codexkey also provides short model aliases for Cursor, so you do not type the full model ID by hand: for example cursor46s for Claude Sonnet 4.6, or cursor45h for the cheapest model, gpt-5.6-luna. The alias list and a step-by-step setup are in the Cursor documentation.
Which to pick for your scenario
- Terminal and a large repository. Claude Code or Codex CLI, depending on which model family you are used to.
- You already live in the OpenAI and Codex ecosystem. Take Codex CLI: the config and the workflow are familiar, and through codexkey it runs GPT models from the same balance.
- You need visual control over every edit. Cursor, if you are ready to pay for Pro to get third-party API support.
- The budget is tight and the workload varies. Terminal agents billed per token: there is no flat monthly payment ticking away in the quiet weeks.
If your question is wider and covers choosing an AI model or a tool for vibe coding in general, beyond these three, see the overview Best AI tools for vibe coding in 2026. Alternatives to Claude Code itself, free and open source ones included, are covered in Claude Code alternatives in 2026.
FAQ
Is Codex CLI free?
The tool itself is, and it installs without a subscription. You pay for the tokens of the model you connect it to, whether directly at OpenAI or through a gateway such as codexkey.
Can I use Claude in Codex CLI?
Yes, if you set up a provider in config.toml whose base address points to the OpenAI-compatible codexkey endpoint. Codex CLI is not nailed to OpenAI models once the provider is configured by hand.
Why does my API key not work in Cursor on the free plan?
Because Cursor offers a third-party API endpoint only from the paid Pro plan. On the free Hobby plan and during the trial that setting is closed, whatever key you enter.
What is better for a large legacy repository?
Usually terminal agents with full shell access, Claude Code or Codex CLI: they cope better when you need many files in front of you and a build after every step. Cursor is more convenient when an edit is local and fits in one or two files.
Can I use Cursor, Codex CLI and Claude Code at the same time?
Yes, nothing stops you from keeping all three and switching by task. There is one codexkey key for all the tools, so billing stays unified even if you change tools during the day.
How do I pay for any of these tools from Russia?
Codex CLI and Claude Code need no subscription, and you pay for API tokens. codexkey accepts payment through SBP (the Russian Faster Payments System), Russian cards and crypto, with top-ups from $1. For Cursor you still have to buy the subscription directly from Cursor: codexkey covers only the cost of the model's tokens, once a third-party API is configured on a paid plan.