aihubmix). Once installed, you can query your account balance, manage API Keys, and view available models from the terminal without opening the web console. It is a single binary — no Python, Node, or Go required — and installs with one command; every command supports JSON output, so it plugs straight into scripts, CI, and AI Agents (such as Claude Code).
What it can do:
- Check balance: Query your account balance and used quota in real time
- Manage Keys: Create, view, search, update, and delete API Keys
- View models: List the models available to the current token
- Scriptable: JSON output + stable exit codes, a natural fit for automation and AI Agents
Don’t mix up the two credentials: The CLI signs in with a “System Access Token” (Manage Key, format
fd***). Get it from the console at console.aihubmix.com/setting by clicking “Generate System Access Token”. It is used to manage your account and is not the same as the API Key (sk-***) you use to call models.Installation
One-Command Install (Recommended)
Copy the command for your system, paste it into your terminal, and run it to download the binary and automatically add it toPATH:
aihubmix login to get started.
You can also manually download the binary for your platform from Releases (Windows:
aihubmix_windows_amd64.exe) and place it in a PATH directory; on Unix-like systems, run chmod +x.| Variable | Description | Default |
|---|---|---|
AIHUBMIX_VERSION | Install a specific version (e.g. v0.2.0) | latest |
AIHUBMIX_BIN_DIR | Custom install directory | Unix: /usr/local/bin or ~/.local/bin; Windows: %LOCALAPPDATA%\aihubmix\bin |
Quick Start
Once logged in, all commands are available:Command Reference
| Command | Purpose |
|---|---|
aihubmix login | Log in (paste Manage Key) |
aihubmix logout | Log out, clear local credentials |
aihubmix whoami | View current login identity and balance |
aihubmix me | View full account information and balance |
aihubmix models list | View currently available models |
aihubmix keys list [--num N] | List API Keys |
aihubmix keys search <keyword> | Search Keys by keyword |
aihubmix keys get <id> | View details for a specific Key |
aihubmix keys create [flags] | Create a new Key |
aihubmix keys update <id> [flags] | Update a Key |
aihubmix keys delete <id> | Delete a Key |
Common Operations
Managing API Keys
-q 10 sets a $10 quota limit on the Key, and -u means unlimited quota. Deletion prompts for confirmation by default; add --yes to skip it in CI scenarios.
Using with Scripts / AI Agents
The CLI is very automation-friendly and can be driven directly by CI, scripts, or AI Agents (such as Claude Code):- Login-free: Pass a Manage Key via the
AIHUBMIX_TOKENenvironment variable or--tokento skip interactive login (priority:--token>AIHUBMIX_TOKEN> config file). - JSON output: Add
--json(-j) to any command; normal results go to stdout and errors to stderr, makingjqparsing easy. - Stable exit codes: Scripts can branch on these to determine success or failure.
| Exit Code | Meaning |
|---|---|
0 | Success |
1 | General error (invalid arguments, business failure, etc.) |
2 | Authentication failure (not logged in / invalid token) |
3 | Network / connection error |
Global Flags
The following flags apply to all commands:| Flag | Short | Description |
|---|---|---|
--token <token> | -t | Pass a Manage Key directly (CI / scripting scenarios) |
--json | -j | Output in JSON format |
--base-url <url> | -b | Custom API URL (default https://aihubmix.com) |
--no-color | Disable colored output | |
--config <path> | Specify the config file path | |
--version | Print version |
Configuration File
Login information is stored in~/.aihubmix/config.json (Windows: %USERPROFILE%\.aihubmix\config.json), with permissions tightened to read/write by the current user only. During login, the Manage Key is not echoed and not written to logs.
FAQ
Do I need to install Python / Node / Go? No. The CLI is a single binary — download and use. What’s the difference between a Manage Key and an API Key? The Manage Key (fd***) is used to manage your account (check balance, manage Keys) and is used by the CLI; the API Key (sk-***) is used to call models. They are generated in different places in the console and cannot be used interchangeably.
Is Windows supported?
Yes. Native binaries are provided for Windows, macOS, and Linux.
How do I use it non-interactively in CI / scripts?
Pass the Manage Key via the AIHUBMIX_TOKEN environment variable, combined with --json and exit codes — no need to run aihubmix login.
What if I forget or leak my Manage Key?
Regenerate it at console.aihubmix.com/setting; the old token is invalidated.
Related docs: Platform API · CliEndpoints · Legacy Python Script · AIHubMix Console
Last updated: 2026-06-22