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": "Bad request format",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Insufficient account balance",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Parameter validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "Service temporarily unavailable, please try again later",
"type": "service_unavailable"
}
}Doc2X V3 PDF Conversion
- Doc2X V3 PDF document conversion model, converting PDF into Markdown / LaTeX / DOCX formats
- Supports formula recognition and cross-page table merging
- The result is a ZIP archive (containing the converted document and image assets), downloaded via
results[0].url - Asynchronous processing mode; use the returned task ID to query the result
- The result format is
{url}, where the URL points to a downloadable ZIP archive containing the converted document files (md / tex / docx) and image assets. See Task Query Special Format Notes - The ZIP link is valid for 24 hours; please download and save it promptly
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": "Bad request format",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Insufficient account balance",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Parameter validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "Service temporarily unavailable, please try again later",
"type": "service_unavailable"
}
}Authorizations
All endpoints require Bearer Token authentication
Add the following to your request header:
Authorization: Bearer YOUR_API_KEY
Body
doc2x-v3: PDF → md / tex / docx conversion; the result is a downloadable ZIP archive
"doc2x-v3"
Download URL of the PDF file
"https://example.com/document.pdf"
Number of PDF pages, used for pre-authorization billing and runtime validation
x >= 110
Output format
md, tex, docx "md"
Formula processing mode
normal, dollar "normal"
Output file name (without extension; truncated at runtime if it exceeds 50 characters)
200"output"
Whether to merge cross-page tables
false
Response
Task created successfully
Task creation timestamp
1757165031
Task ID
"task-unified-1757165031-uyujaw3d"
The actual model name used
The specific type of the task
document.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Asynchronous task information
Show child attributes
Show child attributes
The output type of the task
document "document"