# dev.cocore.compute.defs

> Published by [cocore.dev](https://lexicon.garden/identity/did:plc:5quuhkmwe2q4k3azfsgg7kdz)

✓ This is the authoritative definition for this NSID.

## Description

Shared type definitions for dev.cocore.compute.* records.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.compute.defs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.compute.defs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.compute.defs/examples)

## Definitions

### `dev.cocore.compute.defs#money`

**Type**: `object`

An amount of value, in integer minor units of a named currency. No floats. ISO 4217 codes are preferred; uppercase three-or-more-letter codes are accepted for non-fiat (e.g. XBT, XSAT, USDC).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `amount` | `integer` | Yes | Integer minor units (e.g. cents for USD). |
| `currency` | `string` | Yes | Uppercase currency code. |

### `dev.cocore.compute.defs#tokenRate`

**Type**: `object`

A model-agnostic per-token rate. Same shape as modelPrice without modelId. Used by an exchange to express a uniform rate that applies across providers/models. A receipt's price.amount is auditable against this rate as roughly `inputPricePerMTok * tokens.in / 1e6 + outputPricePerMTok * tokens.out / 1e6`, modulo a small floor for very short jobs.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `currency` | `string` | Yes |  |
| `inputPricePerMTok` | `integer` | Yes | Integer minor units per 1,000,000 input tokens. |
| `outputPricePerMTok` | `integer` | Yes | Integer minor units per 1,000,000 output tokens. |

### `dev.cocore.compute.defs#modelPrice`

**Type**: `object`

A provider's offered price for a single model.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `modelId` | `string` | Yes |  |
| `currency` | `string` | Yes |  |
| `inputPricePerMTok` | `integer` | Yes | Integer minor units per 1,000,000 input tokens. |
| `outputPricePerMTok` | `integer` | Yes | Integer minor units per 1,000,000 output tokens. |

### `dev.cocore.compute.defs#trustLevel`

**Type**: `string`

How strongly the provider's environment is attested.

**Known Values**:
- `self-attested`
- `hardware-attested`

### `dev.cocore.compute.defs#tokenCounts`

**Type**: `object`

Token counts associated with a unit of work.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `in` | `integer` | Yes |  |
| `out` | `integer` | Yes |  |

### `dev.cocore.compute.defs#settlementStatus`

**Type**: `string`

Lifecycle state of a settlement record.

**Known Values**:
- `settled`
- `refunded`
- `disputed`

## Raw Schema

```json
{
  "id": "dev.cocore.compute.defs",
  "defs": {
    "money": {
      "type": "object",
      "required": [
        "amount",
        "currency"
      ],
      "properties": {
        "amount": {
          "type": "integer",
          "minimum": 0,
          "description": "Integer minor units (e.g. cents for USD)."
        },
        "currency": {
          "type": "string",
          "maxLength": 8,
          "minLength": 3,
          "description": "Uppercase currency code."
        }
      },
      "description": "An amount of value, in integer minor units of a named currency. No floats. ISO 4217 codes are preferred; uppercase three-or-more-letter codes are accepted for non-fiat (e.g. XBT, XSAT, USDC)."
    },
    "tokenRate": {
      "type": "object",
      "required": [
        "inputPricePerMTok",
        "outputPricePerMTok",
        "currency"
      ],
      "properties": {
        "currency": {
          "type": "string",
          "maxLength": 8,
          "minLength": 3
        },
        "inputPricePerMTok": {
          "type": "integer",
          "minimum": 0,
          "description": "Integer minor units per 1,000,000 input tokens."
        },
        "outputPricePerMTok": {
          "type": "integer",
          "minimum": 0,
          "description": "Integer minor units per 1,000,000 output tokens."
        }
      },
      "description": "A model-agnostic per-token rate. Same shape as modelPrice without modelId. Used by an exchange to express a uniform rate that applies across providers/models. A receipt's price.amount is auditable against this rate as roughly `inputPricePerMTok * tokens.in / 1e6 + outputPricePerMTok * tokens.out / 1e6`, modulo a small floor for very short jobs."
    },
    "modelPrice": {
      "type": "object",
      "required": [
        "modelId",
        "inputPricePerMTok",
        "outputPricePerMTok",
        "currency"
      ],
      "properties": {
        "modelId": {
          "type": "string",
          "maxLength": 256
        },
        "currency": {
          "type": "string",
          "maxLength": 8,
          "minLength": 3
        },
        "inputPricePerMTok": {
          "type": "integer",
          "minimum": 0,
          "description": "Integer minor units per 1,000,000 input tokens."
        },
        "outputPricePerMTok": {
          "type": "integer",
          "minimum": 0,
          "description": "Integer minor units per 1,000,000 output tokens."
        }
      },
      "description": "A provider's offered price for a single model."
    },
    "trustLevel": {
      "type": "string",
      "description": "How strongly the provider's environment is attested.",
      "knownValues": [
        "self-attested",
        "hardware-attested"
      ]
    },
    "tokenCounts": {
      "type": "object",
      "required": [
        "in",
        "out"
      ],
      "properties": {
        "in": {
          "type": "integer",
          "minimum": 0
        },
        "out": {
          "type": "integer",
          "minimum": 0
        }
      },
      "description": "Token counts associated with a unit of work."
    },
    "settlementStatus": {
      "type": "string",
      "description": "Lifecycle state of a settlement record.",
      "knownValues": [
        "settled",
        "refunded",
        "disputed"
      ]
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Shared type definitions for dev.cocore.compute.* records."
}
```
