{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/huggingbay-xyz/json-schema/huggingbay-xyz-developer-credential-secret-response-schema.json",
  "title": "DeveloperCredentialSecretResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/huggingbay-xyz-developer-api-openapi.yml#/components/schemas/DeveloperCredentialSecretResponse",
  "properties": {
    "credential": {
      "$ref": "#/$defs/DeveloperCredentialMetadata"
    },
    "secret": {
      "type": "string",
      "title": "Secret",
      "description": "One-time secret. Store it now: it is HMAC-hashed before persistence and cannot be listed or recovered later."
    },
    "receipt": {
      "$ref": "#/$defs/DeveloperCredentialReceipt"
    }
  },
  "type": "object",
  "required": [
    "credential",
    "secret",
    "receipt"
  ],
  "$defs": {
    "DeveloperCredentialMetadata": {
      "properties": {
        "credential_id": {
          "type": "string",
          "title": "Credential Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "secret_prefix": {
          "type": "string",
          "title": "Secret Prefix",
          "description": "Non-secret prefix for identifying the key in logs and settings."
        },
        "scopes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Scopes"
        },
        "version": {
          "type": "integer",
          "title": "Version"
        },
        "billing_eligible": {
          "type": "boolean",
          "title": "Billing Eligible"
        },
        "owner_authorized": {
          "type": "boolean",
          "title": "Owner Authorized"
        },
        "issuance_authority": {
          "type": "string",
          "title": "Issuance Authority"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "revoked"
          ],
          "title": "Status"
        },
        "created_at": {
          "type": "string",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "title": "Updated At"
        },
        "rotated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rotated At"
        },
        "revoked_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Revoked At"
        }
      },
      "type": "object",
      "required": [
        "credential_id",
        "name",
        "secret_prefix",
        "scopes",
        "version",
        "billing_eligible",
        "owner_authorized",
        "issuance_authority",
        "status",
        "created_at",
        "updated_at"
      ],
      "title": "DeveloperCredentialMetadata"
    },
    "DeveloperCredentialReceipt": {
      "properties": {
        "receipt_id": {
          "type": "string",
          "title": "Receipt Id"
        },
        "action": {
          "type": "string",
          "enum": [
            "created",
            "rotated",
            "revoked"
          ],
          "title": "Action"
        },
        "credential_id": {
          "type": "string",
          "title": "Credential Id"
        },
        "credential_version": {
          "type": "integer",
          "title": "Credential Version"
        },
        "detail": {
          "additionalProperties": true,
          "type": "object",
          "title": "Detail"
        },
        "occurred_at": {
          "type": "string",
          "title": "Occurred At"
        }
      },
      "type": "object",
      "required": [
        "receipt_id",
        "action",
        "credential_id",
        "credential_version",
        "detail",
        "occurred_at"
      ],
      "title": "DeveloperCredentialReceipt"
    }
  }
}