{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pexafy/json-schema/pexafy-usage-by-key-response-schema.json",
  "title": "UsageByKeyResponse",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pexafy-usage-api-openapi.yml#/components/schemas/UsageByKeyResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "properties": {
        "keys": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_used_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "requests_this_month": {
                "type": "integer"
              },
              "requests_today": {
                "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."
        }
      }
    }
  }
}