Zum Hauptinhalt springen

Befehlsübersicht

CommandDescriptionAuth
chat [MESSAGE]Eine Nachricht senden oder interaktives REPL startenAPI-Schlüssel
modelsVerfügbare Modelle auflisten und durchsuchenAPI-Schlüssel
balanceKontostand anzeigenAPI-Schlüssel (oder 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-Schlüssel
configCLI-Konfiguration verwalten
replInteraktive Befehls-Shell startenAPI-Schlüssel
Befehle mit der Kennzeichnung Access token erfordern die Umgebungsvariable COMETAPI_ACCESS_TOKEN oder den Konfigurationsschlüssel access_token. Details finden Sie im Konfigurationsleitfaden.

Chat

Eine einzelne Nachricht senden oder das interaktive REPL für mehrere Dialogrunden 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 Anzahl 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 Ergebnisse
--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 einen access token.
cometapi account
cometapi account --json
OptionShortDescription
--format-fAusgabeformat
--jsonAls JSON ausgeben

Stats

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

Tokens

Ihre API-Schlüssel auflisten und durchsuchen. Erfordert einen access token.
# List API keys (paginated)
cometapi tokens

# Search by keyword
cometapi tokens --search raycast

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

Logs

Nutzungsprotokolle mit Filtern durchsuchen. Erfordert einen 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
OptionShortDescription
--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 Einträge
--page-pSeitennummer
--page-sizeErgebnisse pro Seite
--exportAls CSV nach stdout ausgeben
--format-fAusgabeformat
--jsonAls JSON ausgeben

Tasks

Async-Task-Protokolle für Plattformen wie Suno, Midjourney, Luma und Kling anzeigen. Erfordert einen 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
OptionShortDescription
--platformNach Plattformnamen filtern
--statusNach Status filtern
--limit-lMaximale Anzahl Einträge
--format-fAusgabeformat
--jsonAls JSON ausgeben

Doctor

Diagnosen ausführen, um die CLI-Konfiguration und die 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
  • Netzwerkkonnektivität zum CometAPI-Endpunkt
  • Gültigkeit der API-Authentifizierung
OptionShortDescription
--format-fAusgabeformat
--jsonAls JSON ausgeben

Config

Die CLI-Konfiguration verwalten, 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
Im Konfigurationsleitfaden finden Sie alle verfügbaren Schlüssel.

Init

Den interaktiven Einrichtungsassistenten ausführen, um Ihren API-Schlüssel und access token zu konfigurieren.
cometapi init
Der Assistent schreibt die Einstellungen nach ~/.config/cometapi/config.toml.

Repl

Eine vollständige interaktive Befehls-Shell starten, in der Sie jeden CLI-Befehl ohne das Präfix cometapi ausführen können.
cometapi repl

Ausgabeformate

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

Shell completion

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

Exit codes

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