Help · Documentation

Set Up Your API With Coding Agents

Choose Codex CLI or Claude Code, install the client, connect it with an API token from the API Access page, then run it inside a real project folder.

AeroLink CLI

OPENAI-COMPATIBLE

The AeroLink terminal coding agent, running on your machine through your gateway.

OpenAI-compatible base URL

https://aeroai.ink/v1

Anthropic-compatible base URL

https://aeroai.ink

AeroLink AI CLI - Windows

Watch the full walkthrough first:

AeroLink AI CLI is an AI coding agent for your AeroLink account. It runs in your terminal: you ask in plain language, and it reads your project, writes the code and runs your tests - every request goes through your own AeroLink Gateway, and the only models you can use are the models your Gateway offers.

Let's get started.

Prerequisites

To use AeroLink AI CLI in your terminal, you'll need:

  1. PowerShell (Command Prompt works too - see below).
  2. An AeroLink API key from API Access in your dashboard (it starts with sk-).

You need nothing else - no Node.js, no Bun, no Git, no other AI tool.

Install

Open PowerShell and run:

powershell
irm https://aeroai.ink/cli/install.ps1 | iex

Already using Command Prompt? Run this instead:

cmd
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://aeroai.ink/cli/install.ps1 | iex"

The installer verifies the download checksum, installs aerolink.exe into %LOCALAPPDATA%\AeroLink\bin and adds that folder to your PATH.

Configure

The quickest connection is from your dashboard: open API Access and press Set Up AeroLink CLI. Pick the key the CLI will use and the model it will run, and you get one command - no key to copy, no configuration file to write:

powershell
powershell -ExecutionPolicy Bypass -Command '$env:AEROLINK_SETUP_CODE=''XXXX-XXXX-XXXX-XXXX-XXXX-XXXX''; irm https://aeroai.ink/cli/setup-aerolink.ps1 | iex'

On macOS or Linux:

bash
AEROLINK_SETUP_CODE='XXXX-XXXX-XXXX-XXXX-XXXX-XXXX' bash -c "$(curl -fsSL https://aeroai.ink/cli/setup-aerolink.sh)"

The setup checks that the CLI is installed, exchanges the one-time setup code over HTTPS and lets the CLI write its own configuration. The code works once and expires after 15 minutes; your API key is never part of the command.

Or configure it yourself - one command connects everything - the Base URL, your API key, and the model catalog:

powershell
aerolink login --base-url https://aeroai.ink/v1 --api-key sk_your_token_here

AeroLink checks the key against your Gateway (GET /v1/models), saves the connection and the model catalog on your computer, picks the first model as default and prints:

text
1Connected - 2 models available (https://aeroai.ink/v1).
2  Default model: aerolink/claude.fable.5
3
4  Next: run "aerolink" to start the coding agent.

Prefer not to put the key on the command line? Run plain aerolink login and paste when asked - it asks for the Gateway URL followed by the key (the same flow is the /connect command inside the TUI). Prefer the one-command setup instead: Set Up AeroLink CLI in API Access does the whole thing with a one-time code. Scripts can set AEROLINK_BASE_URL + AEROLINK_API_KEY instead.

Priority when several sources exist: --api-key flag, then environment, then the saved configuration.

Initialize

Now that you're connected, navigate to a project you want to work on:

powershell
cd C:\path\to\project

And launch:

powershell
aerolink

The interface opens immediately, ready to use - your default model and Gateway: connected are shown at the top. Nothing else to configure.

Usage

You are now ready to use AeroLink AI CLI. If you are new to using an AI coding agent, here are some examples that might help.

Ask questions

> list the files of this project and explain what it does

Add features

Give it enough detail to understand what you want - talk to it like you are talking to a junior developer on your team:

> add a unit test for the add() function

Make changes

For straightforward changes, ask it to build directly, pointing at an existing example to follow:

> the test fails - find out why and fix it

AeroLink works inside the folder it was started in: it reads and edits your files and runs your commands, and it asks before it changes anything or runs a command.

One-shot mode (no interface)

powershell
aerolink run "summarize this repository in five bullet points"

aerolink run prints the answer and exits - useful in scripts and pipelines. Add --auto to approve the tool calls it needs without asking.

Start over

/undo reverts the changes of the last turn, /new starts a fresh session, Ctrl+C cancels the running task.

Models - yours only

AeroLink AI CLI shows only the models your AeroLink Gateway offers. There is no built-in model catalog and no third-party provider: the list comes from your Gateway at login time and is refreshed with:

powershell
aerolink models

Inside a session, /models opens the picker (your Gateway models only). The default model is the one aerolink login saved; AeroLink never swaps in a different model behind your back. If your Gateway stops offering your default model, AeroLink tells you and keeps the selection until you choose another with /models.

Customize

  • /themes changes the look, /settings the editor and behaviour.
  • /agents switches between specialized agents; /variants changes the thinking effort.
  • /mcps, /plugins and /skills extend the agent with MCP servers, plugins and skills.
  • Project-level configuration lives in an aerolink.json file in your project root.

Everyday commands

CommandWhat it does
aerolinkopen the coding agent in the current folder
aerolink run "<task>"run one task, print the result, exit
aerolink modelslist the models your Gateway offers
aerolink loginconnect (or reconnect) to your Gateway
aerolink doctorcheck installation, configuration and Gateway connectivity
aerolink configshow your settings (the API key is never printed)
aerolink config set model aerolink/<id>change the default model
aerolink session listlist saved sessions
aerolink uninstallremove the configuration

Inside a session:

CommandWhat it does
/modelspick one of your Gateway models
/connectset or change the Gateway connection (Base URL + key)
/new , /sessionsstart a fresh session , resume an old one
/undo , /redorevert , re-apply the changes of the last turn
/diffreview the changes of this session
/usageshow the usage your Gateway reported
/helpshow every command
/exitleave

What the agent can do

The agent lists, reads and searches your files, writes and edits files, and runs commands in the project folder. Reading, listing and searching are always allowed inside the project folder; creating or editing a file and running a command need your approval - AeroLink shows what it wants to do and waits for your answer. Anything outside the project folder is refused.

Where things are stored

PathContents
%USERPROFILE%\.config\aerolink\aerolink.jsonGateway Base URL, API key, default model, model catalog (owner-only permissions)
%USERPROFILE%\.local\share\aerolink\aerolink.dbyour sessions and history
%LOCALAPPDATA%\AeroLink\bin\aerolink.exethe executable

The API key is never printed and never logged: every command that shows it prints a masked form only.

Fix Old API Gateway Configuration

If this computer was configured with another API provider before, or you tried an older AeroLink setup, those old settings can still override your new one. That is why you can have a perfectly valid AeroLink key and still see Invalid API Token or 401 Unauthorized.

AeroLink CLI reads settings in this order:

  1. command-line flags (aerolink login --base-url…)
  2. environment variables (for example AEROLINK_API_KEY)
  3. your saved configuration (…\.config\aerolink\aerolink.json)

So an old environment variable wins even when your saved config is correct.

Symptoms and cause

What you seeWhat it meansFix
Invalid API token / 401 UnauthorizedThe key the CLI used was rejected — usually the old environment variable, not the one you savedRemove or update the old variable (steps 4–6 below)
Could not reach / connection failureThe Base URL is wrong or points at a removed GatewayRemove or update AEROLINK_BASE_URL
aerolink doctor prints API key from AEROLINK_API_KEYThe environment key is winningRemove or update the variable
Config looks correct, still 401Your shell never reloading the variable after installOpen a new terminal

1 — Back up your existing configuration

Do not delete anything first. Make a copy of your current folder:

powershell
1$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
2$backup = "$env:USERPROFILE\.config\aerolink.backup-$stamp"
3Copy-Item "$env:USERPROFILE\.config\aerolink" -Recurse -Destination $backup -Force

Backups contain your key. Keep the backup folder private; you can delete it once AeroLink works.

2 — List conflicting environment variables (names only)

This command prints variable names, never values:

powershell
Get-ChildItem Env: | Where-Object Name -match '^(AEROLINK|ANTHROPIC|OPENAI|CODEX|CLAUDE|API_KEY)' | Select-Object -ExpandProperty Name

3 — Check what AeroLink is using

powershell
1aerolink doctor
2aerolink config
  • …\aerolink.json shows the Gateway Base URL and whether the key is usable.
  • aerolink doctor tells you which key is in effect and whether the Gateway accepts it.

If doctor says API key from AEROLINK_API_KEY, your environment is overriding the saved config.

4 — Remove only the conflicting environment variables

Remove only the variables that point at the old Gateway. These three are safe to remove if you do not use them for anything else:

powershell
1[Environment]::SetEnvironmentVariable("AEROLINK_API_KEY", $null, "User")
2[Environment]::SetEnvironmentVariable("AEROLINK_BASE_URL", $null, "User")

If you need to keep them, update them to your current Gateway instead — do not leave an old value in place:

powershell
[Environment]::SetEnvironmentVariable("AEROLINK_API_KEY", "YOUR_API_KEY", "User")

Do not touch variables you do not recognize — those belong to Claude Code, Codex, OpenCode or other apps.

Open a new PowerShell window after changing them — the current window keeps the old values.

5 — Point AeroLink at your Gateway

If the saved config is still wrong (or you want to start fresh with your new key), do the connect flow again:

powershell
aerolink login

Paste the configuration code from API Access → Set Up AeroLink CLI (or press the button again for a fresh one).

6 — Verify

powershell
aerolink doctor

You should see the Gateway reachable and your models listed. If it still fails, verify that AEROLINK_API_KEY is set to the current value (new window) or clear it and repeat from step 4.

Restoration

To restore the backup exactly as it was:

powershell
Copy-Item "$backup\*" -Recurse -Destination "$env:USERPROFILE\.config\aerolink" -Force

If you prefer a clean start, leave the backup untouched and press Set Up AeroLink CLI again — rerunning the setup is safe.

Troubleshooting

"The gateway rejected the API key." The token is wrong, revoked or belongs to another Gateway. Create a new one in API Access and run aerolink login again (or /connect inside a session).

"Could not reach the gateway at ..." Check the Base URL with aerolink config - it must be the OpenAI-compatible address ending in /v1 - and that the Gateway is reachable from your network.

"Model unavailable: ..." You asked for a model your Gateway does not offer. Run aerolink models to see the ones you can use.

An old AEROLINK_API_KEY environment variable wins over my saved key. AeroLink gives environment variables priority over the saved configuration (a flag overrides both), so an old or revoked variable reports "Invalid API token." even after a successful setup. Run aerolink doctor to see which key is in effect. If the environment key is the problem, remove it in a new PowerShell window: [Environment]::SetEnvironmentVariable("AEROLINK_API_KEY", $null, "User") (or delete the AEROLINK_API_KEY and AEROLINK_BASE_URL rows in System Properties > Environment Variables) — or update them to your current Gateway address and key. Nothing is deleted automatically: Set Up AeroLink CLI only prints what to do, and the saved configuration stays correct.

"Updates are not configured for this AeroLink build." This build is distributed by your Gateway, not by an update server: re-run the install command from the top of this page to update.

Windows refuses to run the executable. Smart App Control can block unsigned files. Keep the protection on and let an administrator allow the file.

aerolink is not recognized after installing. Open a new terminal so the PATH change applies.

"Managed service port ... is already in use by another process." Another program (often an OpenCode desktop service) already holds the CLI's local port. Give the CLI its own port and run it again:

aerolink service set port 28895

(The same happens with aerolink run - it starts the same local service.)

Known limitations

  • Windows x64 is the platform verified today; macOS and Linux installers ship with the same flow.
  • The executable is not code-signed.
  • The interactive interface needs a real terminal (Windows Terminal, conhost); it does not run inside pipes or editors' mini-terminals.
  • Sessions are stored on your computer, in the paths above.