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

# AI providers (BYOK)

> Store your own provider keys and select the models Aquila uses.

Aquila supports bring-your-own-key for the AI providers it talks to. Your
key stays yours: Aquila stores it encrypted and never returns the secret
through the API.

## Store a key

`PUT /api/provider-keys` stores or replaces a key:

```json theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
{ "provider": "zai", "apiKey": "..." }
```

* `GET /api/provider-keys` — list your keys. The response names the
  providers, never the secrets.
* `DELETE /api/provider-keys/{provider}` — delete a stored key.

## Models

* `GET /api/provider-keys/{provider}/models` — the models your key can see.
* `PUT /api/provider-keys/{provider}/model` — select the model that provider
  uses. Send `null` to clear the selection.

## Platform model

The platform default model is an owner-level setting:

* `GET /api/models?provider=zai` — list models for a provider.
* `GET /api/models/selected` — the current default.
* `PUT /api/models/selected` — set the default. Owner or admin only.
