CLI Tools
ModelGo provides two official command-line tools. Choose the task you want to complete and run the corresponding command.
Connect AI coding clients
Configure Claude Code, Codex, and other common clients with one command.
npx @model-go/config -r globalUse the official CLI
Pair it with official ModelGo Skills so an AI agent can operate ModelGo directly.
npx @model-go/cli@latest installConnect AI coding clients @model-go/config
To use ModelGo in Claude Code, Codex, OpenCode, or another supported AI coding client, choose guided setup or configure all clients with a single command.
Guided setup
Follow the terminal prompts to enter your API key, select clients, review the configuration, and verify connectivity after the changes are written.
npx @model-go/config -r globalOne-command setup (non-interactive, suitable for automation)
npx @model-go/config -k sk-your-token -r global --only allSupported clients
Guided setup lets you select one or more clients; use --only all to configure every supported client at once.
What happens next
| Step | Prompt |
|---|---|
01 | Enter your ModelGo API key. |
02 | Select one or more clients, or choose “Configure all.” |
03 | Review the site, Base URL, masked API key, and selected clients. |
04 | Confirm the changes, write the client configuration, and verify connectivity. |
Setup succeeded: the terminal reports that configuration is complete and the connectivity check passes, then shows how to start the selected client.
Let an AI agent operate ModelGo @model-go/cli
Install the official CLI and ModelGo Skills when you want an agent such as Claude Code or Codex to use ModelGo directly. The installer sets up the CLI, distributes Skills, selects the site, and optionally signs you in.
npx @model-go/cli@latest installWhat happens next
| Step | Prompt |
|---|---|
01 | Confirm installation of @model-go/cli when npm asks. |
02 | Choose Simplified Chinese or English. The rest of the installation prompts will use your selected language. |
03 | Install or upgrade the ModelGo CLI and install ModelGo Skills. |
04 | Select the environment for this site (https://api.modelgo.ai). |
05 | Choose whether to sign in through the browser now, or skip and run modelgo auth login later. |
Using the CLI after installation
After installation, restart your AI agent or open a new session. ModelGo Skills lets the agent call the ModelGo CLI directly to perform queries and operations, so you can ask in natural language, for example:
- “Which models does ModelGo currently support?”
- “What is my current ModelGo account balance?”
To use the CLI yourself, run modelgo in your terminal to see every available command and option:
modelgoThe most common commands are grouped by task:
| Task | Common commands | What they do |
|---|---|---|
| Authentication | modelgo auth login, modelgo auth status, modelgo auth logout | Sign in to ModelGo, inspect the current authentication state, or clear local credentials. |
| Environments | modelgo env list, modelgo env current, modelgo env use <name> | List environments, show the active environment, or switch sites. Use env add and env remove to manage custom environments. |
| Workspaces | modelgo tenant list, modelgo tenant use <slug> | List the workspaces available to your account and use a workspace slug or ID to select the workspace for subsequent CLI commands. |
| Account and usage | modelgo balance, modelgo permissions, modelgo logs | View balances and transactions, account permissions, call logs, and usage statistics. |
| Model calls | modelgo models, modelgo chat, modelgo embeddings, modelgo call | List available models, make chat or embedding requests, or call any /v1/* model endpoint directly. |
| Keys and payments | modelgo key, modelgo pay | Manage the model API key stored for the active environment or configure x402 pay-per-call payments. |
| CLI maintenance | modelgo update, modelgo --version, modelgo --help | Update the CLI, print its version, or reopen the complete help output. |
Run modelgo <command> --help to inspect the options for a specific command. For balance, permissions, and logs, you can also use the global --tenant <slug\|id> option to target a workspace for that command only.
Continue exploring
- First API Call: make your first model call.
- Authentication: learn how to use and protect your API key.