Documentation

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

IDProviderKey from environmentGet a key
andromityAndromity gateway (default)ANDROMITY_API_KEY, set for you when you sign inNot needed for the free trial
openrouterOpenRouterOPENROUTER_API_KEYopenrouter.ai/keys
anthropicAnthropicANTHROPIC_API_KEYconsole.anthropic.com
openaiOpenAIOPENAI_API_KEYplatform.openai.com
googleGoogle GeminiGEMINI_API_KEY, then GOOGLE_API_KEYaistudio.google.com
deepseekDeepSeekDEEPSEEK_API_KEYplatform.deepseek.com
groqGroqGROQ_API_KEYconsole.groq.com
nvidiaNVIDIA NIMNVIDIA_API_KEY, then NVIDIA_NIM_API_KEYbuild.nvidia.com
ollamaOllama, on your machineNoneollama.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

  1. 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.
  2. Paste the key into the provider's card and select Save. The badge changes from Optional Key to Active.
  3. Choose a model from that provider in the Model Hub or with /model in 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:

  1. A non-empty api_key saved for that connection.
  2. The provider's environment variable.
  3. No key. The andromity connection 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:

OSPath
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 file 600. 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.toml is a sensitive file name, so read_file refuses 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 over config.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 /model in VS Code.
  • The model picker (Ctrl+L) in the terminal app.
  • --provider and --model for a single headless run:
andromity run "Fix the failing tests" --provider anthropic --model claude-sonnet-4-6

The model ID is the provider's own ID, without a prefix. Andromity adds the LiteLLM prefix itself (for example google becomes gemini/<model>).

Troubleshooting

SymptomFix
Authentication Error: Invalid or missing API keySave 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 ignoredThe connection must be named google. An entry named gemini is treated as a separate custom connection.
You have reached your free trial limitSign 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 CodeVS 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.