{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shapesoda-com/json-schema/shapesoda-com-account-response-schema.json",
  "title": "AccountResponse",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shapesoda-com-openapi.json#/components/schemas/AccountResponse",
  "type": "object",
  "required": [
    "account",
    "credits"
  ],
  "properties": {
    "account": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "credits": {
      "$ref": "#/$defs/Credits"
    }
  },
  "$defs": {
    "Credits": {
      "type": "object",
      "required": [
        "balance",
        "subscription_balance",
        "quota",
        "quota_used",
        "quota_left",
        "spent_month",
        "spend_limit",
        "available"
      ],
      "properties": {
        "available": {
          "type": "integer",
          "description": "Images that can be processed right now: quota_left + balance, capped by what is left of spend_limit."
        },
        "balance": {
          "type": "integer",
          "description": "Purchased credits, shared with the website; includes subscription_balance."
        },
        "subscription_balance": {
          "type": "integer",
          "description": "Credits from the API plan, used first. Unused ones roll over up to 5× the monthly amount and expire when the plan ends."
        },
        "quota": {
          "type": "integer",
          "description": "Monthly included credits (0 for pay-as-you-go accounts)."
        },
        "quota_used": {
          "type": "integer"
        },
        "quota_left": {
          "type": "integer"
        },
        "spent_month": {
          "type": "integer",
          "description": "Credits used this calendar month (UTC)."
        },
        "spend_limit": {
          "type": [
            "integer",
            "null"
          ],
          "description": "User-set monthly cap in credits; null means no cap."
        }
      }
    }
  }
}