Cline is an open-source agent for VS Code. It reads your repository, edits files and runs commands in the terminal. It is not tied to one provider: give it your own endpoint and it behaves just as it would with direct Anthropic or OpenAI access.
Step 1. Install the extension
Open the Extensions panel in VS Code (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows and Linux), search for Cline and click Install. When it finishes, a new icon shows up in the sidebar. That is where the chat with the agent opens.
Step 2. Get a codexkey key
Sign up at codexkey and create an API key in the dashboard. The key looks like sk_cdx_.... One key covers both Claude and GPT models, so you do not need a separate key per provider.
Step 3. Configure the provider in Cline
Open Cline's settings with the gear icon at the top of the chat panel. The API Provider field gives you two options that work.
Anthropic with a custom base URL. Choose the Anthropic provider, switch on Use custom base URL and paste https://api.codexkey.online. Enter your sk_cdx_... in the API Key field. This route keeps the Anthropic format and fits if you work with Claude models.
OpenAI Compatible. Choose this provider if you want to switch between Claude and GPT inside one extension. The Base URL is https://api.codexkey.online/v1, the API Key is the same key, and in the Model ID field you type the model you want, for example claude-sonnet-5 or gpt-4.1.
Step 4. Pick a model
What the model dropdown shows depends on the provider. With Anthropic you get the standard Claude lineup, with OpenAI Compatible a free-text field for the model name. Sonnet is a sensible default for everyday coding, and for a genuinely hard refactor you can move to Opus in the same extension without changing the key.
Step 5. Check that it works
Open any project and give the agent something simple, like "add a test for this function." It should propose a plan and ask for confirmation before it touches files. If a reply comes back and Cline can see the project structure, the setup is done.
To test the key on its own, apart from the extension, send a request from the terminal:
curl https://api.codexkey.online/v1/messages \
-H "x-api-key: sk_cdx_your_key_here" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-5","max_tokens":100,"messages":[{"role":"user","content":"hello"}]}'
Common problems
A 401 almost always means the key was pasted with a stray space or cut off while copying. Copy the whole key again from the dashboard and paste it into the settings afresh.
If the model hangs silently with no reply, the base URL is usually wrong: /v1 is missing for the OpenAI Compatible provider, or it was added for Anthropic, where it is not needed.
If Cline asks for confirmation on every single action and that wears you out, the cause is the extension's settings, not the provider. Cline has an auto-approve mode for file reads and for commands you consider safe.
In short
Cline is not locked to one provider, so moving to codexkey means changing two fields in the settings: the base URL and the key. The Anthropic provider keeps the Claude format, while OpenAI Compatible also opens up GPT under the same key. If something stops answering, check the key first, then whether /v1 is where it belongs: nine times out of ten that is the cause.