API Reference

接口参考

按接口拆分查看请求地址、输入参数、输出参数与错误代码。

Gateway Protocols多标准协议兼容
OpenAIAnthropicGeminiOpenRouter
Chat / Responses / Messages / Claude Messages
GET /v1/abilities/tasks/{taskId}

统一任务查询

查询统一外部能力异步任务状态与结果。

接口信息

请求地址https://api.4stoken.cn
请求路径/v1/abilities/tasks/{taskId}
请求方式GET
协议标准Gateway 统一能力
能力分类异步任务查询
Content-Type无请求体
鉴权Authorization: Bearer sk-...

输入参数

参数类型必填说明
taskIdstring路径参数,任务 ID。
providerstring查询参数,供应商标识。

输出参数

参数类型返回说明
task_idstring任务 ID。
statusstringpending / running / succeeded / failed / canceled。
providerstring任务供应商。
outputAssetsstring[]成功时输出素材 URL 列表。
resultobject成功时结构化结果。
errorobject失败时失败原因。

错误代码

HTTP 状态码错误说明
401UnauthorizedClient Key 无效或未提供。
404Not Found任务不存在或不可访问。

在线调试

task_id

统一能力提交接口返回的 task_id

curl -X GET 'https://api.4stoken.cn/v1/abilities/tasks/img-your-task-id' \
  -H 'Authorization: Bearer YOUR_API_KEY'
在线调试会向 Gateway 发起真实请求并可能产生费用。请确认参数无误后再点击。