# Models & provider keys

Choose the **Project manager** model for the project manager and **Cycle** settings for coding and review. Use Hlix-managed model access or connect your own provider, then select it with a model under AI settings.

For coding-agent subscriptions, custom API keys and task charges, see [AI accounts and funding](/harnesses/accounts/).

## Prerequisites

- Workspace `owner` or `admin` to manage provider keys. Members can read configuration metadata; portal clients have no access.
- A key for a supported provider, if you want that provider to bill model usage directly. Managed funding needs no key of your own.

## Store a provider key

In **Settings → Models & accounts → Accounts**, add a provider key and enable the connection. Supported providers are OpenAI, Anthropic, OpenRouter, Moonshot, DeepSeek, Z.ai, Google, xAI, Mistral and Groq. Over the API:

```bash
curl -sS -X POST "$HLIX_BASE_URL/v1/api/providers" \
  -H "x-api-key: $HLIX_API_KEY" \
  -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \
  -H 'content-type: application/json' \
  -d '{"provider":"openrouter","apiKey":"sk-or-…","enabled":true}'
```

Expected result: `201` and the stored configuration. Reads show configuration metadata with the key omitted.

`provider` accepts `openai`, `anthropic`, `openrouter`, `moonshot`, `deepseek`, `zai`, `google`, `xai`, `mistral` or `groq`. Set `baseUrl` only when the account needs a different HTTPS API endpoint.

See [Providers](/api/reference/providers/) for model discovery and the full API, and [Model configuration](/api/reference/model-config/) for AI defaults. In the TypeScript SDK, these operations are available through `hlix.raw`.

Keys are stored encrypted. `PATCH /v1/api/providers/{provider}` rotates a key in place, and `DELETE` removes it.

### Saving and testing are separate steps

After saving, use **Test** to check the provider connection. The test lists models using the selected key; model access also depends on that provider account's permissions.

Test a key explicitly:

```bash
curl -sS -X POST "$HLIX_BASE_URL/v1/api/providers/openrouter/test" \
  -H "x-api-key: $HLIX_API_KEY" \
  -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \
  -H 'content-type: application/json' \
  -d '{}'
```

Expected result for a working key: `200` and `{"ok": true, "status": 200}`. hlix asks the provider to list its models, using the stored key or an `apiKey` you pass in the body to check a key *before* saving it — which is what the dashboard does.

A failed test normally returns **`502`**, with `ok: false` and the provider status:

```json
{"ok": false, "status": 401, "detail": "…the provider's answer…"}
```

Read `ok` and the provider `status` in the response. A provider that does not support model discovery can return HTTP `200` with `ok: false`. After rotating a key, test the connection again.

## Set the models

Models are set in two groups, once for the Workspace and optionally again for a project. The first level that sets a field wins: the project, then the Workspace, then hlix's default.

| Group | What it covers | Fields |
| --- | --- | --- |
| **Project manager** | The project manager, chat, triage — see [Triage](/concepts/triage/) — and roadmap planning | model, effort |
| **Cycle** | The harness, and the review, plan and setup agents that run alongside it, including [Hlix Code](/harnesses/native-hlix/) | harness, provider, model, effort, parallel cycles |

Leave a model unset and hlix chooses a default for that group. Effort is `low`, `medium`, `high`, `xhigh` or `max`, to control the model's reasoning effort; a harness or model that takes fewer shows fewer. [Connect your agents](/guides/connect-agents/#how-ai-settings-are-chosen) explains the full order, including an agent's own harness, and how **parallel cycles** is capped.

```bash
curl -sS -X PUT "$HLIX_BASE_URL/v1/api/model-config/cycle" \
  -H "x-api-key: $HLIX_API_KEY" \
  -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \
  -H 'content-type: application/json' \
  -d '{"model":"anthropic:claude-opus-5","effort":"medium"}'
```

Expected result: `200` and the stored settings row. A field you leave out keeps its value and `null` clears it. Use `operator` in place of `cycle` for the Project manager group, which takes only `model` and `effort`. For one project, use `/v1/api/model-config/projects/$PROJECT_ID/cycle` (needs `manage` access on the project).

| Call | What it does |
| --- | --- |
| `GET /v1/api/model-config` | Every stored setting, the Workspace's first and then each project's |
| `GET /v1/api/model-config/resolved` | What the Workspace resolves to, with the level that set each field |
| `GET /v1/api/model-config/projects/{projectId}/resolved` | The same for one project |
| `GET /v1/api/model-config/catalog` | The models you can choose from |
| `DELETE /v1/api/model-config/{slot}` | Clear the Workspace's `operator` or `cycle` settings |
| `DELETE /v1/api/model-config/projects/{projectId}/{slot}` | Clear a project's override, so it follows the Workspace |

Changing the Workspace's settings needs the `owner` or `admin` role; a `member` can read them. The dashboard shows the same two groups under **Settings → Models & accounts → Defaults**, with a switch on each project to follow the Workspace or set its own.

## Provider

Choose **Managed by hlix** for Hlix-funded model access, or select a connected provider and native model for Hlix Code. Outside harnesses also support compatible API-key accounts, and Claude Code and Codex support their respective subscriptions. [AI accounts and funding](/harnesses/accounts/) explains each selection and who pays for model usage.

## How harnesses reach models

Managed funding uses Hlix model access. Connected provider accounts, custom API keys and subscriptions use the selected account and its native model. The model provider bills that usage separately from Hlix task charges.

### Which model a cycle runs on

With **Managed by hlix**, the harness and the model are separate choices: any catalog model runs in any harness. The first of these that is set wins:

1. A model the project manager pinned for this cycle.
2. The model of the custom agent hired for the cycle.
3. The Cycle group's model: the project's setting, else the Workspace's.
4. hlix's default model for the harness.

With a **connected model provider**, **Custom API key** or **Connected subscription**, the managed catalog model does not apply. The harness runs the account's native model ID. For harness accounts, Claude Code and Codex can use the provider's default when it is blank. Enter a native model ID for other harnesses and connected-provider selections.

<span id="how-hlix-handles-your-keys" />

Keys are encrypted in storage and omitted from account responses. Keep credentials out of test output, artifacts and screenshots. To stop use of a key, remove its connection and revoke it at the provider.

## If a key or model setting does not behave

- **Permission denied (`403`).** Storing, rotating, testing or removing provider keys requires a Workspace owner or administrator. Portal clients cannot access these settings.
- **Provider not found (`404`).** Add the account under **Accounts** or with `POST /v1/api/providers`.
- **No stored credentials during a test.** Save a key first, or pass `apiKey` in the test body to check it before saving.
- **A run reports provider `401`.** Test or replace the selected key. If discovery succeeds, confirm that the account has access to the chosen model and that its endpoint is correct.
- **The project uses a different model.** Read its resolved configuration and check project overrides, custom-agent settings and cycle selections.

<span id="where-to-go-next" />

## Next steps

[Connect your agents](/guides/connect-agents/)
  [Hlix Code](/harnesses/native-hlix/)
  [Outside harnesses](/harnesses/external-acp/)
  [Agents & orchestration](/concepts/agents/)