Zum Hauptinhalt springen

Befehlsübersicht

CommandDescriptionAuth
chat [MESSAGE]Eine Nachricht senden oder interaktive REPL startenAPI key
modelsVerfügbare Modelle auflisten und durchsuchenAPI key
balanceKontostand anzeigenAPI key (or access token)
accountKontoprofil anzeigenAccess token
statsNutzungsstatistiken anzeigenAccess token
tokensIhre API-Schlüssel auflisten und durchsuchenAccess token
logsNutzungsprotokolle mit Filtern durchsuchenAccess token
tasksAsync-Task-Protokolle anzeigenAccess token
initInteraktiver Einrichtungsassistent
doctorDiagnose- und Zustandsprüfungen ausführenAPI key
configCLI-Konfiguration verwalten
replInteraktive Befehlsshell startenAPI key
Befehle, die mit Access token markiert sind, erfordern die Umgebungsvariable COMETAPI_ACCESS_TOKEN oder den Konfigurationsschlüssel access_token. Siehe den Konfigurationsleitfaden für Details.

Chat

Eine einzelne Nachricht senden oder die interaktive REPL mit mehreren Turns starten.
# Single message (streaming by default)
cometapi chat "Explain quantum computing in one sentence"

# Override model and add a system prompt
cometapi chat "Summarize this" --model claude-sonnet-4-6 --system "Be concise"

# Disable streaming
cometapi chat "Hello" --no-stream

# JSON output (full API response)
cometapi chat "Hello" --json

# Interactive REPL (omit message)
cometapi chat
OptionShortDescription
--model-mZu verwendendes Modell (Standard: aus der Konfiguration)
--system-sSystem Prompt
--temperature-tSampling-Temperatur (0.0–2.0)
--max-tokensMaximale Tokens in der Antwort
--stream/--no-streamStreaming aktivieren oder deaktivieren (Standard: stream)
--format-fAusgabeformat
--jsonAls JSON ausgeben

Models

Verfügbare Modelle mit optionaler Suche und Begrenzung auflisten.
# List all models
cometapi models

# Search by keyword
cometapi models --search gemini

# Limit results and output as JSON
cometapi models --search gpt --limit 10 --json
OptionShortDescription
--search-sModelle nach Schlüsselwort filtern
--limit-lMaximale Anzahl an Ergebnissen
--format-fAusgabeformat
--jsonAls JSON ausgeben

Balance

Ihren CometAPI-Kontostand anzeigen.
# Default: account-level balance (falls back to per-key billing)
cometapi balance

# Force account-level view
cometapi balance --source account

# Force API key billing view
cometapi balance --source key

# JSON output
cometapi balance --json
OptionShortDescription
--source-sDatenquelle: account (gesamtes Konto) oder key (aktueller API-Schlüssel).
--format-fAusgabeformat
--jsonAls JSON ausgeben

Account

Ihr Kontoprofil anzeigen. Erfordert ein access token.
cometapi account
cometapi account --json
OptionShortDescription
--format-fAusgabeformat
--jsonAls JSON ausgeben

Stats

Nutzungsstatistiken für den aktuellen Monat anzeigen. Erfordert ein access token.
cometapi stats
cometapi stats --json
Die Ausgabe enthält: Anzahl der Anfragen, Nutzungsbetrag, Erfolgsquote und prognostizierte verbleibende Tage bis zur Ausschöpfung des Guthabens.
OptionShortDescription
--format-fAusgabeformat
--jsonAls JSON ausgeben

Tokens

Liste deine API-Schlüssel auf und durchsuche sie. Erfordert ein access token.
# List API keys (paginated)
cometapi tokens

# Search by keyword
cometapi tokens --search raycast

# JSON output
cometapi tokens --json
OptionShortBeschreibung
--search-sSuchbegriff
--page-pSeitennummer
--page-sizeErgebnisse pro Seite
--format-fAusgabeformat
--jsonAls JSON ausgeben

Logs

Durchsuche Nutzungsprotokolle mit Filtern. Erfordert ein access token.
# Recent logs
cometapi logs

# Filter by model
cometapi logs --model gpt-5.4

# Filter by date range
cometapi logs --start 2026-04-01 --end 2026-04-14

# Filter by log type
cometapi logs --type consume

# Export as CSV
cometapi logs --export > usage.csv

# JSON output with limit
cometapi logs --limit 50 --json
OptionShortBeschreibung
--model-mNach model ID filtern
--token-nameNach API-Schlüsselnamen filtern
--type-tProtokolltyp: consume, topup, error, refund, system, manage
--startStartdatum (YYYY-MM-DD)
--endEnddatum (YYYY-MM-DD)
--group-gNach Gruppe filtern
--limit-lMaximale Anzahl an Einträgen
--page-pSeitennummer
--page-sizeErgebnisse pro Seite
--exportAls CSV an stdout ausgeben
--format-fAusgabeformat
--jsonAls JSON ausgeben

Tasks

Zeige asynchrone Task-Protokolle für Plattformen wie Suno, Midjourney, Luma und Kling an. Erfordert ein access token.
# Recent tasks
cometapi tasks

# Filter by platform
cometapi tasks --platform suno

# Filter by status
cometapi tasks --status SUCCESS

# JSON output
cometapi tasks --json
OptionShortBeschreibung
--platformNach Plattformnamen filtern
--statusNach Status filtern
--limit-lMaximale Anzahl an Einträgen
--format-fAusgabeformat
--jsonAls JSON ausgeben

Doctor

Führe Diagnosen aus, um die CLI-Konfiguration und API-Konnektivität zu überprüfen.
cometapi doctor
cometapi doctor --json
Der Doctor prüft:
  • Vorhandensein und Lesbarkeit der Konfigurationsdatei
  • Verfügbarkeit und Quelle des API-Schlüssels (config, env oder fehlend)
  • Verfügbarkeit des access token
  • Netzwerkverbindung zum CometAPI-Endpunkt
  • Gültigkeit der API-Authentifizierung
OptionShortBeschreibung
--format-fAusgabeformat
--jsonAls JSON ausgeben

Config

Verwalte die CLI-Konfiguration, die in ~/.config/cometapi/config.toml gespeichert ist.
# Show current config
cometapi config show

# Set a value
cometapi config set api_key sk-...
cometapi config set default_model claude-sonnet-4-6
cometapi config set output_format json

# Remove a value
cometapi config unset api_key

# Show config file path
cometapi config path
Siehe den Konfigurationsleitfaden für alle verfügbaren Schlüssel.

Init

Führe den interaktiven Einrichtungsassistenten aus, um deinen API-Schlüssel und access token zu konfigurieren.
cometapi init
Der Assistent schreibt die Einstellungen in ~/.config/cometapi/config.toml.

Repl

Starte eine vollständige interaktive Kommando-Shell, in der du jeden CLI-Befehl ohne das Präfix cometapi ausführen kannst.
cometapi repl

Output formats

Alle Datenbefehle unterstützen --json oder --format:
cometapi models --json
cometapi models --format yaml
cometapi stats --format csv
cometapi account --format markdown
FormatBeschreibung
tableErweiterte Tabelle im Terminal (Standard)
jsonJSON-Ausgabe
yamlYAML-Ausgabe
csvKommagetrennte Werte
markdownMarkdown-Tabelle
Lege über config ein Standardformat für alle Befehle fest:
cometapi config set output_format json

Shell completion

Installiere Shell-Completion für Unterstützung bei der Tab-Vervollständigung:
cometapi --install-completion
Unterstützte Shells: Bash, Zsh, Fish.

Exit-Codes

CodeBedeutung
0Erfolg
1Allgemeiner Fehler
2Ungültige Argumente
64Konfiguration fehlt
69Dienst nicht verfügbar
77Authentifizierungsfehler