获取账户任务详情
使用系统访问令牌读取当前账户的数据
国内用户请注意: 中国大陆用户请使用 https://toapis.cn 作为接口地址 (Base URL). 文档示例中的 https://toapis.com 请替换为 https://toapis.cn.
鉴权, 分页与错误处理见接入说明.
使用说明
分页查询默认近 24 小时, 最长 31 天, 按内部 ID 倒序. ids 批量模式不分页, meta 不含 from/to. 仅返回持久化任务元数据, 不返回结果 URL 或提示词, GET 不轮询上游, 不结算, 退款或发送 Webhook. 视频转存或结算未完成时仍为 processing, finished_at=null; 无法确认门控时返回 503. billing=null 表示无法确认账务; billing.status=pending 时省略金额, 确认后为 settled 或 refunded.
鉴权
Authorizationstring请求头必填使用系统访问令牌, 格式为 Bearer YOUR_SYSTEM_ACCESS_TOKEN. 模型 API Key 不能用于此接口, 无需 X-User-Id.
请求参数
task_idstring路径必填平台任务 ID. 不接受业务 ID 代替, 不允许首尾空白或控制字符.
约束: minLength=1; maxLength=191.
请求示例
curl --request GET \
--url 'https://toapis.com/api/v1/account/tasks/task_example_01' \
--header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'import requests
response = requests.get(
"https://toapis.com/api/v1/account/tasks/task_example_01",
headers={"Authorization": "Bearer YOUR_SYSTEM_ACCESS_TOKEN"},
timeout=30,
)
response.raise_for_status()
print(response.json())const url = new URL("https://toapis.com/api/v1/account/tasks/task_example_01");
const response = await fetch(url, {
headers: { Authorization: "Bearer YOUR_SYSTEM_ACCESS_TOKEN" },
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(await response.json());响应字段
示例使用虚构数据. 金额样例假设 credits_per_usd="100", 实际换算以响应为准.
codeinteger业务状态码, 成功时为 0.
messagestring响应消息, 成功时为空字符串. 错误消息会按请求语言返回.
dataobject本次查询的结果对象.
data.idstring平台任务 ID. 任务详情查询使用此值, 不是业务 ID.
data.client_business_idstring | null创建任务时保存的客户侧业务 ID, 不等同于平台任务 ID. 无法确认或不适用时为 null.
data.api_key_idstring | null关联模型 API Key 的 ID. 没有关联 Key 时为 null.
data.typestring任务类型. 可选值: image, video, music, other.
data.modelstring模型标识.
data.statusstring任务对外状态. 视频转存或结算未完成时仍为 processing. 可选值: pending, processing, completed, failed.
data.progressinteger任务进度百分比, 范围为 0-100.
data.created_atstring | null创建时间. 时间格式为带时区的 RFC 3339. 无法确认或不适用时为 null.
data.finished_atstring | null可确认的任务终态时间. 仍在处理或终态未确认时为 null. 时间格式为带时区的 RFC 3339.
data.billingobject | null可确认的任务账务信息, 无法确认时为 null.
data.billing.statusstring任务账务状态. pending 时不返回金额; 确认后为 settled 或 refunded. 可选值: pending, settled, refunded.
data.billing.creditsstring确认后的任务账务金额, 单位为 credits. pending 时省略此字段. 以十进制字符串返回以保持精度.
data.billing.cost_usdstring确认后的任务账务 USD 金额. pending 时省略此字段. 以十进制字符串返回以保持精度.
响应示例
{
"code": 0,
"message": "",
"data": {
"id": "task_example_01",
"client_business_id": "order_example_01",
"api_key_id": "42",
"type": "video",
"model": "example-video-model",
"status": "completed",
"progress": 100,
"created_at": "2026-11-01T08:00:00Z",
"finished_at": "2026-11-01T08:01:00Z",
"billing": {
"status": "settled",
"credits": "2",
"cost_usd": "0.02"
}
}
}