> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Befehlsreferenz

> Referenz für CometAPI CLI-Befehle, einschließlich chat, models, model info, run, balance, account, stats, tokens, logs, tasks, doctor, config und repl.

Verwenden Sie `cometapi -h` oder `cometapi <command> -h`, um die genauen Argumente und Optionen für die installierte Version anzuzeigen.

## Befehlsübersicht

| Befehl | Beschreibung | Authentifizierung |
| - | - | - |
| `chat [MESSAGE]` | Eine Chat-Nachricht senden oder die Chat-REPL starten | API-Schlüssel |
| `models` | Metadaten des Modellkatalogs auflisten und filtern | API-Schlüssel |
| `model info <id>` | Öffentliche Metadaten eines Modells anzeigen | API-Schlüssel |
| `run [MODEL]` | Eine Anfrage in einem der Formate chat, responses, anthropic oder gemini senden | API-Schlüssel |
| `balance` | Kontoguthaben oder Guthaben des aktuellen API-Schlüssels anzeigen | API-Schlüssel oder Zugriffs-Token |
| `account` | Kontoprofil anzeigen | Zugriffs-Token |
| `stats` | Nutzungsstatistiken anzeigen | Zugriffs-Token |
| `tokens` | API-Schlüssel auflisten und durchsuchen | Zugriffs-Token |
| `logs` | Nutzungsprotokolle mithilfe von Filtern durchsuchen | Zugriffs-Token |
| `tasks` | Protokolle asynchroner Aufgaben anzeigen | Zugriffs-Token |
| `init` | Einrichtungsassistenten ausführen | Keine |
| `doctor` | Diagnose ausführen | API-Schlüssel |
| `config` | Lokale Konfiguration verwalten | Keine |
| `repl` | Eine interaktive Befehls-Shell starten | Abhängig vom verwendeten Befehl |

Befehle mit der Kennzeichnung **Zugriffs-Token** erfordern die Umgebungsvariable `COMETAPI_ACCESS_TOKEN` oder den Konfigurationsschlüssel `access_token`. Siehe das [Konfigurationshandbuch](https://apidoc.cometapi.com/de/developer-tools/cli/configuration.md)  für weitere Informationen.

## Chat

Senden Sie eine einzelne Nachricht oder starten Sie die Chat-REPL für Gespräche über mehrere Nachrichten hinweg.

```bash theme={null}
cometapi chat "Explain CometAPI in one sentence."
cometapi chat "Summarize this" --model your-model-id --system "Be concise."
cometapi chat "Hello" --no-stream
cometapi chat "Hello" --json
cometapi chat
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--model` | `-m` | Zu verwendendes Modell |
| `--system` | `-s` | System-Prompt |
| `--temperature` | `-t` | Sampling-Temperatur |
| `--max-tokens` | | Maximale Anzahl an Antwort-Tokens |
| `--stream/--no-stream` | | Streaming aktivieren oder deaktivieren |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Als JSON ausgeben |

## Modelle

Listet standardmäßig Modelle aus dem öffentlichen Katalog auf. Die Katalogausgabe enthält Modell-ID, Anbieter, Modelltyp, Funktionen, Endpunkte, Preise, Kontextlänge und maximale Anzahl an Completion-Tokens.

```bash theme={null}
cometapi models
cometapi models --search gpt --limit 10
cometapi models --provider openai --type chat --limit 10
cometapi models --feature image --endpoint responses --json
cometapi models --refresh
cometapi models --source openai --search gpt
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--search` | `-s` | Nach ID, Code, Name, Beschreibung oder Anbieter filtern |
| `--provider` | | Nach Anbietername oder -code filtern |
| `--type`, `--modality` | | Nach Modelltyp oder Modalität filtern |
| `--feature`, `--capability` | | Nach Funktion oder Fähigkeit filtern |
| `--endpoint` | | Nach Endpunktname, Methode oder Pfad filtern |
| `--limit` | `-l` | Maximale Anzahl an Ergebnissen |
| `--source` | | `catalog`-Metadaten oder die OpenAI-kompatible `openai`-Auflistung verwenden |
| `--refresh` | | Den eine Stunde gültigen Katalog-Cache aktualisieren |
| `--no-cache` | | Den Katalog-Cache für diesen Befehl umgehen |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Als JSON ausgeben |

Der Katalog-Cache wird unter `~/.cache/cometapi/models.json` gespeichert.

## Modellinformationen

Zeigen Sie öffentliche Metadaten für ein Modell an. Der Befehl ermittelt das Modell über den öffentlichen Katalog und lädt dann die Detailmetadaten für den Katalogcode.

```bash theme={null}
cometapi model info your-model-id
cometapi model info your-model-id --json
cometapi model info your-model-id --refresh
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--refresh` | | Den Katalog-Cache vor der Suche aktualisieren |
| `--no-cache` | | Den Katalog-Cache für diesen Befehl umgehen |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Unverarbeitete Modelldetails als JSON ausgeben |

Die Tabellenausgabe enthält Anbieter, Modelltyp, Funktionen, Endpunkte, Preise, Kontextlänge, maximale Anzahl an Completion-Tokens, Dokumentations-URL und Übersicht.

## Ausführen

Senden Sie eine Anfrage über ein ausgewähltes Endpunktformat. Verwenden Sie `--input-file` für einen JSON-Body, wiederholte `-i key=value`-Werte zum Überschreiben und `-p/--prompt` als Abkürzung für einen Prompt.

```bash theme={null}
cometapi run your-model-id -p "Write one sentence about CometAPI."
cometapi run your-model-id --endpoint responses -p "Reply with OK only." -i max_output_tokens=32 --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
cometapi run your-model-id --endpoint responses --input-file body.json -i temperature=0.2 --json
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--endpoint` | `-e` | Endpunktformat: `chat`, `responses`, `anthropic` oder `gemini` |
| `--input-file` | | Anfrage-Body als JSON-Objekt |
| `--input` | `-i` | Anfrageeingabe als `key=value`; für mehrere Werte wiederholen |
| `--prompt` | `-p` | Abkürzung für einen Prompt |
| `--json` | | Unverarbeitete JSON-Antwort ausgeben |

Endpunktzuordnung:

| Endpunkt | Anfragepfad | Authentifizierung |
| - | - | - |
| `chat` | `POST /v1/chat/completions` | Bearer-API-Schlüssel |
| `responses` | `POST /v1/responses` | Bearer-API-Schlüssel |
| `anthropic` | `POST /v1/messages` | `x-api-key` API-Schlüssel und Anthropic-Versions-Header |
| `gemini` | Gemini Generate Content-Modellpfad | `x-goog-api-key` API-Schlüssel |

Der Body wird in folgender Reihenfolge zusammengeführt: `--input-file`, wiederholte `-i key=value`-Werte, Prompt-Abkürzung und dann das positionale Argument `MODEL`. Inline-Werte werden nach Möglichkeit als JSON geparst. Schlüssel mit Punkten erzeugen verschachtelte Objekte.

## Guthaben

Zeigen Sie Ihr CometAPI-Kontoguthaben oder die Abrechnungsansicht des aktuellen API-Schlüssels an.

```bash theme={null}
cometapi balance
cometapi balance --source account
cometapi balance --source key
cometapi balance --json
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--source` | `-s` | Datenquelle: `account` oder `key` |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Als JSON ausgeben |

## Konto

Zeigen Sie Ihr Kontoprofil an. Erfordert ein Zugriffs-Token.

```bash theme={null}
cometapi account
cometapi account --json
```

## Statistiken

Zeigen Sie Nutzungsstatistiken an. Erfordert ein Zugriffs-Token.

```bash theme={null}
cometapi stats
cometapi stats --json
```

## Tokens

Listen Sie API-Schlüssel auf und durchsuchen Sie diese. Erfordert ein Zugriffs-Token.

```bash theme={null}
cometapi tokens
cometapi tokens --search project
cometapi tokens --json
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--search` | `-s` | Suchbegriff |
| `--page` | `-p` | Seitennummer |
| `--limit` | `-l` | Ergebnisse pro Seite |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Als JSON ausgeben |

## Protokolle

Durchsuchen Sie Nutzungsprotokolle mithilfe von Filtern. Erfordert ein Zugriffs-Token.

```bash theme={null}
cometapi logs
cometapi logs --model your-model-id
cometapi logs --start 2026-04-01 --end 2026-04-14
cometapi logs --type consume
cometapi logs --export > usage.csv
cometapi logs --limit 50 --json
cometapi logs --request-id 20260617165550885561292gJBlzjtp
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--model` | `-m` | Nach Modell-ID filtern |
| `--token-name` | `-t` | Nach API-Schlüsselnamen filtern |
| `--type` | | Protokolltyp |
| `--search` | `-s` | Suchbegriff |
| `--start` | | Startdatum |
| `--end` | | Enddatum |
| `--group` | `-g` | Nach API-Schlüsselgruppe filtern |
| `--request-id` | | Eine einzelne Anfrage suchen anhand von `X-Cometapi-Request-Id` |
| `--page` | `-p` | Seitennummer |
| `--limit` | `-l` | Ergebnisse pro Seite |
| `--export` | | Serverseitige CSV-Daten auf stdout ausgeben |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Als JSON ausgeben |

`logs --request-id` führt eine indizierte Suche am Operator-Log-Endpunkt durch und
akzeptiert nur eine exakte Übereinstimmung mit `request_id`. Die CLI durchsucht keine alternativen Protokollseiten,
da der Self-Log-Endpunkt keine Filterung nach `request_id` anwendet.

## Aufgaben

Zeigen Sie Protokolle asynchroner Aufgaben an. Erfordert ein Zugriffs-Token.

```bash theme={null}
cometapi tasks
cometapi tasks --platform kling
cometapi tasks --status SUCCESS
cometapi tasks --json
```

| Option | Kurzform | Beschreibung |
| - | - | - |
| `--platform` | `-p` | Nach Plattform filtern |
| `--task-id` | | Nach Aufgaben-ID filtern |
| `--status` | `-s` | Nach Status filtern |
| `--action` | `-a` | Nach Aktionstyp filtern |
| `--start` | | Startdatum |
| `--end` | | Enddatum |
| `--page` | | Seitennummer |
| `--limit` | `-l` | Ergebnisse pro Seite |
| `--format` | `-f` | Ausgabeformat |
| `--json` | | Als JSON ausgeben |

## Diagnose

Führen Sie eine Diagnose aus, um die Konfiguration und die API-Konnektivität zu überprüfen.

```bash theme={null}
cometapi doctor
cometapi doctor --json
```

## Konfiguration

Verwalten Sie die CLI-Konfiguration, die in `~/.config/cometapi/config.toml` gespeichert ist.

```bash theme={null}
cometapi config show
cometapi config set api_key "$COMETAPI_KEY"
cometapi config set default_model your-model-id
cometapi config unset api_key
cometapi config path
```

Siehe das [Konfigurationshandbuch](https://apidoc.cometapi.com/de/developer-tools/cli/configuration.md)  für alle verfügbaren Schlüssel.

## Initialisierung

Führen Sie den interaktiven Einrichtungsassistenten aus:

```bash theme={null}
cometapi init
```

## REPL

Starten Sie eine vollständige interaktive Befehls-Shell:

```bash theme={null}
cometapi repl
```

## Ausgabeformate

Die meisten Datenbefehle unterstützen `--json` oder `--format`:

```bash theme={null}
cometapi models --json
cometapi models --format yaml
cometapi stats --format csv
cometapi account --format markdown
```

| Format | Beschreibung |
| - | - |
| `table` | Formatierte Tabelle im Terminal |
| `json` | JSON-Ausgabe |
| `yaml` | YAML-Ausgabe |
| `csv` | Kommagetrennte Werte |
| `markdown` | Markdown-Tabelle |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.