> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acturehub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 初始化 PDF 上传



## OpenAPI

````yaml /specs/bp-agent.openapi.json post /api/open/uploads/init
openapi: 3.1.0
info:
  title: BP-Agent Open API
  description: BP-Agent 对外 API：PDF 上传、异步诊断、结果下载及专项业务能力。所有接口使用租户 API Token 鉴权。
  contact:
    name: BP Agent 开发团队
    email: support@bpagent.com
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
servers:
  - url: https://bptest.mapleai.cc
    description: 测试环境（仅 relay 上传）
  - url: https://project.mapleai.cc
    description: 生产环境（OSS；STS 直传需服务端启用）
security: []
paths:
  /api/open/uploads/init:
    post:
      tags:
        - 开放接口 / Open Uploads
      summary: 初始化 PDF 上传
      operationId: init_open_upload_api_open_uploads_init_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenUploadInitRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_dict_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    OpenUploadInitRequest:
      properties:
        file_name:
          type: string
          minLength: 1
          title: File Name
          description: 文件名（仅支持 .pdf）
        file_size:
          type: integer
          exclusiveMinimum: 0
          title: File Size
          description: 文件大小（字节）
        file_md5:
          type: string
          maxLength: 32
          minLength: 32
          title: File Md5
          description: 文件 MD5（32位小写）
        strategy:
          type: string
          minLength: 1
          title: Strategy
          description: 上传策略：sts_direct 或 relay
      type: object
      required:
        - file_name
        - file_size
        - file_md5
        - strategy
      title: OpenUploadInitRequest
    SuccessResponse_dict_:
      properties:
        code:
          type: integer
          title: Code
          description: 响应码，成功时为0
          default: 0
        message:
          type: string
          title: Message
          description: 成功消息
          default: 操作成功
        data:
          type: object
          title: Data
          description: 响应数据
        timestamp:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timestamp
          description: 响应时间戳（可选）
      type: object
      title: SuccessResponse[dict]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````