Skip to content

Token4AI CLI & Agent Skill

Bring your workspace into your development workflow. Use token4ai to inspect balance and usage, manage API keys and files, and connect Codex, Claude Code, Gemini CLI or OpenCode with `token4ai agent setup`. The companion skill helps your agent choose commands and understand their results.

By the Token4AI Cloud product team

1. Install the CLI

Vega CLI ships to customers as the token4ai command. Select your actual system architecture and run these commands. Node.js and Bun are not required.
macOS · Apple Silicon
mkdir -p "$HOME/.local/bin" &&
curl --fail --show-error --location https://dash.token4ai.cloud/api/cli/download/darwin-arm64 -o "$HOME/.local/bin/token4ai" &&
chmod +x "$HOME/.local/bin/token4ai" &&
export PATH="$HOME/.local/bin:$PATH" &&
token4ai --help

On Windows, use the matching Linux build inside WSL2. On macOS, check the chip in About This Mac. For new terminals, add the export PATH line to ~/.zshrc or ~/.bashrc, or run ~/.local/bin/token4ai directly.

2. Approve access in your browser

The CLI displays an authorization URL and code. Open the link, sign in to Token4AI and approve this device. Return to the terminal to check the login status. An existing browser session still needs this approval.
Authorization
token4ai auth login --host https://dash.token4ai.cloud
token4ai auth status

This access token manages your tenant workspace. It is separate from model API keys; no password or API key belongs in the installation commands.

3. Verify access with account data

Check your identity, balance and five recent requests. --json produces machine-readable output for scripts and agents. These commands only read data. If a request returns 401, run token4ai auth login again and approve it in your browser. auth status reports local authorization state; it does not replace a live API check.
Read-only commands
token4ai whoami --json
token4ai balance --json
token4ai usage --page-size 5 --json

4. Add the skill to your agent

From your project root, choose Codex or Claude Code and save the official SKILL.md. Start a new agent session. Other compatible tools can read the skill URL directly.
Codex · SKILL.md
mkdir -p .agents/skills/token4ai
curl --fail --show-error --location https://dash.token4ai.cloud/api/cli/skill -o .agents/skills/token4ai/SKILL.md
Try this prompt with your agent
Use the token4ai skill to check my current identity, account balance and five latest usage records, then summarize them. Read only; do not create or delete resources.

This skill manages your Token4AI account. Cloud agent execution environments are configured under AI AGENT → Runtimes. Your agent cannot approve browser device authorization for you.

API keys
Inspect keys and current billing groups before configuring access.
API keys
token4ai key list --json
token4ai key groups --provider openai --json
Files and assets
List workspace files and inspect storage usage.
Files and assets
token4ai asset list --json
token4ai asset storage --json
Billing and support
Review recharge orders and support ticket progress.
Billing and support
token4ai billing orders --json
token4ai support tickets --json

Run token4ai auth logout to revoke access. Save newly created API keys when they are returned once. Commands such as delete modify account resources; confirm the intended targets before running them.

Keep reading