技能标识:reducto
|
通过托管API密钥认证访问Reducto文档处理API。解析文档、提取结构化数据、将文档分割为章节,以及编辑PDF/DOCX文件。
bash
https://gateway.maton.ai/reducto/{native-api-path}
将{native-api-path}替换为实际的Reducto API端点路径。网关将请求代理到platform.reducto.ai并自动注入您的API密钥。
所有请求都需要在Authorization头中包含Maton API密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的API密钥设置为MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在https://ctrl.maton.ai管理您的Reducto API密钥连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=reducto&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
data = json.dumps({app: reducto}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
connection: {
connection_id: f7579208-276c-455f-9962-4635fca739b9,
status: ACTIVE,
creation_time: 2026-02-28T00:12:24.797884Z,
lastupdatedtime: 2026-02-28T00:16:13.509841Z,
url: https://connect.maton.ai/?session_token=...,
app: reducto,
metadata: {},
method: API_KEY
}
}
在浏览器中打开返回的url以输入您的Reducto API密钥。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果您有多个Reducto连接,请使用Maton-Connection头指定要使用的连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/reducto/parse)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, f7579208-276c-455f-9962-4635fca739b9)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最早创建的)活动连接。
解析文档并提取结构化内容(文本、表格、图表)。
bash
POST /reducto/parse
Content-Type: application/json
{
document_url: https://example.com/document.pdf
}
响应:
json
{
job_id: 04b8aa38-7eb3-4151-98b0-dbaea71358d9,
duration: 17.85,
pdf_url: https://...,
studio_link: https://studio.reducto.ai/job/...,
usage: {
num_pages: 15,
credits: 15.0
},
result: {
chunks: [
{
content: 提取的文本内容...,
blocks: [...]
}
]
}
}
对于长文档,使用异步以避免超时:
bash
POST /reducto/parse_async
Content-Type: application/json
{
document_url: https://example.com/document.pdf
}
响应:
json
{
job_id: e234ba95-410a-4dd0-8a14-743dbfc49470
}
使用GET /reducto/job/{job_id}轮询任务状态。
使用JSON模式从文档中提取特定字段。
bash
POST /reducto/extract
Content-Type: application/json
{
document_url: https://example.com/document.pdf,
schema: {
type: object,
properties: {
title: {type: string, description: 文档标题},
authors: {type: array, items: {type: string}, description: 作者姓名列表}
}
}
}
响应:
json
{
job_id: 36f01a34-7ef6-40da-9e74-7c14902b6182,
usage: {
num_pages: 15,
num_fields: 9,
credits: 45.0
},
studio_link: https://studio.reducto.ai/job/...,
result: [
{
title: 文档标题,
authors: [作者一, 作者二]
}
]
}
bash
POST /reducto/extract_async
Content-Type: application/json
{
document_url: https://example.com/document.pdf,
schema: {
type: object,
properties: {
title: {type: string}
}
}
}
响应:
json
{
job_id: 0cdb6a50-df92-438b-875b-8b5c72d5b089
}
根据内容类别将文档划分为逻辑章节。
bash
POST /reducto/split
Content-Type: application/json
{
document_url: https://example.com/document.pdf,
split_description: [
{name: abstract, description: 摘要部分},
{name: introduction, description: 引言部分},
{name: conclusion, description: 结论部分}
]
}
响应:
json
{
usage: {
num_pages: 15,
credits: 15.0
},
result: {
section_mapping: {
abstract: [1],
introduction: [1, 2],
conclusion: [14, 15]
},
splits: [
{
name: abstract,
pages: [1],
conf: high
}
]
}
}
bash
POST /reducto/split_async
Content-Type: application/json
{
document_url: https://example.com/document.pdf,
split_description: [
{name: abstract, description: 摘要部分}
]
}
响应:
json
{
job_id: 381
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 reducto-1776292579 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 reducto-1776292579 技能
skillhub install reducto-1776292579
文件大小: 5.52 KB | 发布时间: 2026-4-16 16:43