{
  "openapi": "3.1.0",
  "info": {
    "title": "Videora API",
    "description": "API REST para generar videos profesionales desde JSON. Narración con voces naturales, subtítulos automáticos, música, logos. Formatos: 9:16 (TikTok/Reels), 16:9 (YouTube), 1:1 (Instagram). Gratis: 3 videos/mes. Pro $19/mes. Premium $49/mes. Lifetime $149.",
    "contact": {
      "name": "Videora",
      "url": "https://videora.4l3.org/",
      "email": "hola@4l3.org"
    },
    "license": {
      "name": "Proprietary"
    },
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://videora.4l3.org"
    }
  ],
  "paths": {
    "/v1/voices": {
      "get": {
        "summary": "List Voices",
        "description": "Catálogo de voces TTS disponibles.",
        "operationId": "list_voices_v1_voices_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/niches": {
      "get": {
        "summary": "List Niches",
        "description": "Catálogo de nichos preconfigurados (paleta + voz + SFX + transiciones).",
        "operationId": "list_niches_v1_niches_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/features": {
      "get": {
        "summary": "List Features",
        "description": "Capacidades técnicas del motor.",
        "operationId": "list_features_v1_features_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/addons": {
      "get": {
        "summary": "List Addons",
        "description": "Add-ons opcionales.",
        "operationId": "list_addons_v1_addons_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/pricing": {
      "get": {
        "summary": "Pricing",
        "operationId": "pricing_pricing_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/video/render": {
      "post": {
        "summary": "Render Video Endpoint",
        "description": "Encola un job. NO bloquea — el worker lo procesa async.",
        "operationId": "render_video_endpoint_v1_video_render_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{job_id}": {
      "get": {
        "summary": "Get Job",
        "operationId": "get_job_v1_jobs__job_id__get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/pay/status": {
      "get": {
        "summary": "Pay Status",
        "operationId": "pay_status_pay_status_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/pay/checkout/{plan}": {
      "get": {
        "summary": "Pay Checkout",
        "description": "Create Stripe Checkout session and redirect.",
        "operationId": "pay_checkout_pay_checkout__plan__get",
        "parameters": [
          {
            "name": "plan",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Plan"
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ref"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/pay/success": {
      "get": {
        "summary": "Pay Success",
        "operationId": "pay_success_pay_success_get",
        "parameters": [
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/pay/webhook": {
      "post": {
        "summary": "Pay Webhook",
        "description": "Stripe webhook: checkout.session.completed → save customer + notify Refferq.",
        "operationId": "pay_webhook_pay_webhook_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BackgroundCfg": {
        "properties": {
          "type": {
            "type": "string",
            "pattern": "^(color|image)$",
            "title": "Type",
            "default": "color"
          },
          "color": {
            "type": "string",
            "title": "Color",
            "default": "#0a0a0f"
          },
          "images": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Images",
            "default": []
          }
        },
        "type": "object",
        "title": "BackgroundCfg"
      },
      "CaptionsCfg": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "font": {
            "type": "string",
            "title": "Font",
            "default": "bold"
          },
          "position": {
            "type": "string",
            "title": "Position",
            "default": "bottom"
          }
        },
        "type": "object",
        "title": "CaptionsCfg"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "MusicCfg": {
        "properties": {
          "track": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Track"
          },
          "ai_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Prompt"
          },
          "volume": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Volume",
            "default": 0.3
          }
        },
        "type": "object",
        "title": "MusicCfg"
      },
      "NarrationCfg": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 5000,
            "minLength": 1,
            "title": "Text"
          },
          "voice": {
            "type": "string",
            "title": "Voice",
            "default": "es-MX-Ald"
          },
          "clone_voice_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clone Voice Id"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "NarrationCfg"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VideoReq": {
        "properties": {
          "template": {
            "type": "string",
            "title": "Template",
            "default": "short"
          },
          "format": {
            "type": "string",
            "pattern": "^(9:16|16:9|1:1)$",
            "title": "Format",
            "default": "9:16"
          },
          "duration_s": {
            "type": "number",
            "maximum": 180.0,
            "minimum": 5.0,
            "title": "Duration S",
            "default": 30
          },
          "narration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NarrationCfg"
              },
              {
                "type": "null"
              }
            ]
          },
          "background": {
            "$ref": "#/components/schemas/BackgroundCfg"
          },
          "music": {
            "$ref": "#/components/schemas/MusicCfg"
          },
          "sfx": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Sfx",
            "default": []
          },
          "captions": {
            "$ref": "#/components/schemas/CaptionsCfg"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "outro_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Outro Text"
          }
        },
        "type": "object",
        "title": "VideoReq"
      }
    }
  }
}