Configure Your AI Coding Tools
llm-setup is a one-time configurator that points your AI coding tools at LLM API (https://api.llmapi.ai/v1) in a single interactive run. Answer a few questions and it writes the right config into every tool you pick — no manual config editing, no key pasting into a dozen places.
A few things to know upfront:
- Nothing gets installed — it's a single script that writes config and exits
- Your API key is stored once, in a private env file that every tool's config references
- Safe to re-run — updates your choices, never duplicates anything
- Everything is backed up first and
--uninstall reverses the whole thing
How It Works
llm-setup is not part of the request path. It runs once, writes config files and environment variables, then exits. From that point on, each tool (Claude Code, Cursor, Aider, …) sends requests directly to LLM API — the script is no longer involved.
LLM API is a gateway, not a model. Tools talk to a single OpenAI/Anthropic-compatible endpoint using one key, and LLM API forwards the request to the actual upstream provider (OpenAI, Anthropic, AWS Bedrock, Google, …). One key + one URL = access to every model from every vendor.
For tools with writable config files (opencode, Claude Code, Aider, Goose, Zed, …) the script writes config automatically. For GUI tools and editor extensions (Cursor, Cline, JetBrains AI, …) it prints the exact copy-paste steps, because their settings live in app state that can't be written reliably from a script.
Prerequisites
| Dependency |
Required |
What for |
bash 4+ |
Yes |
Associative arrays (macOS: brew install bash) |
curl |
Yes |
Fetching the model list from the gateway |
jq |
Yes |
Safe merging of JSON configs |
fzf |
No |
Fuzzy multi-select menus; numbered prompts without it |
# Debian / Ubuntu
sudo apt install -y jq fzf
# macOS
brew install jq fzf
Quick Start
### Run the configurator
```bash
curl -fsSL https://llmapi.ai/install | bash
```
On Windows (PowerShell):
```powershell
irm https://llmapi.ai/install.ps1 | iex
```
Common flags:
```bash
curl -fsSL https://llmapi.ai/install | bash # interactive setup (detected tools only)
curl -fsSL https://llmapi.ai/install | bash -s -- --all # show full tool list regardless of what's installed
curl -fsSL https://llmapi.ai/install | bash -s -- --uninstall # uninstall
curl -fsSL https://llmapi.ai/install | bash -s -- -v # version
curl -fsSL https://llmapi.ai/install | bash -s -- -h # help
```
### Enter your API key
The script prompts for your LLM API key — input is hidden as you type. The key is saved to `~/.config/llm-setup/env.sh` (readable only by you). Every config the script writes points back to that file, so you never paste your key into multiple places.
Get your key from the [LLM API dashboard](https://app.llmapi.ai/dashboard/api-keys).
### Pick your tools
By default you see only tools detected on your machine — CLIs on your `PATH`, installed VS Code extensions, known app folders. Use `--all` for the full catalogue.
- **With `fzf`**: TAB to toggle, Ctrl-A for all, Enter to confirm
- **Without `fzf`**: type numbers like `1,3,7-9` or `all`
### Pick your models
The script calls `GET /models` on the gateway and shows everything your key can access. Same multi-select interface as the tool picker — start typing to filter with `fzf`, or type text to filter in the numbered fallback.
INFO
If the script can't reach the gateway, you can enter model names manually, comma-separated.
### Add a routing prefix (optional)
To pin every model to a specific upstream provider, type a prefix — for example `aws-bedrock`. Leave blank to skip.
```
Model prefix (blank for none): aws-bedrock
```
With a prefix, `claude-sonnet-4-6` becomes `aws-bedrock/claude-sonnet-4-6` in every config written. See [provider routing](/features/routing).
### Review the configs
Each tool's config is shown one at a time. For tools configured directly, the file is already written — you're just reviewing. For GUI-only tools, the slide shows the exact copy-paste steps. Press Enter to move to the next.
### Load the env into your shell
The script offers to add one small block to your shell startup file (`~/.bashrc`, `~/.zshrc`, or fish config) that loads the env file automatically. Say yes and every new terminal is set up.
WARN
The rc block only applies to **new** shells. Terminals that are already open — including the one you ran the installer in — need `source ~/.bashrc` (or a restart) before the variables appear. GUI apps launched from a desktop icon don't read shell rc files at all: launch them from a terminal if they need the env (see the Zed note below).
To load it yourself:
```bash
source ~/.config/llm-setup/env.sh # bash / zsh
source ~/.config/llm-setup/env.fish # fish
```
Supported Tools
Configured automatically
The script writes the config file for you. Existing files are merged, never overwritten:
| Tool |
Config location |
| opencode |
~/.config/opencode/opencode.json (merged with jq) |
| Codex CLI |
~/.codex/config.toml |
| Aider |
~/.aider.llmapi.conf.yml |
| Zed |
~/.config/zed/settings.json (merged with jq; JSONC comments stripped) |
| Continue |
~/.continue/config.json (merged) or a fresh config.yaml |
| Goose |
~/.config/goose/config.yaml |
| Claude Code |
env vars (see note below) |
Setup instructions printed
These store settings in app state or editor extensions that a script can't safely write. For each one the script prints where to find the setting and the exact values to paste:
Cursor · Windsurf · Void · PearAI · Aide · Trae · Warp · JetBrains AI · Factory (droid) · Cline · Roo Code · CodeGPT · Augment Code · Refact AI · Pieces · Tabby · Bito · Open Interpreter
INFO
Environment variables only help tools that read them. GUI and editor-extension tools still need the printed manual steps.
Environment Variables Written
The script exports only the variables the tools you picked actually need — so it won't shadow a real key for tools you didn't choose:
| Variable |
Written when |
Used by |
LLMAPI_API_KEY |
always |
opencode, Codex, Zed |
OPENAI_API_KEY |
Aider / Goose / Open Interpreter selected |
those tools |
OPENAI_HOST |
Goose selected |
Goose |
OPENAI_API_BASE |
Open Interpreter selected |
Open Interpreter |
ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN |
Claude Code selected |
Claude Code |
ANTHROPIC_DEFAULT_OPUS_MODEL / …_SONNET_MODEL / …_HAIKU_MODEL |
Claude Code selected |
Claude Code |
Claude Code Note
Claude Code speaks Anthropic's /v1/messages protocol and appends /v1/messages itself to ANTHROPIC_BASE_URL. The script deliberately strips /v1 from the base URL for this reason:
| Tool type |
Base URL |
| OpenAI-compatible tools |
https://api.llmapi.ai/v1 |
Claude Code (ANTHROPIC_BASE_URL) |
https://api.llmapi.ai (no /v1) |
WARN
If you set ANTHROPIC_BASE_URL with /v1, requests go to /v1/v1/messages and return 404.
Zed Note
The script registers LLM API as its own provider under language_models.openai_compatible.llmapi in ~/.config/zed/settings.json, and points agent.default_model at your default model — unless you already default to a different provider, in which case your choice is left untouched.
- JSONC is handled. Zed writes
settings.json with comments and trailing commas; the merge strips them first, so every setting survives — but comments don't (the backup keeps them). Only a file that still won't parse falls back to a printed snippet.
- The key is
LLMAPI_API_KEY. Zed derives the env var from the provider entry name, and the env file always exports it — your real OPENAI_API_KEY is never shadowed.
- Launch Zed from a terminal, not the desktop icon (macOS / Linux). A GUI launch doesn't inherit shell env, so Zed won't see the key. Open a new terminal after the install (or
source ~/.bashrc in the current one) and run zed from it — or paste the key once in the Agent Panel's llmapi provider (stored in the OS keychain; a non-empty env var takes precedence). On Windows the key is a User environment variable, so GUI-launched Zed picks it up.
Older llm-setup versions overrode Zed's built-in openai provider instead — re-running migrates that entry to the new format automatically.
Windows (PowerShell)
llm-setup.ps1 gives the same flow on Windows PowerShell 5.1 and 7+, no extra dependencies:
irm https://llmapi.ai/install.ps1 | iex
Under irm … | iex there's no local file, so flags are passed as environment variables instead:
irm https://llmapi.ai/install.ps1 | iex # interactive setup
$env:LLM_SETUP_API_KEY = "sk-…"; irm https://llmapi.ai/install.ps1 | iex # supply the key without a prompt
$env:LLM_SETUP_ALL = "1"; irm https://llmapi.ai/install.ps1 | iex # show the full tool list
On Windows the key is stored as a user environment variable (so GUI apps and editors pick it up) and written to %USERPROFILE%\.config\llm-setup\env.ps1.
WARN
The PowerShell version does not yet include --uninstall or the routing-prefix step.
Uninstall
curl -fsSL https://llmapi.ai/install | bash -s -- --uninstall
After confirmation it reverses what a previous run wrote, backing up every user-owned file to *.bak.<epoch>:
- Strips your key from
env.sh / env.fish, removes ~/.config/llm-setup/ if empty
- Removes the shell-rc block from
~/.bashrc, ~/.zshrc, and fish config
- Removes the
llmapi provider from opencode JSON, the Codex TOML stanza, and the Aider provider file
- Removes the
llmapi provider from Zed's settings.json (including the agent default model if it points at it, and the legacy built-in-openai override older versions wrote) — when the file parses as strict JSON, which is what the installer writes; if you've added comments since, it's listed for manual review instead
- Lists Continue YAML and Goose configs for manual review — those files are intertwined with user-owned settings
Safe to re-run: anything already removed is silently skipped.
Troubleshooting
No supported tools detected
The script found none of the known tools on your system. Run with --all to pick from the full list manually.
Could not fetch models
Check the base URL and API key. The script will offer manual comma-separated entry — you can continue that way.
Claude Code returns 404 on /v1/v1/messages
ANTHROPIC_BASE_URL has /v1 in it somewhere. It must be set to https://api.llmapi.ai — Claude Code appends the path itself.
Pasted key fails or registers as one character
The VS Code integrated terminal can mangle input into hidden prompts. Run the script in a real terminal, type the key instead of pasting, or set curl -fsSL https://llmapi.ai/install | LLM_SETUP_API_KEY=... bash.
Zed asks for an API key / models don't respond
Zed was launched from the GUI (desktop icon), which doesn't inherit shell env — or from a terminal opened before the install. Open a new terminal (or source ~/.bashrc) and start zed from it, or paste the key once in the Agent Panel's llmapi provider. Note that a non-empty LLMAPI_API_KEY env var takes precedence over a pasted key.
Aider picks up the wrong key
Its config is written to a per-provider file so it won't collide with a real OPENAI_API_KEY. Run it explicitly: aider --config ~/.aider.llmapi.conf.yml
Codex stanza wasn't overwritten
If [model_providers.llmapi] already exists in ~/.codex/config.toml, the script leaves it untouched. Delete the stanza manually and re-run.
Running in CI / without a terminal
Feed answers from a file: curl -fsSL https://llmapi.ai/install | LLM_SETUP_INPUT=answers.txt bash — one answer per line instead of /dev/tty.