
# tdx models

Models callers can request from this gateway.

Models callers can request from this gateway: list them, toggle several at once, and manage who serves each one (providers), routers that pick between models, the aliases callers send, and custom models served from your own endpoint.

Every command also takes the [global flags](/cli/reference#global-flags) and reads the [environment variables](/cli/reference#environment-variables) that the command reference lists once.

## Commands

| Command | Description | Type |
|---|---|---|
| [tdx models list](/cli/reference/models#tdx-models-list) | List catalogue models. | Read |
| [tdx models toggle](/cli/reference/models#tdx-models-toggle) | Enable, disable, list or unlist providers and routers together. | Write |
| [tdx models providers](/cli/reference/models#tdx-models-providers) | Who serves a model on one client API. | Group |
| [tdx models providers list](/cli/reference/models#tdx-models-providers-list) | List provider configurations. | Read |
| [tdx models providers show](/cli/reference/models#tdx-models-providers-show) | Show the provider order of a provider configuration. | Read |
| [tdx models providers enable](/cli/reference/models#tdx-models-providers-enable) | Enable a provider configuration. | Write |
| [tdx models providers disable](/cli/reference/models#tdx-models-providers-disable) | Disable a provider configuration. | Write |
| [tdx models providers edit](/cli/reference/models#tdx-models-providers-edit) | Edit enabled or listing state, or provider routing, of a provider configuration. | Write |
| [tdx models providers edits](/cli/reference/models#tdx-models-providers-edits) | Manage stale provider configuration edits. | Group |
| [tdx models providers edits remove](/cli/reference/models#tdx-models-providers-edits-remove) | Remove a saved provider configuration edit. | Write |
| [tdx models routers](/cli/reference/models#tdx-models-routers) | Ids that pick one of several models per request. | Group |
| [tdx models routers list](/cli/reference/models#tdx-models-routers-list) | List routers. | Read |
| [tdx models routers set](/cli/reference/models#tdx-models-routers-set) | Create or replace an operator router. | Write |
| [tdx models routers preview](/cli/reference/models#tdx-models-routers-preview) | Preview how an operator router would rank its members. | Read |
| [tdx models routers remove](/cli/reference/models#tdx-models-routers-remove) | Remove an operator router. | Write |
| [tdx models routers edit](/cli/reference/models#tdx-models-routers-edit) | Edit a reviewed router. | Write |
| [tdx models routers edits](/cli/reference/models#tdx-models-routers-edits) | Manage stale reviewed router edits. | Group |
| [tdx models routers edits remove](/cli/reference/models#tdx-models-routers-edits-remove) | Remove a saved reviewed router edit. | Write |
| [tdx models routers strategies](/cli/reference/models#tdx-models-routers-strategies) | Ways a router can pick its model. | Group |
| [tdx models routers strategies list](/cli/reference/models#tdx-models-routers-strategies-list) | List operator strategies. | Read |
| [tdx models routers strategies explain](/cli/reference/models#tdx-models-routers-strategies-explain) | Explain an operator strategy. | Read |
| [tdx models routers strategies set](/cli/reference/models#tdx-models-routers-strategies-set) | Create or replace an operator strategy. | Write |
| [tdx models routers strategies remove](/cli/reference/models#tdx-models-routers-strategies-remove) | Remove an operator strategy. | Write |
| [tdx models aliases](/cli/reference/models#tdx-models-aliases) | Model ids callers send, per client API. | Group |
| [tdx models aliases list](/cli/reference/models#tdx-models-aliases-list) | List aliases. | Read |
| [tdx models aliases set](/cli/reference/models#tdx-models-aliases-set) | Point an alias at a provider configuration or router. | Write |
| [tdx models aliases remove](/cli/reference/models#tdx-models-aliases-remove) | Restore a reviewed default alias. | Write |
| [tdx models aliases preview](/cli/reference/models#tdx-models-aliases-preview) | Preview how an alias change would reach provider configurations. | Read |
| [tdx models custom](/cli/reference/models#tdx-models-custom) | Add models from a provider or your own server. | Group |
| [tdx models custom providers](/cli/reference/models#tdx-models-custom-providers) | List the providers a model can be added from. | Read |
| [tdx models custom pools](/cli/reference/models#tdx-models-custom-pools) | List configured pools for server models. | Read |
| [tdx models custom list](/cli/reference/models#tdx-models-custom-list) | List custom model declarations. | Read |
| [tdx models custom status](/cli/reference/models#tdx-models-custom-status) | Inspect runtime status of custom models. | Read |
| [tdx models custom create](/cli/reference/models#tdx-models-custom-create) | Add a model from a provider, or from a file. | Write |
| [tdx models custom edit](/cli/reference/models#tdx-models-custom-edit) | Replace one custom model declaration. | Write |
| [tdx models custom visibility](/cli/reference/models#tdx-models-custom-visibility) | Show or hide a provider-hosted model in discovery. | Write |
| [tdx models custom qualify](/cli/reference/models#tdx-models-custom-qualify) | Qualify a custom model with human approval. | Write |
| [tdx models custom qualify cancel](/cli/reference/models#tdx-models-custom-qualify-cancel) | Cancel one exact accepted qualification run. | Write |
| [tdx models custom remove](/cli/reference/models#tdx-models-custom-remove) | Remove a custom model declaration. | Write |

## tdx models list

List catalogue models.

**Reads**

Read the public catalogue model list with client dialects and kinds. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/v1/catalogue/models
tdx models list [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `models` | masked-catalogue-model[] | Catalogue model id, client dialects and kind. |

**Examples**

List catalogue model ids:

```bash
tdx models list --json=models
```

## tdx models toggle

Enable, disable, list or unlist providers and routers together.

**Writes**

Apply up to the gateway limit of toggle changes in one publication. Each change names its kind, its id, enabled and/or listed, and the expected current {enabled, listed}; kind group is a provider configuration (a catalogue Group) and kind modelGroup is a router. The gateway refuses stale expectations. The file must be a JSON object with a changes array. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/toggles
tdx models toggle --body-file <path> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--body-file` | path |  | Toggle changes file: `{"changes": [...]}`; regular file, or stdin with --body-file=-; UTF-8 JSON, at most 1 MiB. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `updated` | integer | Number of toggle changes applied. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview several toggles:

```bash
tdx models toggle --body-file ./toggles.json --dry-run --json
```

## tdx models providers

Who serves a model on one client API.

Who serves one model on one client API (a catalogue Group): turn it on or off, and list or unlist it. Ids are Group ids, called groupId in output. Provider credentials are managed separately with providers keys.

## tdx models providers list

List provider configurations.

**Reads**

Read the compiled Group inventory: reviewed provider configurations, routers and unreviewed custom provider configurations. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/v1/catalogue/groups
tdx models providers list [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `providers` | masked-group[] | Reviewed provider configurations (catalogue Groups). |
| `routers` | masked-model-group[] | Routers (ModelGroups) by client dialect. |
| `unreviewed` | masked-group[] | Operator-declared custom provider configurations. |
| `bindingsDigest` | string | Digest of the client dialect bindings. |

**Examples**

List provider configurations:

```bash
tdx models providers list --json=providers
```

## tdx models providers show

Show the provider order of a provider configuration.

**Reads**

Read one compiled Group from the inventory and print the order it tries its providers in: each provider with whether it is ready here and its catalogue list price, the routing strategy, and who set the order (catalogue or operator). The catalogue's default order is the cheapest blended list price first, then the model's own (first-party) provider, then provider id A-Z; with an operator's order set, defaultOrder lists the default it replaced. A route serves one client API, so each of a model's API formats has its own order, including multi-provider custom models. Models providers list names the routes. A request's x-tokedex-provider-order header puts its providers first and wins over this order. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/v1/catalogue/groups
tdx models providers show --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `provider` | masked-provider-order | The groupId, publicModelId, clientDialectId, strategy, setBy, order [{providerId, providerName, ready, price}] and defaultOrder when an operator set the order. |

**Examples**

Show the order a provider configuration tries its providers in:

```bash
tdx models providers show --id <group-id> --json
```

## tdx models providers enable

Enable a provider configuration.

**Writes**

Send `{"enabled": true}` for one reviewed Group id. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/groups/:groupId
tdx models providers enable --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `provider` | masked-group | The reviewed provider configuration (source Group) after the change. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview enabling a provider configuration:

```bash
tdx models providers enable --id <group-id> --dry-run --json
```

## tdx models providers disable

Disable a provider configuration.

**Writes**

Send `{"enabled": false}` for one reviewed Group id. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/groups/:groupId
tdx models providers disable --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `provider` | masked-group | The reviewed provider configuration (source Group) after the change. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview disabling a provider configuration:

```bash
tdx models providers disable --id <group-id> --dry-run --json
```

## tdx models providers edit

Edit enabled or listing state, or provider routing, of a provider configuration.

**Writes**

Save a source edit with at least one of --enabled, --listed, --provider-order and --default-order. --provider-order sends requests to the first provider it names and moves to the next when one fails; providers it leaves out follow in the default order (cheapest, then first-party, then A-Z). --default-order removes that order. The order is set per API format: a Group serves one client API, so set it on each of a model's Groups you want ordered, and read it back with models providers show. Custom routes accept provider order, and models custom visibility controls their discovery setting. A route with one provider has no order to set, and the gateway refuses --provider-order for it. A request's x-tokedex-provider-order header puts its providers first and wins over this order. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/source-edits/:groupId
tdx models providers edit --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--enabled` | one of `true`, `false` |  | Enabled state. |
| `--listed` | one of `true`, `false` |  | Listing state. |
| `--provider-order` | string |  | Catalogue provider id to try next; repeat in order, first tried first. Repeatable. |
| `--default-order` | boolean | `false` | Restore the default provider order. |

**Constraints**

- `--enabled` is required unless `--listed` or `--provider-order` or `--default-order`
- At most one of `--provider-order`, `--default-order`

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Keep a provider configuration serving but unlisted:

```bash
tdx models providers edit --id <group-id> --listed false --json
```

Send requests to one provider first, then the others:

```bash
tdx models providers edit --id <group-id> --provider-order <provider-id> --json
```

Restore the default provider order:

```bash
tdx models providers edit --id <group-id> --default-order --json
```

## tdx models providers edits

Manage stale provider configuration edits.

Remove saved provider configuration edits whose Group the catalogue no longer has.

## tdx models providers edits remove

Remove a saved provider configuration edit.

**Writes**

Remove a saved source edit. The gateway removes an edit only when the catalogue no longer has its Group, and refuses one for an existing Group with a usage error; to change a live one, use models providers edit. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# DELETE /control/compiled/source-edits/:groupId
tdx models providers edits remove --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Remove a stale provider configuration edit:

```bash
tdx models providers edits remove --id <group-id> --json
```

## tdx models routers

Ids that pick one of several models per request.

A router is an id that picks one of several models for each request (called a ModelGroup in gateway output). Members are catalogue models; an operator router may also name declared custom models: one on your own server serves only on its own protocol, one from a provider on any client API. set creates or replaces an operator router; edit changes a reviewed one.

## tdx models routers list

List routers.

**Reads**

There is no dedicated router read route; this reads the compiled aliases (addresses) view and prints only its routers (modelGroups in the gateway view). See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/compiled/addresses
tdx models routers list [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `routers` | masked-model-group[] | Reviewed and operator routers (ModelGroups). |
| `settings` | object | Saved operator router settings, including router and member provider selections. |

**Examples**

List reviewed and operator routers:

```bash
tdx models routers list --json
```

## tdx models routers set

Create or replace an operator router.

**Writes**

Send the file's JSON object as the operator router (ModelGroup) definition; the gateway validates it. Each member is `{"sourceGroupIds": {"<client-dialect>": "<group-id>"}}` for a catalogue model or `{"customModel": "<custom model public id>"}` for a declared custom model; keep at least one catalogue member. A custom member on your own server serves only on its custom model's protocol and only for keys that name that custom model; one from a provider serves on any client API, for any key whose model scope admits it, and a fact-ranked strategy leaves it out. Set providers on the router and/or each catalogue member to a list of provider ids for Selected providers; omit providers for All providers. A router with custom members takes no router providers. An empty list permits no provider. Router, member, key and workspace limits intersect. Use set again to edit these settings; list shows the saved settings. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PUT /control/compiled/model-groups/:modelGroupId
tdx models routers set --id <string> --body-file <path> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |
| `--body-file` | path |  | Router (ModelGroup) JSON object file; regular file, or stdin with --body-file=-; UTF-8 JSON, at most 1 MiB. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview a router definition:

```bash
tdx models routers set --id <router-id> --body-file ./router.json --dry-run --json
```

## tdx models routers preview

Preview how an operator router would rank its members.

**Reads**

Ask the gateway to check a router definition as a set would and explain how its strategy orders the members, without saving or auditing it. This is a read, not a dry-run: it sends the request, including with --dry-run. The gateway derives it like a publication, which can take several seconds on a large catalogue, so the request deadline is 30 seconds; any failure, including a timeout or gateway 5xx, is reported as a failed read, never as an applied or possibly applied change. The file is validated before any profile or gateway access. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# POST /control/compiled/model-groups/preview
tdx models routers preview --body-file <path> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--body-file` | path |  | Router (ModelGroup) JSON object file; regular file, or stdin with --body-file=-; UTF-8 JSON, at most 1 MiB. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `members` | masked-member[] | Each catalogue member's model and ranking variants, in the order sent. |
| `customMembers` | masked-member[] | Each custom model member: its position, the model id it ranks as, and whether it serves now with the reason when not. |
| `explanation` | masked-explanation | Each member's position, or why the strategy leaves it out. |

**Examples**

Check a router before saving it:

```bash
tdx models routers preview --body-file ./router.json --json
```

## tdx models routers remove

Remove an operator router.

**Writes**

Remove an operator router; the gateway refuses while an alias points at it. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# DELETE /control/compiled/model-groups/:modelGroupId
tdx models routers remove --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Remove an operator router:

```bash
tdx models routers remove --id <router-id> --json
```

## tdx models routers edit

Edit a reviewed router.

**Writes**

Save an enabled or listing edit for a reviewed router, with at least one of --enabled and --listed. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/model-group-edits/:modelGroupId
tdx models routers edit --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--enabled` | one of `true`, `false` |  | Enabled state. |
| `--listed` | one of `true`, `false` |  | Listing state. |

**Constraints**

- `--enabled` is required unless `--listed`

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Disable a reviewed router:

```bash
tdx models routers edit --id <router-id> --enabled false --json
```

## tdx models routers edits

Manage stale reviewed router edits.

Remove saved reviewed router edits whose ModelGroup the catalogue no longer has.

## tdx models routers edits remove

Remove a saved reviewed router edit.

**Writes**

Remove a saved reviewed router edit. The gateway removes an edit only when the catalogue no longer has its ModelGroup, and refuses one for an existing ModelGroup with a usage error; to change a live one, use models routers edit. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# DELETE /control/compiled/model-group-edits/:modelGroupId
tdx models routers edits remove --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Remove a stale router edit:

```bash
tdx models routers edits remove --id <router-id> --json
```

## tdx models routers strategies

Ways a router can pick its model.

The ways a router can pick its model, shared by routers: list, explain, create, replace and remove operator strategies that order router members.

## tdx models routers strategies list

List operator strategies.

**Reads**

Read the strategy language, its limits and saved operator definitions. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/compiled/model-group-strategies
tdx models routers strategies list [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `strategies` | masked-strategy-view | Masked strategy language, limits and definitions. |

**Examples**

List operator strategies:

```bash
tdx models routers strategies list --json
```

## tdx models routers strategies explain

Explain an operator strategy.

**Reads**

Explain how a saved strategy orders the members of each router using it, or only --router. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/compiled/model-group-strategies/:strategyId/explain
tdx models routers strategies explain --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--router` | string |  | Only explain this router (ModelGroup id). |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `explanations` | masked-explanation[] | Per router availability and member order. |

**Examples**

Explain one router:

```bash
tdx models routers strategies explain --id <strategy-id> --router <router-id> --json
```

## tdx models routers strategies set

Create or replace an operator strategy.

**Writes**

Send the file's JSON object as the strategy definition; the gateway validates it. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PUT /control/compiled/model-group-strategies/:strategyId
tdx models routers strategies set --id <string> --body-file <path> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |
| `--body-file` | path |  | Strategy tree JSON object file; regular file, or stdin with --body-file=-; UTF-8 JSON, at most 1 MiB. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `strategies` | masked-strategy-view | Masked strategy language, limits and definitions. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview a strategy definition:

```bash
tdx models routers strategies set --id <strategy-id> --body-file ./strategy.json --dry-run --json
```

## tdx models routers strategies remove

Remove an operator strategy.

**Writes**

Remove a saved operator strategy. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# DELETE /control/compiled/model-group-strategies/:strategyId
tdx models routers strategies remove --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `strategies` | masked-strategy-view | Masked strategy language, limits and definitions. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Remove an operator strategy:

```bash
tdx models routers strategies remove --id <strategy-id> --json
```

## tdx models aliases

Model ids callers send, per client API.

An alias is a model id callers send, and what it points at (a provider configuration or a router), per client API; it is not the id sent to the provider. The gateway calls these addresses. List, set, restore and preview them.

## tdx models aliases list

List aliases.

**Reads**

Read the compiled addresses view: reviewed sources, saved intent, effective aliases, routers, problems and serving reach. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/compiled/addresses
tdx models aliases list [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `sources` | masked-source[] | Reviewed provider configurations (source Groups). |
| `intent` | masked-intent | Saved operator intent. |
| `aliases` | masked-address[] | Effective aliases (addresses) per client dialect. |
| `routers` | masked-model-group[] | Reviewed and operator routers (ModelGroups). |
| `problems` | string[] | Saved entries disabled by catalogue references. |
| `serving` | masked-reach | How reviewed provider configurations are reached. |

**Examples**

List effective aliases and problems:

```bash
tdx models aliases list --json=aliases,problems
```

## tdx models aliases set

Point an alias at a provider configuration or router.

**Writes**

Point an alias at exactly one of --group, --router or --release. --release clears the target and requires --replaces; a released alias cannot set --listed. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/addresses
tdx models aliases set --client-dialect <string> --address <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--client-dialect` | string |  | Client API (client dialect) id. |
| `--address` | string |  | Alias: the model id callers send. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--group` | string |  | Provider configuration (catalogue Group) id. |
| `--router` | string |  | Router (ModelGroup) id. |
| `--release` | boolean | `false` | Release the alias. |
| `--replaces` | string |  | Reviewed holder id. |
| `--listed` | one of `true`, `false` |  | Listing state. |

**Constraints**

- Exactly one of `--group`, `--router`, `--release`
- `--release` requires `--replaces`
- At most one of `--release`, `--listed`

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview an alias:

```bash
tdx models aliases set --client-dialect <dialect> --address <alias> --group <group-id> --dry-run --json
```

## tdx models aliases remove

Restore a reviewed default alias.

**Writes**

Remove the saved alias entry, restoring the reviewed default. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/addresses
tdx models aliases remove --client-dialect <string> --address <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--client-dialect` | string |  | Client API (client dialect) id. |
| `--address` | string |  | Alias: the model id callers send. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `view` | masked-addresses-view | Masked compiled aliases (addresses) view after the write. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Restore a reviewed default:

```bash
tdx models aliases remove --client-dialect <dialect> --address <alias> --json
```

## tdx models aliases preview

Preview how an alias change would reach provider configurations.

**Reads**

Ask the gateway how reviewed provider configurations would be reached after one alias change, with exactly one of --group, --router, --release or --restore. The gateway derives the result without saving or auditing it. This is a read, not a dry-run: it sends the request, including with --dry-run. The gateway derives it like a publication, which can take several seconds on a large catalogue, so the request deadline is 30 seconds; any failure, including a timeout or gateway 5xx, is reported as a failed read, never as an applied or possibly applied change. --restore cannot set --replaces or --listed. Input is validated before any profile or gateway access. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# POST /control/compiled/addresses/preview
tdx models aliases preview --client-dialect <string> --address <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--client-dialect` | string |  | Client API (client dialect) id. |
| `--address` | string |  | Alias: the model id callers send. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--group` | string |  | Provider configuration (catalogue Group) id. |
| `--router` | string |  | Router (ModelGroup) id. |
| `--release` | boolean | `false` | Release the alias. |
| `--replaces` | string |  | Reviewed holder id. |
| `--listed` | one of `true`, `false` |  | Listing state. |
| `--restore` | boolean | `false` | Preview restoring the reviewed default. |

**Constraints**

- Exactly one of `--group`, `--router`, `--release`, `--restore`
- `--release` requires `--replaces`
- At most one of `--release`, `--listed`
- At most one of `--restore`, `--listed`
- At most one of `--restore`, `--replaces`

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `memberOnly` | masked-reach[] | Provider configurations reached only as router members or fallbacks. |
| `unaddressed` | string[] | Provider configurations no alias would reach. |

**Examples**

Preview reach before saving:

```bash
tdx models aliases preview --client-dialect <dialect> --address <alias> --router <router-id> --json
```

## tdx models custom

Add models from a provider or your own server.

Add, list, edit, qualify and remove custom models. One gateway model ID can contain a declaration for each of several providers. A declaration names the provider and its upstream model ID: it is served through the provider's own API and key, under the provider's id, as soon as it is saved, and its calls are recorded unpriced until it has a price. A model on your own server names its base URL and native protocol (Chat Completions, stateless Responses or conservative Messages); it is pending and not served until a qualification that a person approves, with spend consent, passes. upstreamModelId is sent unchanged. Aliases never point at a custom model, but an operator router may list one: on its own protocol for a model on your own server, on any client API for a model from a provider. Declarations name where the gateway reads a credential, never its value.

## tdx models custom providers

List the providers a model can be added from.

**Reads**

Read every catalogue provider with the APIs a model added from it can use (protocols, empty when it can use none) and any reason the reviewed binding or credentials are unavailable. Requires catalogue.read and credentials.read. No credential names or values are returned. Without --workspace-id, workspace-dependent eligibility is provisional. No provider calls.

```bash
# GET /control/compiled/custom-model-providers
tdx models custom providers [flags]
```

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--workspace-id` | string |  | Optional final workspace scope for provider key eligibility. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `providers` | provider-choice[] | ProviderId, label, protocols, workspaceDependent and optional unavailableReason. |

**Examples**

List the providers a model can be added from:

```bash
tdx models custom providers --json
```

## tdx models custom pools

List configured pools for server models.

**Reads**

List dedicated server pools configured on the gateway. Each choice shows its ID, origin, native protocol and availability. The full base URL and protocol must match the pool configuration when you select it in a model declaration. Requires catalogue.read and credentials.read. No provider calls.

```bash
# GET /control/compiled/custom-model-pools
tdx models custom pools [flags]
```

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--workspace-id` | string |  | Optional workspace for pool eligibility. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `pools` | custom-model-pool[] | Id, origin-only baseUrl, protocol, available and optional unavailableReason. |

**Examples**

List configured server pools:

```bash
tdx models custom pools --json
```

## tdx models custom list

List custom model declarations.

**Reads**

Read operator custom model declarations; requires catalogue.read and credentials.read. Valid entries show publicModelId, origin-only baseUrl (no private path), upstreamModelId, protocol, optional messages and price, listed and upstreamAuth (environment, custody, provider, pool or none). A dedicated pool also shows its ID. A model from a provider also shows provider and optional inputs; a model on your own server shows its server-owned qualification. Credential names are not shown. Qualification status is pending, testing, failed or enabled; it is not the runtime serving status. Isolated malformed entries instead show publicModelId, entryIndex, entryRevision and problem {code,message}, without declaration fields. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/compiled/custom-models
tdx models custom list [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `customModels` | masked-custom-model-or-invalid-entry[] | Provider, protocol, revision, optional messages, price and qualification for each declaration, or the invalid declaration’s entry index, entry revision and problem. |

**Examples**

List custom model declarations:

```bash
tdx models custom list --json
```

## tdx models custom status

Inspect runtime status of custom models.

**Reads**

Read each custom model's runtime status: serving or disabled, with an optional problem {code,message}. Pending, stale or invalid declarations are disabled; this is not qualification evidence or an activation command. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/v1/catalogue/custom-models
tdx models custom status [flags]
```

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `customModels` | masked-custom-model-status[] | PublicModelId, the provider if hosted, status (serving or disabled) and optional problem {code,message}. |

**Examples**

Inspect custom model status:

```bash
tdx models custom status --json
```

## tdx models custom create

Add a model from a provider, or from a file.

**Writes**

With --provider, add a model a catalogue provider serves that the catalogue does not list: --provider-model is the provider's id for it and --id the id clients send. It is served through the provider's API and key, under the provider's id, as soon as it is saved; no test is needed. Create another provider declaration with its own price under the same gateway model ID to add a fallback. Client APIs use the provider's reviewed projections. The serving provider reports approved translation losses, and strict requests require a lossless route. --api picks the provider API where it has several. A call to a Messages provider needs an output limit on the request or a reviewed or configured limit. Set max_tokens on Messages, max_completion_tokens (or max_tokens) on Chat Completions, or max_output_tokens on Responses. Use --max-output-tokens to configure a default. Before saving, it reads models custom providers and stops, saying what to change, on an unknown or unavailable provider, a missing or unserved --api, or a misplaced --max-output-tokens. Give each hosted declaration an explicit price with --free or both --price-input and --price-output. With rates, you can add --price-cached-input, --price-cache-write and --price-cache-write-long. A model the catalogue already serves on that provider is refused, naming the catalogue model. With --body-file, the file is one declaration object: either the same model from a provider (`{"publicModelId", "provider", "upstreamModelId", "price"}` with optional protocol, messages `{"maxOutputTokens"}`, inputs ["image","file"] and listed), or a model on your own server: publicModelId, baseUrl, upstreamModelId and protocol (openai.chat-completions, openai.responses or anthropic.messages). A Messages server you run also requires messages `{"apiVersion": "2023-06-01", "maxOutputTokens": 16384}`. Set price to `{"input": "1", "output": "2"}` or `{"free": true}`. Input, output and optional cachedInput, cacheWrite and cacheWriteLong are nonnegative decimal strings in USD per million tokens with up to six decimal places. Choose explicit free if both input and output rates are zero. A new model on your own server also needs a price. A cache rate left out is charged at the input rate, an hour-long write at the cache write rate. The first declaration defaults to listed, and adding a provider inherits the model's listing if listed is omitted. Use models custom visibility to change it. Optional credential is one of `{"environment": NAME}`, `{"custody": NAME}`, `{"pool": ID}`, or `{"provider": ID}`. Use models custom pools for dedicated pool IDs. A provider credential uses the provider's key or pool at its exact reviewed API address. baseUrl must be http(s) without userinfo, query or fragment; other URL, credential and rate rules remain the gateway's. A model on your own server is pending, not served, until qualification passes; never submit qualification: it is server-owned. Replies show origin-only baseUrl, protocol, optional provider, inputs, messages and price, listed, upstreamAuth and qualification; dry-run stays offline and shows the requested declaration without server evidence. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing). Example declaration: `{"publicModelId": "synthetic/endpoint", "baseUrl": "https://synthetic.invalid", "upstreamModelId": "synthetic-upstream", "protocol": "openai.chat-completions", "price": {"input": "1", "output": "2"}}`.

```bash
# POST /control/compiled/custom-models
tdx models custom create [flags]
```

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Catalogue provider id from models custom providers: the model is served through its API and key. |
| `--provider-model` | string |  | The provider's own model id, sent to it unchanged. |
| `--id` | string |  | Gateway model id: the id clients send. |
| `--api` | one of `chat-completions`, `responses`, `messages`, `gemini`, `bedrock-converse` |  | The provider API to call when more than one is available. |
| `--max-output-tokens` | integer |  | Set a default output limit for calls to a Messages provider, from 1 to 1000000. |
| `--inputs` | string |  | Inputs beyond text and tools it accepts: image, file or image,file. |
| `--price-input` | string |  | Input USD per million tokens, a decimal string such as 0.60. |
| `--price-output` | string |  | Output USD per million tokens, a decimal string such as 2.50. |
| `--price-cached-input` | string |  | Cached input (a prompt-cache read) USD per million tokens; without it, charged at --price-input. |
| `--price-cache-write` | string |  | Prompt-cache write USD per million tokens; without it, charged at --price-input. |
| `--price-cache-write-long` | string |  | Hour-long prompt-cache write USD per million tokens; without it, charged at --price-cache-write. |
| `--free` | boolean | `false` | Record its calls as free. |
| `--unlisted` | boolean | `false` | Create an unlisted model. Added providers inherit visibility when omitted. |
| `--body-file` | path |  | Declaration file, in place of the flags above; regular file, or stdin with --body-file=-; UTF-8 JSON, at most 1 MiB. |

**Constraints**

- Exactly one of `--provider`, `--body-file`
- `--provider-model` requires `--provider`
- `--provider` requires `--provider-model`
- `--id` requires `--provider`
- `--provider` requires `--id`
- `--api` requires `--provider`
- `--max-output-tokens` requires `--provider`
- `--inputs` requires `--provider`
- `--unlisted` requires `--provider`
- `--free` requires `--provider`
- `--price-input` requires `--price-output`
- `--price-output` requires `--price-input`
- `--price-input` requires `--provider`
- At most one of `--free`, `--price-input`
- `--price-cached-input` requires `--price-input`
- `--price-cache-write` requires `--price-input`
- `--price-cache-write-long` requires `--price-input`
- `--price-input` is required unless `--free` or `--body-file`

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `customModel` | masked-custom-model | PublicModelId, optional provider, origin-only baseUrl, upstreamModelId, protocol, price, optional inputs and messages, listed, upstreamAuth and, on your own server, server-owned pending qualification. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview a model from a provider:

```bash
tdx models custom create --provider <provider> --provider-model <provider-model-id> --id <gateway-model-id> --price-input 1 --price-output 2 --dry-run --json
```

Preview a custom model declaration:

```bash
tdx models custom create --body-file ./custom-model.json --dry-run --json
```

## tdx models custom edit

Replace one custom model declaration.

**Writes**

Edit one declaration selected by model ID and provider. Use models custom list to find the current revision. Include a price when editing a priced hosted model. An existing unpriced hosted model can keep its current pricing or receive a price. Use models custom visibility to change listing for a provider-hosted model. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PUT /control/compiled/custom-models/:publicModelId
tdx models custom edit --id <string> --revision <string> --body-file <path> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |
| `--revision` | string |  | Current declaration revision from models custom list. |
| `--body-file` | path |  | Complete replacement declaration; regular file, or stdin with --body-file=-; UTF-8 JSON, at most 1 MiB. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Provider to edit when several serve the model. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `customModel` | masked-custom-model | The updated declaration. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview updating one provider:

```bash
tdx models custom edit --id <public-model-id> --provider <provider-id> --revision <revision> --body-file ./custom-model.json --dry-run --json
```

## tdx models custom visibility

Show or hide a provider-hosted model in discovery.

**Writes**

Update discovery visibility for all providers under one model ID. Authorized callers can invoke a hidden model by ID. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# PATCH /control/compiled/custom-models/:publicModelId
tdx models custom visibility --id <string> --listed <true|false> --expected-listed <true|false> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |
| `--listed` | one of `true`, `false` |  | New listing state. |
| `--expected-listed` | one of `true`, `false` |  | Current listing state from models custom list. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `customModel` | masked-custom-model-visibility | The model ID and its new listed state. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Hide a model from discovery:

```bash
tdx models custom visibility --id <public-model-id> --listed false --expected-listed true --json
```

## tdx models custom qualify

Qualify a custom model with human approval.

**Writes**

Requires explicit --consent. Opens dashboard device approval when no fresh human qualification session exists. Admin keys, API keys and master keys cannot substitute for browser human approval. Fresh approval lasts at most ten minutes and ends on browser session expiry/revocation. Fixed suite: at most four calls of 128 output tokens, on a temporary model-restricted API key with total budget equal to the explicit cap (0 \< capUsd \<= 0.10). Reports the exact accepted run, testing and then enabled or failed. Starts are never retried; inspect dashboard state after an ambiguous acknowledgement. Transport interruption is not cancellation. Dry-run stays offline.

```bash
# POST /control/compiled/custom-models/:publicModelId/qualification
tdx models custom qualify <publicModelId> <command> --cap-usd <usd> --workspace <string> [flags]
```

**Arguments**

| Argument | Type | Description |
|---|---|---|
| `publicModelId` | string | Required. Custom model public ID. |

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--cap-usd` | usd |  | Explicit total budget: more than USD 0, at most USD 0.10. |
| `--workspace` | string |  | Workspace charged by the temporary restricted API key. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Provider to qualify when several serve the model. |
| `--consent` | boolean | `false` | Approve at most four calls, each at most 128 output tokens, with total budget equal to cap-usd. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `publicModelId` | string | Requested model. |
| `provider` | string | The qualified provider, when applicable. |
| `runId` | string\|null | Exact accepted run ID. |
| `status` | string | Testing, enabled or failed. |
| `failure` | string\|null | Safe qualification failure category. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

## tdx models custom qualify cancel

Cancel one exact accepted qualification run.

**Writes**

Requires the human-approved qualification session and the exact accepted --run-id. Never cancels a guessed current run; transport abort is not cancellation. Dry-run sends nothing.

```bash
# POST /control/compiled/custom-models/:publicModelId/qualification/cancel
tdx models custom qualify cancel <publicModelId> --run-id <string> [flags]
```

**Arguments**

| Argument | Type | Description |
|---|---|---|
| `publicModelId` | string | Required. Custom model public ID. |

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--run-id` | string |  | Exact accepted qualification run ID. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Provider whose run to cancel. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `publicModelId` | string | Requested model. |
| `provider` | string | The provider selected for cancellation, when given. |
| `runId` | string | Exact cancellation target. |
| `cancelled` | boolean | Gateway acknowledged cancellation. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

## tdx models custom remove

Remove a custom model declaration.

**Writes**

Remove one declaration by public model ID and provider if the model has several providers. See [Catalogue changes](/cli/reference#catalogue-changes) and [Catalogue republishing](/cli/reference#catalogue-republishing).

```bash
# DELETE /control/compiled/custom-models/:publicModelId
tdx models custom remove --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Public resource id; never a credential. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Provider to remove when several serve the model. |
| `--revision` | string |  | Require this current declaration revision. |

**Output fields** (inside `data`)

| Field | Type | Description |
|---|---|---|
| `removed` | string | Removed public model id. |
| `provider` | string | Provider selected for removal, when given. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Remove a custom model:

```bash
tdx models custom remove --id <public-model-id> --json
```
