查询任务
GET /replicate/v1/predictions/{任务id}
说明
概览
| Method | GET |
|---|---|
| Path | /replicate/v1/predictions/{任务id} |
| Type | http |
| Status | 1 |
| Module | 2102810 |
| Folder | 61442780 |
参数
{ "query": [], "path": [ { "id": "任务id#0", "name": "任务id", "required": true, "description": "", "type": "string", "enable": true, "sampleValue": "w44zs9cet5rmc0cqzp49gpkhf8" } ], "cookie": [], "header": [ { "required": false, "description": "", "type": "string", "id": "GTujCrB2It", "enable": true, "name": "Authorization", "sampleValue": "Bearer {{YOUR_API_KEY}}" } ] }
请求体
{ "type": "none", "parameters": [], "jsonSchema": { "type": "object", "properties": { "model": { "type": "string", "description": "用于图像生成的模型。" }, "prompt": { "type": "string", "description": "所需图像的文本描述。最大长度为 1000 个字符。" }, "n": { "type": "integer", "description": "要生成的图像数。必须介于 1 和 10 之间。" }, "size": { "type": "string", "description": "生成图像的大小。必须是256x256、512x512或 1024x1024之一。" }, "quality": { "type": "string", "description": "将生成的图像的质量。`hd`创建具有更精细细节和更高一致性的图像。此参数仅支持`dall-e-3`." }, "response_format": { "type": "string", "description": "返回生成的图像的格式。必须是 或url之一b64_json。" }, "style": { "type": "string", "description": "风格" }, "user": { "type": "string", "description": "生成图像的风格。必须是 或`vivid`之一`natural`。生动使模型倾向于生成超真实和戏剧性的图像。自然使模型生成更自然、不太真实的图像。此参数仅支持`dall-e-3`." }, "aspect_ratio": { "type": "string", "description": "图片比例: 枚举值Possible enum values: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21", "x-apifox-mock": "1:1" } }, "required": [ "prompt", "aspect_ratio" ], "x-apifox-orders": [ "prompt", "model", "n", "quality", "response_format", "style", "user", "size", "aspect_ratio" ] }, "mediaType": "", "examples": [ { "value": "", "mediaType": "application/json", "description": "" } ], "oasExtensions": "" }
响应
[ { "id": 719660578, "name": "成功", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string" }, "logs": { "type": "string" }, "urls": { "type": "object", "properties": { "get": { "type": "string" }, "web": { "type": "string" }, "cancel": { "type": "string" }, "stream": { "type": "string" } }, "required": [ "get", "web", "cancel", "stream" ] }, "error": { "type": "null" }, "input": { "type": "object", "properties": { "prompt": { "type": "string" }, "input_image": { "type": "string" }, "aspect_ratio": { "type": "string" }, "output_format": { "type": "string" }, "safety_tolerance": { "type": "integer" }, "prompt_upsampling": { "type": "boolean" } }, "required": [ "prompt", "input_image", "aspect_ratio", "output_format", "safety_tolerance", "prompt_upsampling" ] }, "model": { "type": "string" }, "output": { "type": "string" }, "status": { "type": "string" }, "metrics": { "type": "object", "properties": { "image_count": { "type": "integer" }, "predict_time": { "type": "number" } }, "required": [ "image_count", "predict_time" ] }, "version": { "type": "string" }, "created_at": { "type": "string" }, "started_at": { "type": "string" }, "completed_at": { "type": "string" }, "data_removed": { "type": "boolean" } }, "required": [ "id", "logs", "urls", "error", "input", "model", "output", "status", "metrics", "version", "created_at", "started_at", "completed_at", "data_removed" ] }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [], "oasExtensions": "" } ]
响应示例
[ { "name": "Create image", "responseId": 719660578, "data": "{\n \"created\": 1589478378,\n \"data\": [\n {\n \"url\": \"https://...\"\n },\n {\n \"url\": \"https://...\"\n }\n ]\n}", "description": "", "oasKey": "", "oasExtensions": "", "id": 641274172 }, { "name": "成功示例", "responseId": 719660578, "data": "{\r\n \"id\": \"w44zs9cet5rmc0cqzp49gpkhf8\",\r\n \"logs\": \"Starting generate image\\nUsing seed: 29889\\nTotal safe images: 1 out of 1\\ngenerate image took 3.53 seconds\\n\",\r\n \"urls\": {\r\n \"get\": \"https://api.replicate.com/v1/predictions/w44zs9cet5rmc0cqzp49gpkhf8\",\r\n \"web\": \"https://replicate.com/p/w44zs9cet5rmc0cqzp49gpkhf8\",\r\n \"cancel\": \"https://api.replicate.com/v1/predictions/w44zs9cet5rmc0cqzp49gpkhf8/cancel\",\r\n \"stream\": \"https://stream.replicate.com/v1/files/bcwr-h7bu76ujftxzwih5u35puoysogps56mqvpvjz4nrxskhfe7ks42a\"\r\n },\r\n \"error\": null,\r\n \"input\": {\r\n \"prompt\": \"Make the letters 3D, floating in space on a city street\",\r\n \"input_image\": \"https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png\",\r\n \"aspect_ratio\": \"match_input_image\",\r\n \"output_format\": \"jpg\",\r\n \"safety_tolerance\": 2,\r\n \"prompt_upsampling\": false\r\n },\r\n \"model\": \"black-forest-labs/flux-kontext-dev\",\r\n \"output\": \"https://replicate.delivery/xezq/FB7iNUmvHJ4NHFIMPea2hEoa4N4mTbwf3GBQjGzGQ4yeD4fTB/output.jpg\",\r\n \"status\": \"succeeded\",\r\n \"metrics\": {\r\n \"image_count\": 1,\r\n \"predict_time\": 3.590520183\r\n },\r\n \"version\": \"hidden\",\r\n \"created_at\": \"2025-07-12T07:27:54.577Z\",\r\n \"started_at\": \"2025-07-12T07:27:54.587120975Z\",\r\n \"completed_at\": \"2025-07-12T07:27:58.177641162Z\",\r\n \"data_removed\": false\r\n}", "description": "", "oasKey": "", "oasExtensions": "", "id": 641284326 } ]