{
  "openapi": "3.1.0",
  "info": {
    "title": "1Route Video-site Images API",
    "version": "2026-10-08",
    "description": "Midjourney and Seedream images on Video. All prices are site balance units. Image URLs last 7 days. Video task endpoints and retention rules are separate."
  },
  "servers": [
    {
      "url": "https://video.1route.dev"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "ImageRequest": {
        "type": "object",
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "Midjourney v6",
              "Midjourney v6.1",
              "Midjourney v7",
              "Midjourney v8.1",
              "Midjourney v8.2",
              "Seedream 5.0 Pro"
            ]
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "n": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 1
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "description": "Alias for n; when both are present their values must match"
          },
          "image": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 10,
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "images": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "string"
            }
          },
          "image_urls": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 10,
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ],
            "default": "url"
          },
          "stream": {
            "type": "boolean",
            "const": false
          },
          "size": {
            "type": "string"
          },
          "aspect_ratio": {
            "type": "string"
          },
          "resolution": {
            "type": "string",
            "enum": [
              "1k",
              "2k"
            ]
          },
          "mode": {
            "type": "string"
          },
          "quality": {
            "type": [
              "number",
              "string"
            ]
          },
          "stylize": {
            "type": [
              "number",
              "string"
            ]
          },
          "chaos": {
            "type": [
              "number",
              "string"
            ]
          },
          "weird": {
            "type": [
              "number",
              "string"
            ]
          },
          "seed": {
            "type": [
              "number",
              "string"
            ]
          },
          "sw": {
            "type": [
              "number",
              "string"
            ]
          },
          "iw": {
            "type": [
              "number",
              "string"
            ]
          },
          "cw": {
            "type": [
              "number",
              "string"
            ]
          },
          "stop": {
            "type": [
              "number",
              "string"
            ]
          },
          "style": {
            "type": "string"
          },
          "negative_prompt": {
            "type": "string"
          },
          "sref": {
            "type": "string"
          },
          "cref": {
            "type": "string"
          },
          "tile": {
            "type": "boolean"
          },
          "draft": {
            "type": "boolean"
          },
          "hd": {
            "type": "boolean"
          },
          "params": {
            "type": "object",
            "properties": {
              "quality": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "stylize": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "chaos": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "weird": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "seed": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "sw": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "iw": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "cw": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "stop": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "style": {
                "type": "string"
              },
              "negative_prompt": {
                "type": "string"
              },
              "sref": {
                "type": "string"
              },
              "cref": {
                "type": "string"
              },
              "tile": {
                "type": "boolean"
              },
              "draft": {
                "type": "boolean"
              },
              "hd": {
                "type": "boolean"
              },
              "size": {
                "type": "string"
              },
              "aspect_ratio": {
                "type": "string"
              },
              "resolution": {
                "type": "string",
                "enum": [
                  "1k",
                  "2k"
                ]
              },
              "mode": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "Model parameters; top-level fields win and explicit zero/false are preserved. n/count must be top-level."
          }
        },
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "model": {
                  "enum": [
                    "Midjourney v6",
                    "Midjourney v6.1",
                    "Midjourney v7",
                    "Midjourney v8.1",
                    "Midjourney v8.2"
                  ]
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "prompt": {
                  "maxLength": 1024
                },
                "images": {
                  "maxItems": 4
                }
              }
            }
          }
        ]
      },
      "ImageEditRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ImageRequest"
          },
          {
            "anyOf": [
              {
                "required": [
                  "image"
                ]
              },
              {
                "required": [
                  "images"
                ]
              },
              {
                "required": [
                  "image_urls"
                ]
              }
            ]
          }
        ]
      },
      "ImageResponse": {
        "type": "object",
        "required": [
          "created",
          "data"
        ],
        "properties": {
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "minItems": 1,
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "pattern": "^https://video\\.1route\\.dev/v1/images/content/",
                      "description": "Opaque site image link, valid for 7 days; no API key required to read this capability URL"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "b64_json"
                  ],
                  "properties": {
                    "b64_json": {
                      "type": "string",
                      "contentEncoding": "base64",
                      "description": "PNG image bytes with source metadata removed"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/v1/images/generations": {
      "post": {
        "operationId": "generateImages",
        "summary": "Synchronous image generation",
        "description": "Use a Video-site Midjourney-group key. No image polling, Prefer async mode or streaming interface. Client timeouts do not prove failure; do not automatically retry. MJ charges n generations, not candidate images. Seedream charges successful images.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Site-hosted PNG image URLs or Base64 output without source URLs",
            "headers": {
              "X-Oneapi-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Site request ID for support"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid image request or explicit generation failure"
          },
          "401": {
            "description": "Invalid site key"
          },
          "403": {
            "description": "Group or model access denied"
          },
          "413": {
            "description": "Reference/request resource limit exceeded"
          },
          "429": {
            "description": "Service busy; check uncertain prior requests first"
          },
          "502": {
            "description": "Generation or delivery failed; do not automatically regenerate"
          },
          "503": {
            "description": "Resource capacity unavailable"
          },
          "504": {
            "description": "Outcome unresolved; save the site request ID and contact support"
          }
        }
      }
    },
    "/v1/images/edits": {
      "post": {
        "operationId": "editImages",
        "summary": "Reference image editing",
        "description": "Use a Video-site Midjourney-group key. No image polling, Prefer async mode or streaming interface. Client timeouts do not prove failure; do not automatically retry. MJ charges n generations, not candidate images. Seedream charges successful images.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt",
                  "image"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "Midjourney v6",
                      "Midjourney v6.1",
                      "Midjourney v7",
                      "Midjourney v8.1",
                      "Midjourney v8.2",
                      "Seedream 5.0 Pro"
                    ]
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 5000
                  },
                  "image": {
                    "type": "string",
                    "format": "binary",
                    "description": "Image upload up to 10 MiB; repeated image[] fields support multiple references"
                  },
                  "n": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "default": 1
                  },
                  "size": {
                    "type": "string"
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "1k",
                      "2k"
                    ]
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "url",
                      "b64_json"
                    ],
                    "default": "url"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Site-hosted PNG image URLs or Base64 output without source URLs",
            "headers": {
              "X-Oneapi-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Site request ID for support"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid image request or explicit generation failure"
          },
          "401": {
            "description": "Invalid site key"
          },
          "403": {
            "description": "Group or model access denied"
          },
          "413": {
            "description": "Reference/request resource limit exceeded"
          },
          "429": {
            "description": "Service busy; check uncertain prior requests first"
          },
          "502": {
            "description": "Generation or delivery failed; do not automatically regenerate"
          },
          "503": {
            "description": "Resource capacity unavailable"
          },
          "504": {
            "description": "Outcome unresolved; save the site request ID and contact support"
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "listKeyModels",
        "summary": "List models allowed for this key",
        "responses": {
          "200": {
            "description": "OpenAI-compatible model list filtered by key permissions"
          }
        }
      }
    }
  }
}
