API Keys and Providers
Connect Andromity to Anthropic, OpenAI, Google Gemini, DeepSeek, Groq, OpenRouter, NVIDIA NIM or Ollama with your own API key, or use the built-in Andromity gateway. Where keys are stored, which environment variables are read, and in what order.
Andromity reaches models through connections. Each connection has an ID, an adapter type, and optionally an API key, base URL and model. Nine connections are built in; you can add your own for any other OpenAI-compatible or LiteLLM-supported endpoint (see Custom providers).
Built-in connections
| ID | Provider | Key from environment | Get a key |
|---|---|---|---|
andromity | Andromity gateway (default) | ANDROMITY_API_KEY, set for you when you sign in | Not needed for the free trial |
openrouter | OpenRouter | OPENROUTER_API_KEY | openrouter.ai/keys |
anthropic | Anthropic | ANTHROPIC_API_KEY | console.anthropic.com |
openai | OpenAI | OPENAI_API_KEY | platform.openai.com |
google | Google Gemini | GEMINI_API_KEY, then GOOGLE_API_KEY | aistudio.google.com |
deepseek | DeepSeek | DEEPSEEK_API_KEY | platform.deepseek.com |
groq | Groq | GROQ_API_KEY | console.groq.com |
nvidia | NVIDIA NIM | NVIDIA_API_KEY, then NVIDIA_NIM_API_KEY | build.nvidia.com |
ollama | Ollama, on your machine | None | ollama.com |
Use the ID, not the brand name, wherever a provider is named: /keys set google ..., provider = "google", andromity run --provider google.
Mistral, Cerebras, Azure OpenAI, LM Studio, vLLM, LiteLLM proxy and other endpoints are not built in. Add them as custom providers.
The Andromity gateway
A new install uses the andromity connection with the model auto, so you can start without a key. Requests go to https://gateway.agenticmarket.dev/v1, which forwards them to free upstream models and falls back to another upstream when one fails. The gateway does not store prompts, source code or completions. See Edge gateway for how it works.
- Without signing in you get an anonymous free trial with a daily limit.
- Signing in with an AgenticMarket account raises the limit. In VS Code, open Settings → API Keys & Connectors and select Sign In with AgenticMarket on the Andromity card. The terminal app has no sign-in; it uses the anonymous trial or your own keys.
- Limits count turns per UTC day and reset at 00:00 UTC. When you reach one, the error card shows when the quota resets and offers Sign In, Open Settings and Switch Model.
For unlimited use, add your own key for any other provider.
Add a key in VS Code
- Run Andromity: Settings & API Keys from the Command Palette, or select the gear at the top of the Andromity chat view. Settings opens on API Keys & Connectors.
- Paste the key into the provider's card and select Save. The badge changes from Optional Key to Active.
- Choose a model from that provider in the Model Hub or with
/modelin chat.
Saved keys are never shown again; the field reads (Configured). Andromity does not test a key when you save it. If it is wrong, the next request fails with an Authentication Error card that links back to Settings.
To remove a key, clear the field and select Save.
The first-run Connect your AI card in the chat view saves a key the same way and selects that provider.
Add a key in the terminal app
/keys # show which providers have a key
/keys set anthropic sk-ant-... # save a key
/keys set google AIza.../keys lists each built-in provider as configured (with the first and last characters of the key) or not set (with the environment variable it would read). Custom connections are not listed.
You can also save keys in Settings (Ctrl+E) → API Keys, then Save All, or in the model picker (Ctrl+L) with Paste API key… and Connect.
Use environment variables
If a connection has no api_key in config.toml, Andromity reads the environment variable listed in the table above. The order is:
- A non-empty
api_keysaved for that connection. - The provider's environment variable.
- No key. The
andromityconnection then uses the anonymous trial.
To keep a key out of the file but still choose which variable it comes from, set api_key to $ followed by the variable name:
[[providers]]
name = "anthropic"
type = "anthropic"
api_key = "$WORK_ANTHROPIC_KEY"If that variable is not set, the connection has no key. It does not fall back to ANTHROPIC_API_KEY.
The VS Code extension starts the Andromity engine as a child process, so the engine sees the environment VS Code was started with. After setting a variable in your shell profile, restart VS Code (or start it from that shell) before expecting the key to work.
Where keys are stored
Keys you save are written to config.toml:
| OS | Path |
|---|---|
| Windows | %APPDATA%\andromity\config.toml |
| macOS and Linux | ~/.andromity/config.toml |
Set ANDROMITY_CONFIG_DIR to use a different folder on any OS. Each connection is a [[providers]] table:
[default]
provider = "anthropic"
model = "claude-sonnet-4-6"
[[providers]]
name = "andromity"
type = "andromity"
base_url = "https://gateway.agenticmarket.dev/v1"
[[providers]]
name = "anthropic"
type = "anthropic"
api_key = "sk-ant-..."
[[providers]]
name = "ollama"
type = "ollama"
base_url = "http://localhost:11434"Things to know about this file:
- Keys are stored in plain text. On macOS and Linux Andromity makes the folder readable only by you (
700) and the file600. On Windows the file has your user profile's permissions. Don't commit it, sync it to shared storage or paste it into issues. - The agent cannot read it.
config.tomlis a sensitive file name, soread_filerefuses it in every mode. - Commands and MCP servers don't get your keys. Provider key variables (
ANTHROPIC_API_KEY,OPENAI_API_KEY,GEMINI_API_KEY,GOOGLE_API_KEY,DEEPSEEK_API_KEY,GROQ_API_KEY,OPENROUTER_API_KEY,NVIDIA_API_KEY,NVIDIA_NIM_API_KEY,ANDROMITY_API_KEY) are removed from the environment of commands the agent runs and of local MCP servers. - Comments are not kept. Andromity rewrites the whole file whenever a setting is saved, so comments you add by hand disappear.
- Check the syntax after editing by hand. If the file can't be parsed, Andromity keeps a copy as
config.toml.unreadable-<time>in the same folder, starts with default settings, and VS Code shows a warning with Open Saved Copy. Fix the copy's syntax, copy it overconfig.toml, and restart Andromity to get your keys back.
In VS Code, your AgenticMarket sign-in token is also kept in VS Code's Secret Storage. Sign Out removes it from both places.
Choose the active provider and model
The active connection and model are [default] provider and [default] model in config.toml. Change them with:
- The Model Hub (Select Model) or
/modelin VS Code. - The model picker (Ctrl+L) in the terminal app.
--providerand--modelfor a single headless run:
andromity run "Fix the failing tests" --provider anthropic --model claude-sonnet-4-6The model ID is the provider's own ID, without a prefix. Andromity adds the LiteLLM prefix itself (for example google becomes gemini/<model>).
Troubleshooting
| Symptom | Fix |
|---|---|
| Authentication Error: Invalid or missing API key | Save the key again in Settings, or check that the environment variable is visible to VS Code (see above). |
A Gemini key in config.toml is ignored | The connection must be named google. An entry named gemini is treated as a separate custom connection. |
| You have reached your free trial limit | Sign in with AgenticMarket, add your own key, or wait for the reset at 00:00 UTC. |
| A key works in your shell but not in VS Code | VS Code was started before the variable was set. Restart VS Code. |
/keys set in the VS Code chat does nothing | /keys is a terminal-app command. In VS Code, use Settings → API Keys & Connectors. |
Install Andromity for VS Code and Terminal
Install the Andromity AI coding agent from the VS Code Marketplace, with pipx, or with the install script on Windows, macOS, and Linux, then verify the setup.
Model Hub
Browse, search, filter, pin and select models from every connected provider in Andromity's Model Hub, and learn where the model list, context windows and prices come from.