{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sudomock-com/json-schema/sudomock-com-me-response-schema.json",
  "title": "MeResponse",
  "description": "Your account, plan, usage and remaining credits.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sudomock-com-account-api-openapi.yml#/components/schemas/MeResponse",
  "properties": {
    "data": {
      "$ref": "#/$defs/MeResponseData",
      "description": "Response data"
    },
    "success": {
      "type": "boolean",
      "description": "Success status",
      "default": true
    }
  },
  "type": "object",
  "required": [
    "data"
  ],
  "$defs": {
    "MeAccountData": {
      "properties": {
        "uuid": {
          "type": "string",
          "description": "User UUID"
        },
        "email": {
          "type": "string",
          "description": "User email address"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Account or company name"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Account creation timestamp"
        }
      },
      "type": "object",
      "required": [
        "uuid",
        "email",
        "created_at"
      ],
      "title": "MeAccountData",
      "description": "Account information in /me response"
    },
    "MeApiKeyData": {
      "properties": {
        "name": {
          "type": "string",
          "description": "API key name"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the API key was created"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "Last time the API key was used"
        },
        "total_requests": {
          "type": "integer",
          "description": "Total credit-consuming operations recorded for this API key"
        }
      },
      "type": "object",
      "required": [
        "name",
        "created_at",
        "total_requests"
      ],
      "title": "MeApiKeyData",
      "description": "API key metadata in /me response"
    },
    "MeOrganizationData": {
      "properties": {
        "id": {
          "type": "string",
          "description": "Organization UUID"
        },
        "name": {
          "type": "string",
          "description": "Organization name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "MeOrganizationData",
      "description": "Organization the request acts on in /me response"
    },
    "MeResponseData": {
      "properties": {
        "account": {
          "$ref": "#/$defs/MeAccountData",
          "description": "User account information"
        },
        "organization": {
          "$ref": "#/$defs/MeOrganizationData",
          "description": "Organization that owns the subscription and usage below"
        },
        "subscription": {
          "$ref": "#/$defs/MeSubscriptionData",
          "description": "Subscription details"
        },
        "usage": {
          "$ref": "#/$defs/MeUsageData",
          "description": "Usage statistics"
        },
        "api_key": {
          "anyOf": [
            {
              "$ref": "#/$defs/MeApiKeyData"
            },
            {
              "type": "null"
            }
          ],
          "description": "Current API key metadata"
        }
      },
      "type": "object",
      "required": [
        "account",
        "organization",
        "subscription",
        "usage"
      ],
      "title": "MeResponseData",
      "description": "Data payload in /me response"
    },
    "MeSubscriptionData": {
      "properties": {
        "plan": {
          "type": "string",
          "description": "Plan slug (e.g., 'pro-25k', 'scale-100k', 'free')"
        },
        "tier": {
          "type": "string",
          "description": "Plan tier for feature gating (e.g., 'free', 'pro', 'scale')"
        },
        "status": {
          "type": "string",
          "description": "Subscription status: 'active', 'cancelled', 'past_due', 'expired', 'paused'"
        },
        "current_period_end": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "description": "End of current billing period"
        },
        "billing_channel": {
          "type": "string",
          "enum": [
            "shopify",
            "stripe",
            "none"
          ],
          "description": "Which billing channel currently owns this subscription.",
          "default": "none"
        }
      },
      "type": "object",
      "required": [
        "plan",
        "tier",
        "status"
      ],
      "title": "MeSubscriptionData",
      "description": "Subscription information in /me response"
    },
    "MeUsageData": {
      "properties": {
        "credits_used_this_month": {
          "type": "integer",
          "description": "Credits used in current billing period"
        },
        "credits_limit": {
          "type": "integer",
          "description": "Credits granted for the current billing period: the plan's monthly credits on a monthly plan, the full year's credits on a yearly plan"
        },
        "credits_remaining": {
          "type": "integer",
          "description": "Credits remaining in the current billing period"
        },
        "billing_period_start": {
          "type": "string",
          "format": "date-time",
          "description": "Start of current billing period"
        },
        "billing_period_end": {
          "type": "string",
          "format": "date-time",
          "description": "End of current billing period"
        },
        "prepaid_balance": {
          "type": "number",
          "description": "Prepaid balance remaining, in prepaid_balance_currency. 0 when the account holds no balance (never null). Independent of the credits_* fields above, which count a subscription allotment."
        },
        "prepaid_balance_currency": {
          "type": "string",
          "description": "ISO 4217 currency of prepaid_balance. Always USD today."
        }
      },
      "type": "object",
      "required": [
        "credits_used_this_month",
        "credits_limit",
        "credits_remaining",
        "billing_period_start",
        "billing_period_end",
        "prepaid_balance",
        "prepaid_balance_currency"
      ],
      "title": "MeUsageData",
      "description": "Usage statistics in /me response"
    }
  }
}