> ## 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.

# Opdrachtreferentie

> Referentie voor CometAPI CLI-opdrachten, waaronder chat, models, model info, run, balance, account, stats, tokens, logs, tasks, doctor, config en repl.

Gebruik `cometapi -h` of `cometapi <command> -h` om de exacte argumenten en opties voor de geïnstalleerde versie te bekijken.

## Overzicht van opdrachten

| Command           | Description                                                              | Auth                    |
| ----------------- | ------------------------------------------------------------------------ | ----------------------- |
| `chat [MESSAGE]`  | Verzend een chatbericht of start de chat REPL                            | API key                 |
| `models`          | Toon en filter metadata van de modelcatalogus                            | API key                 |
| `model info <id>` | Bekijk de openbare metadata van één model                                | API key                 |
| `run [MODEL]`     | Verzend één request via chat-, responses-, anthropic- of gemini-formaten | API key                 |
| `balance`         | Toon het accountsaldo of het saldo van de huidige API key                | API key or access token |
| `account`         | Toon het accountprofiel                                                  | Access token            |
| `stats`           | Toon gebruiksstatistieken                                                | Access token            |
| `tokens`          | Toon en doorzoek API keys                                                | Access token            |
| `logs`            | Blader door gebruikslogs met filters                                     | Access token            |
| `tasks`           | Toon logs van async taken                                                | Access token            |
| `init`            | Voer de installatiewizard uit                                            | None                    |
| `doctor`          | Voer diagnostiek uit                                                     | API key                 |
| `config`          | Beheer lokale configuratie                                               | None                    |
| `repl`            | Start een interactieve opdrachtshell                                     | Depends on command used |

Opdrachten gemarkeerd met **Access token** vereisen de omgevingsvariabele `COMETAPI_ACCESS_TOKEN` of de configuratiesleutel `access_token`. Zie de [configuratiegids](/nl/libraries/cli/configuration) voor details.

## Chat

Verzend één bericht of start de chat REPL met meerdere beurten.

```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                 | Short | Description                   |
| ---------------------- | ----- | ----------------------------- |
| `--model`              | `-m`  | Te gebruiken model            |
| `--system`             | `-s`  | Systeemprompt                 |
| `--temperature`        | `-t`  | Sampling temperature          |
| `--max-tokens`         |       | Maximum response tokens       |
| `--stream/--no-stream` |       | Streaming in- of uitschakelen |
| `--format`             | `-f`  | Uitvoerformaat                |
| `--json`               |       | Uitvoer als JSON              |

## Models

Toon standaard modellen uit de openbare catalogus. De catalogusuitvoer bevat model ID, provider, modeltype, features, endpoints, prijzen, contextlengte en maximale 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                      | Short | Description                                                     |
| --------------------------- | ----- | --------------------------------------------------------------- |
| `--search`                  | `-s`  | Filter op ID, code, naam, beschrijving of provider              |
| `--provider`                |       | Filter op providernaam of -code                                 |
| `--type`, `--modality`      |       | Filter op modeltype of modaliteit                               |
| `--feature`, `--capability` |       | Filter op feature of capability                                 |
| `--endpoint`                |       | Filter op endpointnaam, methode of pad                          |
| `--limit`                   | `-l`  | Maximum aantal resultaten                                       |
| `--source`                  |       | Gebruik `catalog`-metadata of OpenAI-compatibele `openai`-lijst |
| `--refresh`                 |       | Vernieuw de cataloguscache van één uur                          |
| `--no-cache`                |       | Omzeil de cataloguscache voor deze opdracht                     |
| `--format`                  | `-f`  | Uitvoerformaat                                                  |
| `--json`                    |       | Uitvoer als JSON                                                |

De cataloguscache wordt opgeslagen in `~/.cache/cometapi/models.json`.

## Model info

Inspecteer openbare metadata voor één model. Het commando resolveert het model via de openbare catalogus en laadt vervolgens detailmetadata voor de cataloguscode.

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

| Option       | Short | Description                                  |
| ------------ | ----- | -------------------------------------------- |
| `--refresh`  |       | Vernieuw de cataloguscache vóór het opzoeken |
| `--no-cache` |       | Omzeil de cataloguscache voor dit commando   |
| `--format`   | `-f`  | Uitvoerformaat                               |
| `--json`     |       | Geef ruwe modeldetail-JSON weer              |

De tabeluitvoer bevat provider, modeltype, features, endpoints, prijzen, contextlengte, maximum completion tokens, documentatie-URL en overzicht.

## Run

Verstuur één request via een geselecteerd endpoint-formaat. Gebruik `--input-file` voor een JSON-body, herhaalde `-i key=value`-waarden voor overschrijvingen en `-p/--prompt` voor een prompt-snelkoppeling.

```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         | Short | Description                                                    |
| -------------- | ----- | -------------------------------------------------------------- |
| `--endpoint`   | `-e`  | Endpoint-formaat: `chat`, `responses`, `anthropic` of `gemini` |
| `--input-file` |       | JSON-object request-body                                       |
| `--input`      | `-i`  | Request-invoer als `key=value`; herhaal voor meerdere waarden  |
| `--prompt`     | `-p`  | Prompt-snelkoppeling                                           |
| `--json`       |       | Geef ruwe JSON-response weer                                   |

Endpoint-mapping:

| Endpoint    | Request path                     | Auth                                          |
| ----------- | -------------------------------- | --------------------------------------------- |
| `chat`      | `POST /v1/chat/completions`      | Bearer API key                                |
| `responses` | `POST /v1/responses`             | Bearer API key                                |
| `anthropic` | `POST /v1/messages`              | `x-api-key` API key en Anthropic-versieheader |
| `gemini`    | Gemini Generate Content-modelpad | `x-goog-api-key` API key                      |

De body-samenvoegvolgorde is `--input-file`, herhaalde `-i key=value`, prompt-snelkoppeling en daarna positionele `MODEL`. Inline waarden worden waar mogelijk als JSON geparseerd. Dotted keys maken geneste objecten.

## Balance

Toon het saldo van je CometAPI-account of de huidige factureringsweergave van de API key.

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

| Option     | Short | Description                      |
| ---------- | ----- | -------------------------------- |
| `--source` | `-s`  | Gegevensbron: `account` of `key` |
| `--format` | `-f`  | Uitvoerformaat                   |
| `--json`   |       | Geef uit als JSON                |

## Account

Toon je accountprofiel. Vereist een access token.

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

## Stats

Toon gebruiksstatistieken. Vereist een access token.

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

## Tokens

Lijst API keys en doorzoek ze. Vereist een access token.

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

| Option     | Short | Description           |
| ---------- | ----- | --------------------- |
| `--search` | `-s`  | Zoekterm              |
| `--page`   | `-p`  | Paginanummer          |
| `--limit`  | `-l`  | Resultaten per pagina |
| `--format` | `-f`  | Uitvoerformaat        |
| `--json`   |       | Geef uit als JSON     |

## Logs

Bekijk gebruikslogs met filters. Vereist een access 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         | Short | Description                                     |
| -------------- | ----- | ----------------------------------------------- |
| `--model`      | `-m`  | Filter op model ID                              |
| `--token-name` | `-t`  | Filter op API-sleutelnaam                       |
| `--type`       |       | Logtype                                         |
| `--search`     | `-s`  | Zoekterm                                        |
| `--start`      |       | Startdatum                                      |
| `--end`        |       | Einddatum                                       |
| `--group`      | `-g`  | Filter op API-sleutelgroep                      |
| `--request-id` |       | Zoek één request op via `X-Cometapi-Request-Id` |
| `--page`       | `-p`  | Paginanummer                                    |
| `--limit`      | `-l`  | Resultaten per pagina                           |
| `--export`     |       | Server-side CSV uitvoeren naar stdout           |
| `--format`     | `-f`  | Uitvoerformaat                                  |
| `--json`       |       | Uitvoer als JSON                                |

`logs --request-id` voert één geïndexeerde lookup uit op het operator-logendpoint en
accepteert alleen een exacte overeenkomst met `request_id`. De CLI scant geen fallback-logpagina's,
omdat het self-logendpoint geen filtering op `request_id` toepast.

## Tasks

Toon asynchrone taaklogs. Vereist een access token.

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

| Option       | Short | Description           |
| ------------ | ----- | --------------------- |
| `--platform` | `-p`  | Filter op platform    |
| `--task-id`  |       | Filter op task ID     |
| `--status`   | `-s`  | Filter op status      |
| `--action`   | `-a`  | Filter op actietype   |
| `--start`    |       | Startdatum            |
| `--end`      |       | Einddatum             |
| `--page`     |       | Paginanummer          |
| `--limit`    | `-l`  | Resultaten per pagina |
| `--format`   | `-f`  | Uitvoerformaat        |
| `--json`     |       | Uitvoer als JSON      |

## Doctor

Voer diagnostiek uit om de configuratie en API-connectiviteit te controleren.

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

## Config

Beheer de CLI-configuratie die is opgeslagen in `~/.config/cometapi/config.toml`.

```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
```

Zie de [configuratiegids](/nl/libraries/cli/configuration) voor alle beschikbare sleutels.

## Init

Voer de interactieve installatiewizard uit:

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

## Repl

Start een volledige interactieve command shell:

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

## Output formats

De meeste datacommand's ondersteunen `--json` of `--format`:

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

| Format     | Description                      |
| ---------- | -------------------------------- |
| `table`    | Uitgebreide tabel in de terminal |
| `json`     | JSON-uitvoer                     |
| `yaml`     | YAML-uitvoer                     |
| `csv`      | Door komma's gescheiden waarden  |
| `markdown` | Markdown-tabel                   |
