REMOTE INFERENCE API
诊断服务远程调用
通过 API Key 调用诊断服务批量处理时序文件;当前交付版本使用随机推理模拟器。
API KEY
获取API KEY
我的API KEY
- 暂无 Key等待生成
AUTHENTICATION
认证方式
请求时在 Header 中携带 API Key。没有密钥或密钥无效时,接口将拒绝处理文件。
Authorization: Bearer gbx_your_api_key
ENDPOINT
批量诊断接口
POST
https://tinker-demo.duckdns.org/api/v1/batch-predict
- 文件字段
- files
- 单次数量
- 最多 10 个
- 支持格式
- .xlsx / .csv / .tsv / .txt
- 输入规格
- 1024 × 2,自动补齐或截断
EXAMPLE
调用示例
curl -X POST "https://tinker-demo.duckdns.org/api/v1/batch-predict" \
-H "Authorization: Bearer gbx_your_api_key" \
-F "files=@test0001.xlsx" \
-F "files=@test0002.csv"
import requests
url = "https://tinker-demo.duckdns.org/api/v1/batch-predict"
headers = {"Authorization": "Bearer gbx_your_api_key"}
files = [
("files", open("test0001.xlsx", "rb")),
("files", open("test0002.csv", "rb")),
]
response = requests.post(url, headers=headers, files=files, timeout=60)
print(response.json())
const fs = require("fs");
const FormData = require("form-data");
const fetch = require("node-fetch");
const form = new FormData();
form.append("files", fs.createReadStream("test0001.xlsx"));
form.append("files", fs.createReadStream("test0002.csv"));
const response = await fetch("https://tinker-demo.duckdns.org/api/v1/batch-predict", {
method: "POST",
headers: {
Authorization: "Bearer gbx_your_api_key",
...form.getHeaders(),
},
body: form,
});
console.log(await response.json());
RESPONSE
返回格式
{
"results": [
{
"filename": "test0001.xlsx",
"label": "INNER_MISSING",
"name": "内圈缺失",
"confidence": 0.7206
}
]
}