{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pexafy/json-schema/pexafy-usage-response-schema.json",
  "title": "UsageResponse",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pexafy-usage-api-openapi.yml#/components/schemas/UsageResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "properties": {
        "period": {
          "type": "string",
          "description": "YYYY-MM"
        },
        "requests": {
          "type": "object",
          "properties": {
            "used": {
              "type": "integer"
            },
            "limit": {
              "type": "integer"
            },
            "remaining": {
              "type": "integer"
            }
          }
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/Meta_2"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ApiError"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "ApiError": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Machine-readable error code (e.g. `MISSING_PARAMS`, `PHOTO_NOT_FOUND`)."
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message."
        },
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "Meta_2": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "description": "Unique id for this request (quote it in support tickets)."
        },
        "took_ms": {
          "type": "number",
          "description": "Server processing time in milliseconds."
        }
      }
    }
  }
}