# ChipRateTable Schema

Platform-scoped table mapping model IDs to normalized Chip multipliers.

Source: https://mandrel-web-363efb.gitlab.io/docs/spec/chip-rate-table/

---


A `MandrelChipRateTable` maps model IDs to normalized **Chip** multipliers. **Chip** is the Mandrel cost unit, pegged to one input token on the baseline model. Agents declare only `spec.token-budget.model-id`; the Collet and Metrology Lab resolve the input/output multipliers from the active table at runtime.

At most one table is active at a time. `PUT /v1/chip-rates` replaces it atomically. The table persists across Lab restarts.

## Schema

```yaml
apiVersion: mandrelproject.ai/v1
kind: MandrelChipRateTable
```

### `spec.baseline`

The reference model whose cost defines 1.0 Chip.

| Field | Required | Type | Description |
| :--- | :--- | :--- | :--- |
| `chips-per-million-tokens` | ✓ | number > 0 | USD cost per 1M tokens on the baseline model (the Chip peg) |
| `model-id` | ✓ | string | Model pegged to 1.0× input and output multipliers; must also appear in `spec.rates` |

### `spec.rates`

Array of per-model multipliers. Must contain at least one entry. The baseline `model-id` must appear here.

| Field | Required | Type | Description |
| :--- | :--- | :--- | :--- |
| `model-id` | ✓ | string | Unique model identifier |
| `input-multiplier` | ✓ | number > 0 | Chip cost per 1M input tokens relative to the baseline |
| `output-multiplier` | ✓ | number > 0 | Chip cost per 1M output tokens relative to the baseline |

## Validation (E013)

| Code | Rule |
| :--- | :--- |
| E013 | Duplicate `model-id` in `spec.rates` |
| E013 | `spec.baseline.model-id` not found in `spec.rates` |
| E013 | `input-multiplier` or `output-multiplier` ≤ 0 |

E013 is emitted by `mandrel-cli validate` when the input file is a `MandrelChipRateTable`.

## Loading into the Metrology Lab

The preferred way to manage the chip rate table is via the Mandrel CLI:

```bash
# Get the active table
mandrel-cli platform chip-rates get > rates.yaml

# Update the table
mandrel-cli platform chip-rates put rates.yaml
```

Alternatively, you can use `curl` directly:

```bash
curl -X PUT https://lab.mandrel.internal:8740/v1/chip-rates \
  -H "Authorization: Bearer $TOKEN" \
  --data-binary @chip-rate-table.yaml
```

In dev mode with `--dev-api-key`:

```bash
curl -X PUT http://lab:8740/v1/chip-rates \
  -H "X-Mandrel-Lab-Key: $DEV_KEY" \
  --data-binary @chip-rate-table.yaml
```

## Example

```yaml
apiVersion: mandrelproject.ai/v1
kind: MandrelChipRateTable
metadata:
  name: v1-chip-rates
spec:
  baseline:
    chips-per-million-tokens: 0.10
    model-id: "gemini-2.5-flash-lite"
  rates:
    - model-id: "gemini-2.5-flash-lite"
      input-multiplier: 1.0
      output-multiplier: 4.0
    - model-id: "gemini-2.5-flash"
      input-multiplier: 3.0
      output-multiplier: 25.0
    - model-id: "gemini-2.5-pro"
      input-multiplier: 12.5
      output-multiplier: 100.0
    - model-id: "claude-haiku-4-5"
      input-multiplier: 10.0
      output-multiplier: 50.0
    - model-id: "claude-sonnet-4-6"
      input-multiplier: 30.0
      output-multiplier: 150.0
    - model-id: "claude-opus-4-6"
      input-multiplier: 50.0
      output-multiplier: 250.0
```

## Relationship to `spec.token-budget`

An agent's `spec.token-budget.model-id` is validated against this table at several points in the lifecycle:

| Code | Stage | Condition |
| :--- | :--- | :--- |
| E012 | CLI (`validate`) | `model-id` is empty — structural error, always enforced |
| W012 | CLI (`validate --metrology-lab`) | `model-id` not found in the active table — warning only |
| L001 | Lab (promotion gate) | `model-id` is on the platform deny-list — promotion rejected |
| L002 | Lab (promotion gate) | `model-id` not found in the active table — promotion rejected |

See the [CLI reference](https://mandrel-web-363efb.gitlab.io/docs/reference/cli.md) and [Metrology Lab reference](https://mandrel-web-363efb.gitlab.io/docs/reference/metrology-lab.md) for full diagnostic code details.

