cometapi -h or cometapi <command> -h to inspect the exact arguments and options for the installed version.
Commands overview
| Command | Description | Auth |
|---|---|---|
chat [MESSAGE] | Send a chat message or start the chat REPL | API key |
models | List and filter model catalog metadata | API key |
model info <id> | Inspect one model’s public metadata | API key |
run [MODEL] | Send one request through chat, responses, anthropic, or gemini formats | API key |
balance | Show account or current API key balance | API key or access token |
account | Show account profile | Access token |
stats | Show usage statistics | Access token |
tokens | List and search API keys | Access token |
logs | Browse usage logs with filters | Access token |
tasks | Show async task logs | Access token |
init | Run the setup wizard | None |
doctor | Run diagnostics | API key |
config | Manage local configuration | None |
repl | Start an interactive command shell | Depends on command used |
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 chat REPL.| Option | Short | Description |
|---|---|---|
--model | -m | Model to use |
--system | -s | System prompt |
--temperature | -t | Sampling temperature |
--max-tokens | Maximum response tokens | |
--stream/--no-stream | Enable or disable streaming | |
--format | -f | Output format |
--json | Output as JSON |
Models
List models from the public catalog by default. Catalog output includes model ID, provider, model type, features, endpoints, pricing, context length, and maximum completion tokens.| Option | Short | Description |
|---|---|---|
--search | -s | Filter by ID, code, name, description, or provider |
--provider | Filter by provider name or code | |
--type, --modality | Filter by model type or modality | |
--feature, --capability | Filter by feature or capability | |
--endpoint | Filter by endpoint name, method, or path | |
--limit | -l | Maximum number of results |
--source | Use catalog metadata or OpenAI-compatible openai listing | |
--refresh | Refresh the one-hour catalog cache | |
--no-cache | Bypass the catalog cache for this command | |
--format | -f | Output format |
--json | Output as JSON |
~/.cache/cometapi/models.json.
Model info
Inspect public metadata for one model. The command resolves the model through the public catalog, then loads detail metadata for the catalog code.| Option | Short | Description |
|---|---|---|
--refresh | Refresh the catalog cache before lookup | |
--no-cache | Bypass the catalog cache for this command | |
--format | -f | Output format |
--json | Output raw model detail JSON |
Run
Send one request through a selected endpoint format. Use--input-file for a JSON body, repeated -i key=value values for overrides, and -p/--prompt for a prompt shortcut.
| Option | Short | Description |
|---|---|---|
--endpoint | -e | Endpoint format: chat, responses, anthropic, or gemini |
--input-file | JSON object request body | |
--input | -i | Request input as key=value; repeat for multiple values |
--prompt | -p | Prompt shortcut |
--json | Output raw JSON response |
| Endpoint | Request path | Auth |
|---|---|---|
chat | POST /v1/chat/completions | Bearer API key |
responses | POST /v1/responses | Bearer API key |
anthropic | POST /v1/messages | x-api-key API key and Anthropic version header |
gemini | Gemini Generate Content model path | x-goog-api-key API key |
--input-file, repeated -i key=value, prompt shortcut, then positional MODEL. Inline values parse JSON when possible. Dotted keys create nested objects.
Balance
Show your CometAPI account balance or current API key billing view.| Option | Short | Description |
|---|---|---|
--source | -s | Data source: account or key |
--format | -f | Output format |
--json | Output as JSON |
Account
Show your account profile. Requires an access token.Stats
Show usage statistics. Requires an access token.Tokens
List and search API keys. Requires an access token.| Option | Short | Description |
|---|---|---|
--search | -s | Search keyword |
--page | -p | Page number |
--limit | -l | 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 | -t | Filter by API key name |
--type | Log type | |
--search | -s | Search keyword |
--start | Start date | |
--end | End date | |
--group | -g | Filter by API key group |
--page | -p | Page number |
--limit | -l | Results per page |
--export | Output server-side CSV to stdout | |
--format | -f | Output format |
--json | Output as JSON |
Tasks
Show async task logs. Requires an access token.| Option | Short | Description |
|---|---|---|
--platform | -p | Filter by platform |
--task-id | Filter by task ID | |
--status | -s | Filter by status |
--action | -a | Filter by action type |
--start | Start date | |
--end | End date | |
--page | Page number | |
--limit | -l | Results per page |
--format | -f | Output format |
--json | Output as JSON |
Doctor
Run diagnostics to verify configuration and API connectivity.Config
Manage CLI configuration stored in~/.config/cometapi/config.toml.
Init
Run the interactive setup wizard:Repl
Start a full interactive command shell:Output formats
Most data commands support--json or --format:
| Format | Description |
|---|---|
table | Rich table in the terminal |
json | JSON output |
yaml | YAML output |
csv | Comma-separated values |
markdown | Markdown table |