{
  "openapi": "3.1.0",
  "info": {
    "title": "Frameport API",
    "version": "1.0.0",
    "summary": "One API key for image and video models, paid from a USD balance.",
    "description": "Every request carries a workspace key: `Authorization: Bearer fp_live_…`. A request that starts work holds its price on the balance and answers `202` with a generation to poll (or be told about by webhook); a success is charged, a failure costs nothing.\n\nA workspace sends 60 requests that start work a minute and runs 20 generations at once; lists come 20 at a time.\n\nDocs: https://frameport.ai/docs",
    "contact": {
      "name": "Frameport",
      "email": "hello@frameport.ai",
      "url": "https://frameport.ai"
    }
  },
  "externalDocs": {
    "description": "The docs",
    "url": "https://frameport.ai/docs"
  },
  "servers": [
    {
      "url": "https://frameport.ai"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Images",
      "description": "Images from a prompt, with reference pictures on the models that take them."
    },
    {
      "name": "Videos",
      "description": "Clips from a prompt, a first frame (and a last) or reference pictures."
    },
    {
      "name": "Clip edits",
      "description": "Changes to a clip you send: its people replaced with the faces sent, or the clip upscaled."
    },
    {
      "name": "Uploads",
      "description": "Local files sent once, then named by id in any request for 24 hours."
    },
    {
      "name": "Generations",
      "description": "Every generation and edit of the workspace, their files, and the price of a request before it runs."
    },
    {
      "name": "Files",
      "description": "The outputs' bytes, by signed link."
    },
    {
      "name": "Models",
      "description": "The models on sale, with their prices and options."
    },
    {
      "name": "Account",
      "description": "The workspace, its balance and limits, and the API's status."
    }
  ],
  "paths": {
    "/v1/images/generations": {
      "post": {
        "operationId": "createImageGeneration",
        "summary": "Generate images",
        "description": "Holds the price of `n` images, starts them and answers `202` with the generation to poll. [Docs](https://frameport.ai/docs/images).",
        "tags": [
          "Images"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "An image model id from [GET /v1/models](https://frameport.ai/docs/models)."
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 2400,
                    "description": "Up to 2,400 characters."
                  },
                  "n": {
                    "type": "integer",
                    "default": 1,
                    "minimum": 1,
                    "maximum": 4,
                    "description": "1 to 4, default 1. Each image is charged."
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "enum": [
                      "1:1",
                      "3:4",
                      "4:3",
                      "9:16",
                      "16:9"
                    ],
                    "default": "1:1",
                    "description": "`1:1` (default), `3:4`, `4:3`, `9:16` or `16:9`."
                  },
                  "negative_prompt": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Up to 1,000 characters, on models that take one."
                  },
                  "reference_images": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 10,
                    "description": "Pictures to edit or keep, each an https URL, a `data:image/png|jpeg|webp|gif;base64,` URI, an [upload](https://frameport.ai/docs/uploads) (`upl_…`) or one of your image outputs (`file_…`). Up to 10 by the API, fewer on most models (each model page says)."
                  },
                  "private": {
                    "type": "boolean",
                    "default": false,
                    "description": "Private mode, on models with `options.private`: nothing is kept, not even the prompt. Each image comes back once, as `b64_json`, in the read that completes it. See [Private mode](https://frameport.ai/docs/files#private)."
                  },
                  "max_cost_usd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 10000,
                    "description": "The most this request may cost, in USD: a higher price is refused with `400 max_cost_exceeded` before anything is held. See [Quotes](https://frameport.ai/docs/quotes)."
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ],
                "additionalProperties": false
              },
              "example": {
                "model": "fp-image-2",
                "prompt": "A lighthouse on a cliff at dawn, long exposure, soft fog",
                "n": 1,
                "aspect_ratio": "16:9"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An Idempotency-Key replay: the generation the first request made.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the generation, queued, with the price held. `200` when an Idempotency-Key replays an earlier request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field, a value off the model's options, a picture or clip that cannot be used, or a price above `max_cost_usd`. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The balance does not cover the hold. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with another body, or its first request still runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 16 MB: send large pictures by URL or upload them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Past the workspace's requests a minute or running generations: wait for `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/generations/{id}": {
      "get": {
        "operationId": "getImageGeneration",
        "summary": "Read an image generation",
        "description": "The generation, moved forward if it is still running. [Docs](https://frameport.ai/docs/images).",
        "tags": [
          "Images"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation's id (`gen_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "gen_4kQ8vT2nLm9Xr7Wd1sYcPa"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The generation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/generations": {
      "post": {
        "operationId": "createVideoGeneration",
        "summary": "Generate a video",
        "description": "Holds the clip's price, starts it and answers `202` with the generation to poll. [Docs](https://frameport.ai/docs/videos).",
        "tags": [
          "Videos"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A video model id from [GET /v1/models](https://frameport.ai/docs/models)."
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 2400,
                    "description": "Up to 2,400 characters: the action, the camera, the sound."
                  },
                  "duration": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "description": "Seconds, on the model's grid (`options.durations`: min, max, step). 5 when left out, or the nearest the model allows."
                  },
                  "resolution": {
                    "type": "string",
                    "description": "One of the model's `options.resolutions`. Its `default_resolution` when left out."
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "enum": [
                      "16:9",
                      "9:16",
                      "1:1",
                      "21:9",
                      "4:3",
                      "3:4"
                    ],
                    "description": "`16:9`, `9:16`, `1:1`, `21:9`, `4:3` or `3:4`, as the model lists."
                  },
                  "audio": {
                    "type": "boolean",
                    "default": true,
                    "description": "Default `true`. Honoured where the model has `audio_toggle`; some models always render sound."
                  },
                  "reference_images": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 4,
                    "description": "Up to 4 pictures, each an https URL, a `data:image/png|jpeg|webp|gif;base64,` URI, an [upload](https://frameport.ai/docs/uploads) (`upl_…`) or one of your image outputs (`file_…`): the first frame, or references (see `reference_mode`)."
                  },
                  "reference_mode": {
                    "type": "string",
                    "enum": [
                      "frame",
                      "identity"
                    ],
                    "default": "frame",
                    "description": "`frame` (default): on models with `start_frame`, one picture, the first frame. `identity`: up to `max_reference_images` pictures of who or what stars, and the model builds the scene; not with `end_image`."
                  },
                  "end_image": {
                    "type": "string",
                    "description": "The last frame, on models with `end_frame`, in the same forms. Needs a first frame."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647,
                    "description": "0 to 2147483647, on models with `seed`."
                  },
                  "negative_prompt": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Up to 1,000 characters, on models with `negative_prompt`."
                  },
                  "private": {
                    "type": "boolean",
                    "default": false,
                    "description": "Private mode, on models with `options.private`, at their `private_resolutions`: nothing is kept, not even the prompt, and the clip is served for about 30 minutes. See [Private mode](https://frameport.ai/docs/files#private)."
                  },
                  "max_cost_usd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 10000,
                    "description": "The most this request may cost, in USD: a higher price is refused with `400 max_cost_exceeded` before anything is held. See [Quotes](https://frameport.ai/docs/quotes)."
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ],
                "additionalProperties": false
              },
              "example": {
                "model": "fp-motion-1",
                "prompt": "A red vintage car winds along a coastal road at sunrise, drone follow shot",
                "duration": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An Idempotency-Key replay: the generation the first request made.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the generation, queued, with the price held. `200` when an Idempotency-Key replays an earlier request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field, a value off the model's options, a picture or clip that cannot be used, or a price above `max_cost_usd`. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The balance does not cover the hold. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with another body, or its first request still runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 16 MB: send large pictures by URL or upload them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Past the workspace's requests a minute or running generations: wait for `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/generations/{id}": {
      "get": {
        "operationId": "getVideoGeneration",
        "summary": "Read a video generation",
        "description": "The generation, moved forward if it is still running. [Docs](https://frameport.ai/docs/videos).",
        "tags": [
          "Videos"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation's id (`gen_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "gen_4kQ8vT2nLm9Xr7Wd1sYcPa"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The generation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/edits": {
      "post": {
        "operationId": "createVideoEdit",
        "summary": "Edit a clip",
        "description": "Fetches the clip and the faces, holds the price of the longest clip, starts the edit and answers `202` with the generation to poll, its hold brought down to the clip's length. [Docs](https://frameport.ai/docs/edits).",
        "tags": [
          "Clip edits"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A clip editor: `fp-replace-1` and `fp-upscale-1`."
                  },
                  "video": {
                    "type": "string",
                    "description": "The clip: a public https URL we download, one of your video outputs (`file_…`) or a video [upload](https://frameport.ai/docs/uploads) (`upl_…`)."
                  },
                  "resolution": {
                    "type": "string",
                    "description": "One of the model's `options.resolutions`. Its `default_resolution` when left out."
                  },
                  "faces": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 4,
                    "description": "Required by Frameport Replace 1, refused by the others: one picture per person replaced, left to right, up to 4. An https URL, a base64 data URI, one of your image outputs (`file_…`) or an image upload (`upl_…`): PNG, JPEG or WebP, up to 10 MB each."
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Who each face replaces, in the same order (`\"the woman on the left\"`), up to 200 characters each. Required with several faces."
                  },
                  "keep_outfit": {
                    "type": "boolean",
                    "default": true,
                    "description": "Default `true`: the clip's clothes stay. `false` dresses each person as in their picture."
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Optional, up to 500 characters: a note on the edit."
                  },
                  "max_cost_usd": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 10000,
                    "description": "The most this edit may hold, in USD: the price of the longest clip the model takes. Above it, `400 max_cost_exceeded` before anything is fetched or held."
                  }
                },
                "required": [
                  "model",
                  "video"
                ],
                "additionalProperties": false
              },
              "example": {
                "model": "fp-replace-1",
                "video": "https://example.com/dance.mp4",
                "faces": [
                  "https://example.com/me.jpg"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An Idempotency-Key replay: the generation the first request made.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the edit, queued, with the price of its clip held. `200` when an Idempotency-Key replays an earlier request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field, a value off the model's options, a picture or clip that cannot be used, or a price above `max_cost_usd`. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The balance does not cover the hold. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key was used with another body, or its first request still runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 16 MB: send large pictures by URL or upload them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Past the workspace's requests a minute or running generations: wait for `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/edits/{id}": {
      "get": {
        "operationId": "getVideoEdit",
        "summary": "Read a clip edit",
        "description": "The generation, moved forward if it is still running (the same as `GET /v1/videos/generations/{id}`). [Docs](https://frameport.ai/docs/edits).",
        "tags": [
          "Clip edits"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation's id (`gen_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "gen_4kQ8vT2nLm9Xr7Wd1sYcPa"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The generation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Upload a picture or a clip",
        "description": "Stores a file sent as the raw body and answers `201` with its id (`upl_…`), which any media field takes for 24 hours. [Docs](https://frameport.ai/docs/uploads).",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "filename",
            "in": "query",
            "required": false,
            "description": "Its name, kept for display (no path, 200 characters at most).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The file itself as the body, with its Content-Type.",
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/png"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/jpeg"
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/webp"
              }
            },
            "video/mp4": {
              "schema": {
                "type": "string",
                "contentMediaType": "video/mp4"
              }
            },
            "video/quicktime": {
              "schema": {
                "type": "string",
                "contentMediaType": "video/quicktime"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "No body, a type that is not taken, or bytes that are not the file they say. Nothing was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The workspace holds 100 uploads: delete some, or wait for them to expire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The file is over the size for its kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Past the workspace's uploads a minute: wait for `Retry-After`.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads/{id}": {
      "get": {
        "operationId": "getUpload",
        "summary": "Read an upload",
        "description": "One of the workspace's uploads: `ready`, `expired` or `deleted`. [Docs](https://frameport.ai/docs/uploads).",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The upload's id (`upl_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "upl_7Rk2PqV9wXm4Tn8Lc1BdZe"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The upload.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteUpload",
        "summary": "Delete an upload",
        "description": "Stops the id from working at once and deletes the file. [Docs](https://frameport.ai/docs/uploads).",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The upload's id (`upl_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "upl_7Rk2PqV9wXm4Tn8Lc1BdZe"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadDeleted"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations": {
      "get": {
        "operationId": "listGenerations",
        "summary": "List generations",
        "description": "The workspace's generations and clip edits, newest first, a page at a time. [Docs](https://frameport.ai/docs/generations).",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100, default 20.",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` of the page before.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "`queued`, `running`, `succeeded` or `failed`.",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "succeeded",
                "failed"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "`image` or `video` (clip edits are videos).",
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "video"
              ]
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "description": "A model id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "`api` (a key) or `playground` (the Studio).",
            "schema": {
              "type": "string",
              "enum": [
                "api",
                "playground"
              ]
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Made at or after this time, ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Made before this time, ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of generations.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationList"
                }
              }
            }
          },
          "400": {
            "description": "A filter or cursor that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{id}": {
      "get": {
        "operationId": "getGeneration",
        "summary": "Read a generation",
        "description": "One generation of any type, moved forward if it is still running. [Docs](https://frameport.ai/docs/generations).",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation's id (`gen_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "gen_4kQ8vT2nLm9Xr7Wd1sYcPa"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The generation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{id}/content": {
      "get": {
        "operationId": "getGenerationContent",
        "summary": "Download a generation's file",
        "description": "The bytes of its first output, streamed with your key. `Range` is supported. [Docs](https://frameport.ai/docs/generations).",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation's id (`gen_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "gen_4kQ8vT2nLm9Xr7Wd1sYcPa"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file (`206` for a range).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream",
                  "description": "The file, with its own Content-Type (image/png, video/mp4…)."
                }
              }
            }
          },
          "206": {
            "description": "The range asked for.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream",
                  "description": "The file, with its own Content-Type (image/png, video/mp4…)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not finished yet, or this output failed (it has no file).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "The file is no longer stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{id}/content/{index}": {
      "get": {
        "operationId": "getGenerationContentAt",
        "summary": "Download one output's file",
        "description": "The bytes of output `index`, from 0: the images of a batch. [Docs](https://frameport.ai/docs/generations).",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation's id (`gen_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "gen_4kQ8vT2nLm9Xr7Wd1sYcPa"
              ]
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "description": "The output's position, from 0.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "examples": [
                1
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file (`206` for a range).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream",
                  "description": "The file, with its own Content-Type (image/png, video/mp4…)."
                }
              }
            }
          },
          "206": {
            "description": "The range asked for.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream",
                  "description": "The file, with its own Content-Type (image/png, video/mp4…)."
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. Nothing was charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such generation, or no output at that position.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not finished yet, or this output failed (it has no file).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "The file is no longer stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/quote": {
      "post": {
        "operationId": "quoteGeneration",
        "summary": "Price a request",
        "description": "The price of a request before it is sent, against the balance available. Nothing is held or started. [Docs](https://frameport.ai/docs/quotes).",
        "tags": [
          "Generations"
        ],
        "requestBody": {
          "required": true,
          "description": "The body you would send to the model's endpoint (a prompt is optional here), with `seconds`, the clip's length, for a clip editor.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Any model id: the rest of the body is that model's endpoint's."
                  },
                  "seconds": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "A clip editor only: the clip's length, for its exact price. Without it, the quote is the hold, the price of the longest clip."
                  }
                },
                "required": [
                  "model"
                ],
                "additionalProperties": true
              },
              "example": {
                "model": "fp-image-2",
                "n": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The quote.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "description": "A field or a value the model's endpoint would refuse, or a price above `max_cost_usd`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files/{id}": {
      "get": {
        "operationId": "getFile",
        "summary": "Download an output",
        "description": "An output's bytes, streamed, with its signed link or your key. `Range` is supported. [Docs](https://frameport.ai/docs/files).",
        "tags": [
          "Files"
        ],
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The output's id (`file_…`).",
            "schema": {
              "type": "string",
              "examples": [
                "file_8Hc2RkQw5ZpT1mVb7nXe3L"
              ]
            }
          },
          {
            "name": "expires",
            "in": "query",
            "required": false,
            "description": "From the signed link (`outputs[].url`).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "signature",
            "in": "query",
            "required": false,
            "description": "From the signed link.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file (`206` for a range).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream",
                  "description": "The file, with its own Content-Type (image/png, video/mp4…)."
                }
              }
            }
          },
          "206": {
            "description": "The range asked for.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream",
                  "description": "The file, with its own Content-Type (image/png, video/mp4…)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The signed link is invalid or expired: read the generation again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "The file is no longer stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable for now. Nothing was charged.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models",
        "description": "Every model on sale, with its USD prices and options. No key needed; a key that is sent is checked. [Docs](https://frameport.ai/docs/models).",
        "tags": [
          "Models"
        ],
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The catalog.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "401": {
            "description": "A key was sent and it does not work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models/{id}": {
      "get": {
        "operationId": "getModel",
        "summary": "Read a model",
        "description": "One model, as the list shows it. No key needed. [Docs](https://frameport.ai/docs/models).",
        "tags": [
          "Models"
        ],
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A model id.",
            "schema": {
              "type": "string",
              "examples": [
                "fp-image-1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The model.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Model"
                }
              }
            }
          },
          "401": {
            "description": "A key was sent and it does not work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No model with this id is on sale.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Read the account",
        "description": "The key's workspace, the key, the balance, the content filter and the workspace's limits. [Docs](https://frameport.ai/docs/account).",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "The account.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/balance": {
      "get": {
        "operationId": "getBalance",
        "summary": "Read the balance",
        "description": "The workspace's balance in USD: available, held, and their total. [Docs](https://frameport.ai/docs/account).",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "The balance.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Balance"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "Read the API's status",
        "description": "Whether the API takes work now, for a monitor. No key needed. [Docs](https://frameport.ai/docs/account).",
        "tags": [
          "Account"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "`operational`.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "503": {
            "description": "`degraded`, with the same body.",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A workspace API key, `fp_live_…`, created in the dashboard."
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "The request's id: send it to support.",
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Limit": {
        "description": "Requests of this kind the workspace may send a minute.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "What is left in this minute.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "When the minute ends, in Unix seconds.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      },
      "Idempotent-Replayed": {
        "description": "`true` when the answer is the generation an earlier request with the same Idempotency-Key made.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "A key of yours, 1 to 200 printable characters: the same key with the same body returns the first request's generation for 24 hours instead of running it again.",
        "schema": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "schemas": {
      "ErrorBody": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable: branch on it."
          },
          "message": {
            "type": "string",
            "description": "What happened, in words to show."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable: branch on it."
              },
              "message": {
                "type": "string",
                "description": "What happened, in words to show."
              },
              "request_id": {
                "type": "string",
                "description": "Also in the X-Request-Id header."
              }
            }
          }
        }
      },
      "Output": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The output's file id (`file_…`)."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "description": "A signed download link that works without a key until `url_expires_at`."
              },
              {
                "type": "null"
              }
            ]
          },
          "url_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When `url` stops working: read the generation again for a fresh one."
          },
          "b64_json": {
            "type": "string",
            "description": "A private image (`private: true`), base64: only in the read that completed it, never again."
          },
          "content_type": {
            "type": "string"
          },
          "cost_usd": {
            "type": "number",
            "description": "What this output was charged."
          },
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        }
      },
      "Generation": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "model",
          "status",
          "input",
          "reserved_usd",
          "cost_usd",
          "outputs",
          "error",
          "created_at",
          "completed_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`gen_…`"
          },
          "object": {
            "const": "generation"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "input": {
            "type": "object",
            "description": "The request's settings as they were applied (pictures counted, never echoed; no prompt when private)."
          },
          "private": {
            "type": "boolean",
            "description": "Private mode: nothing kept, an image handed over once as `b64_json`."
          },
          "reserved_usd": {
            "type": "number",
            "description": "The price held on the balance."
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "number",
                "description": "What was charged, once it settled: 0 for a failure."
              },
              {
                "type": "null"
              }
            ]
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Output"
            }
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ErrorBody"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was accepted."
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "When it settled."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "GenerationList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Generation"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "description": "Pass it as `cursor` for the next page."
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Model": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "mode",
          "name",
          "pricing",
          "options"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "model"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "generate",
              "edit"
            ],
            "description": "`generate`: from a prompt; `edit`: a clip you send (POST /v1/videos/edits)."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "pricing": {
            "type": "object",
            "description": "USD: `per_image`, or `per_second` by resolution (with `per_second_with_audio`, `aspect_ratio_multiplier`, picture prices where they apply)."
          },
          "options": {
            "type": "object",
            "description": "The values a request may use: resolutions, durations, aspect ratios, frames, reference pictures, seed."
          },
          "edit": {
            "type": "object",
            "description": "A clip editor's limits: tool, formats, seconds, bytes, frames, faces."
          }
        }
      },
      "ModelList": {
        "type": "object",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        }
      },
      "Quote": {
        "type": "object",
        "required": [
          "object",
          "model",
          "type",
          "mode",
          "price_usd",
          "reserved_usd",
          "breakdown",
          "available_usd",
          "enough_balance"
        ],
        "properties": {
          "object": {
            "const": "quote"
          },
          "model": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "generate",
              "edit"
            ]
          },
          "price_usd": {
            "anyOf": [
              {
                "type": "number",
                "description": "What a success is charged; null for a clip edit sent without `seconds`."
              },
              {
                "type": "null"
              }
            ]
          },
          "reserved_usd": {
            "type": "number",
            "description": "What the request holds when it is sent: the balance must cover it."
          },
          "breakdown": {
            "type": "string",
            "description": "How the price is made, in words."
          },
          "available_usd": {
            "type": "number",
            "description": "The balance available now."
          },
          "enough_balance": {
            "type": "boolean"
          }
        }
      },
      "Upload": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "status",
          "content_type",
          "bytes",
          "filename",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`upl_…`: put it in any media field."
          },
          "object": {
            "const": "upload"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "expired",
              "deleted"
            ]
          },
          "content_type": {
            "type": "string",
            "description": "What the bytes are."
          },
          "bytes": {
            "type": "integer"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was stored."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it stops working (a request that uses it keeps it 3 hours more)."
          }
        }
      },
      "UploadDeleted": {
        "type": "object",
        "required": [
          "id",
          "object",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "upload"
          },
          "deleted": {
            "const": true
          }
        }
      },
      "Balance": {
        "type": "object",
        "required": [
          "object",
          "currency",
          "available_usd",
          "held_usd",
          "total_usd"
        ],
        "properties": {
          "object": {
            "const": "balance"
          },
          "currency": {
            "const": "USD"
          },
          "available_usd": {
            "type": "number",
            "description": "What new requests can hold."
          },
          "held_usd": {
            "type": "number",
            "description": "What running generations hold."
          },
          "total_usd": {
            "type": "number",
            "description": "Both."
          }
        }
      },
      "Account": {
        "type": "object",
        "required": [
          "object",
          "workspace",
          "key",
          "balance",
          "content_filter",
          "limits",
          "usage"
        ],
        "properties": {
          "object": {
            "const": "account"
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "key": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "last4": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": ""
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "balance": {
            "type": "object",
            "properties": {
              "currency": {
                "const": "USD"
              },
              "available_usd": {
                "type": "number",
                "description": ""
              },
              "held_usd": {
                "type": "number",
                "description": ""
              },
              "total_usd": {
                "type": "number",
                "description": ""
              },
              "spent_usd": {
                "type": "number",
                "description": "Charged for every success so far."
              }
            }
          },
          "content_filter": {
            "type": "boolean",
            "description": "Whether the workspace's content filter is on."
          },
          "limits": {
            "type": "object",
            "properties": {
              "requests_per_minute": {
                "type": "integer",
                "examples": [
                  60
                ]
              },
              "uploads_per_minute": {
                "type": "integer",
                "examples": [
                  10
                ]
              },
              "concurrent_generations": {
                "type": "integer",
                "examples": [
                  20
                ]
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "running_generations": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Status": {
        "type": "object",
        "required": [
          "object",
          "status",
          "models",
          "checked_at"
        ],
        "properties": {
          "object": {
            "const": "status"
          },
          "status": {
            "type": "string",
            "enum": [
              "operational",
              "degraded"
            ]
          },
          "models": {
            "type": "integer",
            "description": "Models on sale now."
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": ""
          }
        }
      }
    }
  }
}
