{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter GPT Image 2.6",
    "version": "1.0.0",
    "description": "Official image parameters with asynchronous task delivery and URL inputs/outputs. stream and partial_images are not exposed. Not a synchronous SDK replacement."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.ai/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/images/generations": {
      "post": {
        "summary": "Create an image generation or editing task; images selects editing",
        "operationId": "createImageTask",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted. Poll the returned id; no image is returned by this call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{task_id}": {
      "get": {
        "summary": "Read an owned image task",
        "operationId": "getImageTask",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^task_[A-Za-z0-9]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Processing, completed or failed task. Polling timeout is not a task failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "ImageRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "gpt-image-2.6-sunburst-official",
              "gpt-image-2.6-sunburst",
              "gpt-image-2.6-flare-official",
              "gpt-image-2.6-flare"
            ]
          },
          "prompt": {
            "type": "string",
            "minLength": 1
          },
          "n": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 10
              },
              {
                "type": "null"
              }
            ],
            "default": 1
          },
          "size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "auto",
            "description": "auto or positive WIDTHxHEIGHT, multiples of 16. PNG/JPEG/SVG: each edge <=3840, 655360–8294400 pixels, aspect ratio 1:3–3:1. GIF uses a separate total pixel budget."
          },
          "quality": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "low",
                  "medium",
                  "high",
                  "xhigh",
                  "max"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "auto"
          },
          "background": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "opaque",
                  "transparent"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "auto"
          },
          "output_format": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "gif",
                  "svg"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "png"
          },
          "output_compression": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "default": 100
          },
          "moderation": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "low"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "auto"
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "images": {
            "anyOf": [
              {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "image_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "image_url"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "mask": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "image_url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "image_url"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "PNG up to 50 MB, dimensions match the first image after orientation. Transparent pixels are edited. Requires images; cannot accompany markup."
          },
          "complexity": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              {
                "type": "null"
              }
            ],
            "default": "high"
          },
          "frame_count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 2,
                "maximum": 16
              },
              {
                "type": "null"
              }
            ],
            "default": 9
          },
          "frame_duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 20,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "default": 200
          },
          "svg": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "reasoning": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "effort": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "minimal",
                                  "low",
                                  "medium",
                                  "high",
                                  "xhigh",
                                  "max"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "model"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "markup": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "image_url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "image_url"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Transparent PNG up to 50 MB, dimensions match the first image after orientation. Both may have at most 16777216 pixels. Requires images; cannot accompany mask."
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "model",
          "prompt"
        ],
        "additionalProperties": false,
        "description": "SVG is generation-only and requires n=1. GIF may be generated or edited, but not with a mask. Frames require GIF, compression requires JPEG, svg options require SVG, and markup/mask require images and cannot be combined. Unknown fields are discarded. See the API guide for media and size constraints."
      },
      "TaskAccepted": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "gpt-image-2.6-sunburst-official",
              "gpt-image-2.6-sunburst",
              "gpt-image-2.6-flare-official",
              "gpt-image-2.6-flare"
            ]
          },
          "status": {
            "const": "processing"
          },
          "created_at": {
            "type": "integer"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              10001,
              10002,
              20001,
              20002,
              30001,
              30002,
              50001,
              50002,
              50003,
              60001,
              60002,
              60003,
              60004,
              90001
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "Task": {
        "type": "object",
        "required": [
          "id",
          "model",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "enum": [
              "gpt-image-2.6-sunburst-official",
              "gpt-image-2.6-sunburst",
              "gpt-image-2.6-flare-official",
              "gpt-image-2.6-flare"
            ]
          },
          "status": {
            "enum": [
              "processing",
              "completed",
              "failed"
            ]
          },
          "created_at": {
            "type": "integer"
          },
          "finished_at": {
            "type": "integer"
          },
          "output": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer"
              },
              "size": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,4}x[1-9][0-9]{0,4}$"
              },
              "quality": {
                "enum": [
                  "low",
                  "medium",
                  "high",
                  "xhigh",
                  "max"
                ]
              },
              "background": {
                "enum": [
                  "opaque",
                  "transparent"
                ]
              },
              "output_format": {
                "enum": [
                  "png",
                  "jpeg",
                  "gif",
                  "svg"
                ]
              },
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              },
              "usage": {
                "type": "object",
                "description": "Numeric input_tokens, output_tokens, total_tokens and token details when reported."
              },
              "svg_usage": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "output_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reasoning_tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total_tokens": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "safety_identifier": {
                "type": "string",
                "maxLength": 128
              }
            }
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
