Commands overview
| Command | Description | Auth |
|---|---|---|
chat [MESSAGE] | Send a message or start interactive REPL | API key |
models | List and search available models | API key |
balance | Show account balance | API key (or access token) |
account | Show account profile | Access token |
stats | Show usage statistics | Access token |
tokens | List and search your API keys | Access token |
logs | Browse usage logs with filters | Access token |
tasks | Show async task logs | Access token |
init | Interactive setup wizard | — |
doctor | Run diagnostics and health checks | API key |
config | Manage CLI configuration | — |
repl | Start interactive command shell | API key |
COMETAPI_ACCESS_TOKEN environment variable or the access_token config key. See the configuration guide for details.
Chat
Send a single message or start the multi-turn interactive REPL.| Option | Short | Description |
|---|---|---|
--model | -m | Model to use (default: from config) |
--system | -s | System prompt |
--temperature | -t | Sampling temperature (0.0–2.0) |
--max-tokens | Max tokens in response | |
--stream/--no-stream | Enable or disable streaming (default: stream) | |
--format | -f | Output format |
--json | Output as JSON |
Models
List available models with optional search and limit.| Option | Short | Description |
|---|---|---|
--search | -s | Filter models by keyword |
--limit | -l | Maximum number of results |
--format | -f | Output format |
--json | Output as JSON |
Balance
Show your CometAPI account balance.| Option | Short | Description |
|---|---|---|
--source | -s | Data source: account (full account) or key (current API key). |
--format | -f | Output format |
--json | Output as JSON |
Account
Show your account profile. Requires an access token.| Option | Short | Description |
|---|---|---|
--format | -f | Output format |
--json | Output as JSON |
Stats
Show usage statistics for the current month. Requires an access token.| Option | Short | Description |
|---|---|---|
--format | -f | Output format |
--json | Output as JSON |
Tokens
List and search your API keys. Requires an access token.| Option | Short | Description |
|---|---|---|
--search | -s | Search keyword |
--page | -p | Page number |
--page-size | Results per page | |
--format | -f | Output format |
--json | Output as JSON |
Logs
Browse usage logs with filters. Requires an access token.| Option | Short | Description |
|---|---|---|
--model | -m | Filter by model ID |
--token-name | Filter by API key name | |
--type | -t | Log type: consume, topup, error, refund, system, manage |
--start | Start date (YYYY-MM-DD) | |
--end | End date (YYYY-MM-DD) | |
--group | -g | Filter by group |
--limit | -l | Max number of entries |
--page | -p | Page number |
--page-size | Results per page | |
--export | Output as CSV to stdout | |
--format | -f | Output format |
--json | Output as JSON |
Tasks
Show async task logs for platforms such as Suno, Midjourney, Luma, and Kling. Requires an access token.| Option | Short | Description |
|---|---|---|
--platform | Filter by platform name | |
--status | Filter by status | |
--limit | -l | Max number of entries |
--format | -f | Output format |
--json | Output as JSON |
Doctor
Run diagnostics to verify CLI configuration and API connectivity.- Config file existence and readability
- API key availability and source (config, env, or missing)
- Access token availability
- Network connectivity to the CometAPI endpoint
- API authentication validity
| Option | Short | Description |
|---|---|---|
--format | -f | Output format |
--json | Output as JSON |
Config
Manage CLI configuration stored in~/.config/cometapi/config.toml.
Init
Run the interactive setup wizard to configure your API key and access token.~/.config/cometapi/config.toml.
Repl
Start a full interactive command shell where you can run any CLI command without thecometapi prefix.
Output formats
All data commands support--json or --format:
| Format | Description |
|---|---|
table | Rich table in the terminal (default) |
json | JSON output |
yaml | YAML output |
csv | Comma-separated values |
markdown | Markdown table |
Shell completion
Install shell completion for tab-complete support:Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Invalid arguments |
64 | Configuration missing |
69 | Service unavailable |
77 | Authentication error |