API Reference

接口参考

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

Gateway Protocols多标准协议兼容
OpenAIAnthropicGeminiOpenRouter
Chat / Responses / Messages / Claude Messages
POST /v1/abilities/generations

统一生成提交

图、视频等异步能力的统一提交入口。

接口信息

请求地址https://api.4stoken.cn
请求路径/v1/abilities/generations
请求方式POST
协议标准Gateway 统一能力
能力分类异步能力提交
Content-Typeapplication/json
鉴权Authorization: Bearer sk-...

输入参数

参数类型必填说明
capabilitystring能力类型。
modelstring模型或能力编码。
promptstring生成提示词。
providerstring指定供应商。
inputAssetsstring[]输入素材 URL 列表。
optionsobject能力扩展参数。

输出参数

参数类型返回说明
task_idstring任务 ID。
statusstring提交后通常为 pending。
providerstring实际使用的供应商。

错误代码

HTTP 状态码错误说明
401UnauthorizedClient Key 无效或未提供。
402Payment RequiredClient Key 配额或消费限额超限。

在线调试

model
your-model-code

仅展示该接口支持的已发布模型

暂无可用模型 →
prompt

统一能力提交的生成提示词;示例默认 capability=video

curl -X POST 'https://api.4stoken.cn/v1/abilities/generations' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  --data-raw '{"capability":"video","model":"your-model-code","prompt":"Hello","inputAssets":["https://example.com/reference-1.png","https://example.com/reference-2.png"],"options":{"duration":5}}'
在线调试会向 Gateway 发起真实请求并可能产生费用。请确认参数无误后再点击。