{
  "openapi": "3.1.0",
  "info": {
    "title": "FLUX 3 Image Klein",
    "version": "1.0.0",
    "description": "Asynchronous image generation and editing. URL references only; one output image; charges depend on resolution."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.ai"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/images/generations": {
      "post": {
        "operationId": "createFluxKleinImage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "const": "flux-3-image-klein"
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "\\S",
                    "description": "Non-empty image description or edit instruction."
                  },
                  "image_urls": {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "format": "uri",
                      "pattern": "^https?://",
                      "description": "Public HTTP(S) image URL without user credentials. No base64."
                    }
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "21:9",
                      "2:1",
                      "16:9",
                      "3:2",
                      "7:5",
                      "4:3",
                      "5:4",
                      "1:1",
                      "4:5",
                      "3:4",
                      "5:7",
                      "2:3",
                      "9:16",
                      "1:2",
                      "9:21",
                      "21x9",
                      "2x1",
                      "16x9",
                      "3x2",
                      "7x5",
                      "4x3",
                      "5x4",
                      "1x1",
                      "4x5",
                      "3x4",
                      "5x7",
                      "2x3",
                      "9x16",
                      "1x2",
                      "9x21"
                    ],
                    "default": "auto"
                  },
                  "size": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "21:9",
                      "2:1",
                      "16:9",
                      "3:2",
                      "7:5",
                      "4:3",
                      "5:4",
                      "1:1",
                      "4:5",
                      "3:4",
                      "5:7",
                      "2:3",
                      "9:16",
                      "1:2",
                      "9:21",
                      "21x9",
                      "2x1",
                      "16x9",
                      "3x2",
                      "7x5",
                      "4x3",
                      "5x4",
                      "1x1",
                      "4x5",
                      "3x4",
                      "5x7",
                      "2x3",
                      "9x16",
                      "1x2",
                      "9x21"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "pattern": "^(?:768(?:[sS][qQ])?|1[kK]|1\\.5[kK]|2[kK]|4[kK])$",
                    "default": "1k",
                    "description": "Case insensitive resolution tier: 768sq, 1k, 1.5k, 2k, 4k. 768 aliases 768sq."
                  },
                  "safety_tolerance": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "default": 2
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4294967295
                  },
                  "steps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16,
                    "default": 16
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "jpeg",
                      "jpg",
                      "png"
                    ],
                    "default": "jpeg"
                  },
                  "n": {
                    "type": "number",
                    "const": 1,
                    "default": 1
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted task",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "model",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "model": {
                      "const": "flux-3-image-klein"
                    },
                    "status": {
                      "const": "processing"
                    },
                    "created_at": {
                      "type": "integer",
                      "description": "Unix seconds"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request or task error; see the shared error directory.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request or task error; see the shared error directory.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Request or task error; see the shared error directory.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/{id}": {
      "get": {
        "operationId": "getFluxKleinTask",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task status; output exists only after completion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "processing",
                        "completed",
                        "failed"
                      ]
                    },
                    "output": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "url"
                            ],
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request or task error; see the shared error directory.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
