{
  "$defs": {
    "BudgetPeriod": {
      "description": "Window of a per-token vCPU-second budget (UTC calendar day or month).",
      "enum": [
        "day",
        "month"
      ],
      "title": "BudgetPeriod",
      "type": "string"
    }
  },
  "$id": "https://schemas.mapi.dev/v1/api-TokenCreate.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "``POST /v1/tokens``: mint a token for the caller in the selected project.\n\nThe token can never do more than its owner's role allows at the time of use. Limits are\noptional: ``None`` means the tenant's defaults apply (they always apply in addition).",
  "examples": [
    {
      "budget_period": "month",
      "expires_in_days": 30,
      "name": "budget-planner",
      "rate_limit_per_minute": 120,
      "scopes": [
        "score:geo-mmm-prod",
        "models:read"
      ],
      "vcpu_seconds_budget": 36000
    }
  ],
  "properties": {
    "budget_period": {
      "$ref": "#/$defs/BudgetPeriod",
      "default": "month"
    },
    "expires_in_days": {
      "default": 90,
      "maximum": 365,
      "minimum": 1,
      "title": "Expires In Days",
      "type": "integer"
    },
    "name": {
      "maxLength": 100,
      "minLength": 1,
      "pattern": "^[^\\x00-\\x1f\\x7f]+$",
      "title": "Name",
      "type": "string"
    },
    "rate_limit_per_minute": {
      "anyOf": [
        {
          "maximum": 100000,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Rate Limit Per Minute"
    },
    "scopes": {
      "items": {
        "examples": [
          "models:read",
          "runs:create",
          "score:geo-mmm-prod"
        ],
        "maxLength": 140,
        "type": "string"
      },
      "maxItems": 32,
      "minItems": 1,
      "title": "Scopes",
      "type": "array"
    },
    "vcpu_seconds_budget": {
      "anyOf": [
        {
          "exclusiveMinimum": 0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Vcpu Seconds Budget"
    }
  },
  "required": [
    "name",
    "scopes"
  ],
  "title": "TokenCreate",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
