{
  "components": {
    "schemas": {
      "TaskResponse": {
        "description": "Standard async task creation response",
        "properties": {
          "code": {
            "description": "Status code returned by the service",
            "example": "success",
            "type": "string"
          },
          "data": {
            "description": "Response payload containing task details",
            "properties": {
              "task_id": {
                "description": "Identifier of the created task",
                "type": "string"
              }
            },
            "required": [
              "task_id"
            ],
            "type": "object"
          },
          "fail_code": {
            "description": "Failure code if the task submission did not succeed",
            "type": "string"
          },
          "message": {
            "description": "Additional information about the request result",
            "type": "string"
          }
        },
        "required": [
          "data",
          "code",
          "message"
        ],
        "type": "object"
      },
      "TaskStatusResponse": {
        "description": "Async task status query response",
        "example": {
          "code": "success",
          "data": {
            "fail_code": "",
            "fail_reason": "",
            "finish_time": 1763274838,
            "outputs": [
              "https://api.siray.ai/redirect/example-output"
            ],
            "progress": "100%",
            "start_time": 1763274702,
            "status": "SUCCESS",
            "submit_time": 1763274672,
            "task_id": "video_69196fafcc9c8190acccf32e9b560c3f0da8a6d1948cfaa5"
          },
          "message": ""
        },
        "properties": {
          "code": {
            "description": "Status code returned by the service",
            "example": "success",
            "type": "string"
          },
          "data": {
            "description": "Task execution details",
            "properties": {
              "fail_code": {
                "description": "Failure code if the task did not succeed",
                "type": "string"
              },
              "fail_reason": {
                "description": "Explanation of the failure if the task did not succeed",
                "type": "string"
              },
              "finish_time": {
                "description": "Unix timestamp when task processing finished",
                "format": "int64",
                "type": "integer"
              },
              "outputs": {
                "description": "URLs for generated assets",
                "items": {
                  "description": "Public URL to the generated asset",
                  "format": "uri",
                  "type": "string"
                },
                "type": "array"
              },
              "progress": {
                "description": "Human-readable task progress indicator",
                "example": "100%",
                "type": "string"
              },
              "start_time": {
                "description": "Unix timestamp when task processing began",
                "format": "int64",
                "type": "integer"
              },
              "status": {
                "description": "Current task status",
                "enum": [
                  "NOT_START",
                  "SUBMITTED",
                  "QUEUED",
                  "IN_PROGRESS",
                  "FAILURE",
                  "SUCCESS"
                ],
                "type": "string"
              },
              "submit_time": {
                "description": "Unix timestamp when the task was submitted",
                "format": "int64",
                "type": "integer"
              },
              "task_id": {
                "description": "Identifier of the task",
                "type": "string"
              }
            },
            "required": [
              "task_id",
              "status"
            ],
            "type": "object"
          },
          "message": {
            "description": "Additional information or error details",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "data"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "API Key",
        "description": "Bearer authentication using API key",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Flux Kontext i2i Pro by Black Forest Labs is a image editing AI model for image editing and compositing. It delivers high-quality results for rapid iteration and dependable production workflows.",
    "summary": "API for Flux Kontext i2i Pro model",
    "title": "Flux Kontext i2i Pro API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/images/generations/async": {
      "post": {
        "description": "Generate an image using the Flux Kontext i2i Pro model",
        "operationId": "image_model-rfmlcntmts2dzoip",
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "aspect_ratio": "match_input_image",
                "image": "example_value",
                "model": "black-forest-labs/flux-kontext-i2i-pro",
                "prompt": "example_value",
                "seed": -1
              },
              "schema": {
                "description": "Request format for image generation models",
                "properties": {
                  "aspect_ratio": {
                    "description": "Aspect ratio",
                    "enum": [
                      "match_input_image",
                      "1:1",
                      "16:9",
                      "9:16",
                      "4:3",
                      "3:4",
                      "3:2",
                      "2:3",
                      "4:5",
                      "5:4",
                      "21:9",
                      "9:21",
                      "2:1",
                      "1:2"
                    ],
                    "type": "string"
                  },
                  "image": {
                    "description": "Input image for generation, it can be data URL or image URL",
                    "type": "string"
                  },
                  "model": {
                    "description": "Model name to use for the request",
                    "enum": [
                      "black-forest-labs/flux-kontext-i2i-pro"
                    ],
                    "type": "string"
                  },
                  "prompt": {
                    "description": "Text prompt for generation",
                    "type": "string"
                  },
                  "seed": {
                    "description": "Random seed for generation",
                    "maximum": 9999999999,
                    "minimum": -1,
                    "type": "integer"
                  }
                },
                "required": [
                  "model",
                  "prompt",
                  "image",
                  "aspect_ratio"
                ],
                "title": "Image Generation Request",
                "type": "object"
              }
            }
          },
          "description": "Request payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "Successful response"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Generate image",
        "tags": [
          "Flux Kontext i2i Pro"
        ]
      }
    },
    "/v1/images/generations/async/{task_id}": {
      "get": {
        "description": "Query the status and result of an image generation task",
        "operationId": "query_image_task_model-rfmlcntmts2dzoip",
        "parameters": [
          {
            "description": "Task ID returned from the image generation request",
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponse"
                }
              }
            },
            "description": "Task status and result"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Query image generation task",
        "tags": [
          "Flux Kontext i2i Pro"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Model Verse API Server",
      "url": "https://api.siray.ai"
    }
  ],
  "tags": [
    {
      "description": "Flux Kontext i2i Pro - Flux Kontext i2i Pro by Black Forest Labs is a image editing AI model for image editing and compositing. It delivers high-quality results for rapid iteration and dependable production workflows.",
      "name": "Flux Kontext i2i Pro"
    }
  ]
}