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

# Configuratie

> Configureer de CometAPI CLI: locatie van het configuratiebestand, beschikbare instellingen, beheer van inloggegevens, omgevingsvariabelen en beveiligingsmaatregelen.

De CometAPI CLI leest instellingen uit een TOML-configuratiebestand, omgevingsvariabelen en opdrachtregelopties. Als dezelfde instelling uit meerdere bronnen beschikbaar is, geldt de volgende prioriteitsvolgorde:

**CLI-opties > configuratiebestand > omgevingsvariabelen > standaardwaarden**

## Configuratiebestand

Locatie: `~/.config/cometapi/config.toml`

Voer de installatiewizard uit om het configuratiebestand interactief aan te maken:

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

Of beheer afzonderlijke instellingen met de subopdracht `config`:

```bash theme={null}
# View current configuration
cometapi config show

# Set a value
cometapi config set api_key "$COMETAPI_KEY"

# Remove a value
cometapi config unset api_key

# Show the config file path
cometapi config path
```

## Beschikbare instellingen

| Configuratiesleutel | Omgevingsvariabele | Beschrijving |
| - | - | - |
| `api_key` | `COMETAPI_KEY` | API-sleutel (vereist voor alle opdrachten) |
| `access_token` | `COMETAPI_ACCESS_TOKEN` | Toegangstoken voor opdrachten op accountniveau |
| `base_url` | `COMETAPI_BASE_URL` | API-basis-URL (standaard: `https://api.cometapi.com/v1`) |
| `default_model` | `COMETAPI_DEFAULT_MODEL` | Standaardmodel voor `chat` en `run` (terugvalwaarde: `gpt-5.4`) |
| `output_format` | — | Standaarduitvoerformaat: `table`, `json`, `yaml`, `csv` of `markdown` |

## Inloggegevens

De CLI gebruikt twee soorten inloggegevens:

### API-sleutel

Vereist voor alle opdrachten. De API-sleutel authenticeert aanvragen bij de modeleindpunten van CometAPI.

Maak een API-sleutel aan via [CometAPI Console → API Keys](https://www.cometapi.com/console/token).

Stel deze op een van de volgende manieren in:

```bash Environment variable theme={null}
read -rsp "CometAPI API key: " COMETAPI_KEY
printf '\n'
export COMETAPI_KEY
```

```bash Config file theme={null}
cometapi config set api_key "$COMETAPI_KEY"
```

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

### Toegangstoken

Optioneel. Het toegangstoken is vereist voor opdrachten op accountniveau: `account`, `stats`, `tokens`, `logs` en `tasks`.

Genereer een toegangstoken via [CometAPI Console → Personal Settings](https://www.cometapi.com/console/personal).

Stel dit op een van de volgende manieren in:

```bash Environment variable theme={null}
export COMETAPI_ACCESS_TOKEN="your-access-token"
```

```bash Config file theme={null}
cometapi config set access_token your-access-token
```

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

## Beveiliging

De CLI past de volgende beveiligingsmaatregelen toe:

* API-sleutels en toegangstokens worden nooit volledig gelogd of weergegeven. In de diagnostische uitvoer worden alleen de laatste 4 tekens getoond.
* Het configuratiebestand wordt aangemaakt met beperkte toegangsrechten (`0600`) en is alleen leesbaar voor de bestandseigenaar.
* Inloggegevens mogen nooit aan versiebeheer worden toegevoegd. Voeg indien van toepassing het pad naar het configuratiebestand toe aan je `.gitignore`.

> [!WARNING]
>
> Je bent verantwoordelijk voor al het gebruik en alle kosten die met je API-sleutels worden gemaakt. Bewaar je sleutels veilig en vervang ze als je ongeautoriseerde toegang vermoedt.

## Problemen oplossen

| Fout | Oplossing |
| - | - |
| `API key not configured` | Voer `cometapi init` uit of stel de omgevingsvariabele `COMETAPI_KEY` in |
| `Connection failed` | Voer `cometapi doctor` uit om de verbinding te diagnosticeren |
| `Access token not configured` | Alleen nodig voor `account`/`stats`/`tokens`/`logs`/`tasks`. Voer `cometapi init` uit om er een toe te voegen |


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