{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asoskill-com/json-schema/asoskill-com-device-token-response-schema.json",
  "title": "DeviceTokenResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asoskill-com-openapi.yaml#/components/schemas/DeviceTokenResponse",
  "type": "object",
  "required": [
    "tokenType",
    "credential",
    "apiKey"
  ],
  "properties": {
    "tokenType": {
      "type": "string",
      "const": "Bearer"
    },
    "credential": {
      "$ref": "#/$defs/CredentialEnvelope"
    },
    "apiKey": {
      "type": "object",
      "required": [
        "id",
        "name",
        "scopes",
        "expiresAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "scopes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ApiKeyScope"
          }
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  },
  "$defs": {
    "ApiKeyScope": {
      "type": "string",
      "enum": [
        "data",
        "credits",
        "checkout"
      ]
    },
    "CredentialEnvelope": {
      "type": "object",
      "required": [
        "algorithm",
        "iv",
        "ciphertext",
        "tag"
      ],
      "additionalProperties": false,
      "properties": {
        "algorithm": {
          "type": "string",
          "const": "A256GCM"
        },
        "iv": {
          "type": "string"
        },
        "ciphertext": {
          "type": "string"
        },
        "tag": {
          "type": "string"
        }
      }
    }
  }
}