Skip to main content
AIHubMix CLI is the official AIHubMix command-line tool (executable 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.
Looking for the older Python script (aihubmix_cli.py)? See Retrieve Account Information via API. This page is its next-generation replacement — simpler and faster.

Installation

Copy the command for your system, paste it into your terminal, and run it to download the binary and automatically add it to PATH:
After installation, open a new terminal, then run 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.
When needed, you can adjust install behavior with environment variables:

Quick Start

Once logged in, all commands are available:

Command Reference

Add --help to any command to see its full flags, e.g. aihubmix keys create --help.

Common Operations

Managing API Keys

Here -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_TOKEN environment variable or --token to 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, making jq parsing easy.
  • Stable exit codes: Scripts can branch on these to determine success or failure.
Exit code meanings:

Global Flags

The following flags apply to all commands:

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.
Do not commit your Manage Key to a code repository or share it with others. If it leaks, regenerate it in the console; the old token is invalidated immediately.

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