GPT Image 2.5 Flare - Image To Image
This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.
Endpoint
POST /jobs/createTask
Full URL: https://ai.modelfold.online/v1/jobs/createTask
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Create Task
Use this endpoint to create a new image-to-image generation task.
- Get Task Details — After submission, use the unified query endpoint to check task progress and retrieve results
TIP
For production use, we recommend providing the callBackUrl parameter so your service can receive completion notifications instead of polling for task status.
Related Resources
- Model Marketplace — Explore all available models and capabilities
- Common API — Check account credits and usage
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name used for generation. This field is required. This endpoint must use the gpt-image-2-5-flare-image-to-image model. Default:"gpt-image-2-5-flare-image-to-image"。 Allowed values:gpt-image-2-5-flare-image-to-image。 示例:gpt-image-2-5-flare-image-to-image。 |
callBackUrl | string | No | Callback URL for task completion notifications. Optional parameter. If provided, the system will send a POST request to this URL when the task completes, whether it succeeds or fails. If omitted, no callback notification will be sent. To ensure callback security, see Webhook Verification Guide. 示例:https://your-domain.com/api/callback。 |
input | object | Yes | Input parameters for the image-to-image task. |
input.prompt | string | Yes | Text prompts, up to 20,000 characters. 示例:Transform this product image into a premium e-commerce poster style.。 |
input.input_urls | array<string> | No | Array of input image URLs. |
input.aspect_ratio | string | No | The aspect ratio of the generated image is set to auto by default. The 27:16, 16:27, 9:8 and 8:9 aspect ratios support 1K only. 2K and 4K are available for other aspect ratios. Allowed values:auto / 1:1 / 3:2 / 2:3 / 4:3 / 3:4 / 16:9 / 9:16 / 21:9 / 27:16 / 16:27 / 9:8 / 8:9。 示例:auto。 |
input.resolution | string | No | Image resolution Allowed values:1K / 2K / 4K。 示例:1K。 |
input.background | string | No | Image background Allowed values:transparent / opaque / auto。 示例:transparent。 |
Request Example
bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-5-flare-image-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Transform this product image into a premium e-commerce poster style.",
"input_urls": [
"https://example.com/"
],
"aspect_ratio": "auto",
"resolution": "4K",
"background": "transparent"
}
}'json
{
"model": "gpt-image-2-5-flare-image-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Transform this product image into a premium e-commerce poster style.",
"input_urls": [
"https://example.com/"
],
"aspect_ratio": "auto",
"resolution": "4K",
"background": "transparent"
}
}Response
200 — Request successful
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). 可选值:200 / 401 / 402 / 404 / 422 / 429 / 433 / 455 / 500 / 501 / 505。 示例:200。 |
msg | string | 否 | Response message, error description upon failure 示例:success。 |
data | object | 是 | — |
data.taskId | string | 是 | The task ID can be used with the "Get Task Details" endpoint to query the task status. 示例:dc1928bfcbc77cb6c85f3359a9c718b3。 |
json
{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_gptimage_1765180586443"
}
}Callback
onImageGenerated
Callback URL: {$request.body#/callBackUrl} (the callBackUrl in the request body).
Sent when the task succeeds or fails.
Callback body parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | 200: success. 501: failure; see data.failCode and data.failMsg. Allowed values:200 / 501。 示例:200。 |
msg | string | 否 | Status message 示例:Playground task completed successfully.。 |
data | object | 否 | — |
data.completeTime | integer | 否 | Task completion time, represented as a Unix timestamp in milliseconds 示例:1786433042000。 |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. 示例:78。 |
data.createTime | integer | 否 | Task creation time, represented as a Unix timestamp in milliseconds 示例:1786432963000。 |
data.creditsConsumed | number | 否 | Credits consumed by the task; 0 for failed tasks. 示例:3。 |
data.model | string | 否 | Image editing model used for the task 示例:gpt-image-2-5-flare-image-to-image。 |
data.param | string | 否 | Parameters submitted when creating the task, in JSON string format 示例:{"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"take a photo with Sam Altman in the conference room\",\"input_urls\":[\"https://static.aiquickdraw.com/tools/example/1776782793756_wrogXTdd.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-5-flare-image-to-image"}。 |
data.resultJson | string | 否 | Image generation result in JSON string format. resultUrls contains the list of generated image URLs. Present only when state is success. 示例:{"resultUrls":["https://tempfile.aiquickdraw.com/images/chatgpt/file_000000008b8481f7a0a8618ee2d10b84.png"]}。 |
data.state | string | 否 | Task status Allowed values:success / fail。 示例:success。 |
data.taskId | string | 否 | Task ID 示例:3fd37da5c726d0c8b1278f391906ac82。 |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. 示例:1786433042000。 |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. 示例:500。 |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. 示例:<error detail>。 |
Success
json
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "3fd37da5c726d0c8b1278f391906ac82",
"model": "gpt-image-2-5-flare-image-to-image",
"state": "success",
"param": "{\"input\":\"{\\\"aspect_ratio\\\":\\\"auto\\\",\\\"prompt\\\":\\\"take a photo with Sam Altman in the conference room\\\",\\\"input_urls\\\":[\\\"https://static.aiquickdraw.com/tools/example/1776782793756_wrogXTdd.png\\\"]}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"gpt-image-2-5-flare-image-to-image\"}",
"resultJson": "{\"resultUrls\":[\"https://tempfile.aiquickdraw.com/images/chatgpt/file_000000008b8481f7a0a8618ee2d10b84.png\"]}",
"completeTime": 1786433042000,
"createTime": 1786432963000,
"costTime": 78,
"creditsConsumed": 3,
"updateTime": 1786433042000
}
}Failure
json
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "3fd37da5c726d0c8b1278f391906ac82",
"model": "gpt-image-2-5-flare-image-to-image",
"state": "fail",
"param": "{\"input\":\"{\\\"aspect_ratio\\\":\\\"auto\\\",\\\"prompt\\\":\\\"take a photo with Sam Altman in the conference room\\\",\\\"input_urls\\\":[\\\"https://static.aiquickdraw.com/tools/example/1776782793756_wrogXTdd.png\\\"]}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"gpt-image-2-5-flare-image-to-image\"}",
"failCode": "500",
"failMsg": "<error detail>",
"completeTime": 1786433042000,
"createTime": 1786432963000,
"costTime": 78,
"creditsConsumed": 0,
"updateTime": 1786433042000
}
}