{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vmotif-com/json-schema/vmotif-com-usage-schema.json",
  "title": "Usage",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vmotif-com-openapi.yml#/components/schemas/Usage",
  "type": "object",
  "required": [
    "tier",
    "token_budget_micros",
    "used_micros",
    "remaining_micros",
    "resets_at",
    "limit_kind",
    "daily_generations_limit",
    "daily_generations_remaining",
    "scope",
    "workspace_id",
    "workspace_budget_micros",
    "workspace_used_micros",
    "workspace_remaining_micros",
    "workspace_resets_at"
  ],
  "properties": {
    "tier": {
      "type": "string",
      "enum": [
        "legacy_free",
        "pro",
        "enterprise",
        "blocked"
      ]
    },
    "token_budget_micros": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Period budget in micro-dollars; null = no micro-dollar ceiling, and `limit_kind` says why. Always reflects personal budget."
    },
    "used_micros": {
      "type": "integer",
      "description": "Micro-dollars used this period. Always reflects personal usage."
    },
    "remaining_micros": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Micro-dollars remaining; null = no micro-dollar ceiling (see `token_budget_micros`). Always reflects personal budget."
    },
    "resets_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the personal budget resets (for `daily_count`, the daily generation count); null if not applicable."
    },
    "limit_kind": {
      "type": "string",
      "enum": [
        "token_budget",
        "unlimited",
        "daily_count",
        "blocked"
      ],
      "description": "What limits personal generation: a micro-dollar budget, nothing, a daily generation count (legacy free), or no plan. Tells a `null` budget for an unlimited account apart from a legacy free one."
    },
    "daily_generations_limit": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Generations allowed per day when `limit_kind` is `daily_count`. Null otherwise."
    },
    "daily_generations_remaining": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Generations left today when `limit_kind` is `daily_count`. Null otherwise."
    },
    "scope": {
      "type": "string",
      "enum": [
        "personal",
        "workspace"
      ],
      "description": "Where this API key's generations charge: `personal` for personal-budget keys, `workspace` for workspace-bound keys."
    },
    "workspace_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The workspace this key bills to, when `scope` is `workspace`. Null for personal keys."
    },
    "workspace_budget_micros": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Workspace pool budget in micro-dollars, when `scope` is `workspace` and the workspace has an active Team plan. Null only when the pool is unlimited. 0 when the key cannot charge its workspace (no active Team plan, or the key's workspace access no longer resolves), so generations answer 402."
    },
    "workspace_used_micros": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Workspace pool usage in micro-dollars, when `scope` is `workspace` and the workspace has an active Team plan. Null otherwise."
    },
    "workspace_remaining_micros": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Workspace pool remaining in micro-dollars (clamped >= 0), when `scope` is `workspace` and the workspace has an active Team plan. Null only when the pool is unlimited (no ceiling — keep submitting work). 0 when the key cannot charge its workspace."
    },
    "workspace_resets_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the workspace pool resets, when `scope` is `workspace` and the workspace has an active Team plan. Null otherwise."
    }
  }
}