
# tdx pricing

Inspect prices and manage price overrides.

Read effective deployment prices and coverage, and manage operator price overrides.

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 pricing list](/cli/reference/pricing#tdx-pricing-list) | List deployment prices and overrides. | Read |
| [tdx pricing overrides](/cli/reference/pricing#tdx-pricing-overrides) | Manage price overrides. | Group |
| [tdx pricing overrides set](/cli/reference/pricing#tdx-pricing-overrides-set) | Set a price override for a provider model. | Write |
| [tdx pricing overrides edit](/cli/reference/pricing#tdx-pricing-overrides-edit) | Replace a price override. | Write |
| [tdx pricing overrides remove](/cli/reference/pricing#tdx-pricing-overrides-remove) | Remove a price override. | Write |
| [tdx pricing unpriced](/cli/reference/pricing#tdx-pricing-unpriced) | Price calls made with no price. | Group |
| [tdx pricing unpriced list](/cli/reference/pricing#tdx-pricing-unpriced-list) | List calls served with no price, by provider model. | Read |
| [tdx pricing unpriced price](/cli/reference/pricing#tdx-pricing-unpriced-price) | Charge a provider model's calls with no price at the price covering it now. | Write |

## tdx pricing list

List deployment prices and overrides.

**Reads**

Read effective deployment prices, coverage, this month's call counts, model reach and price overrides. See [Catalogue reads](/cli/reference#catalogue-reads).

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

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

| Field | Type | Description |
|---|---|---|
| `catalogueRevision` | string\|null | Catalogue price revision. |
| `coverage` | masked-coverage | Priced and unpriced deployments. |
| `month` | masked-month | This month's call counts. |
| `deployments` | masked-price[] | Effective price per deployment. |
| `models` | masked-reach[] | Deployments answering each model id. |
| `overrides` | masked-override[] | Saved price overrides. |

**Examples**

Inspect price coverage and overrides:

```bash
tdx pricing list --json=coverage,overrides
```

## tdx pricing overrides

Manage price overrides.

Set, replace or remove a price override for one provider model, identified as provider:model.

## tdx pricing overrides set

Set a price override for a provider model.

**Writes**

Send exactly one of a --price-file JSON object or --free, with an optional --note. With --apply-to-unpriced, the calls the provider model already served with no price are priced too, at this price, each in the day, week and month it was made; a call that had a price keeps it. See [Catalogue changes](/cli/reference#catalogue-changes).

```bash
# POST /control/v1/pricing/overrides
tdx pricing overrides set --provider <string> --model <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Provider id from pricing list. |
| `--model` | string |  | Provider model id from pricing list. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--price-file` | path |  | Price card JSON object file; regular file, or stdin with --price-file=-; at most 1 MiB. |
| `--free` | boolean | `false` | Mark the model free instead of supplying a price. |
| `--note` | string |  | Non-secret note. |
| `--apply-to-unpriced` | boolean | `false` | Also price the calls this provider model served with no price, at this price. |

**Constraints**

- Exactly one of `--price-file`, `--free`

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

| Field | Type | Description |
|---|---|---|
| `override` | masked-override | Saved price override. |
| `repriced` | repriced\|null | With --apply-to-unpriced: calls priced, those priced from an estimate, calls still with no price, the cost added (null when hidden) and the workspaces charged. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Preview a price override:

```bash
tdx pricing overrides set --provider <provider> --model <model> --price-file ./price.json --dry-run --json
```

Set a price and charge it to the calls already made:

```bash
tdx pricing overrides set --provider <provider> --model <model> --price-file ./price.json --apply-to-unpriced --json
```

## tdx pricing overrides edit

Replace a price override.

**Writes**

Replace the price of an existing override with exactly one of --price-file or --free, with an optional --note. Omitting --note clears any saved note. See [Catalogue changes](/cli/reference#catalogue-changes).

```bash
# PATCH /control/v1/pricing/overrides/:overrideId
tdx pricing overrides edit --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Price override id (provider:model) from pricing list. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--price-file` | path |  | Price card JSON object file; regular file, or stdin with --price-file=-; at most 1 MiB. |
| `--free` | boolean | `false` | Mark the model free instead of supplying a price. |
| `--note` | string |  | Non-secret note. |
| `--apply-to-unpriced` | boolean | `false` | Also price the calls this provider model served with no price, at this price. |

**Constraints**

- Exactly one of `--price-file`, `--free`

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

| Field | Type | Description |
|---|---|---|
| `override` | masked-override | Saved price override. |
| `repriced` | repriced\|null | With --apply-to-unpriced: calls priced, those priced from an estimate, calls still with no price, the cost added (null when hidden) and the workspaces charged. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Mark an overridden model free:

```bash
tdx pricing overrides edit --id <provider:model> --free --json
```

## tdx pricing overrides remove

Remove a price override.

**Writes**

Remove a price override, restoring the catalogue price. See [Catalogue changes](/cli/reference#catalogue-changes).

```bash
# DELETE /control/v1/pricing/overrides/:overrideId
tdx pricing overrides remove --id <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--id` | string |  | Price override id (provider:model) from pricing list. |

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

| Field | Type | Description |
|---|---|---|
| `removed` | string | Removed price override id. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

Remove a price override:

```bash
tdx pricing overrides remove --id <provider:model> --json
```

## tdx pricing unpriced

Price calls made with no price.

List the calls models served before they had a price, by provider model, and charge them once a price covers the model.

## tdx pricing unpriced list

List calls served with no price, by provider model.

**Reads**

Read the calls the gateway recorded with no price, by provider and provider model ID: how many, their tokens, when they were made, the gateway model IDs that served them, and the price that covers them now, if any. Such calls are kept to be priced for retentionDays days. See [Catalogue reads](/cli/reference#catalogue-reads).

```bash
# GET /control/v1/pricing/unpriced
tdx pricing unpriced list [flags]
```

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--since` | string |  | Only calls made at or after this: an ISO time, or a number of days back such as 30d. |

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

| Field | Type | Description |
|---|---|---|
| `retentionDays` | number | How long a call with no price is kept to be priced. |
| `models` | masked-unpriced[] | Calls with no price per provider model: counts, tokens, first and last call, gateway model ids, the price covering them now, and uncoveredCalls, those no price covers yet. |

**Examples**

List the last 30 days of calls with no price:

```bash
tdx pricing unpriced list --since 30d --json
```

## tdx pricing unpriced price

Charge a provider model's calls with no price at the price covering it now.

**Writes**

Charge the calls this provider model served with no price at the price that covers it now (its own, an override, or the catalogue's), each in the day, week and month it was made. A call is priced once; a call that had a price keeps it. With --preview the gateway says what that would charge and prices nothing. When no price covers the model yet the gateway refuses, and nothing is priced. See [Catalogue changes](/cli/reference#catalogue-changes).

```bash
# POST /control/v1/pricing/unpriced/reprice
tdx pricing unpriced price --provider <string> --model <string> [flags]
```

**Required flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--provider` | string |  | Provider id from pricing unpriced list. |
| `--model` | string |  | Provider model id from pricing unpriced list. |

**Optional flags**

| Flag | Type | Default | Description |
|---|---|---|---|
| `--preview` | boolean | `false` | Say what pricing would charge, and price nothing. |

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

| Field | Type | Description |
|---|---|---|
| `priced` | repriced | Whether it was a preview, calls priced, those priced from an estimate, calls still with no price, the cost added (null when hidden) and the workspaces charged. |
| `preview` | write-preview\|null | Requested change, unchecked by the gateway; null after execution. |

**Examples**

See what pricing the calls would charge:

```bash
tdx pricing unpriced price --provider <provider> --model <provider-model-id> --preview --json
```
