{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audivo-dev/json-schema/audivo-dev-api-key-create-response-schema.json",
  "title": "ApiKeyCreateResponse",
  "description": "Same fields as `ApiKeySummary` plus the plaintext `secret`, shown exactly once. Duplicated rather than composed via `allOf` for the same reason documented on `TranscriptArtifact`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audivo-dev-api-keys-api-openapi.yml#/components/schemas/ApiKeyCreateResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "key_id",
    "label",
    "prefix",
    "mode",
    "created_at",
    "revoked",
    "secret"
  ],
  "properties": {
    "key_id": {
      "$ref": "#/$defs/KeyId"
    },
    "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "prefix": {
      "$ref": "#/$defs/ApiKeyPrefix"
    },
    "mode": {
      "$ref": "#/$defs/ApiKeyMode"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "revoked": {
      "type": "boolean"
    },
    "secret": {
      "type": "string",
      "minLength": 20,
      "maxLength": 200,
      "description": "The plaintext secret. Shown exactly once; never retrievable again."
    }
  },
  "$defs": {
    "ApiKeyMode": {
      "type": "string",
      "enum": [
        "live",
        "test"
      ]
    },
    "ApiKeyPrefix": {
      "type": "string",
      "enum": [
        "hk_live_",
        "hk_test_"
      ]
    },
    "KeyId": {
      "type": "string",
      "pattern": "^key_[A-Za-z0-9]{16,32}$",
      "maxLength": 40,
      "description": "Opaque, server-generated API key identifier."
    }
  }
}