{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lumeta-ai/json-schema/lumeta-ai-team-schema.json",
  "title": "Team",
  "description": "Everything past `team_page` is there for the team's admins only.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lumeta-ai-openapi.json#/components/schemas/Team",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "`team_<id>`"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "creator",
        "viewer"
      ]
    },
    "manage": {
      "type": "boolean",
      "description": "You are one of its admins."
    },
    "team_page": {
      "type": "string",
      "description": "Where its admins manage it on the website (seats are added there)."
    },
    "admins": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Not an admin: their names, to know whom to ask."
    },
    "default_monthly_limit": {
      "type": [
        "integer",
        "null"
      ]
    },
    "plan": {
      "type": "string"
    },
    "credits_left": {
      "type": "integer",
      "description": "In the team's shared pool this cycle."
    },
    "resets_at": {
      "type": "string"
    },
    "members": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "creator",
              "viewer"
            ]
          },
          "monthly_limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "spent_this_cycle": {
            "type": "integer"
          },
          "bonus_this_cycle": {
            "type": "integer"
          },
          "private": {
            "type": "boolean"
          },
          "only_added": {
            "type": "boolean"
          },
          "paused": {
            "type": "boolean"
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "joined_at": {
            "type": "string"
          },
          "you": {
            "type": "boolean"
          }
        }
      }
    },
    "invites": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "`invite_<id>`"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          },
          "uses": {
            "type": [
              "integer",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "seats": {
      "type": "object",
      "properties": {
        "billed": {
          "type": "boolean",
          "description": "Only a billed team ever needs a seat."
        },
        "paid": {
          "type": "integer"
        },
        "used": {
          "type": "integer"
        },
        "seat_price_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "interval": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}