{
 "openapi": "3.1.0",
 "info": {
  "title": "supervide API",
  "version": "1.0.0",
  "description": "Generate videos and images with one HTTP API. Every generation is a **job**: create it, follow it,\ndownload the result.\n\n**Authentication.** Send your key on every request: `Authorization: Bearer <your API key>`.\n\n**How a request goes.**\n1. `POST /v1/videos` answers at once with a job (`status: queued`) and holds its highest possible cost\n   from your wallet.\n2. Follow the job: read `GET /v1/videos/{id}` every `poll_after_ms`, or long-poll with `?wait=25`, or\n   open the `/events` stream.\n3. When `status` is `completed`, download from `output.url` (a signed link that works for an hour) or\n   from `/content`. You pay for what was delivered; the rest of the hold is released. A failed or\n   cancelled job costs nothing.\n\n**Where results live.** Outputs stay in supervide's storage, in your account's data region, for the\nretention period. You download them; they are never copied to a bucket of yours.\n\n**Money.** The wallet is prepaid, in US dollars. Add credit with `POST /v1/credits/checkouts`.\nWith too little credit a create is refused with 402 `insufficient_credits` and nothing is queued.\n\n**Retries.** Every create needs an `Idempotency-Key` header, a new one (a UUID, say) for each new\nrequest; without it the answer is 400 `idempotency_key_required`. Retrying with the same key returns\nthe first job again instead of creating and charging a second one.\n\n**Errors.** Every error is `{\"error\": {\"code\", \"type\", \"message\", \"param\"?, \"metadata\"?}}` with an\n`X-Request-Id` response header. `code` is stable; `message` is safe to show to a person. A 429 or\n503 carries `Retry-After`.\n\n**Error codes**\n\n| HTTP | code | type |\n|---|---|---|\n| 400 | `idempotency_key_required` | `invalid_request_error` |\n| 400 | `invalid_batch` | `invalid_request_error` |\n| 400 | `invalid_input_url` | `invalid_request_error` |\n| 400 | `invalid_request` | `invalid_request_error` |\n| 400 | `invalid_seconds` | `invalid_request_error` |\n| 400 | `invalid_size` | `invalid_request_error` |\n| 400 | `unsupported_mode` | `invalid_request_error` |\n| 401 | `unauthorized` | `authentication_error` |\n| 402 | `insufficient_credits` | `insufficient_quota` |\n| 403 | `key_scope_denied` | `permission_error` |\n| 403 | `model_not_available_in_region` | `permission_error` |\n| 403 | `team_keys_not_supported` | `permission_error` |\n| 404 | `model_not_found` | `not_found_error` |\n| 404 | `not_found` | `not_found_error` |\n| 405 | `method_not_allowed` | `invalid_request_error` |\n| 409 | `cannot_cancel_in_progress` | `invalid_request_error` |\n| 409 | `data_region_locked` | `conflict_error` |\n| 409 | `file_in_use` | `conflict_error` |\n| 409 | `idempotency_conflict` | `conflict_error` |\n| 409 | `idempotency_in_progress` | `conflict_error` |\n| 409 | `job_not_finished` | `conflict_error` |\n| 409 | `media_not_ready` | `conflict_error` |\n| 409 | `upload_incomplete` | `conflict_error` |\n| 410 | `data_removed` | `gone_error` |\n| 413 | `request_too_large` | `invalid_request_error` |\n| 422 | `content_rejected` | `content_policy_error` |\n| 422 | `file_rejected` | `invalid_request_error` |\n| 429 | `queue_full` | `rate_limit_error` |\n| 429 | `rate_limited` | `rate_limit_error` |\n| 429 | `too_many_jobs` | `rate_limit_error` |\n| 429 | `too_many_streams` | `rate_limit_error` |\n| 500 | `internal_error` | `server_error` |\n| 502 | `upstream_error` | `server_error` |\n| 503 | `capacity_unavailable` | `server_error` |\n| 503 | `model_not_ready` | `server_error` |\n| 503 | `not_configured` | `server_error` |\n| 504 | `upstream_timeout` | `server_error` |\n\n**Why a job can fail** (`error.code` on a failed job)\n\n| code | meaning |\n|---|---|\n| `queue_timeout` | No GPU became available in time. You were not charged. |\n| `invalid_input` | An input file could not be used: it is damaged or not a supported format. Fix the input and send the request again. You were not charged. |\n| `too_large` | This size or length is not supported for this model. Use a smaller size or a shorter clip. You were not charged. |\n| `input_fetch_failed` | An input file could not be downloaded. |\n| `content_rejected` | The request was refused by content screening. |\n| `cancelled_by_deadline` | The job was cancelled because its deadline passed. |\n| `queue_full` | The queue was full, so this request was not started. You were not charged. |\n| `generation_failed` | The generation failed. You were not charged. |\n"
 },
 "servers": [
  {
   "url": "https://api.superveo.io"
  }
 ],
 "tags": [
  {
   "name": "Videos",
   "description": "Create videos and follow them to the result."
  },
  {
   "name": "Images",
   "description": "Create and edit images. Same job object as videos."
  },
  {
   "name": "Batches",
   "description": "Many requests in one call at the batch price."
  },
  {
   "name": "Files",
   "description": "Input files: first frames, reference images, video and audio."
  },
  {
   "name": "Models",
   "description": "What can be generated, and the price."
  },
  {
   "name": "Credits",
   "description": "The prepaid wallet: balance, top-ups, and every line that changed it."
  },
  {
   "name": "Account",
   "description": "Limits, data region and retention."
  }
 ],
 "security": [
  {
   "ApiKey": []
  }
 ],
 "paths": {
  "/v1/models": {
   "get": {
    "operationId": "get_models",
    "tags": [
     "Models"
    ],
    "summary": "List models",
    "description": "Only the models this account and key may use, with prices.",
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ModelList"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/models/{model_id}": {
   "get": {
    "operationId": "get_models_model_id",
    "tags": [
     "Models"
    ],
    "summary": "Get one model",
    "parameters": [
     {
      "name": "model_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Model id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Model"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/queue": {
   "get": {
    "operationId": "get_queue",
    "tags": [
     "Models"
    ],
    "summary": "Waiting time before you create",
    "description": "How long a job created now would wait before it starts rendering, per model and per `speed`, and whether it would be accepted. Free to call and it creates nothing. The numbers come from the same code that decides at create, are refreshed every few seconds, and are estimates, not promises: `fast` is priority in the queue, not a start time. Compare `standard` with `fast` to see whether `fast` is worth its price right now. After a create, the job itself carries `eta_seconds`.",
    "parameters": [
     {
      "name": "model",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "One model id. Without it: every model this key may use."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/QueueList"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "`upstream_error`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "504": {
      "description": "`upstream_timeout`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/quote": {
   "post": {
    "operationId": "post_quote",
    "tags": [
     "Models"
    ],
    "summary": "Price a request before you send it",
    "description": "Send the body you would send to `url` and get what it would hold from the wallet (`max_cost_usd`), worked out by the same code that holds it at create. Works for /v1/videos, /v1/images/generations, /v1/images/edits and /v1/batches. Nothing is created, held or charged. The request is checked as at create (model, size, seconds, mode, speed), but not your credit, your input files or whether a GPU is free: see GET /v1/account and GET /v1/queue. The same request costs the same at create unless the prices change in between.",
    "parameters": [
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/QuoteCreate"
       },
       "example": {
        "url": "/v1/images/generations",
        "body": {
         "model": "z-image",
         "prompt": "a red kite over a beach",
         "size": "1024x1024",
         "speed": "fast"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Quote"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_batch`, `invalid_request`, `invalid_seconds`, `invalid_size`, `unsupported_mode`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`key_scope_denied`, `model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`data_region_locked`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "`request_too_large`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`, `model_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/videos": {
   "post": {
    "operationId": "post_videos",
    "tags": [
     "Videos"
    ],
    "summary": "Create a video",
    "description": "**Coming soon.** Starts a generation and answers at once with a job to follow. The most the job can cost is held from the wallet (`max_cost_usd`); when it finishes you pay for what was delivered and the rest is released. A failed job costs nothing.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 255
      },
      "description": "Required. A new key for each new request, for example a UUID. Send the same key to retry safely: the first result is returned again (200 with `Idempotent-Replayed: true`) and nothing is created or charged twice. Without it the answer is 400 `idempotency_key_required`."
     },
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/VideoCreate"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "200": {
      "description": "The same request was sent before with this Idempotency-Key: the first job is returned, with `Idempotent-Replayed: true`.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "400": {
      "description": "`idempotency_key_required`, `invalid_input_url`, `invalid_request`, `invalid_seconds`, `invalid_size`, `unsupported_mode`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "`insufficient_credits`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`key_scope_denied`, `model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`idempotency_conflict`, `idempotency_in_progress`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "`request_too_large`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "`content_rejected`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`queue_full`, `rate_limited`, `too_many_jobs`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "`upstream_error`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`, `model_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "504": {
      "description": "`upstream_timeout`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "get_videos",
    "tags": [
     "Videos"
    ],
    "summary": "List videos",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "description": "**Coming soon.** "
   }
  },
  "/v1/videos/{job_id}": {
   "get": {
    "operationId": "get_videos_job_id",
    "tags": [
     "Videos"
    ],
    "summary": "Get one video",
    "description": "**Coming soon.** Read the job until `status` is final. Three ways to wait: sleep `poll_after_ms` between reads, long-poll with `?wait=25`, or use the `/events` stream.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The video's id."
     },
     {
      "name": "wait",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 25,
       "default": 0
      },
      "description": "Long-poll: hold the request up to this many seconds until the job changes."
     },
     {
      "name": "If-None-Match",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The `ETag` of your last read. Answers 304 when the job has not changed."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "304": {
      "description": "Not changed since the `ETag` you sent."
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "delete_videos_job_id",
    "tags": [
     "Videos"
    ],
    "summary": "Delete a finished video",
    "description": "**Coming soon.** Removes the media now and hides the job. No refund. Only for a finished job.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The video's id."
     }
    ],
    "responses": {
     "204": {
      "description": "Done. No body.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`cannot_cancel_in_progress`, `job_not_finished`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/videos/{job_id}/events": {
   "get": {
    "operationId": "get_videos_job_id_events",
    "tags": [
     "Videos"
    ],
    "summary": "Stream a video's progress",
    "description": "**Coming soon.** Server-sent events: `status`, `stage` and `progress` as they change, then one `job` event with the final job, and the stream ends. A comment line is sent every 15 seconds to keep it open.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The video's id."
     }
    ],
    "responses": {
     "200": {
      "description": "An event stream.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`, `too_many_streams`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/videos/{job_id}/content": {
   "get": {
    "operationId": "get_videos_job_id_content",
    "tags": [
     "Videos"
    ],
    "summary": "Download the video",
    "description": "**Coming soon.** Redirects to a signed link that works for 1 hour (15 minutes for a `zdr` account). `X-Signed-Url-Expires-At` says when it stops.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The video's id."
     },
     {
      "name": "variant",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "video",
        "image",
        "thumbnail"
       ]
      },
      "description": "`thumbnail` for the preview image."
     }
    ],
    "responses": {
     "302": {
      "description": "Redirect to a signed download link.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       },
       "Location": {
        "schema": {
         "type": "string"
        }
       },
       "X-Signed-Url-Expires-At": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`media_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "410": {
      "description": "`data_removed`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/videos/{job_id}/cancel": {
   "post": {
    "operationId": "post_videos_job_id_cancel",
    "tags": [
     "Videos"
    ],
    "summary": "Cancel a queued video",
    "description": "**Coming soon.** Works only while the job is queued: the hold is released and it costs nothing. Once it is generating the answer is 409 and the job runs to the end and is billed. A finished job is returned as it is.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The video's id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`cannot_cancel_in_progress`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images/generations": {
   "post": {
    "operationId": "post_images_generations",
    "tags": [
     "Images"
    ],
    "summary": "Create an image",
    "description": "Waits for the image up to `Prefer: wait=<s>` and answers 200 with the finished job. If it is not ready by then the answer is 202 with a job to poll, exactly like a video.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 255
      },
      "description": "Required. A new key for each new request, for example a UUID. Send the same key to retry safely: the first result is returned again (200 with `Idempotent-Replayed: true`) and nothing is created or charged twice. Without it the answer is 400 `idempotency_key_required`."
     },
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     },
     {
      "name": "Prefer",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "example": "wait=30",
      "description": "`wait=<seconds>`: how long to hold the request for the finished image (default 30, at most 60). After that the answer is 202 with a job to poll."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ImageCreate"
       },
       "example": {
        "model": "z-image",
        "prompt": "a cat on a windowsill",
        "size": "1024x1024"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "202": {
      "description": "Not finished within the wait: poll the job.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "400": {
      "description": "`idempotency_key_required`, `invalid_input_url`, `invalid_request`, `invalid_seconds`, `invalid_size`, `unsupported_mode`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "`insufficient_credits`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`key_scope_denied`, `model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`idempotency_conflict`, `idempotency_in_progress`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "`request_too_large`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "`content_rejected`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`queue_full`, `rate_limited`, `too_many_jobs`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "`upstream_error`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`, `model_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "504": {
      "description": "`upstream_timeout`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images/edits": {
   "post": {
    "operationId": "post_images_edits",
    "tags": [
     "Images"
    ],
    "summary": "Edit an image",
    "description": "Like /v1/images/generations with an input image in `image_url`. JSON only: never multipart, never base64.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 255
      },
      "description": "Required. A new key for each new request, for example a UUID. Send the same key to retry safely: the first result is returned again (200 with `Idempotent-Replayed: true`) and nothing is created or charged twice. Without it the answer is 400 `idempotency_key_required`."
     },
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     },
     {
      "name": "Prefer",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "example": "wait=30",
      "description": "`wait=<seconds>`: how long to hold the request for the finished image (default 30, at most 60). After that the answer is 202 with a job to poll."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ImageCreate"
       },
       "example": {
        "model": "qwen-image-edit",
        "prompt": "make it snow",
        "image_url": "file_0123456789abcdef0123456789abcdef"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "202": {
      "description": "Not finished within the wait: poll the job.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "400": {
      "description": "`idempotency_key_required`, `invalid_input_url`, `invalid_request`, `invalid_seconds`, `invalid_size`, `unsupported_mode`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "`insufficient_credits`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`key_scope_denied`, `model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`idempotency_conflict`, `idempotency_in_progress`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "`request_too_large`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "`content_rejected`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`queue_full`, `rate_limited`, `too_many_jobs`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "`upstream_error`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`, `model_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "504": {
      "description": "`upstream_timeout`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images": {
   "get": {
    "operationId": "get_images",
    "tags": [
     "Images"
    ],
    "summary": "List images",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images/{job_id}": {
   "get": {
    "operationId": "get_images_job_id",
    "tags": [
     "Images"
    ],
    "summary": "Get one image",
    "description": "Read the job until `status` is final. Three ways to wait: sleep `poll_after_ms` between reads, long-poll with `?wait=25`, or use the `/events` stream.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The image's id."
     },
     {
      "name": "wait",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 25,
       "default": 0
      },
      "description": "Long-poll: hold the request up to this many seconds until the job changes."
     },
     {
      "name": "If-None-Match",
      "in": "header",
      "schema": {
       "type": "string"
      },
      "description": "The `ETag` of your last read. Answers 304 when the job has not changed."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "304": {
      "description": "Not changed since the `ETag` you sent."
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "delete_images_job_id",
    "tags": [
     "Images"
    ],
    "summary": "Delete a finished image",
    "description": "Removes the media now and hides the job. No refund. Only for a finished job.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The image's id."
     }
    ],
    "responses": {
     "204": {
      "description": "Done. No body.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`cannot_cancel_in_progress`, `job_not_finished`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images/{job_id}/events": {
   "get": {
    "operationId": "get_images_job_id_events",
    "tags": [
     "Images"
    ],
    "summary": "Stream a image's progress",
    "description": "Server-sent events: `status`, `stage` and `progress` as they change, then one `job` event with the final job, and the stream ends. A comment line is sent every 15 seconds to keep it open.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The image's id."
     }
    ],
    "responses": {
     "200": {
      "description": "An event stream.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`, `too_many_streams`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images/{job_id}/content": {
   "get": {
    "operationId": "get_images_job_id_content",
    "tags": [
     "Images"
    ],
    "summary": "Download the image",
    "description": "Redirects to a signed link that works for 1 hour (15 minutes for a `zdr` account). `X-Signed-Url-Expires-At` says when it stops.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The image's id."
     },
     {
      "name": "variant",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "video",
        "image",
        "thumbnail"
       ]
      },
      "description": "`thumbnail` for the preview image."
     }
    ],
    "responses": {
     "302": {
      "description": "Redirect to a signed download link.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       },
       "Location": {
        "schema": {
         "type": "string"
        }
       },
       "X-Signed-Url-Expires-At": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`media_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "410": {
      "description": "`data_removed`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/images/{job_id}/cancel": {
   "post": {
    "operationId": "post_images_job_id_cancel",
    "tags": [
     "Images"
    ],
    "summary": "Cancel a queued image",
    "description": "Works only while the job is queued: the hold is released and it costs nothing. Once it is generating the answer is 409 and the job runs to the end and is billed. A finished job is returned as it is.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The image's id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`cannot_cancel_in_progress`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/batches": {
   "post": {
    "operationId": "post_batches",
    "tags": [
     "Batches"
    ],
    "summary": "Create a batch",
    "description": "Up to 1000 video or image requests in one call, at the batch price. Either every request is valid and paid for, or none is created. Batch jobs run when GPUs are free, within the completion window.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 255
      },
      "description": "Required. A new key for each new request, for example a UUID. Send the same key to retry safely: the first result is returned again (200 with `Idempotent-Replayed: true`) and nothing is created or charged twice. Without it the answer is 400 `idempotency_key_required`."
     },
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BatchCreate"
       },
       "example": {
        "requests": [
         {
          "custom_id": "poster-1",
          "url": "/v1/images/generations",
          "body": {
           "model": "z-image",
           "prompt": "a poster of a red kite",
           "size": "1024x1024"
          }
         },
         {
          "custom_id": "poster-2",
          "url": "/v1/images/generations",
          "body": {
           "model": "flux2-klein",
           "prompt": "a red kite, watercolour",
           "aspect_ratio": "3:4"
          }
         }
        ],
        "completion_window": "24h"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Batch"
        }
       }
      }
     },
     "400": {
      "description": "`idempotency_key_required`, `invalid_batch`, `invalid_input_url`, `invalid_request`, `invalid_seconds`, `invalid_size`, `unsupported_mode`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "`insufficient_credits`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "`key_scope_denied`, `model_not_available_in_region`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`model_not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`idempotency_conflict`, `idempotency_in_progress`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "`request_too_large`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "`content_rejected`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`queue_full`, `rate_limited`, `too_many_jobs`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "`upstream_error`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`, `model_not_ready`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "504": {
      "description": "`upstream_timeout`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "get_batches",
    "tags": [
     "Batches"
    ],
    "summary": "List batches",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BatchList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/batches/{batch_id}": {
   "get": {
    "operationId": "get_batches_batch_id",
    "tags": [
     "Batches"
    ],
    "summary": "Get one batch",
    "parameters": [
     {
      "name": "batch_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Batch id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Batch"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/batches/{batch_id}/requests": {
   "get": {
    "operationId": "get_batches_batch_id_requests",
    "tags": [
     "Batches"
    ],
    "summary": "List a batch's jobs",
    "description": "The batch's jobs in the order they were sent. Each is a normal job.",
    "parameters": [
     {
      "name": "batch_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Batch id."
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/batches/{batch_id}/cancel": {
   "post": {
    "operationId": "post_batches_batch_id_cancel",
    "tags": [
     "Batches"
    ],
    "summary": "Cancel a batch",
    "description": "Cancels the requests still queued. The ones already generating finish and are billed.",
    "parameters": [
     {
      "name": "batch_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Batch id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Batch"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/files": {
   "post": {
    "operationId": "post_files",
    "tags": [
     "Files"
    ],
    "summary": "Upload a small file",
    "description": "`multipart/form-data`, up to 20 MB. The file is checked and stored in one call. For larger files use /v1/uploads.",
    "parameters": [
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "description": "The file.",
          "format": "binary"
         },
         "purpose": {
          "type": "string",
          "enum": [
           "input"
          ]
         },
         "expires_after[seconds]": {
          "type": "integer",
          "description": "Remove the file this long after upload."
         }
        },
        "required": [
         "file"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/File"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`data_region_locked`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "`request_too_large`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "`file_rejected`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "get_files",
    "tags": [
     "Files"
    ],
    "summary": "List files",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FileList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/uploads": {
   "post": {
    "operationId": "post_uploads",
    "tags": [
     "Files"
    ],
    "summary": "Start a direct upload",
    "description": "For files of any allowed size. You get a signed link; PUT the bytes to it within 15 minutes with the given headers, then call `/complete`.",
    "parameters": [
     {
      "name": "X-Data-Region",
      "in": "header",
      "schema": {
       "type": "string",
       "enum": [
        "us",
        "eu",
        "uk",
        "in"
       ]
      },
      "description": "Same as `data_region` in the body."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UploadCreate"
       },
       "example": {
        "filename": "first.png",
        "content_type": "image/png",
        "bytes": 482113
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Upload"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`data_region_locked`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/uploads/{upload_id}/complete": {
   "post": {
    "operationId": "post_uploads_upload_id_complete",
    "tags": [
     "Files"
    ],
    "summary": "Finish a direct upload",
    "description": "Checks the uploaded bytes and makes the file usable as an input.",
    "parameters": [
     {
      "name": "upload_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "`upl_...` or its `file_...` id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/File"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`upload_incomplete`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "`file_rejected`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/files/{file_id}": {
   "get": {
    "operationId": "get_files_file_id",
    "tags": [
     "Files"
    ],
    "summary": "Get one file",
    "parameters": [
     {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "File id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/File"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "delete_files_file_id",
    "tags": [
     "Files"
    ],
    "summary": "Delete a file",
    "description": "Removes the file now. Refused while an unfinished job still needs it.",
    "parameters": [
     {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "File id."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FileDeleted"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`file_in_use`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/files/{file_id}/content": {
   "get": {
    "operationId": "get_files_file_id_content",
    "tags": [
     "Files"
    ],
    "summary": "Download a file",
    "description": "Redirects to a signed link that works for 1 hour (15 minutes for a `zdr` account).",
    "parameters": [
     {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "File id."
     }
    ],
    "responses": {
     "302": {
      "description": "Redirect to a signed download link.",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       },
       "Location": {
        "schema": {
         "type": "string"
        }
       },
       "X-Signed-Url-Expires-At": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`upload_incomplete`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "410": {
      "description": "`data_removed`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/credits": {
   "get": {
    "operationId": "get_credits",
    "tags": [
     "Credits"
    ],
    "summary": "Read the wallet",
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Credits"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/credits/transactions": {
   "get": {
    "operationId": "get_credits_transactions",
    "tags": [
     "Credits"
    ],
    "summary": "List balance changes",
    "description": "Top-ups, one `usage` line per finished job, refunds and disputes.",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TransactionList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/credits/checkouts": {
   "post": {
    "operationId": "post_credits_checkouts",
    "tags": [
     "Credits"
    ],
    "summary": "Start a top-up",
    "description": "Returns `checkout_url`, the payment page. The wallet is credited when the payment provider confirms the payment; read the checkout to see when.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CheckoutCreate"
       },
       "example": {
        "amount_usd": 25
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Checkout"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "502": {
      "description": "`upstream_error`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`, `not_configured`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "504": {
      "description": "`upstream_timeout`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "get_credits_checkouts",
    "tags": [
     "Credits"
    ],
    "summary": "List top-ups",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "name": "after",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Return what comes after this id (`last_id` of the previous page)."
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CheckoutList"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/credits/checkouts/{top_id}": {
   "get": {
    "operationId": "get_credits_checkouts_top_id",
    "tags": [
     "Credits"
    ],
    "summary": "Get one top-up",
    "parameters": [
     {
      "name": "top_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "`top_...`"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Checkout"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "`not_found`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/account": {
   "get": {
    "operationId": "get_account",
    "tags": [
     "Account"
    ],
    "summary": "Read the account",
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Account"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/account/settings": {
   "put": {
    "operationId": "put_account_settings",
    "tags": [
     "Account"
    ],
    "summary": "Change account settings",
    "description": "`data_region` can be set once. `retention` can be changed at any time and applies to new jobs.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountSettings"
       },
       "example": {
        "retention": "7d"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-Request-Id": {
        "schema": {
         "type": "string"
        },
        "description": "Quote this when asking for help."
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Account"
        }
       }
      }
     },
     "400": {
      "description": "`invalid_request`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "`unauthorized`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "`data_region_locked`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "`rate_limited`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "`capacity_unavailable`",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "ApiKey": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your API key, from the console at https://console.superveo.io."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string",
        "description": "Stable, for programs. The full list is in the description of this API.",
        "enum": [
         "cannot_cancel_in_progress",
         "capacity_unavailable",
         "content_rejected",
         "data_region_locked",
         "data_removed",
         "file_in_use",
         "file_rejected",
         "idempotency_conflict",
         "idempotency_in_progress",
         "idempotency_key_required",
         "insufficient_credits",
         "internal_error",
         "invalid_batch",
         "invalid_input_url",
         "invalid_request",
         "invalid_seconds",
         "invalid_size",
         "job_not_finished",
         "key_scope_denied",
         "media_not_ready",
         "method_not_allowed",
         "model_not_available_in_region",
         "model_not_found",
         "model_not_ready",
         "not_configured",
         "not_found",
         "queue_full",
         "rate_limited",
         "request_too_large",
         "team_keys_not_supported",
         "too_many_jobs",
         "too_many_streams",
         "unauthorized",
         "unsupported_mode",
         "upload_incomplete",
         "upstream_error",
         "upstream_timeout"
        ]
       },
       "type": {
        "type": "string",
        "description": "The family the code belongs to.",
        "enum": [
         "authentication_error",
         "conflict_error",
         "content_policy_error",
         "gone_error",
         "insufficient_quota",
         "invalid_request_error",
         "not_found_error",
         "permission_error",
         "rate_limit_error",
         "server_error"
        ]
       },
       "message": {
        "type": "string",
        "description": "Safe to show to a person."
       },
       "param": {
        "type": "string",
        "description": "The request field that is wrong, when one is."
       },
       "metadata": {
        "type": "object",
        "description": "Extra facts, for example `required_usd` and `available_usd` on `insufficient_credits`.",
        "additionalProperties": true
       }
      },
      "required": [
       "code",
       "type",
       "message"
      ],
      "additionalProperties": false
     }
    },
    "required": [
     "error"
    ],
    "additionalProperties": false,
    "description": "Every error has this shape."
   },
   "JobError": {
    "type": "object",
    "properties": {
     "code": {
      "type": "string",
      "enum": [
       "cancelled_by_deadline",
       "content_rejected",
       "generation_failed",
       "input_fetch_failed",
       "invalid_input",
       "queue_full",
       "queue_timeout",
       "too_large"
      ]
     },
     "message": {
      "type": "string"
     }
    },
    "required": [
     "code",
     "message"
    ],
    "additionalProperties": false,
    "description": "Why a job failed. A failed job costs nothing unless the message says otherwise."
   },
   "Usage": {
    "type": "object",
    "properties": {
     "seconds": {
      "type": "number",
      "description": "Video: seconds of video delivered."
     },
     "images": {
      "type": "integer",
      "description": "Image: images delivered."
     },
     "cost_usd": {
      "type": "number",
      "description": "What the job cost. 0 until it completes."
     }
    },
    "required": [
     "cost_usd"
    ],
    "additionalProperties": false,
    "description": "What was delivered and what it cost."
   },
   "Output": {
    "type": "object",
    "properties": {
     "url": {
      "type": [
       "string",
       "null"
      ],
      "description": "Signed download link. Present when you read one job; null in lists. It stops working at `url_expires_at`; read the job again for a new one."
     },
     "url_expires_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     },
     "content_url": {
      "type": "string",
      "description": "Stable address that redirects to a fresh signed link. Needs your API key."
     },
     "thumbnail_url": {
      "type": [
       "string",
       "null"
      ]
     },
     "width": {
      "type": [
       "integer",
       "null"
      ]
     },
     "height": {
      "type": [
       "integer",
       "null"
      ]
     },
     "expires_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "When the media is removed. Unix time in seconds."
     },
     "seconds": {
      "type": [
       "number",
       "null"
      ],
      "description": "Video only."
     },
     "fps": {
      "type": [
       "number",
       "null"
      ],
      "description": "Video only."
     },
     "has_audio": {
      "type": "boolean",
      "description": "Video only."
     }
    },
    "required": [
     "url",
     "url_expires_at",
     "content_url",
     "thumbnail_url",
     "width",
     "height",
     "expires_at"
    ],
    "additionalProperties": false,
    "description": "The finished media. It stays in supervide's storage; you download it."
   },
   "Job": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "`vid_...` or `img_...`."
     },
     "object": {
      "type": "string",
      "enum": [
       "video",
       "image"
      ]
     },
     "status": {
      "type": "string",
      "description": "`queued` waiting for a GPU, `in_progress` rendering, then one of the final states. `expired` is a completed job whose media has been removed. If a render does not finish on one GPU the job is given to another one: it goes back to `queued` with a new `eta_seconds` and is charged once, when it completes.",
      "enum": [
       "queued",
       "in_progress",
       "completed",
       "failed",
       "cancelled",
       "expired"
      ]
     },
     "stage": {
      "type": "string",
      "description": "Finer than status while the job runs, for example `waiting_for_gpu`, `loading_model`, `sampling`, `decoding`, `encoding_video`. Equals the status once final."
     },
     "progress": {
      "type": "integer",
      "description": "0 to 100. 100 only when completed.",
      "minimum": 0,
      "maximum": 100
     },
     "queue_position": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Place in the queue while queued, when known."
     },
     "eta_seconds": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Estimated seconds until the job is done, when known."
     },
     "start_by": {
      "type": [
       "integer",
       "null"
      ],
      "description": "While the job waits for a GPU: the time it is expected to start by, set once when the job was accepted. Unix time in seconds. Null once it has started, or when not known."
     },
     "busy": {
      "type": [
       "boolean",
       "null"
      ],
      "description": "While the job waits: true when it was accepted with a longer wait than usual because the GPUs were busy. Null once it has started, or when not known."
     },
     "cold_start": {
      "type": [
       "boolean",
       "null"
      ],
      "description": "True when a GPU had to be started for this job."
     },
     "model": {
      "type": "string"
     },
     "mode": {
      "type": "string",
      "description": "What the job does: `t2v`, `i2v`, `flf2v`, `r2v` for video; `t2i`, `edit` for images."
     },
     "size": {
      "type": "string",
      "description": "Output size asked for, `WIDTHxHEIGHT`."
     },
     "speed": {
      "type": "string",
      "description": "`fast` has priority in the queue (not a promised start time) and is priced higher; `batch` is the batch price.",
      "enum": [
       "standard",
       "fast",
       "batch"
      ]
     },
     "runs_as": {
      "type": "string",
      "description": "The speed the job runs and is billed at. The same as `speed`, except for a `fast` job accepted while the fast lane was full: it is `standard` and is charged the standard price.",
      "enum": [
       "standard",
       "fast",
       "batch"
      ]
     },
     "retention": {
      "type": "string",
      "description": "How long the output is kept. `zdr` removes it shortly after delivery.",
      "enum": [
       "7d",
       "14d",
       "28d",
       "zdr"
      ]
     },
     "created_at": {
      "type": "integer",
      "description": "Unix time in seconds."
     },
     "started_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     },
     "completed_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     },
     "poll_after_ms": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Wait this long before asking again. Null once the job is final."
     },
     "polling_url": {
      "type": "string",
      "description": "GET this to read the job."
     },
     "output": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Output"
       },
       {
        "type": "null"
       }
      ],
      "description": "Set when status is `completed`."
     },
     "error": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/JobError"
       },
       {
        "type": "null"
       }
      ],
      "description": "Set when status is `failed`."
     },
     "attribution": {
      "type": [
       "string",
       "null"
      ],
      "description": "Text the model's licence asks you to show next to the output."
     },
     "max_cost_usd": {
      "type": "number",
      "description": "The amount held for this job. The final cost is never higher."
     },
     "batch_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "custom_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Your own id, for jobs created through a batch."
     },
     "seconds": {
      "type": [
       "number",
       "null"
      ],
      "description": "Video only: the length asked for."
     },
     "usage": {
      "$ref": "#/components/schemas/Usage"
     }
    },
    "required": [
     "id",
     "object",
     "status",
     "stage",
     "progress",
     "queue_position",
     "eta_seconds",
     "start_by",
     "busy",
     "cold_start",
     "model",
     "mode",
     "size",
     "speed",
     "runs_as",
     "retention",
     "created_at",
     "started_at",
     "completed_at",
     "poll_after_ms",
     "polling_url",
     "output",
     "error",
     "attribution",
     "max_cost_usd",
     "batch_id",
     "custom_id",
     "usage"
    ],
    "additionalProperties": false,
    "description": "A video or image generation. Videos and images share this shape."
   },
   "JobList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Job"
      }
     },
     "has_more": {
      "type": "boolean",
      "description": "True when more exist after this page."
     },
     "last_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Pass as `after` to get the next page."
     }
    },
    "required": [
     "object",
     "data",
     "has_more",
     "last_id"
    ],
    "additionalProperties": false,
    "description": "One page of jobs, newest first."
   },
   "Model": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "object": {
      "type": "string",
      "enum": [
       "model"
      ]
     },
     "name": {
      "type": "string"
     },
     "type": {
      "type": "string",
      "enum": [
       "video",
       "image"
      ]
     },
     "modes": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "resolutions": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Accepted `resolution` values."
     },
     "aspect_ratios": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "default_size": {
      "type": "string"
     },
     "max_side": {
      "type": "integer",
      "description": "Longest side in pixels."
     },
     "size_multiple": {
      "type": "integer",
      "description": "Width and height must be multiples of this."
     },
     "negative_prompt": {
      "type": "boolean",
      "description": "False when the model does not take a `negative_prompt`; sending one is refused."
     },
     "pricing": {
      "type": "object",
      "properties": {
       "unit": {
        "type": "string",
        "description": "What one price unit is.",
        "enum": [
         "second",
         "image"
        ]
       },
       "currency": {
        "type": "string"
       },
       "fast_multiplier": {
        "type": "number",
        "description": "`speed: fast` costs this many times the price."
       },
       "batch_multiplier": {
        "type": "number",
        "description": "A batch costs this many times the price."
       },
       "tiers": {
        "type": [
         "object",
         "null"
        ],
        "additionalProperties": {
         "type": "number"
        },
        "description": "Price per unit by resolution. Null when the model has no price yet."
       }
      },
      "required": [
       "unit",
       "currency",
       "fast_multiplier",
       "batch_multiplier",
       "tiers"
      ],
      "additionalProperties": false
     },
     "is_ready": {
      "type": "boolean",
      "description": "False when the model cannot take jobs right now."
     },
     "licence": {
      "type": [
       "object",
       "null"
      ],
      "additionalProperties": true
     },
     "attribution": {
      "type": [
       "string",
       "null"
      ]
     },
     "fps": {
      "type": "number",
      "description": "Video only."
     },
     "min_seconds": {
      "type": "number",
      "description": "Video only."
     },
     "max_seconds": {
      "type": "number",
      "description": "Video only."
     },
     "has_audio": {
      "type": "boolean",
      "description": "Video only."
     }
    },
    "required": [
     "id",
     "object",
     "name",
     "type",
     "modes",
     "resolutions",
     "aspect_ratios",
     "default_size",
     "max_side",
     "size_multiple",
     "negative_prompt",
     "pricing",
     "is_ready",
     "licence",
     "attribution"
    ],
    "additionalProperties": false,
    "description": "A model this key may use."
   },
   "ModelList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Model"
      }
     }
    },
    "required": [
     "object",
     "data"
    ],
    "additionalProperties": false
   },
   "QueueSpeed": {
    "type": "object",
    "properties": {
     "accepting": {
      "type": "boolean",
      "description": "False only when every GPU that may start is counted and the queue is still too long. A create sent now would be refused; see `retry_after_seconds`."
     },
     "estimated_start_seconds": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Estimated seconds until a job created now starts rendering, GPU start-up included. An estimate, not a promise. Null when not accepting, and always null for `batch`: a batch job runs when GPUs are idle and has a completion window, not a start time."
     },
     "busy": {
      "type": "boolean",
      "description": "True when the estimate is longer than the normal start time because the fleet is busy."
     },
     "runs_as": {
      "type": "string",
      "description": "The speed a job created now with this speed would run and be billed as. A `fast` job runs as `standard` when going first would delay a job that was already accepted.",
      "enum": [
       "standard",
       "fast",
       "batch"
      ]
     },
     "retry_after_seconds": {
      "type": [
       "integer",
       "null"
      ],
      "description": "When not accepting: come back after this many seconds. Otherwise null."
     }
    },
    "required": [
     "accepting",
     "estimated_start_seconds",
     "busy",
     "runs_as",
     "retry_after_seconds"
    ],
    "additionalProperties": false,
    "description": "What a job created now with this `speed` would be told."
   },
   "Queue": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "queue"
      ]
     },
     "model": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "description": "`cold`: no GPU is on for this model, the first job waits for one to start. `starting`: a GPU is starting. `warm`: a GPU is on and free. `busy`: GPUs are on and working. `unavailable`: the model cannot take jobs right now.",
      "enum": [
       "cold",
       "starting",
       "warm",
       "busy",
       "unavailable"
      ]
     },
     "speeds": {
      "type": [
       "object",
       "null"
      ],
      "additionalProperties": false,
      "required": [
       "standard",
       "fast",
       "batch"
      ],
      "properties": {
       "standard": {
        "anyOf": [
         {
          "$ref": "#/components/schemas/QueueSpeed"
         },
         {
          "type": "null"
         }
        ]
       },
       "fast": {
        "anyOf": [
         {
          "$ref": "#/components/schemas/QueueSpeed"
         },
         {
          "type": "null"
         }
        ]
       },
       "batch": {
        "anyOf": [
         {
          "$ref": "#/components/schemas/QueueSpeed"
         },
         {
          "type": "null"
         }
        ]
       }
      },
      "description": "One estimate per `speed`; a single speed is null when there is no estimate for it right now. The whole object is null when no estimate is available for this model."
     }
    },
    "required": [
     "object",
     "model",
     "state",
     "speeds"
    ],
    "additionalProperties": false,
    "description": "The waiting time for one model, right now, for a job of the model's usual size."
   },
   "QueueList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Queue"
      }
     }
    },
    "required": [
     "object",
     "data"
    ],
    "additionalProperties": false
   },
   "QuoteLine": {
    "type": "object",
    "properties": {
     "custom_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "The request's `custom_id` in a batch, else null."
     },
     "url": {
      "type": "string",
      "description": "The endpoint the request is for."
     },
     "model": {
      "type": "string"
     },
     "mode": {
      "type": "string",
      "description": "What the request would be run as, worked out from its inputs."
     },
     "speed": {
      "type": "string",
      "enum": [
       "standard",
       "fast",
       "batch"
      ]
     },
     "size": {
      "type": "string",
      "description": "`WIDTHxHEIGHT` the request would render at."
     },
     "price_tier": {
      "type": "string",
      "description": "The price tier it would be billed at, for example `480p`."
     },
     "seconds": {
      "type": [
       "number",
       "null"
      ],
      "description": "Video length asked for. Null for an image."
     },
     "unit": {
      "type": "string",
      "enum": [
       "second",
       "image"
      ]
     },
     "unit_price_usd": {
      "type": "number",
      "description": "Price per `unit` at this tier and speed, the `fast` or batch multiplier included."
     },
     "max_cost_usd": {
      "type": "number",
      "description": "What a create of this request would hold: the most it can cost."
     }
    },
    "required": [
     "custom_id",
     "url",
     "model",
     "mode",
     "speed",
     "size",
     "price_tier",
     "seconds",
     "unit",
     "unit_price_usd",
     "max_cost_usd"
    ],
    "additionalProperties": false,
    "description": "One priced request."
   },
   "Quote": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "quote"
      ]
     },
     "url": {
      "type": "string",
      "description": "The endpoint you asked about."
     },
     "data_region": {
      "type": "string",
      "description": "The data region the request would use."
     },
     "currency": {
      "type": "string",
      "enum": [
       "usd"
      ]
     },
     "speed": {
      "type": "string",
      "description": "`batch` for a batch.",
      "enum": [
       "standard",
       "fast",
       "batch"
      ]
     },
     "completion_window": {
      "type": [
       "string",
       "null"
      ],
      "description": "For a batch, its completion window. Otherwise null."
     },
     "max_cost_usd": {
      "type": "number",
      "description": "What a create of this request (or batch) would hold, to the micro-dollar."
     },
     "requests": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/QuoteLine"
      },
      "description": "One line per request: one for a single request, one per batch request in order."
     }
    },
    "required": [
     "object",
     "url",
     "data_region",
     "currency",
     "speed",
     "completion_window",
     "max_cost_usd",
     "requests"
    ],
    "additionalProperties": false,
    "description": "The price of a request before you send it. Nothing was created or held."
   },
   "Account": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "object": {
      "type": "string",
      "enum": [
       "account"
      ]
     },
     "balance_usd": {
      "type": "number",
      "description": "US dollars."
     },
     "held_usd": {
      "type": "number",
      "description": "Reserved for jobs that are running."
     },
     "available_usd": {
      "type": "number",
      "description": "What a new job can use: balance minus held."
     },
     "data_region": {
      "type": [
       "string",
       "null"
      ],
      "description": "Where this account's files and outputs are stored."
     },
     "data_region_locked": {
      "type": "boolean",
      "description": "True once a region is set. It cannot be changed afterwards."
     },
     "retention": {
      "type": "string",
      "enum": [
       "7d",
       "14d",
       "28d",
       "zdr"
      ]
     },
     "in_flight_jobs": {
      "type": "integer"
     },
     "limits": {
      "type": "object",
      "properties": {
       "requests_per_minute": {
        "type": "integer"
       },
       "max_in_flight_jobs": {
        "type": "integer"
       },
       "max_open_streams": {
        "type": "integer"
       }
      },
      "required": [
       "requests_per_minute",
       "max_in_flight_jobs",
       "max_open_streams"
      ],
      "additionalProperties": false
     }
    },
    "required": [
     "id",
     "object",
     "balance_usd",
     "held_usd",
     "available_usd",
     "data_region",
     "data_region_locked",
     "retention",
     "in_flight_jobs",
     "limits"
    ],
    "additionalProperties": false
   },
   "Credits": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "credits"
      ]
     },
     "balance_usd": {
      "type": "number"
     },
     "held_usd": {
      "type": "number"
     },
     "available_usd": {
      "type": "number"
     },
     "currency": {
      "type": "string"
     },
     "topups": {
      "type": "object",
      "properties": {
       "enabled": {
        "type": "boolean",
        "description": "False when card top-ups are switched off."
       },
       "min_usd": {
        "type": "number"
       },
       "max_usd": {
        "type": "number"
       }
      },
      "required": [
       "enabled",
       "min_usd",
       "max_usd"
      ],
      "additionalProperties": false
     }
    },
    "required": [
     "object",
     "balance_usd",
     "held_usd",
     "available_usd",
     "currency",
     "topups"
    ],
    "additionalProperties": false,
    "description": "The prepaid wallet."
   },
   "Checkout": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "`top_...`"
     },
     "object": {
      "type": "string",
      "enum": [
       "credit.checkout"
      ]
     },
     "status": {
      "type": "string",
      "description": "`pending` until the payment provider confirms. `in_review` means the payment needs a manual check before credit is added.",
      "enum": [
       "pending",
       "succeeded",
       "failed",
       "refunded",
       "partially_refunded",
       "in_review"
      ]
     },
     "amount_usd": {
      "type": "number",
      "description": "What you asked to add."
     },
     "credited_usd": {
      "type": "number",
      "description": "What was added to the wallet. Tax is not credited."
     },
     "refunded_usd": {
      "type": "number"
     },
     "created_at": {
      "type": "integer",
      "description": "Unix time in seconds."
     },
     "paid_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     },
     "checkout_url": {
      "type": "string",
      "description": "The payment page. Present while the checkout is pending."
     }
    },
    "required": [
     "id",
     "object",
     "status",
     "amount_usd",
     "credited_usd",
     "refunded_usd",
     "created_at",
     "paid_at"
    ],
    "additionalProperties": false,
    "description": "One top-up of the wallet."
   },
   "CheckoutList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Checkout"
      }
     },
     "has_more": {
      "type": "boolean",
      "description": "True when more exist after this page."
     },
     "last_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Pass as `after` to get the next page."
     }
    },
    "required": [
     "object",
     "data",
     "has_more",
     "last_id"
    ],
    "additionalProperties": false,
    "description": "One page of top-ups, newest first."
   },
   "Transaction": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "object": {
      "type": "string",
      "enum": [
       "credit.transaction"
      ]
     },
     "type": {
      "type": "string",
      "enum": [
       "topup",
       "usage",
       "refund",
       "dispute",
       "adjustment"
      ]
     },
     "amount_usd": {
      "type": "number",
      "description": "Positive adds to the balance, negative takes from it."
     },
     "reference": {
      "type": [
       "string",
       "null"
      ],
      "description": "The job or top-up this line belongs to."
     },
     "created_at": {
      "type": "integer",
      "description": "Unix time in seconds."
     }
    },
    "required": [
     "id",
     "object",
     "type",
     "amount_usd",
     "reference",
     "created_at"
    ],
    "additionalProperties": false,
    "description": "One line that changed the balance."
   },
   "TransactionList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Transaction"
      }
     },
     "has_more": {
      "type": "boolean",
      "description": "True when more exist after this page."
     },
     "last_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Pass as `after` to get the next page."
     }
    },
    "required": [
     "object",
     "data",
     "has_more",
     "last_id"
    ],
    "additionalProperties": false,
    "description": "One page of balance changes, newest first."
   },
   "Upload": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "`upl_...`"
     },
     "object": {
      "type": "string",
      "enum": [
       "upload"
      ]
     },
     "file_id": {
      "type": "string",
      "description": "The file this upload becomes."
     },
     "upload_url": {
      "type": "string",
      "description": "PUT the bytes here, with exactly the `headers` below."
     },
     "method": {
      "type": "string",
      "enum": [
       "PUT"
      ]
     },
     "headers": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "expires_at": {
      "type": "integer",
      "description": "When `upload_url` stops working. Unix time in seconds."
     },
     "file_expires_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     },
     "url": {
      "type": "string",
      "description": "`upload://upl_...`: usable as an input reference once the upload is complete."
     }
    },
    "required": [
     "id",
     "object",
     "file_id",
     "upload_url",
     "method",
     "headers",
     "expires_at",
     "file_expires_at",
     "url"
    ],
    "additionalProperties": false,
    "description": "A place to send a file directly to storage."
   },
   "File": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "`file_...`"
     },
     "object": {
      "type": "string",
      "enum": [
       "file"
      ]
     },
     "bytes": {
      "type": "integer"
     },
     "filename": {
      "type": [
       "string",
       "null"
      ]
     },
     "content_type": {
      "type": "string",
      "enum": [
       "audio/mp4",
       "audio/mpeg",
       "audio/wav",
       "image/jpeg",
       "image/png",
       "image/webp",
       "video/mp4",
       "video/quicktime",
       "video/webm"
      ]
     },
     "kind": {
      "type": "string",
      "enum": [
       "image",
       "video",
       "audio"
      ]
     },
     "purpose": {
      "type": "string",
      "enum": [
       "input"
      ]
     },
     "status": {
      "type": "string",
      "description": "`pending` until the bytes have arrived and passed the checks.",
      "enum": [
       "pending",
       "processed"
      ]
     },
     "data_region": {
      "type": "string"
     },
     "created_at": {
      "type": "integer",
      "description": "Unix time in seconds."
     },
     "expires_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     }
    },
    "required": [
     "id",
     "object",
     "bytes",
     "filename",
     "content_type",
     "kind",
     "purpose",
     "status",
     "data_region",
     "created_at",
     "expires_at"
    ],
    "additionalProperties": false,
    "description": "An input file: a first frame, a reference image, video or audio."
   },
   "FileList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/File"
      }
     },
     "has_more": {
      "type": "boolean",
      "description": "True when more exist after this page."
     },
     "last_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Pass as `after` to get the next page."
     }
    },
    "required": [
     "object",
     "data",
     "has_more",
     "last_id"
    ],
    "additionalProperties": false,
    "description": "One page of files, newest first."
   },
   "FileDeleted": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "object": {
      "type": "string",
      "enum": [
       "file"
      ]
     },
     "deleted": {
      "type": "boolean"
     }
    },
    "required": [
     "id",
     "object",
     "deleted"
    ],
    "additionalProperties": false
   },
   "BatchItemRef": {
    "type": "object",
    "properties": {
     "custom_id": {
      "type": "string"
     },
     "id": {
      "type": "string"
     },
     "object": {
      "type": "string",
      "enum": [
       "video",
       "image"
      ]
     },
     "status": {
      "type": "string"
     },
     "polling_url": {
      "type": "string"
     }
    },
    "required": [
     "custom_id",
     "id",
     "object",
     "status",
     "polling_url"
    ],
    "additionalProperties": false
   },
   "Batch": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "`batch_...`"
     },
     "object": {
      "type": "string",
      "enum": [
       "batch"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "in_progress",
       "completed",
       "cancelled",
       "expired"
      ]
     },
     "created_at": {
      "type": "integer",
      "description": "Unix time in seconds."
     },
     "expires_at": {
      "type": "integer",
      "description": "End of the completion window. Unix time in seconds."
     },
     "cancelled_at": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Unix time in seconds."
     },
     "completion_window": {
      "type": "string"
     },
     "retention": {
      "type": "string",
      "enum": [
       "7d",
       "14d",
       "28d",
       "zdr"
      ]
     },
     "price_multiplier": {
      "type": "number"
     },
     "request_counts": {
      "type": "object",
      "properties": {
       "total": {
        "type": "integer"
       },
       "queued": {
        "type": "integer"
       },
       "in_progress": {
        "type": "integer"
       },
       "completed": {
        "type": "integer"
       },
       "failed": {
        "type": "integer"
       },
       "cancelled": {
        "type": "integer"
       }
      },
      "required": [
       "total",
       "queued",
       "in_progress",
       "completed",
       "failed",
       "cancelled"
      ],
      "additionalProperties": false
     },
     "max_cost_usd": {
      "type": "number",
      "description": "Held for the whole batch."
     },
     "usage": {
      "type": "object",
      "properties": {
       "cost_usd": {
        "type": "number"
       }
      },
      "required": [
       "cost_usd"
      ],
      "additionalProperties": false
     },
     "polling_url": {
      "type": "string"
     },
     "requests_url": {
      "type": "string"
     },
     "poll_after_ms": {
      "type": [
       "integer",
       "null"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BatchItemRef"
      },
      "description": "Only in the answer to POST /v1/batches: the job created for each request."
     }
    },
    "required": [
     "id",
     "object",
     "status",
     "created_at",
     "expires_at",
     "cancelled_at",
     "completion_window",
     "retention",
     "price_multiplier",
     "request_counts",
     "max_cost_usd",
     "usage",
     "polling_url",
     "requests_url",
     "poll_after_ms"
    ],
    "additionalProperties": false,
    "description": "Many requests sent in one call at the batch price."
   },
   "BatchList": {
    "type": "object",
    "properties": {
     "object": {
      "type": "string",
      "enum": [
       "list"
      ]
     },
     "data": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Batch"
      }
     },
     "has_more": {
      "type": "boolean",
      "description": "True when more exist after this page."
     },
     "last_id": {
      "type": [
       "string",
       "null"
      ],
      "description": "Pass as `after` to get the next page."
     }
    },
    "required": [
     "object",
     "data",
     "has_more",
     "last_id"
    ],
    "additionalProperties": false,
    "description": "One page of batches, newest first."
   },
   "VideoCreate": {
    "additionalProperties": false,
    "properties": {
     "model": {
      "maxLength": 64,
      "minLength": 1,
      "type": "string",
      "description": "Model id from GET /v1/models."
     },
     "prompt": {
      "minLength": 1,
      "type": "string",
      "description": "What to generate."
     },
     "mode": {
      "anyOf": [
       {
        "enum": [
         "t2v",
         "i2v",
         "flf2v",
         "r2v"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Normally left out: it is worked out from the input files you send."
     },
     "size": {
      "anyOf": [
       {
        "maxLength": 16,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "`WIDTHxHEIGHT`, for example `832x480`. Or use `resolution` with `aspect_ratio`."
     },
     "resolution": {
      "anyOf": [
       {
        "maxLength": 8,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "For example `480p`, `720p`. See the model's `resolutions`."
     },
     "aspect_ratio": {
      "anyOf": [
       {
        "maxLength": 8,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "For example `16:9`. See the model's `aspect_ratios`."
     },
     "seconds": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "number"
       },
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Length of the video, within the model's `min_seconds` and `max_seconds`."
     },
     "seed": {
      "anyOf": [
       {
        "maximum": 4294967295,
        "minimum": 0,
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "The same seed and request give the same result."
     },
     "negative_prompt": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "What to avoid."
     },
     "first_frame": {
      "anyOf": [
       {},
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Start image: a file id (`file_...`), `{\"file_id\": ...}`, `{\"url\": \"https://...\"}` or an https URL."
     },
     "last_frame": {
      "anyOf": [
       {},
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "End image, same forms as `first_frame`."
     },
     "reference_images": {
      "anyOf": [
       {
        "items": {},
        "maxItems": 9,
        "minItems": 1,
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Up to 9 images to guide the result, same forms as `first_frame`."
     },
     "reference_video": {
      "anyOf": [
       {
        "items": {},
        "maxItems": 3,
        "minItems": 1,
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Up to 3 videos to guide the result."
     },
     "reference_audio": {
      "anyOf": [
       {
        "items": {},
        "maxItems": 3,
        "minItems": 1,
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Up to 3 audio files to guide the result."
     },
     "image_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Older name of `first_frame` (an https URL or a file id). Required by /v1/images/edits."
     },
     "last_image_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Older name of `last_frame`."
     },
     "reference_image_urls": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "maxItems": 9,
        "minItems": 1,
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Older name of `reference_images`."
     },
     "quality": {
      "anyOf": [
       {
        "enum": [
         "fast",
         "standard"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Model-specific quality preset."
     },
     "output_format": {
      "anyOf": [
       {
        "enum": [
         "mp4",
         "webm",
         "mov"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Container of the result."
     },
     "speed": {
      "anyOf": [
       {
        "enum": [
         "fast",
         "standard"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "`fast` has priority in the queue: it goes ahead of standard jobs when GPUs are busy. It is not a promised start time. It costs `fast_multiplier` times the price."
     },
     "max_wait_s": {
      "anyOf": [
       {
        "maximum": 1800,
        "minimum": 5,
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Longest wait, in seconds, for a GPU to START this job. If it cannot start that soon the answer is 503 with Retry-After at once; nothing is queued or charged."
     },
     "retention": {
      "anyOf": [
       {
        "enum": [
         "7d",
         "14d",
         "28d",
         "zdr"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "How long to keep the output. Defaults to the account's setting."
     },
     "data_region": {
      "anyOf": [
       {
        "enum": [
         "us",
         "eu",
         "uk",
         "in"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Where to store the output. Only valid if it matches the account's region."
     },
     "extra_body": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Model-specific options that have no field of their own."
     }
    },
    "required": [
     "model",
     "prompt"
    ],
    "type": "object"
   },
   "ImageCreate": {
    "additionalProperties": false,
    "properties": {
     "model": {
      "maxLength": 64,
      "minLength": 1,
      "type": "string",
      "description": "Model id from GET /v1/models."
     },
     "prompt": {
      "minLength": 1,
      "type": "string",
      "description": "What to generate."
     },
     "size": {
      "anyOf": [
       {
        "maxLength": 16,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "`WIDTHxHEIGHT`, for example `832x480`. Or use `resolution` with `aspect_ratio`."
     },
     "resolution": {
      "anyOf": [
       {
        "maxLength": 8,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "For example `480p`, `720p`. See the model's `resolutions`."
     },
     "aspect_ratio": {
      "anyOf": [
       {
        "maxLength": 8,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "For example `16:9`. See the model's `aspect_ratios`."
     },
     "n": {
      "default": 1,
      "maximum": 1,
      "minimum": 1,
      "type": "integer",
      "description": "Number of images. Only 1 for now."
     },
     "seed": {
      "anyOf": [
       {
        "maximum": 4294967295,
        "minimum": 0,
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "The same seed and request give the same result."
     },
     "negative_prompt": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "What to avoid."
     },
     "image_url": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Older name of `first_frame` (an https URL or a file id). Required by /v1/images/edits."
     },
     "response_format": {
      "anyOf": [
       {
        "const": "url",
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Only `url`: results are links, never base64."
     },
     "speed": {
      "anyOf": [
       {
        "enum": [
         "fast",
         "standard"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "`fast` has priority in the queue: it goes ahead of standard jobs when GPUs are busy. It is not a promised start time. It costs `fast_multiplier` times the price."
     },
     "max_wait_s": {
      "anyOf": [
       {
        "maximum": 1800,
        "minimum": 5,
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Longest wait, in seconds, for a GPU to START this job. If it cannot start that soon the answer is 503 with Retry-After at once; nothing is queued or charged."
     },
     "retention": {
      "anyOf": [
       {
        "enum": [
         "7d",
         "14d",
         "28d",
         "zdr"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "How long to keep the output. Defaults to the account's setting."
     },
     "data_region": {
      "anyOf": [
       {
        "enum": [
         "us",
         "eu",
         "uk",
         "in"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Where to store the output. Only valid if it matches the account's region."
     },
     "extra_body": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Model-specific options that have no field of their own."
     }
    },
    "required": [
     "model",
     "prompt"
    ],
    "type": "object"
   },
   "ExpiresAfter": {
    "additionalProperties": false,
    "properties": {
     "anchor": {
      "const": "created_at",
      "default": "created_at",
      "type": "string",
      "description": "Only `created_at`."
     },
     "seconds": {
      "minimum": 1,
      "type": "integer",
      "description": "Length of the video, within the model's `min_seconds` and `max_seconds`."
     }
    },
    "required": [
     "seconds"
    ],
    "type": "object"
   },
   "UploadCreate": {
    "additionalProperties": false,
    "properties": {
     "filename": {
      "anyOf": [
       {
        "maxLength": 255,
        "minLength": 1,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Shown in file listings."
     },
     "content_type": {
      "maxLength": 64,
      "minLength": 1,
      "type": "string",
      "description": "One of: `audio/mp4`, `audio/mpeg`, `audio/wav`, `image/jpeg`, `image/png`, `image/webp`, `video/mp4`, `video/quicktime`, `video/webm`."
     },
     "bytes": {
      "anyOf": [
       {
        "minimum": 1,
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Exact size of the file. The upload link accepts no more."
     },
     "size_bytes": {
      "anyOf": [
       {
        "minimum": 1,
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Older name of `bytes`."
     },
     "expires_after": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/ExpiresAfter"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Remove the file this long after it was created."
     },
     "data_region": {
      "anyOf": [
       {
        "enum": [
         "us",
         "eu",
         "uk",
         "in"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Where to store the output. Only valid if it matches the account's region."
     }
    },
    "required": [
     "content_type"
    ],
    "type": "object"
   },
   "CheckoutCreate": {
    "additionalProperties": false,
    "properties": {
     "amount_usd": {
      "description": "Amount to add, a number or a string like `\"25.00\"`, two decimals at most. See GET /v1/credits for the smallest and largest amount."
     }
    },
    "required": [
     "amount_usd"
    ],
    "type": "object"
   },
   "AccountSettings": {
    "additionalProperties": false,
    "properties": {
     "data_region": {
      "anyOf": [
       {
        "enum": [
         "us",
         "eu",
         "uk",
         "in"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Where to store the output. Only valid if it matches the account's region."
     },
     "retention": {
      "anyOf": [
       {
        "enum": [
         "7d",
         "14d",
         "28d",
         "zdr"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "How long to keep the output. Defaults to the account's setting."
     }
    },
    "type": "object"
   },
   "BatchItem": {
    "additionalProperties": false,
    "properties": {
     "custom_id": {
      "maxLength": 64,
      "minLength": 1,
      "pattern": "^[A-Za-z0-9_.:\\-]+$",
      "type": "string",
      "description": "Your id for this request, unique within the batch."
     },
     "url": {
      "enum": [
       "/v1/videos",
       "/v1/images/generations",
       "/v1/images/edits"
      ],
      "type": "string",
      "description": "The endpoint this request is for."
     },
     "body": {
      "additionalProperties": true,
      "type": "object",
      "description": "The JSON body that endpoint takes."
     }
    },
    "required": [
     "custom_id",
     "url",
     "body"
    ],
    "type": "object"
   },
   "BatchCreate": {
    "additionalProperties": false,
    "properties": {
     "requests": {
      "items": {
       "$ref": "#/components/schemas/BatchItem"
      },
      "minItems": 1,
      "type": "array",
      "description": "1 to 1000 requests."
     },
     "completion_window": {
      "anyOf": [
       {
        "maxLength": 4,
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "`1h` to `24h`. Requests not started by then are cancelled and not charged. Default `24h`."
     },
     "retention": {
      "anyOf": [
       {
        "enum": [
         "7d",
         "14d",
         "28d",
         "zdr"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "How long to keep the output. Defaults to the account's setting."
     },
     "data_region": {
      "anyOf": [
       {
        "enum": [
         "us",
         "eu",
         "uk",
         "in"
        ],
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "default": null,
      "description": "Where to store the output. Only valid if it matches the account's region."
     }
    },
    "required": [
     "requests"
    ],
    "type": "object"
   },
   "QuoteCreate": {
    "additionalProperties": false,
    "description": "POST /v1/quote: the request you would send, and where you would send it.",
    "properties": {
     "url": {
      "enum": [
       "/v1/videos",
       "/v1/images/generations",
       "/v1/images/edits",
       "/v1/batches"
      ],
      "type": "string",
      "description": "The endpoint this request is for."
     },
     "body": {
      "additionalProperties": true,
      "type": "object",
      "description": "The JSON body that endpoint takes."
     }
    },
    "required": [
     "url",
     "body"
    ],
    "type": "object"
   }
  }
 }
}