Skip to main content
POST
Python
This endpoint parses the PDF, generates the Office file, and keeps the connection open until the task succeeds, fails, or times out. On success, download_url is a short-lived download URL.

Conversion parameters

  • Choose target_type based on the PDF’s original file type: select word for a PDF exported from Word and ppt for a PDF exported from PowerPoint. The wrong choice may reduce content-structure and layout fidelity.
  • When target_type is ppt, layout_mode must be layout; the ppt and flow combination is rejected.
  • Only PDF files are supported. Each file can be up to 200MB and 300 pages. Provide exactly one of file and file_url; for long-running or batch conversions, use async conversion.

Body

multipart/form-data
api_key
string
required

API 密钥,格式 sk-***

Example:

"sk-***"

file
file

PDF 文件,与 file_url 二选一;最大 200MB、300 页

file_url
string<uri>

PDF 的公开或有效预签名下载链接,与 file 二选一

target_type
enum<string>
default:word

目标文件类型。请根据 PDF 的原始文件类型选择:由 Word 导出的 PDF 选择 word,由 PPT 导出的 PDF 选择 ppt。选择错误可能影响内容结构和版式还原效果

Available options:
word,
ppt
layout_mode
enum<string> | null

排版模式。Word 未传时默认 flow;PPT 未传时默认 layout,且 PPT 仅支持 layout

Available options:
flow,
layout

Response

200 - application/json

转换完成或任务失败

code
integer

状态码,0 为成功,非 0 见错误码说明

Example:

0

message
string
Example:

"查询成功"

data
object