{
  "openapi": "3.1.0",
  "info": {
    "title": "Copywriting",
    "description": "API service for App Factory reusable modules",
    "version": "1.0.0",
    "x-source-commit": "f33cc2b935f31b36240d724948dc8b9c765430cc"
  },
  "paths": {
    "/api/v1/copywriting/extract-link": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Extract Link",
        "description": "从链接提取口播文案\n\n短视频链接流水线：解析视频 → 分离音频 → ASR 识别 → 返回文案。\n普通网页仍走 HTML 抓取。",
        "operationId": "extract_link_api_v1_copywriting_extract_link_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkExtractionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/smart-original": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Smart Original",
        "description": "智能原创",
        "operationId": "smart_original_api_v1_copywriting_smart_original_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartOriginalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/image-to-text": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Image To Text",
        "description": "图片转文案：经 Backend 调 Media OCR（model=auto|glm-ocr|pp-ocrv5）。",
        "operationId": "image_to_text_api_v1_copywriting_image_to_text_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_image_to_text_api_v1_copywriting_image_to_text_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/word-to-text": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Word To Text",
        "description": "文档转文案（Backend → Media anydoc）",
        "operationId": "word_to_text_api_v1_copywriting_word_to_text_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_word_to_text_api_v1_copywriting_word_to_text_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/webpage-scrape": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Webpage Scrape",
        "description": "网页解析转文案（Backend → Media web scrape）",
        "operationId": "webpage_scrape_api_v1_copywriting_webpage_scrape_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebpageScrapeCopyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/audio-to-text": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Audio To Text",
        "description": "音频转文案\n\n将上传的音频文件转录为文字。使用远程 AI 推理服务进行语音识别。\n\n注意: 需要配置 AI 推理服务 (SH_INFER_ENABLED=true)",
        "operationId": "audio_to_text_api_v1_copywriting_audio_to_text_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_audio_to_text_api_v1_copywriting_audio_to_text_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/detect-forbidden": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Detect Forbidden Words",
        "description": "违禁词检测",
        "operationId": "detect_forbidden_words_api_v1_copywriting_detect_forbidden_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForbiddenWordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/video-script": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Generate Video Script",
        "description": "生成视频脚本",
        "operationId": "generate_video_script_api_v1_copywriting_video_script_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoScriptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/product-review": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Generate Product Review",
        "description": "生成产品测评",
        "operationId": "generate_product_review_api_v1_copywriting_product_review_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/xiaohongshu": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Generate Xiaohongshu",
        "description": "生成小红书风格文案",
        "operationId": "generate_xiaohongshu_api_v1_copywriting_xiaohongshu_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XiaohongshuRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/copywriting/marketing": {
      "post": {
        "tags": [
          "copywriting"
        ],
        "summary": "Generate Marketing",
        "description": "生成营销文案",
        "operationId": "generate_marketing_api_v1_copywriting_marketing_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Body_audio_to_text_api_v1_copywriting_audio_to_text_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_audio_to_text_api_v1_copywriting_audio_to_text_post"
      },
      "Body_image_to_text_api_v1_copywriting_image_to_text_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "default": "auto"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_image_to_text_api_v1_copywriting_image_to_text_post"
      },
      "Body_word_to_text_api_v1_copywriting_word_to_text_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_word_to_text_api_v1_copywriting_word_to_text_post"
      },
      "ForbiddenWordRequest": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "ForbiddenWordRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "LinkExtractionRequest": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "LinkExtractionRequest"
      },
      "MarketingRequest": {
        "properties": {
          "product": {
            "type": "string",
            "title": "Product"
          },
          "scene": {
            "type": "string",
            "title": "Scene",
            "default": "general"
          }
        },
        "type": "object",
        "required": [
          "product"
        ],
        "title": "MarketingRequest"
      },
      "ProductReviewRequest": {
        "properties": {
          "product": {
            "type": "string",
            "title": "Product"
          }
        },
        "type": "object",
        "required": [
          "product"
        ],
        "title": "ProductReviewRequest"
      },
      "SmartOriginalRequest": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "style": {
            "type": "string",
            "title": "Style",
            "default": "rewrite"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "SmartOriginalRequest"
      },
      "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"
      },
      "VideoScriptRequest": {
        "properties": {
          "topic": {
            "type": "string",
            "title": "Topic"
          },
          "style": {
            "type": "string",
            "title": "Style",
            "default": "short"
          }
        },
        "type": "object",
        "required": [
          "topic"
        ],
        "title": "VideoScriptRequest"
      },
      "WebpageScrapeCopyRequest": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "fetch": {
            "type": "string",
            "title": "Fetch",
            "default": "auto"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "WebpageScrapeCopyRequest"
      },
      "XiaohongshuRequest": {
        "properties": {
          "topic": {
            "type": "string",
            "title": "Topic"
          }
        },
        "type": "object",
        "required": [
          "topic"
        ],
        "title": "XiaohongshuRequest"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.sniphunter.com"
    }
  ]
}