{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smstunnel-io/json-schema/smstunnel-io-usage-schema.json",
  "title": "Usage",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smstunnel-io-openapi.json#/components/schemas/Usage",
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "data": {
      "type": "object",
      "required": [
        "plan",
        "accountType",
        "usage",
        "limits",
        "remaining"
      ],
      "properties": {
        "plan": {
          "type": "string",
          "enum": [
            "free",
            "twofa",
            "standard",
            "pro",
            "enterprise"
          ],
          "description": "The plan: `twofa` is Starter, `pro` is Professional."
        },
        "accountType": {
          "type": "string",
          "enum": [
            "standard",
            "enterprise",
            "sub_account"
          ]
        },
        "usage": {
          "type": "object",
          "description": "What was used. Daily counts restart at 00:00 UTC, `smsCleanMonth` on the 1st.",
          "required": [
            "smsClean",
            "smsBranded",
            "twoFaClean",
            "smsCleanMonth"
          ],
          "properties": {
            "smsClean": {
              "type": "integer",
              "description": "Texts sent as written, today."
            },
            "smsBranded": {
              "type": "integer",
              "description": "Texts and codes sent with the Free plan's line, today."
            },
            "twoFaClean": {
              "type": "integer",
              "description": "Sign-in codes sent as written, today."
            },
            "smsCleanMonth": {
              "type": "integer",
              "description": "Texts sent as written, this month."
            }
          }
        },
        "limits": {
          "type": "object",
          "description": "What the plan allows: a number, or `\"unlimited\"`.",
          "required": [
            "smsClean",
            "twoFaClean",
            "smsCleanPerMonth",
            "smsBrandedPerDay"
          ],
          "properties": {
            "smsClean": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Texts as written, per day."
            },
            "twoFaClean": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Sign-in codes as written, per day."
            },
            "smsCleanPerMonth": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Texts as written, per month."
            },
            "smsBrandedPerDay": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Texts and codes with the Free plan's line, per day."
            }
          }
        },
        "remaining": {
          "type": "object",
          "description": "What is left: a number, or `\"unlimited\"`.",
          "required": [
            "smsClean",
            "twoFaClean",
            "smsCleanMonth",
            "smsBranded"
          ],
          "properties": {
            "smsClean": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Texts that can still go out as written today, this month's count included."
            },
            "twoFaClean": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Sign-in codes that can still go out as written today."
            },
            "smsCleanMonth": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Texts that can still go out as written this month."
            },
            "smsBranded": {
              "oneOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "enum": [
                    "unlimited"
                  ]
                }
              ],
              "description": "Texts and codes that can still go out with the Free plan's line today."
            }
          }
        },
        "enterprise": {
          "type": "object",
          "description": "For a client account of a company: the company whose allowance it uses.",
          "required": [
            "id",
            "name"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}