Passer au contenu principal
The CometAPI CLI is the official command-line tool for CometAPI. It helps you chat with models, inspect the model catalog, send one-off requests, check balance, and browse account usage from the terminal. Use the PyPI package page as the public homepage for installation and package metadata. This documentation expands on the same commands without requiring access to the private source repository.
The CometAPI CLI is in beta. Command names and options may change while the interface stabilizes.

Features

  • Chat with models using streaming output or an interactive REPL
  • Browse model catalog metadata, including provider, modality, endpoint, capability, context, and pricing fields
  • Inspect one model with cometapi model info <id>
  • Send one request through Chat Completions, Responses, Anthropic Messages, or Gemini Generate Content formats with cometapi run
  • Check balance, account profile, usage statistics, API keys, logs, and async task history
  • Output table, JSON, YAML, CSV, or Markdown data
  • Store local configuration in ~/.config/cometapi/config.toml

Prerequisites

Install the CLI

Install the package from PyPI:
pip install cometapi-cli
Verify the installed command:
cometapi --version
cometapi -h

Start using the CLI

1

Configure credentials

Run the setup wizard:
cometapi init
You can also configure the API key with an environment variable:
export COMETAPI_KEY="your-api-key"
The optional COMETAPI_ACCESS_TOKEN value is only needed for account, stats, tokens, logs, and tasks commands.
2

Chat with a model

Send one chat message:
cometapi chat "Explain CometAPI in one sentence."
Run cometapi chat without a message to start the chat REPL.
3

Browse models

Search the public model catalog:
cometapi models --search gpt --limit 10
Filter by catalog metadata:
cometapi models --provider openai --type chat --limit 10
cometapi models --feature image --endpoint responses --json
4

Inspect one model

Show detail metadata for one model:
cometapi model info your-model-id
Output the raw detail payload:
cometapi model info your-model-id --json
5

Run a multi-protocol request

Send a one-off request through the default chat endpoint:
cometapi run your-model-id -p "Reply with OK only."
Select another endpoint format when your request body follows a different provider schema:
cometapi run your-model-id --endpoint responses -p "Reply with OK only." --json
cometapi run your-model-id --endpoint anthropic -p "Reply with OK only." -i max_tokens=32
cometapi run your-model-id --endpoint gemini -p "Reply with OK only." -i generationConfig.maxOutputTokens=32

Get command help

Use -h on the root command or any subcommand to inspect the options for the installed version:
cometapi -h
cometapi models -h
cometapi model info -h
cometapi run -h

Commandes principales

CommandeDescription
chat [MESSAGE]Envoyer un message de chat ou démarrer le REPL de chat
modelsLister et filtrer les métadonnées du catalogue de modèles
model info <id>Inspecter les métadonnées publiques d’un modèle
run [MODEL]Envoyer une requête via les formats chat, responses, anthropic ou gemini
balanceAfficher le solde du compte ou de la clé API
accountAfficher le profil du compte
statsAfficher les statistiques d’utilisation
tokensLister et rechercher des clés API
logsParcourir les journaux d’utilisation et exporter un CSV
tasksParcourir les journaux des tâches asynchrones
initExécuter l’assistant de configuration
doctorExécuter les diagnostics de configuration
configGérer la configuration locale
replDémarrer un shell de commande interactif

Liens