{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/socialtoai-com/json-schema/socialtoai-com-account-response-schema.json",
  "title": "AccountResponse",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/socialtoai-com-openapi.json#/components/schemas/AccountResponse",
  "type": "object",
  "properties": {
    "request_id": {
      "type": "string",
      "minLength": 1
    },
    "schema_version": {
      "type": "string",
      "const": "v1"
    },
    "plan": {
      "type": "string",
      "enum": [
        "free",
        "paid"
      ]
    },
    "balance_credits": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "key": {
      "type": "object",
      "properties": {
        "today_spend_credits": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "daily_limit_credits": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "daily_remaining_credits": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "today_spend_credits",
        "daily_limit_credits",
        "daily_remaining_credits",
        "permissions",
        "expires_at"
      ],
      "additionalProperties": false
    },
    "account": {
      "type": "object",
      "properties": {
        "today_spend_credits": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "daily_limit_credits": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "daily_remaining_credits": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "today_spend_credits",
        "daily_limit_credits",
        "daily_remaining_credits"
      ],
      "additionalProperties": false
    },
    "billing": {
      "$ref": "#/$defs/Billing"
    },
    "purchase": {
      "type": "object",
      "properties": {
        "display": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "display",
        "url"
      ],
      "additionalProperties": false
    },
    "for_scripts": {
      "type": "object",
      "properties": {
        "display": {
          "type": "string",
          "minLength": 1
        },
        "keys_url": {
          "type": "string",
          "minLength": 1
        },
        "env_var": {
          "type": "string",
          "minLength": 1
        },
        "header": {
          "type": "string",
          "minLength": 1
        },
        "api_base": {
          "type": "string",
          "minLength": 1
        },
        "openapi": {
          "type": "string",
          "minLength": 1
        },
        "docs": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "display",
        "keys_url",
        "env_var",
        "header",
        "api_base",
        "openapi",
        "docs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "request_id",
    "schema_version",
    "plan",
    "balance_credits",
    "key",
    "account",
    "billing"
  ],
  "additionalProperties": false,
  "$defs": {
    "Billing": {
      "type": "object",
      "properties": {
        "cost_credits": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "balance_credits": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "today_spend_credits": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "daily_limit_credits": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "daily_remaining_credits": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "display": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "cost_credits",
        "balance_credits",
        "today_spend_credits",
        "daily_limit_credits",
        "daily_remaining_credits",
        "display"
      ],
      "additionalProperties": false
    }
  }
}