{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audiopod-ai/json-schema/audiopod-ai-podcast-project-schema.json",
  "title": "PodcastProject",
  "description": "Podcast project response model.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audiopod-ai-podcast-api-openapi.yml#/components/schemas/PodcastProject",
  "properties": {
    "title": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Title",
      "description": "Podcast title"
    },
    "topic": {
      "type": "string",
      "maxLength": 500,
      "minLength": 1,
      "title": "Topic",
      "description": "Main topic"
    },
    "briefing": {
      "type": "string",
      "maxLength": 2000,
      "title": "Briefing",
      "description": "Additional context/briefing",
      "default": ""
    },
    "key_points": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Key Points",
      "description": "Key points to cover"
    },
    "language": {
      "type": "string",
      "title": "Language",
      "description": "Primary language code",
      "default": "en"
    },
    "quality_preset": {
      "$ref": "#/$defs/QualityPreset",
      "description": "Quality preset",
      "default": "standard"
    },
    "target_duration_minutes": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 60.0,
          "minimum": 5.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Duration Minutes",
      "description": "Target episode length in minutes (5-60). Drives segment count + dialogue density."
    },
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Unique project ID"
    },
    "user_id": {
      "type": "string",
      "title": "User Id",
      "description": "Owner user ID"
    },
    "status": {
      "$ref": "#/$defs/PodcastStatus",
      "description": "Project status"
    },
    "speakers": {
      "items": {
        "$ref": "#/$defs/Speaker"
      },
      "type": "array",
      "title": "Speakers",
      "description": "Project speakers"
    },
    "outline": {
      "anyOf": [
        {
          "$ref": "#/$defs/Outline"
        },
        {
          "type": "null"
        }
      ],
      "description": "Project outline"
    },
    "transcript": {
      "anyOf": [
        {
          "$ref": "#/$defs/Transcript"
        },
        {
          "type": "null"
        }
      ],
      "description": "Project transcript"
    },
    "segments": {
      "items": {
        "$ref": "#/$defs/Segment"
      },
      "type": "array",
      "title": "Segments",
      "description": "Outline segments"
    },
    "dialogues": {
      "items": {
        "$ref": "#/$defs/Dialogue"
      },
      "type": "array",
      "title": "Dialogues",
      "description": "Transcript dialogues"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/PodcastSourceResponse"
      },
      "type": "array",
      "title": "Sources",
      "description": "Grounding sources"
    },
    "grounding_mode": {
      "type": "string",
      "title": "Grounding Mode",
      "description": "topic or sourced",
      "default": "topic"
    },
    "episode_profile_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Episode Profile Id",
      "description": "Applied episode profile id"
    },
    "combined_audio_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Combined Audio Url",
      "description": "URL to combined final audio (WAV)"
    },
    "combined_audio_mp3_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Combined Audio Mp3 Url",
      "description": "URL to combined final audio (MP3)"
    },
    "total_duration_seconds": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Duration Seconds",
      "description": "Total audio duration"
    },
    "progress_percentage": {
      "type": "integer",
      "maximum": 100.0,
      "minimum": 0.0,
      "title": "Progress Percentage",
      "description": "Generation progress",
      "default": 0
    },
    "dialogues_completed": {
      "type": "integer",
      "title": "Dialogues Completed",
      "description": "Number of dialogues generated",
      "default": 0
    },
    "dialogues_total": {
      "type": "integer",
      "title": "Dialogues Total",
      "description": "Total number of dialogues",
      "default": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Creation timestamp"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At",
      "description": "Last update timestamp"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At",
      "description": "Completion timestamp"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Message",
      "description": "Error message if failed"
    }
  },
  "type": "object",
  "required": [
    "title",
    "topic",
    "id",
    "user_id",
    "status",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "Dialogue": {
      "properties": {
        "speaker": {
          "type": "string",
          "title": "Speaker",
          "description": "Speaker name"
        },
        "text": {
          "type": "string",
          "title": "Text",
          "description": "Spoken text"
        },
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique dialogue ID"
        },
        "order": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Order",
          "description": "Order in the transcript"
        },
        "status": {
          "$ref": "#/$defs/DialogueStatus",
          "description": "Generation status",
          "default": "pending"
        },
        "audio_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Url",
          "description": "URL to generated audio clip"
        },
        "duration_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Seconds",
          "description": "Audio duration in seconds"
        },
        "error_message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Message",
          "description": "Error message if generation failed"
        },
        "use_turbo": {
          "type": "boolean",
          "title": "Use Turbo",
          "description": "Whether the fast English voice engine was used for this dialogue",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "speaker",
        "text",
        "id",
        "order"
      ],
      "title": "Dialogue",
      "description": "Dialogue response model."
    },
    "DialogueStatus": {
      "type": "string",
      "enum": [
        "pending",
        "generating",
        "completed",
        "failed"
      ],
      "title": "DialogueStatus",
      "description": "Status of a dialogue clip."
    },
    "Outline": {
      "properties": {
        "segments": {
          "items": {
            "$ref": "#/$defs/Segment"
          },
          "type": "array",
          "title": "Segments",
          "description": "Ordered list of segments"
        },
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique outline ID"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "Creation timestamp"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At",
          "description": "Last update timestamp"
        }
      },
      "type": "object",
      "required": [
        "id",
        "created_at",
        "updated_at"
      ],
      "title": "Outline",
      "description": "Outline response model."
    },
    "PodcastSourceResponse": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "source_type": {
          "$ref": "#/$defs/SourceType"
        },
        "status": {
          "$ref": "#/$defs/SourceStatus"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "original_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Original Ref"
        },
        "original_filename": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Original Filename"
        },
        "token_count": {
          "type": "integer",
          "title": "Token Count",
          "default": 0
        },
        "char_count": {
          "type": "integer",
          "title": "Char Count",
          "default": 0
        },
        "error_message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Message"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "source_type",
        "status"
      ],
      "title": "PodcastSourceResponse",
      "description": "A grounding source attached to a project."
    },
    "PodcastStatus": {
      "type": "string",
      "enum": [
        "draft",
        "sources_ingesting",
        "sources_ready",
        "outline_generating",
        "outline_ready",
        "transcript_generating",
        "transcript_ready",
        "audio_generating",
        "audio_ready",
        "combining",
        "completed",
        "failed"
      ],
      "title": "PodcastStatus",
      "description": "Status of a podcast project."
    },
    "QualityPreset": {
      "type": "string",
      "enum": [
        "quick",
        "standard",
        "premium"
      ],
      "title": "QualityPreset",
      "description": "Quality preset for podcast generation."
    },
    "Segment": {
      "properties": {
        "title": {
          "type": "string",
          "title": "Title",
          "description": "Segment title"
        },
        "description": {
          "type": "string",
          "title": "Description",
          "description": "Segment description/notes",
          "default": ""
        },
        "size": {
          "$ref": "#/$defs/SegmentSize",
          "description": "Segment size: short, medium, or long",
          "default": "medium"
        },
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique segment ID"
        },
        "order": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Order",
          "description": "Order in the outline"
        }
      },
      "type": "object",
      "required": [
        "title",
        "id",
        "order"
      ],
      "title": "Segment",
      "description": "Segment response model."
    },
    "SegmentSize": {
      "type": "string",
      "enum": [
        "short",
        "medium",
        "long"
      ],
      "title": "SegmentSize",
      "description": "Size/length of a podcast segment."
    },
    "SourceStatus": {
      "type": "string",
      "enum": [
        "pending",
        "extracting",
        "ready",
        "failed"
      ],
      "title": "SourceStatus",
      "description": "Extraction lifecycle of a grounding source."
    },
    "SourceType": {
      "type": "string",
      "enum": [
        "file",
        "text",
        "url",
        "youtube"
      ],
      "title": "SourceType",
      "description": "Grounding source kind."
    },
    "Speaker": {
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 50,
          "minLength": 1,
          "title": "Name",
          "description": "Display name for the speaker"
        },
        "role": {
          "$ref": "#/$defs/SpeakerRole",
          "description": "Speaker role: Host, Expert, Guest, or Narrator"
        },
        "voice_type": {
          "$ref": "#/$defs/app__schemas__podcast__VoiceType",
          "description": "Voice type: preset, cloned, or standard",
          "default": "preset"
        },
        "voice_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Voice Id",
          "description": "Legacy voice identifier (preset name or reference URL)"
        },
        "voice_ref_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Voice Ref Id",
          "description": "In-house Voice catalog id for the audiobook TTS path"
        },
        "language": {
          "type": "string",
          "title": "Language",
          "description": "Language code (e.g., en, zh, ja)",
          "default": "en"
        },
        "use_turbo": {
          "type": "boolean",
          "title": "Use Turbo",
          "description": "Use our fast English voice engine (faster, supports paralinguistic tags like [laugh], [cough])",
          "default": false
        },
        "backstory": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2000
            },
            {
              "type": "null"
            }
          ],
          "title": "Backstory",
          "description": "Speaker backstory/expertise"
        },
        "personality": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2000
            },
            {
              "type": "null"
            }
          ],
          "title": "Personality",
          "description": "Speaker personality/voice"
        },
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique speaker ID"
        }
      },
      "type": "object",
      "required": [
        "name",
        "role",
        "id"
      ],
      "title": "Speaker",
      "description": "Speaker response model."
    },
    "SpeakerRole": {
      "type": "string",
      "enum": [
        "Host",
        "Expert",
        "Guest",
        "Narrator"
      ],
      "title": "SpeakerRole",
      "description": "Role of a speaker in the podcast."
    },
    "Transcript": {
      "properties": {
        "dialogues": {
          "items": {
            "$ref": "#/$defs/Dialogue"
          },
          "type": "array",
          "title": "Dialogues",
          "description": "Ordered dialogue list"
        },
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique transcript ID"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "Creation timestamp"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At",
          "description": "Last update timestamp"
        }
      },
      "type": "object",
      "required": [
        "id",
        "created_at",
        "updated_at"
      ],
      "title": "Transcript",
      "description": "Transcript response model."
    },
    "app__schemas__podcast__VoiceType": {
      "type": "string",
      "enum": [
        "preset",
        "cloned",
        "standard"
      ],
      "title": "VoiceType",
      "description": "Type of voice for TTS."
    }
  }
}