Doc2X V3 PDF 转换
curl --request POST \
--url https://api.aihubmax.com/v1/run/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doc2x-v3",
"pdf_url": "https://example.com/document.pdf",
"page_count": 10,
"convert_mode": "md",
"formula_mode": "normal",
"filename": "output",
"merge_cross_page_forms": false
}
'import requests
url = "https://api.aihubmax.com/v1/run/generations"
payload = {
"model": "doc2x-v3",
"pdf_url": "https://example.com/document.pdf",
"page_count": 10,
"convert_mode": "md",
"formula_mode": "normal",
"filename": "output",
"merge_cross_page_forms": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doc2x-v3',
pdf_url: 'https://example.com/document.pdf',
page_count: 10,
convert_mode: 'md',
formula_mode: 'normal',
filename: 'output',
merge_cross_page_forms: false
})
};
fetch('https://api.aihubmax.com/v1/run/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/v1/run/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doc2x-v3',
'pdf_url' => 'https://example.com/document.pdf',
'page_count' => 10,
'convert_mode' => 'md',
'formula_mode' => 'normal',
'filename' => 'output',
'merge_cross_page_forms' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/v1/run/generations"
payload := strings.NewReader("{\n \"model\": \"doc2x-v3\",\n \"pdf_url\": \"https://example.com/document.pdf\",\n \"page_count\": 10,\n \"convert_mode\": \"md\",\n \"formula_mode\": \"normal\",\n \"filename\": \"output\",\n \"merge_cross_page_forms\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/v1/run/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doc2x-v3\",\n \"pdf_url\": \"https://example.com/document.pdf\",\n \"page_count\": 10,\n \"convert_mode\": \"md\",\n \"formula_mode\": \"normal\",\n \"filename\": \"output\",\n \"merge_cross_page_forms\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/v1/run/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doc2x-v3\",\n \"pdf_url\": \"https://example.com/document.pdf\",\n \"page_count\": 10,\n \"convert_mode\": \"md\",\n \"formula_mode\": \"normal\",\n \"filename\": \"output\",\n \"merge_cross_page_forms\": false\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "document.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "document"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}文档处理
Doc2X V3 PDF 转换
- Doc2X V3 PDF 文档转换模型,将 PDF 转换为 Markdown / LaTeX / DOCX 格式
- 支持公式识别与跨页表格合并
- 结果为 ZIP 压缩包(含转换文档与图片资源),通过
results[0].url下载 - 异步处理模式,使用返回的任务ID 进行查询
- 结果格式为
{url},URL 指向一个可下载的 ZIP 压缩包,内含转换后的文档文件(md / tex / docx)及图片资源,详见 任务查询特殊格式说明 - ZIP 链接有效期为24小时,请尽快下载保存
POST
/
v1
/
run
/
generations
Doc2X V3 PDF 转换
curl --request POST \
--url https://api.aihubmax.com/v1/run/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doc2x-v3",
"pdf_url": "https://example.com/document.pdf",
"page_count": 10,
"convert_mode": "md",
"formula_mode": "normal",
"filename": "output",
"merge_cross_page_forms": false
}
'import requests
url = "https://api.aihubmax.com/v1/run/generations"
payload = {
"model": "doc2x-v3",
"pdf_url": "https://example.com/document.pdf",
"page_count": 10,
"convert_mode": "md",
"formula_mode": "normal",
"filename": "output",
"merge_cross_page_forms": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doc2x-v3',
pdf_url: 'https://example.com/document.pdf',
page_count: 10,
convert_mode: 'md',
formula_mode: 'normal',
filename: 'output',
merge_cross_page_forms: false
})
};
fetch('https://api.aihubmax.com/v1/run/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/v1/run/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doc2x-v3',
'pdf_url' => 'https://example.com/document.pdf',
'page_count' => 10,
'convert_mode' => 'md',
'formula_mode' => 'normal',
'filename' => 'output',
'merge_cross_page_forms' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/v1/run/generations"
payload := strings.NewReader("{\n \"model\": \"doc2x-v3\",\n \"pdf_url\": \"https://example.com/document.pdf\",\n \"page_count\": 10,\n \"convert_mode\": \"md\",\n \"formula_mode\": \"normal\",\n \"filename\": \"output\",\n \"merge_cross_page_forms\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/v1/run/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doc2x-v3\",\n \"pdf_url\": \"https://example.com/document.pdf\",\n \"page_count\": 10,\n \"convert_mode\": \"md\",\n \"formula_mode\": \"normal\",\n \"filename\": \"output\",\n \"merge_cross_page_forms\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/v1/run/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doc2x-v3\",\n \"pdf_url\": \"https://example.com/document.pdf\",\n \"page_count\": 10,\n \"convert_mode\": \"md\",\n \"formula_mode\": \"normal\",\n \"filename\": \"output\",\n \"merge_cross_page_forms\": false\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "document.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "document"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}授权
所有接口均需要使用Bearer Token进行认证
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
doc2x-v3:PDF → md / tex / docx 转换,结果为可下载的 ZIP 压缩包
示例:
"doc2x-v3"
PDF 文件下载地址
示例:
"https://example.com/document.pdf"
PDF 页数,用于预扣费与执行时校验
必填范围:
x >= 1示例:
10
输出格式
可用选项:
md, tex, docx 示例:
"md"
公式处理模式
可用选项:
normal, dollar 示例:
"normal"
输出文件名(不含扩展名,超 50 字执行时截断)
Maximum string length:
200示例:
"output"
是否合并跨页表格
示例:
false
响应
任务创建成功
任务创建时间戳
示例:
1757165031
任务ID
示例:
"task-unified-1757165031-uyujaw3d"
实际使用的模型名称
任务的具体类型
可用选项:
document.generation.task 任务进度百分比 (0-100)
必填范围:
0 <= x <= 100示例:
0
任务状态
可用选项:
pending, processing, completed, failed 示例:
"pending"
异步任务信息
Show child attributes
Show child attributes
任务的输出类型
可用选项:
document 示例:
"document"
⌘I