Naar hoofdinhoud gaan

Overzicht van opdrachten

CommandDescriptionAuth
chat [MESSAGE]Verstuur een bericht of start interactieve REPLAPI-sleutel
modelsBeschikbare modellen weergeven en doorzoekenAPI-sleutel
balanceAccountsaldo weergevenAPI-sleutel (of access token)
accountAccountprofiel weergevenAccess token
statsGebruiksstatistieken weergevenAccess token
tokensJe API-sleutels weergeven en doorzoekenAccess token
logsGebruikslogs bekijken met filtersAccess token
tasksAsync taaklogs weergevenAccess token
initInteractieve configuratiewizard
doctorDiagnostiek en gezondheidscontroles uitvoerenAPI-sleutel
configCLI-configuratie beheren
replInteractieve opdrachtshell startenAPI-sleutel
Opdrachten gemarkeerd met Access token vereisen de omgevingsvariabele COMETAPI_ACCESS_TOKEN of de configuratiesleutel access_token. Zie de configuratiegids voor details.

Chat

Verstuur één bericht of start de interactieve REPL met meerdere beurten.
# 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-mTe gebruiken model (standaard: uit config)
--system-sSystem prompt
--temperature-tSampling temperature (0.0–2.0)
--max-tokensMax tokens in response
--stream/--no-streamStreaming inschakelen of uitschakelen (standaard: stream)
--format-fUitvoerformaat
--jsonUitvoer als JSON

Models

Beschikbare modellen weergeven met optionele zoekopdracht en limiet.
# 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-sModellen filteren op trefwoord
--limit-lMaximum aantal resultaten
--format-fUitvoerformaat
--jsonUitvoer als JSON

Balance

Je CometAPI-accountsaldo weergeven.
# 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-sGegevensbron: account (volledig account) of key (huidige API-sleutel).
--format-fUitvoerformaat
--jsonUitvoer als JSON

Account

Je accountprofiel weergeven. Vereist een access token.
cometapi account
cometapi account --json
OptionShortDescription
--format-fUitvoerformaat
--jsonUitvoer als JSON

Stats

Gebruiksstatistieken voor de huidige maand weergeven. Vereist een access token.
cometapi stats
cometapi stats --json
De uitvoer bevat: aantal aanvragen, gebruiksbedrag, slagingspercentage en voorspeld aantal resterende dagen saldo.
OptionShortDescription
--format-fUitvoerformaat
--jsonUitvoer als JSON

Tokens

Je API-sleutels weergeven en doorzoeken. Vereist een access token.
# List API keys (paginated)
cometapi tokens

# Search by keyword
cometapi tokens --search raycast

# JSON output
cometapi tokens --json
OptionShortDescription
--search-sZoektrefwoord
--page-pPaginanummer
--page-sizeResultaten per pagina
--format-fUitvoerformaat
--jsonUitvoer als JSON

Logs

Gebruikslogs bekijken met filters. Vereist een 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-mFilteren op model ID
--token-nameFilteren op naam van API-sleutel
--type-tLogtype: consume, topup, error, refund, system, manage
--startStartdatum (YYYY-MM-DD)
--endEinddatum (YYYY-MM-DD)
--group-gFilteren op groep
--limit-lMaximaal aantal items
--page-pPaginanummer
--page-sizeResultaten per pagina
--exportUitvoer als CSV naar stdout
--format-fUitvoerformaat
--jsonUitvoer als JSON

Tasks

Async taaklogs weergeven voor platforms zoals Suno, Midjourney, Luma en Kling. Vereist een 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
--platformFilteren op platformnaam
--statusFilteren op status
--limit-lMaximaal aantal items
--format-fUitvoerformaat
--jsonUitvoer als JSON

Doctor

Diagnostiek uitvoeren om CLI-configuratie en API-connectiviteit te verifiëren.
cometapi doctor
cometapi doctor --json
De doctor controleert:
  • Bestaan en leesbaarheid van het configuratiebestand
  • Beschikbaarheid en bron van API-sleutel (config, env of ontbrekend)
  • Beschikbaarheid van access token
  • Netwerkconnectiviteit met het CometAPI-endpoint
  • Geldigheid van API-authenticatie
OptionShortDescription
--format-fUitvoerformaat
--jsonUitvoer als JSON

Config

CLI-configuratie beheren die is opgeslagen in ~/.config/cometapi/config.toml.
# 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
Zie de configuratiegids voor alle beschikbare sleutels.

Init

Voer de interactieve configuratiewizard uit om je API-sleutel en access token te configureren.
cometapi init
De wizard schrijft instellingen naar ~/.config/cometapi/config.toml.

Repl

Start een volledige interactieve opdrachtshell waarin je elke CLI-opdracht kunt uitvoeren zonder het voorvoegsel cometapi.
cometapi repl

Uitvoerformaten

Alle data-opdrachten ondersteunen --json of --format:
cometapi models --json
cometapi models --format yaml
cometapi stats --format csv
cometapi account --format markdown
FormatDescription
tableUitgebreide tabel in de terminal (standaard)
jsonJSON-uitvoer
yamlYAML-uitvoer
csvKomma-gescheiden waarden
markdownMarkdown-tabel
Stel een standaardformaat voor alle opdrachten in via config:
cometapi config set output_format json

Shell completion

Installeer shell completion voor ondersteuning van tab-aanvullen:
cometapi --install-completion
Ondersteunde shells: Bash, Zsh, Fish.

Exit codes

CodeMeaning
0Succes
1Algemene fout
2Ongeldige argumenten
64Configuratie ontbreekt
69Service niet beschikbaar
77Authenticatiefout