Skip to main content
The CometAPI CLI reads settings from a TOML config file, environment variables, and command-line flags. When the same setting is available from multiple sources, the priority order is: CLI flags > config file > environment variables > defaults

Config file

Location: ~/.config/cometapi/config.toml Run the setup wizard to create the config file interactively:
Or manage individual settings with the config subcommand:

Available settings

Credentials

The CLI uses two types of credentials:

API key

Required for all commands. The API key authenticates requests to the CometAPI model endpoints. Create an API key at CometAPI Console → API Keys. Set it in one of these ways:

Access token

Optional. The access token is required for account-level commands: account, stats, tokens, logs, and tasks. Generate an access token at CometAPI Console → Personal Settings. Set it in one of these ways:

Security

The CLI applies the following security practices:
  • API keys and access tokens are never logged or displayed in full. Only the last 4 characters are shown in diagnostics output.
  • The config file is created with restrictive permissions (0600) — readable only by the file owner.
  • Credentials should never be committed to version control. Add the config file path to your .gitignore if applicable.
You are responsible for all usage and charges incurred with your API keys. Keep your keys secure and rotate them if you suspect unauthorized access.

Troubleshooting

Last modified on May 26, 2026