图片模型接口参考处理图片提交回执

处理图片提交回执

未收到图片提交的响应时,使用原请求体和原 Idempotency-Key 确认提交结果。原请求已受理时返回该任务;未受理时返回一个未扣费的失败任务,并确保原请求之后不会再被受理。本接口不会生成图片。

认证

API Key:X-API-Key: <API Key> 或 Authorization: Bearer <API Key>。

示例中的凭证为占位值,请替换后在服务器端运行。

代码示例

curl -X POST 'https://shixux.com/api/v1/image/submissions/resolve' \  -H 'X-API-Key: yb_xxx_yyy' \  -H 'Content-Type: application/json' \  -H 'Idempotency-Key: your-unique-business-action-id' \  -d '{"request":{"mode":"text-to-image","model":"doubao-seedream-5-0-pro-260628","prompt":"A yellow ceramic cup on a plain table.","size":"1024x1024","rate_version":1}}'
{  "id": "job_xxx",  "type": "tts",  "status": "queued",  "reserved_credits": 1,  "estimate_detail": {}}

请求头参数

Idempotency-Key*string

幂等键,最长 128 个字符。重试同一请求时使用相同的值;同一个键用于不同的请求时返回 409。

长度length <= 128

请求体

application/json
  1. body
request*

未收到响应的原始图片请求,须与原提交的请求体一致。

expected_job_id?string

Job ID returned earlier for this submission, or an empty string if none was returned.

响应体

返回原任务,或一个未扣费的失败任务

application/json
  1. response
estimate_detail*
id*Id
reserved_credits*Reserved Credits
status*JobStatus
可选值"queued""processing""succeeded""failed""cancelled"
type*JobType
可选值"tts""avatar""video""video_analysis""image""voice_design""audio_composition"

本页目录