How to Use Your Own API Key With an AI Coding Agent in VS Code
To add an API key in VS Code, install the Atlarix extension, open its Settings, choose Models & keys, press + Add under Providers, pick your provider and paste the key. Atlarix checks the key before saving it, and the provider's models appear in the model picker. You pay the provider directly, with nothing added.
How to add an API key in VS Code
The same steps work in Cursor, Kiro and Windsurf.
- 1Install the extension. In the Extensions view, search for Atlarix and install it. It comes from the Visual Studio Marketplace in VS Code and from Open VSX in Cursor, Kiro and Windsurf, and it brings its own copy of the agent, so there is nothing else to install.
- 2Sign in once. Open the Atlarix view (the ant in the activity bar, or ⌘⌥A / Ctrl+Alt+A) and sign in. The account is free and keeps your chats, settings and keys the same in the editor, the desktop app and the CLI.
- 3Open Models & keys. Press the gear for Settings, then Models & keys, then + Add next to Providers.
- 4Pick the provider and paste the key. Popular providers are listed first, or search them all. The key is checked with the provider before it is saved, so a mistyped key is caught here, not in the middle of a task.
- 5Choose the model. The model picker sits under the message box. Your key's models appear there next to Atlarix Auto and the Atlarix Core models, and the one you choose applies to this chat.
Where is my VS Code API key stored?
On your computer. The key is kept by Atlarix, encrypted with your operating system's secure storage where it is available, and the Atlarix desktop app and CLI on the same computer use it too, so you connect a provider once. Requests on your key go from your computer to the provider, not through Atlarix.
Bring your own key: which providers work in an AI IDE
OpenAI, Anthropic, Google, OpenRouter, DeepSeek, xAI, Groq and Mistral are listed first, and the search finds the rest. For anything else there are two more choices:
- Your own endpoint: any API in the OpenAI-compatible or Anthropic format, with a base URL, a key and its models. This is how a company gateway or Amazon Bedrock connects.
- A model server on this computer, such as Ollama or LM Studio, with no key at all.
The same keys work in Zed and JetBrains IDEs, which run Atlarix over the Agent Client Protocol (see the editors guide).
What does it cost to use your own API key?
Atlarix adds nothing to your own key's usage: you pay the provider exactly what they charge. The usage view shows what you have spent on your own keys. If the provider rejects the key (revoked, mistyped or out of credit), the chat says so, so you know to fix the key rather than retry.
Every mode works on your own key
Build, Explore and Plan, and the /debug and /review commands, all run on your key. Edits open in the editor's diff for your Yes or No, commands wait for your approval, and plans tick off as they are built.
Which model to start with
There is no single answer, and the honest advice is to try two. Frontier models from OpenAI, Anthropic and Google are the strongest at long multi-step changes; DeepSeek and GLM are far cheaper per token and very capable for most everyday work; OpenRouter gives you one key for many providers. Because the picker is per chat, comparing them on your own code costs one extra chat.
If you would rather not manage keys at all, Atlarix Auto in the same picker chooses a model for each step for you.
Questions
- How do I add an API key in VS Code?
- Install the Atlarix extension, open Settings (the gear), choose Models & keys, press + Add next to Providers, pick the provider and paste the key. The key is checked before it is saved, and its models appear in the model picker.
- Is my API key sent to Atlarix?
- No. The key stays on your computer, and requests on it go from your computer to the provider you chose, not through Atlarix.
- Does the same key work in Cursor, Kiro and Windsurf?
- Yes. Install Atlarix from Open VSX in those editors and the steps are the same. The desktop app and CLI on the same computer use the key too.
- Can I bring my own key to an AI IDE for any provider?
- Atlarix lists the major providers and finds the rest by search. Any endpoint in the OpenAI-compatible or Anthropic format can be added with its base URL and key, and local model servers need no key.