{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/detectif-ai/json-schema/detectif-ai-enroll-response-schema.json",
  "title": "EnrollResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/detectif-ai-api-openapi.json#/components/schemas/EnrollResponse",
  "properties": {
    "request_id": {
      "type": "string",
      "title": "Request Id"
    },
    "operation_id": {
      "type": "string",
      "title": "Operation Id"
    },
    "object": {
      "type": "string",
      "const": "speaker.enrollment",
      "title": "Object"
    },
    "speaker": {
      "$ref": "#/$defs/Speaker"
    },
    "quality": {
      "$ref": "#/$defs/EnrollQuality"
    },
    "model": {
      "$ref": "#/$defs/ModelInfo"
    },
    "credits": {
      "$ref": "#/$defs/CreditsCharged"
    },
    "latency_ms": {
      "type": "number",
      "title": "Latency Ms"
    },
    "idempotent_replay": {
      "type": "boolean",
      "title": "Idempotent Replay"
    }
  },
  "type": "object",
  "required": [
    "request_id",
    "operation_id",
    "object",
    "speaker",
    "quality",
    "model",
    "credits",
    "latency_ms",
    "idempotent_replay"
  ],
  "$defs": {
    "CreditsCharged": {
      "properties": {
        "charged": {
          "type": "integer",
          "title": "Charged",
          "description": "Credits used by this request. A repeated request with the same Idempotency-Key uses none: it reports 0 here and what the original request used in `original_charge`."
        },
        "balance": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Balance",
          "description": "Your available credits after this request; null on the unlimited plan."
        },
        "original_charge": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Original Charge",
          "description": "Only on repeated requests (`charged` is then 0): the credits the original request used."
        },
        "unlimited": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unlimited",
          "description": "Present (true) only for accounts on the unlimited plan, where checks use no credits."
        }
      },
      "type": "object",
      "required": [
        "charged",
        "balance"
      ],
      "title": "CreditsCharged"
    },
    "EnrollQuality": {
      "properties": {
        "speech_seconds": {
          "type": "number",
          "title": "Speech Seconds"
        },
        "duration_seconds": {
          "type": "number",
          "title": "Duration Seconds"
        }
      },
      "type": "object",
      "required": [
        "speech_seconds",
        "duration_seconds"
      ],
      "title": "EnrollQuality"
    },
    "ModelInfo": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Model family: `aletheia` (deepfake detection) or `eidos` (speaker verification)."
        },
        "version": {
          "type": "string",
          "title": "Version",
          "description": "Model version, for example `2026.10`; it changes whenever the model is updated."
        }
      },
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "title": "ModelInfo"
    },
    "Speaker": {
      "properties": {
        "speaker_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
          "title": "Speaker Id"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Display Name"
        },
        "samples": {
          "type": "integer",
          "title": "Samples",
          "description": "Active enrollment samples for the current speaker model (max 5)."
        },
        "created_at": {
          "type": "string",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "title": "Updated At"
        }
      },
      "type": "object",
      "required": [
        "speaker_id",
        "display_name",
        "samples",
        "created_at",
        "updated_at"
      ],
      "title": "Speaker"
    }
  }
}