{
  "openapi": "3.1.0",
  "info": {
    "title": "Leap API",
    "version": "1.0.0",
    "description": "One API for the best image, video and audio models. Every request goes to `https://api.tryleap.ai` with your API key in the `x-api-key` header, or as `Authorization: Bearer leap_...`. Create a key at https://app.tryleap.ai/go/api.\n\nGuides, examples and the errors list are at https://www.tryleap.ai/docs."
  },
  "servers": [
    {
      "url": "https://api.tryleap.ai"
    }
  ],
  "externalDocs": {
    "url": "https://www.tryleap.ai/docs"
  },
  "tags": [
    {
      "name": "Models",
      "description": "Every model and preset you can run, with its price and the JSON Schema of the input it takes."
    },
    {
      "name": "Quotes",
      "description": "The exact price of a run before you start it, with its input checked and its defaults filled in."
    },
    {
      "name": "Generations",
      "description": "A generation is one run of a model or preset: queued, then running, then succeeded, failed or canceled. Only a succeeded run is charged."
    },
    {
      "name": "Batches",
      "description": "Up to 50 generations priced and held together in one request, each then run as its own generation."
    },
    {
      "name": "Webhooks",
      "description": "URLs your workspace's events are POSTed to, signed following Standard Webhooks, and the default secret for the `webhook` URL a request names."
    },
    {
      "name": "Events",
      "description": "What happened in your workspace, kept 30 days, with each delivery to your webhooks and a way to send one again."
    },
    {
      "name": "Files",
      "description": "Photos, videos and sounds that models take as input. Upload one, then pass its `file_...` ID in the input field the model's schema names."
    },
    {
      "name": "Characters",
      "description": "A character your workspace keeps: a name and up to four pictures. Put its `chr_...` ID wherever a model or recipe takes an image file, and every run gets the same character."
    },
    {
      "name": "Credits",
      "description": "Your workspace's balance in US dollars."
    }
  ],
  "security": [
    {
      "ApiKey": []
    },
    {
      "Bearer": []
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models",
        "description": "Every model and preset your key can run, with its price, in one answer. Filter it on your side by `modality` or `tasks`. Read one model for the JSON Schema of its input.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Models"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The catalog.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "black-forest-labs/flux-2-pro",
                      "object": "model",
                      "type": "model",
                      "name": "FLUX.2 [pro]",
                      "creator": "Black Forest Labs",
                      "modality": "image",
                      "tasks": [
                        "text-to-image"
                      ],
                      "description": "Black Forest Labs' second generation: sharper detail and text than FLUX1.1, at a lower price.",
                      "revision": "2026-10-02",
                      "version": null,
                      "latest": true,
                      "status": "stable",
                      "deprecation": null,
                      "pricing": {
                        "unit": "image",
                        "usd": "0.033",
                        "overrides": [],
                        "drivers": [
                          "n"
                        ]
                      }
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/models/{creator}/{name}": {
      "get": {
        "operationId": "retrieveModel",
        "summary": "Retrieve a model",
        "description": "One model or preset with `input_schema`, the JSON Schema (2020-12) of the `input` it takes. Build your request from it: required fields, allowed values and defaults are all there, and unknown fields are refused.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "creator",
            "schema": {
              "type": "string",
              "description": "The first part of the model ID, such as `black-forest-labs` or `leap`."
            },
            "required": true,
            "description": "The first part of the model ID, such as `black-forest-labs` or `leap`."
          },
          {
            "in": "path",
            "name": "name",
            "schema": {
              "type": "string",
              "description": "The second part, such as `flux-2-pro`, or `restore-photo@1` for a preset."
            },
            "required": true,
            "description": "The second part, such as `flux-2-pro`, or `restore-photo@1` for a preset."
          }
        ],
        "responses": {
          "200": {
            "description": "The model and its input schema.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Deprecation": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: when it was, as `@` and a Unix time (RFC 9745)."
                }
              },
              "Sunset": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: the date it stops running, as an HTTP date (RFC 8594)."
                }
              },
              "Link": {
                "schema": {
                  "type": "string",
                  "description": "For a deprecated model with a replacement: `</v1/models/{id}>; rel=\"successor-version\"`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "black-forest-labs/flux-2-pro",
                  "object": "model",
                  "type": "model",
                  "name": "FLUX.2 [pro]",
                  "creator": "Black Forest Labs",
                  "modality": "image",
                  "tasks": [
                    "text-to-image"
                  ],
                  "description": "Black Forest Labs' second generation: sharper detail and text than FLUX1.1, at a lower price.",
                  "revision": "2026-10-02",
                  "version": null,
                  "latest": true,
                  "status": "stable",
                  "deprecation": null,
                  "pricing": {
                    "unit": "image",
                    "usd": "0.033",
                    "overrides": [],
                    "drivers": [
                      "n"
                    ]
                  },
                  "input_schema": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "prompt"
                    ],
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "pattern": "\\S"
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "1:1",
                          "3:2",
                          "2:3",
                          "4:3",
                          "3:4",
                          "16:9",
                          "9:16",
                          "21:9",
                          "9:21"
                        ],
                        "default": "1:1"
                      },
                      "n": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4,
                        "default": 1
                      },
                      "seed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 4294967295
                      }
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ModelWithSchema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "$ref": "#/components/responses/ResourceNotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/public/models": {
      "get": {
        "operationId": "listPublicModels",
        "summary": "List models without a key",
        "description": "The same catalog as `GET /v1/models`, for anyone: browse models and prices before you sign up.\n\nNo API key needed.",
        "tags": [
          "Models"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The catalog.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "description": "The catalog changes only with a deploy, so a CDN may keep it for an hour."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "black-forest-labs/flux-2-pro",
                      "object": "model",
                      "type": "model",
                      "name": "FLUX.2 [pro]",
                      "creator": "Black Forest Labs",
                      "modality": "image",
                      "tasks": [
                        "text-to-image"
                      ],
                      "description": "Black Forest Labs' second generation: sharper detail and text than FLUX1.1, at a lower price.",
                      "revision": "2026-10-02",
                      "version": null,
                      "latest": true,
                      "status": "stable",
                      "deprecation": null,
                      "pricing": {
                        "unit": "image",
                        "usd": "0.033",
                        "overrides": [],
                        "drivers": [
                          "n"
                        ]
                      }
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/public/models/{creator}/{name}": {
      "get": {
        "operationId": "retrievePublicModel",
        "summary": "Retrieve a model without a key",
        "description": "The same as `GET /v1/models/{creator}/{name}`, for anyone.\n\nNo API key needed.",
        "tags": [
          "Models"
        ],
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "creator",
            "schema": {
              "type": "string",
              "description": "The first part of the model ID, such as `black-forest-labs` or `leap`."
            },
            "required": true,
            "description": "The first part of the model ID, such as `black-forest-labs` or `leap`."
          },
          {
            "in": "path",
            "name": "name",
            "schema": {
              "type": "string",
              "description": "The second part, such as `flux-2-pro`, or `restore-photo@1` for a preset."
            },
            "required": true,
            "description": "The second part, such as `flux-2-pro`, or `restore-photo@1` for a preset."
          }
        ],
        "responses": {
          "200": {
            "description": "The model and its input schema.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "description": "The catalog changes only with a deploy, so a CDN may keep it for an hour."
                }
              },
              "Deprecation": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: when it was, as `@` and a Unix time (RFC 9745)."
                }
              },
              "Sunset": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: the date it stops running, as an HTTP date (RFC 8594)."
                }
              },
              "Link": {
                "schema": {
                  "type": "string",
                  "description": "For a deprecated model with a replacement: `</v1/models/{id}>; rel=\"successor-version\"`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "black-forest-labs/flux-2-pro",
                  "object": "model",
                  "type": "model",
                  "name": "FLUX.2 [pro]",
                  "creator": "Black Forest Labs",
                  "modality": "image",
                  "tasks": [
                    "text-to-image"
                  ],
                  "description": "Black Forest Labs' second generation: sharper detail and text than FLUX1.1, at a lower price.",
                  "revision": "2026-10-02",
                  "version": null,
                  "latest": true,
                  "status": "stable",
                  "deprecation": null,
                  "pricing": {
                    "unit": "image",
                    "usd": "0.033",
                    "overrides": [],
                    "drivers": [
                      "n"
                    ]
                  },
                  "input_schema": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "prompt"
                    ],
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "pattern": "\\S"
                      },
                      "aspect_ratio": {
                        "type": "string",
                        "enum": [
                          "1:1",
                          "3:2",
                          "2:3",
                          "4:3",
                          "3:4",
                          "16:9",
                          "9:16",
                          "21:9",
                          "9:21"
                        ],
                        "default": "1:1"
                      },
                      "n": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4,
                        "default": 1
                      },
                      "seed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 4294967295
                      }
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ModelWithSchema"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/ResourceNotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/quotes": {
      "post": {
        "operationId": "createQuote",
        "summary": "Create a quote",
        "description": "The exact price of a run, without running it or holding credit. It takes the same body as `POST /v1/generations`, checks the input against the model's schema and fills in its defaults, so an input the schema refuses gets the same `400`. It can't tell whether the model will accept the prompt itself.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Quotes"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The price and the input as it would run.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Deprecation": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: when it was, as `@` and a Unix time (RFC 9745)."
                }
              },
              "Sunset": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: the date it stops running, as an HTTP date (RFC 8594)."
                }
              },
              "Link": {
                "schema": {
                  "type": "string",
                  "description": "For a deprecated model with a replacement: `</v1/models/{id}>; rel=\"successor-version\"`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "quote",
                  "model": "google/veo-3.1-fast",
                  "revision": "2026-10-02",
                  "input": {
                    "prompt": "A heron lands on a still lake at dawn",
                    "aspect_ratio": "16:9",
                    "n": 1,
                    "duration": 4,
                    "resolution": "1080p",
                    "audio": true
                  },
                  "cost_usd": "0.80",
                  "hold_usd": "0.80"
                },
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/generations": {
      "get": {
        "operationId": "listGenerations",
        "summary": "List generations",
        "description": "Your workspace's generations, newest first, 50 to a page by default. Filter by model, status or where they were started. To read the next page, send `next_cursor` as `cursor` with the same filters.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Maximum number of rows to return: 1 to 100; default 50.",
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Maximum number of rows to return: 1 to 100; default 50."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Send next_cursor as cursor; omit it for the first page.",
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$"
            },
            "description": "Send next_cursor as cursor; omit it for the first page."
          },
          {
            "in": "query",
            "name": "model",
            "schema": {
              "description": "Only runs of this model or preset. A preset's ID without a version, such as leap/headshot, takes in every version.",
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$"
            },
            "description": "Only runs of this model or preset. A preset's ID without a version, such as leap/headshot, takes in every version."
          },
          {
            "in": "query",
            "name": "source",
            "schema": {
              "description": "Only runs started from these places, comma-separated: api, mcp or studio, such as api,mcp.",
              "type": "string"
            },
            "description": "Only runs started from these places, comma-separated: api, mcp or studio, such as api,mcp."
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Only runs in these states, comma-separated, such as queued,running.",
              "type": "string"
            },
            "description": "Only runs in these states, comma-separated, such as queued,running."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of generations.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "url": "/v1/generations",
                  "data": [
                    {
                      "id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
                      "object": "generation",
                      "model": "google/veo-3.1-fast",
                      "modality": "video",
                      "status": "succeeded",
                      "provider": "gateway",
                      "revision": "2026-10-02",
                      "input": {
                        "prompt": "A heron lands on a still lake at dawn",
                        "aspect_ratio": "16:9",
                        "n": 1,
                        "duration": 4,
                        "resolution": "1080p",
                        "audio": true
                      },
                      "output": [
                        {
                          "type": "video",
                          "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                          "expires_at": "2026-10-05T18:24:12.004Z",
                          "content_type": "video/mp4",
                          "width": 1920,
                          "height": 1080,
                          "poster": {
                            "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                            "expires_at": "2026-10-05T18:24:12.004Z",
                            "width": 720,
                            "height": 405
                          }
                        }
                      ],
                      "error": null,
                      "failure_cause": null,
                      "usage": {
                        "cost_usd": "0.80"
                      },
                      "source": "api",
                      "batch_id": null,
                      "created_at": "2026-10-04T18:22:41.512Z",
                      "started_at": "2026-10-04T18:22:42.090Z",
                      "completed_at": "2026-10-04T18:24:11.877Z",
                      "slow_at": null,
                      "deadline_at": null,
                      "suggested_recipe": null
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "eyJpZCI6Imdlbl83SHEybVZ4OUxyNEtwOFRuM1djNlliMUQifQ.2b4Kx9Qm7Lr1Tn5Wc3Yb8Df6Gh0Jk2Mn4Pq6Rs8Tv0X"
                },
                "schema": {
                  "$ref": "#/components/schemas/GenerationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "post": {
        "operationId": "createGeneration",
        "summary": "Create a generation",
        "description": "Starts a run of any model or preset. Every model takes this same shape; only `input` differs, as the model's `input_schema` says. The price is held from your balance first, and charged only if the run succeeds.\n\nWithout `Prefer`, the answer comes at once with the generation `queued`. With `Prefer: wait=60`, it comes when the run finishes or after 60 seconds, whichever is first: most images finish inside the wait, and video doesn't. Send an `Idempotency-Key` so a retry never starts a second run.\n\nA run that would sexualise a real person from a photo you uploaded is refused with `422 sexualized_real_person` before anything is held: words that ask to undress them or show them in a sexual way, on the photo or on an image Leap made from it, or a face swap or a recast into a sexual picture or clip.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "description": "A key you generate for this request, such as a UUID, so a retry never starts a second run. A retry with the same key and body returns the same generation as it is now, marked `Idempotent-Replayed: true`. The same key with a different body is a `409`. A key belongs to your workspace and doesn't expire, so use a new one for each new request.",
              "example": "7f1c2a9e-3b4d-4e8a-9c21-5d0f6a7b8c90",
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[\\x21-\\x7e]+$"
            },
            "description": "A key you generate for this request, such as a UUID, so a retry never starts a second run. A retry with the same key and body returns the same generation as it is now, marked `Idempotent-Replayed: true`. The same key with a different body is a `409`. A key belongs to your workspace and doesn't expire, so use a new one for each new request."
          },
          {
            "in": "header",
            "name": "Prefer",
            "schema": {
              "description": "`wait=N` holds the request open for up to N seconds (at most 60) until the generation finishes, and `Preference-Applied` echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back `queued` or `running`; poll it from there. Without this header the generation comes back queued at once.",
              "example": "wait=60",
              "type": "string"
            },
            "description": "`wait=N` holds the request open for up to N seconds (at most 60) until the generation finishes, and `Preference-Applied` echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back `queued` or `running`; poll it from there. Without this header the generation comes back queued at once."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The generation: `queued` at once, or as it is when the wait ends.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "The new resource's path, such as `/v1/generations/gen_...`."
                }
              },
              "Idempotent-Replayed": {
                "schema": {
                  "type": "string",
                  "const": "true",
                  "description": "Present when this answer replays the first request sent with the same `Idempotency-Key`."
                }
              },
              "Preference-Applied": {
                "schema": {
                  "type": "string",
                  "description": "The wait that was applied, such as `wait=60`."
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "While a run is still `queued` or `running`: seconds to wait before you read it again, 2 for images and audio, 5 for video and 3D. A final answer has none.",
                  "example": 5
                }
              },
              "Deprecation": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: when it was, as `@` and a Unix time (RFC 9745)."
                }
              },
              "Sunset": {
                "schema": {
                  "type": "string",
                  "description": "Present when the model or preset is deprecated: the date it stops running, as an HTTP date (RFC 8594)."
                }
              },
              "Link": {
                "schema": {
                  "type": "string",
                  "description": "For a deprecated model with a replacement: `</v1/models/{id}>; rel=\"successor-version\"`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
                  "object": "generation",
                  "model": "google/veo-3.1-fast",
                  "modality": "video",
                  "status": "queued",
                  "provider": null,
                  "revision": "2026-10-02",
                  "input": {
                    "prompt": "A heron lands on a still lake at dawn",
                    "aspect_ratio": "16:9",
                    "n": 1,
                    "duration": 4,
                    "resolution": "1080p",
                    "audio": true
                  },
                  "output": [],
                  "error": null,
                  "failure_cause": null,
                  "usage": {
                    "cost_usd": null
                  },
                  "source": "api",
                  "batch_id": null,
                  "created_at": "2026-10-04T18:22:41.512Z",
                  "started_at": null,
                  "completed_at": null,
                  "slow_at": null,
                  "deadline_at": null,
                  "suggested_recipe": null
                },
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "402": {
            "$ref": "#/components/responses/InsufficientCreditOrTopUpRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrUnpaidFailureCap"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "422": {
            "$ref": "#/components/responses/PhotoBlockedOrSexualizedRealPerson"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/generations/{id}": {
      "get": {
        "operationId": "retrieveGeneration",
        "summary": "Retrieve a generation",
        "description": "A generation's status, outputs and cost. Each read signs fresh output links, valid for 24 hours.\n\nTo wait for the result, send `Prefer: wait=60`: the read holds until `status` is `succeeded`, `failed` or `canceled`, or 60 seconds pass, so a loop of these reads long-polls a video in a few requests. Without it the read answers at once; while the run isn't final, `Retry-After` says how many seconds to wait before the next read.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The generation's ID, `gen_...`."
            },
            "required": true,
            "description": "The generation's ID, `gen_...`."
          },
          {
            "in": "header",
            "name": "Prefer",
            "schema": {
              "description": "`wait=N` holds the request open for up to N seconds (at most 60) until the generation finishes, and `Preference-Applied` echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back `queued` or `running`; poll it from there. Without this header the generation comes back queued at once.",
              "example": "wait=60",
              "type": "string"
            },
            "description": "`wait=N` holds the request open for up to N seconds (at most 60) until the generation finishes, and `Preference-Applied` echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back `queued` or `running`; poll it from there. Without this header the generation comes back queued at once."
          }
        ],
        "responses": {
          "200": {
            "description": "The generation, as it is now or when the wait ends.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Preference-Applied": {
                "schema": {
                  "type": "string",
                  "description": "The wait that was applied, such as `wait=60`."
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "While a run is still `queued` or `running`: seconds to wait before you read it again, 2 for images and audio, 5 for video and 3D. A final answer has none.",
                  "example": 5
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
                  "object": "generation",
                  "model": "google/veo-3.1-fast",
                  "modality": "video",
                  "status": "succeeded",
                  "provider": "gateway",
                  "revision": "2026-10-02",
                  "input": {
                    "prompt": "A heron lands on a still lake at dawn",
                    "aspect_ratio": "16:9",
                    "n": 1,
                    "duration": 4,
                    "resolution": "1080p",
                    "audio": true
                  },
                  "output": [
                    {
                      "type": "video",
                      "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                      "expires_at": "2026-10-05T18:24:12.004Z",
                      "content_type": "video/mp4",
                      "width": 1920,
                      "height": 1080,
                      "poster": {
                        "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                        "expires_at": "2026-10-05T18:24:12.004Z",
                        "width": 720,
                        "height": 405
                      }
                    }
                  ],
                  "error": null,
                  "failure_cause": null,
                  "usage": {
                    "cost_usd": "0.80"
                  },
                  "source": "api",
                  "batch_id": null,
                  "created_at": "2026-10-04T18:22:41.512Z",
                  "started_at": "2026-10-04T18:22:42.090Z",
                  "completed_at": "2026-10-04T18:24:11.877Z",
                  "slow_at": null,
                  "deadline_at": null,
                  "suggested_recipe": null
                },
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That generation does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/generations/{id}/cancel": {
      "post": {
        "operationId": "cancelGeneration",
        "summary": "Cancel a generation",
        "description": "Stops a queued or running generation and releases its hold; if the provider finishes it anyway, the result is thrown away and nothing is charged. A generation that already ended comes back as it is. Two kinds can't be stopped once started and answer `409`: a run at a provider that bills it either way, and a preset run that has already shown its `preview`. Each runs to its end and is charged only if it succeeds.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The generation's ID, `gen_...`."
            },
            "required": true,
            "description": "The generation's ID, `gen_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The generation, `canceled`, or as it was if it had already ended.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
                  "object": "generation",
                  "model": "google/veo-3.1-fast",
                  "modality": "video",
                  "status": "canceled",
                  "provider": null,
                  "revision": "2026-10-02",
                  "input": {
                    "prompt": "A heron lands on a still lake at dawn",
                    "aspect_ratio": "16:9",
                    "n": 1,
                    "duration": 4,
                    "resolution": "1080p",
                    "audio": true
                  },
                  "output": [],
                  "error": null,
                  "failure_cause": null,
                  "usage": {
                    "cost_usd": null
                  },
                  "source": "api",
                  "batch_id": null,
                  "created_at": "2026-10-04T18:22:41.512Z",
                  "started_at": null,
                  "completed_at": "2026-10-04T18:22:50.218Z",
                  "slow_at": null,
                  "deadline_at": null,
                  "suggested_recipe": null
                },
                "schema": {
                  "$ref": "#/components/schemas/Generation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That generation does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/generations/{id}/outputs/{index}/file": {
      "post": {
        "operationId": "keepGenerationOutput",
        "summary": "Keep an output as a file",
        "description": "Turns an image output of a succeeded generation into a file of your workspace, so you can pass its ID to the next run without downloading and uploading it. Calling it again returns the same file. Other outputs answer `400`.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Generations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The generation's ID, `gen_...`."
            },
            "required": true,
            "description": "The generation's ID, `gen_...`."
          },
          {
            "in": "path",
            "name": "index",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 63,
              "description": "The output's position in `output`, from 0."
            },
            "required": true,
            "description": "The output's position in `output`, from 0."
          }
        ],
        "responses": {
          "201": {
            "description": "The file.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "file_6Wn1Tc8Lr3Vx5Kq9Bd2Mh7Pz",
                  "object": "file",
                  "content_type": "image/jpeg",
                  "bytes": 412337,
                  "width": 896,
                  "height": 1152,
                  "duration": null,
                  "filename": null,
                  "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                  "created_at": "2026-10-04T18:23:02.115Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`, `conflicting_credentials`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_parameter": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "invalid_parameter",
                        "message": "Invalid request parameters.",
                        "param": "index",
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  },
                  "conflicting_credentials": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "conflicting_credentials",
                        "message": "Send one API key.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That generation does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/batches": {
      "post": {
        "operationId": "createBatch",
        "summary": "Create a batch",
        "description": "Starts up to 50 generations in one request. They're priced and held together, so either all start or none do, and each then runs as its own generation with this batch's `batch_id`. Read each one with `GET /v1/generations/{id}`. One request that would sexualise a real person from a photo you uploaded refuses the whole batch with `422 sexualized_real_person`.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Batches"
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "description": "A key you generate for this request, such as a UUID, so a retry never starts a second run. A retry with the same key and body returns the same generation as it is now, marked `Idempotent-Replayed: true`. The same key with a different body is a `409`. A key belongs to your workspace and doesn't expire, so use a new one for each new request.",
              "example": "7f1c2a9e-3b4d-4e8a-9c21-5d0f6a7b8c90",
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[\\x21-\\x7e]+$"
            },
            "description": "A key you generate for this request, such as a UUID, so a retry never starts a second run. A retry with the same key and body returns the same generation as it is now, marked `Idempotent-Replayed: true`. The same key with a different body is a `409`. A key belongs to your workspace and doesn't expire, so use a new one for each new request."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "requests": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "model": {
                          "type": "string",
                          "maxLength": 100,
                          "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
                          "description": "The model to call, as creator/name. GET /v1/models lists them."
                        },
                        "input": {
                          "default": {},
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "webhook": {
                          "description": "An https URL to POST the generation.succeeded, generation.failed or generation.canceled event to when the run ends, signed with your workspace's default secret (GET /v1/webhooks/default/secret).",
                          "type": "string",
                          "maxLength": 2048,
                          "format": "uri"
                        }
                      },
                      "required": [
                        "model"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Up to 50 generations, each a model and its input. All are priced and held together."
                  }
                },
                "required": [
                  "requests"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The batch, with each generation queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "schema": {
                  "type": "string",
                  "const": "true",
                  "description": "Present when this answer replays the first request sent with the same `Idempotency-Key`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "batch",
                  "data": [
                    {
                      "id": "gen_2Pk7Wd4Qx9Lm1Tn6Vb3Rc8Hy",
                      "object": "generation",
                      "model": "black-forest-labs/flux-2-pro",
                      "modality": "image",
                      "status": "queued",
                      "provider": null,
                      "revision": "2026-10-02",
                      "input": {
                        "prompt": "A fox in the snow, watercolor",
                        "aspect_ratio": "1:1",
                        "n": 1
                      },
                      "output": [],
                      "error": null,
                      "failure_cause": null,
                      "usage": {
                        "cost_usd": null
                      },
                      "source": "api",
                      "batch_id": "bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "created_at": "2026-10-04T18:22:41.512Z",
                      "started_at": null,
                      "completed_at": null,
                      "slow_at": null,
                      "deadline_at": null,
                      "suggested_recipe": null
                    },
                    {
                      "id": "gen_9Rb3Hy6Tc1Vn8Lm4Qx7Wd2Pk",
                      "object": "generation",
                      "model": "black-forest-labs/flux-2-pro",
                      "modality": "image",
                      "status": "queued",
                      "provider": null,
                      "revision": "2026-10-02",
                      "input": {
                        "prompt": "A fox in the snow, linocut print",
                        "aspect_ratio": "1:1",
                        "n": 1
                      },
                      "output": [],
                      "error": null,
                      "failure_cause": null,
                      "usage": {
                        "cost_usd": null
                      },
                      "source": "api",
                      "batch_id": "bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "created_at": "2026-10-04T18:22:41.512Z",
                      "started_at": null,
                      "completed_at": null,
                      "slow_at": null,
                      "deadline_at": null,
                      "suggested_recipe": null
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "402": {
            "$ref": "#/components/responses/InsufficientCreditOrTopUpRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "409": {
            "$ref": "#/components/responses/ConflictOrUnpaidFailureCap"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "422": {
            "$ref": "#/components/responses/PhotoBlockedOrSexualizedRealPerson"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/batches/{id}": {
      "get": {
        "operationId": "retrieveBatch",
        "summary": "Retrieve a batch",
        "description": "A batch with every generation in it, each as `GET /v1/generations/{id}` would return it. Send `Prefer: wait=60` to hold the read until every run is final or 60 seconds pass. While any run isn't final, `Retry-After` says how many seconds to wait before the next read.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Batches"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The batch's ID, `bat_...`."
            },
            "required": true,
            "description": "The batch's ID, `bat_...`."
          },
          {
            "in": "header",
            "name": "Prefer",
            "schema": {
              "description": "`wait=N` holds the request open for up to N seconds (at most 60) until the generation finishes, and `Preference-Applied` echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back `queued` or `running`; poll it from there. Without this header the generation comes back queued at once.",
              "example": "wait=60",
              "type": "string"
            },
            "description": "`wait=N` holds the request open for up to N seconds (at most 60) until the generation finishes, and `Preference-Applied` echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back `queued` or `running`; poll it from there. Without this header the generation comes back queued at once."
          }
        ],
        "responses": {
          "200": {
            "description": "The batch, as it is now or when the wait ends.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Preference-Applied": {
                "schema": {
                  "type": "string",
                  "description": "The wait that was applied, such as `wait=60`."
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "While a run is still `queued` or `running`: seconds to wait before you read it again, 2 for images and audio, 5 for video and 3D. A final answer has none.",
                  "example": 5
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "batch",
                  "data": [
                    {
                      "id": "gen_2Pk7Wd4Qx9Lm1Tn6Vb3Rc8Hy",
                      "object": "generation",
                      "model": "black-forest-labs/flux-2-pro",
                      "modality": "image",
                      "status": "queued",
                      "provider": null,
                      "revision": "2026-10-02",
                      "input": {
                        "prompt": "A fox in the snow, watercolor",
                        "aspect_ratio": "1:1",
                        "n": 1
                      },
                      "output": [],
                      "error": null,
                      "failure_cause": null,
                      "usage": {
                        "cost_usd": null
                      },
                      "source": "api",
                      "batch_id": "bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "created_at": "2026-10-04T18:22:41.512Z",
                      "started_at": null,
                      "completed_at": null,
                      "slow_at": null,
                      "deadline_at": null,
                      "suggested_recipe": null
                    },
                    {
                      "id": "gen_9Rb3Hy6Tc1Vn8Lm4Qx7Wd2Pk",
                      "object": "generation",
                      "model": "black-forest-labs/flux-2-pro",
                      "modality": "image",
                      "status": "queued",
                      "provider": null,
                      "revision": "2026-10-02",
                      "input": {
                        "prompt": "A fox in the snow, linocut print",
                        "aspect_ratio": "1:1",
                        "n": 1
                      },
                      "output": [],
                      "error": null,
                      "failure_cause": null,
                      "usage": {
                        "cost_usd": null
                      },
                      "source": "api",
                      "batch_id": "bat_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "created_at": "2026-10-04T18:22:41.512Z",
                      "started_at": null,
                      "completed_at": null,
                      "slow_at": null,
                      "deadline_at": null,
                      "suggested_recipe": null
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That batch does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/webhook_endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "List webhook endpoints",
        "description": "Your workspace's webhook endpoints, newest first. Their secrets are never listed.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Maximum number of rows to return: 1 to 100; default 50.",
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Maximum number of rows to return: 1 to 100; default 50."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Send next_cursor as cursor; omit it for the first page.",
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$"
            },
            "description": "Send next_cursor as cursor; omit it for the first page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of endpoints.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "url": "/v1/webhook_endpoints",
                  "data": [
                    {
                      "id": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "object": "webhook_endpoint",
                      "url": "https://example.com/webhooks/leap",
                      "description": "Production renders",
                      "events": [
                        "generation.succeeded",
                        "generation.failed"
                      ],
                      "disabled": false,
                      "disabled_reason": null,
                      "created_at": "2026-10-04T18:20:03.441Z",
                      "updated_at": "2026-10-04T18:20:03.441Z"
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "Create a webhook endpoint",
        "description": "Starts sending your workspace's events to an https URL: every type by default (`[\"*\"]`, including types added later), or the ones you list. Runs started from the API, the studio and MCP all send events. The answer holds the endpoint's signing secret, shown only here and when you rotate it. A workspace can have up to 16 endpoints; one more answers `409`.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The endpoint, with its signing secret.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "The new resource's path, such as `/v1/generations/gen_...`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "webhook_endpoint",
                  "url": "https://example.com/webhooks/leap",
                  "description": "Production renders",
                  "events": [
                    "generation.succeeded",
                    "generation.failed"
                  ],
                  "disabled": false,
                  "disabled_reason": null,
                  "created_at": "2026-10-04T18:20:03.441Z",
                  "updated_at": "2026-10-04T18:20:03.441Z",
                  "secret": "whsec_foO4NH7H4fkZ/TBkV6oqbUTlZgWKMsflfyzrjNDfrQs="
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/webhook_endpoints/{id}": {
      "get": {
        "operationId": "retrieveWebhookEndpoint",
        "summary": "Retrieve a webhook endpoint",
        "description": "One endpoint, without its secret.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The endpoint's ID, `we_...`."
            },
            "required": true,
            "description": "The endpoint's ID, `we_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "webhook_endpoint",
                  "url": "https://example.com/webhooks/leap",
                  "description": "Production renders",
                  "events": [
                    "generation.succeeded",
                    "generation.failed"
                  ],
                  "disabled": false,
                  "disabled_reason": null,
                  "created_at": "2026-10-04T18:20:03.441Z",
                  "updated_at": "2026-10-04T18:20:03.441Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That webhook endpoint does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "summary": "Update a webhook endpoint",
        "description": "Changes any of `url`, `events` and `description` (null clears it), and turns deliveries off and on with `disabled`. `{\"disabled\": false}` turns back on an endpoint Leap disabled after 72 hours of failures, and clears `disabled_reason`. Fields you leave out stay as they are.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The endpoint's ID, `we_...`."
            },
            "required": true,
            "description": "The endpoint's ID, `we_...`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The endpoint.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "webhook_endpoint",
                  "url": "https://example.com/webhooks/leap",
                  "description": "Production renders",
                  "events": [
                    "generation.succeeded",
                    "generation.failed"
                  ],
                  "disabled": false,
                  "disabled_reason": null,
                  "created_at": "2026-10-04T18:20:03.441Z",
                  "updated_at": "2026-10-04T18:20:03.441Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That webhook endpoint does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "summary": "Delete a webhook endpoint",
        "description": "Removes an endpoint. Its events stop going there.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The endpoint's ID, `we_...`."
            },
            "required": true,
            "description": "The endpoint's ID, `we_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The removed endpoint's ID.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "webhook_endpoint",
                  "deleted": true
                },
                "schema": {
                  "$ref": "#/components/schemas/DeletedWebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That webhook endpoint does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/webhook_endpoints/{id}/rotate_secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Rotate a webhook secret",
        "description": "Makes a new signing secret and returns it, shown only here. For 24 hours the old secret signs too, as a second signature in `webhook-signature`, so you can deploy the new one without dropping events. Rotating again within those 24 hours drops the oldest.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The endpoint's ID, `we_...`."
            },
            "required": true,
            "description": "The endpoint's ID, `we_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint, with its new signing secret.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "object": "webhook_endpoint",
                  "url": "https://example.com/webhooks/leap",
                  "description": "Production renders",
                  "events": [
                    "generation.succeeded",
                    "generation.failed"
                  ],
                  "disabled": false,
                  "disabled_reason": null,
                  "created_at": "2026-10-04T18:20:03.441Z",
                  "updated_at": "2026-10-04T18:20:03.441Z",
                  "secret": "whsec_foO4NH7H4fkZ/TBkV6oqbUTlZgWKMsflfyzrjNDfrQs="
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That webhook endpoint does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/webhook_endpoints/{id}/test": {
      "post": {
        "operationId": "testWebhookEndpoint",
        "summary": "Send a test event",
        "description": "Sends a `webhook.test` event to this endpoint only, once, even if it's disabled, and answers with the delivery and how the try went. The event's `data.object` is the endpoint, never its secret. Tests and redeliveries share a budget of 100 an hour per workspace.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The endpoint's ID, `we_...`."
            },
            "required": true,
            "description": "The endpoint's ID, `we_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery, with the try's result.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "whd_2Pk7Wd4Qx9Lm1Tn6Vb3Rc8Hy",
                  "object": "webhook_delivery",
                  "event": "evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn",
                  "endpoint": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                  "url": "https://example.com/webhooks/leap",
                  "status": "succeeded",
                  "attempts": [
                    {
                      "attempted_at": "2026-10-04T18:24:12.106Z",
                      "succeeded": true,
                      "status_code": 204,
                      "error": null,
                      "duration_ms": 184
                    }
                  ],
                  "next_attempt_at": null,
                  "created_at": "2026-10-04T18:24:12.040Z",
                  "completed_at": "2026-10-04T18:24:12.290Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That webhook endpoint does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/webhooks/default/secret": {
      "get": {
        "operationId": "retrieveDefaultWebhookSecret",
        "summary": "Retrieve the default webhook secret",
        "description": "The secret that signs events sent to the `webhook` URL a generation or batch request names. It's made the first time you read it. Keep it in your server's environment.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The secret.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "webhook_secret",
                  "secret": "whsec_DMlar1QHs8wCiHFLVgS15l9Crm0IK7kUDXDPN1lNDrg="
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List events",
        "description": "Your workspace's events from the last 30 days, newest first, optionally only some types. Use it to catch up after your endpoint was down.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Maximum number of rows to return: 1 to 100; default 50.",
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Maximum number of rows to return: 1 to 100; default 50."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Send next_cursor as cursor; omit it for the first page.",
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$"
            },
            "description": "Send next_cursor as cursor; omit it for the first page."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "description": "Only events of these types, comma-separated, such as generation.succeeded,generation.failed.",
              "type": "string"
            },
            "description": "Only events of these types, comma-separated, such as generation.succeeded,generation.failed."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "url": "/v1/events",
                  "data": [
                    {
                      "id": "evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn",
                      "object": "event",
                      "type": "generation.succeeded",
                      "api_version": "2026-10-04",
                      "created_at": "2026-10-04T18:24:12.031Z",
                      "data": {
                        "object": {
                          "id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
                          "object": "generation",
                          "model": "google/veo-3.1-fast",
                          "modality": "video",
                          "status": "succeeded",
                          "provider": "gateway",
                          "revision": "2026-10-02",
                          "input": {
                            "prompt": "A heron lands on a still lake at dawn",
                            "aspect_ratio": "16:9",
                            "n": 1,
                            "duration": 4,
                            "resolution": "1080p",
                            "audio": true
                          },
                          "output": [
                            {
                              "type": "video",
                              "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                              "expires_at": "2026-10-05T18:24:12.004Z",
                              "content_type": "video/mp4",
                              "width": 1920,
                              "height": 1080,
                              "poster": {
                                "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                                "expires_at": "2026-10-05T18:24:12.004Z",
                                "width": 720,
                                "height": 405
                              }
                            }
                          ],
                          "error": null,
                          "failure_cause": null,
                          "usage": {
                            "cost_usd": "0.80"
                          },
                          "source": "api",
                          "batch_id": null,
                          "created_at": "2026-10-04T18:22:41.512Z",
                          "started_at": "2026-10-04T18:22:42.090Z",
                          "completed_at": "2026-10-04T18:24:11.877Z",
                          "slow_at": null,
                          "deadline_at": null,
                          "suggested_recipe": null
                        }
                      }
                    }
                  ],
                  "has_more": true,
                  "next_cursor": "eyJpZCI6ImV2dF85V2MzWWIxRHE3SG0yVng0THI4S3A2VG4ifQ.4Kx9Qm7Lr1Tn5Wc3Yb8Df6Gh0Jk2Mn4Pq6Rs8Tv0XyZ"
                },
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "operationId": "retrieveEvent",
        "summary": "Retrieve an event",
        "description": "One event, with its `data.object` as the API returns it now, so its output links are fresh.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The event's ID, `evt_...`."
            },
            "required": true,
            "description": "The event's ID, `evt_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The event.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn",
                  "object": "event",
                  "type": "generation.succeeded",
                  "api_version": "2026-10-04",
                  "created_at": "2026-10-04T18:24:12.031Z",
                  "data": {
                    "object": {
                      "id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
                      "object": "generation",
                      "model": "google/veo-3.1-fast",
                      "modality": "video",
                      "status": "succeeded",
                      "provider": "gateway",
                      "revision": "2026-10-02",
                      "input": {
                        "prompt": "A heron lands on a still lake at dawn",
                        "aspect_ratio": "16:9",
                        "n": 1,
                        "duration": 4,
                        "resolution": "1080p",
                        "audio": true
                      },
                      "output": [
                        {
                          "type": "video",
                          "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                          "expires_at": "2026-10-05T18:24:12.004Z",
                          "content_type": "video/mp4",
                          "width": 1920,
                          "height": 1080,
                          "poster": {
                            "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                            "expires_at": "2026-10-05T18:24:12.004Z",
                            "width": 720,
                            "height": 405
                          }
                        }
                      ],
                      "error": null,
                      "failure_cause": null,
                      "usage": {
                        "cost_usd": "0.80"
                      },
                      "source": "api",
                      "batch_id": null,
                      "created_at": "2026-10-04T18:22:41.512Z",
                      "started_at": "2026-10-04T18:22:42.090Z",
                      "completed_at": "2026-10-04T18:24:11.877Z",
                      "slow_at": null,
                      "deadline_at": null,
                      "suggested_recipe": null
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That event does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/events/{id}/deliveries": {
      "get": {
        "operationId": "listEventDeliveries",
        "summary": "List an event's deliveries",
        "description": "Where the event went, newest first: one delivery per URL, each with every try, the status your server answered, and when Leap tries again.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The event's ID, `evt_...`."
            },
            "required": true,
            "description": "The event's ID, `evt_...`."
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Maximum number of rows to return: 1 to 100; default 50.",
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Maximum number of rows to return: 1 to 100; default 50."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Send next_cursor as cursor; omit it for the first page.",
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$"
            },
            "description": "Send next_cursor as cursor; omit it for the first page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "url": "/v1/events/evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn/deliveries",
                  "data": [
                    {
                      "id": "whd_2Pk7Wd4Qx9Lm1Tn6Vb3Rc8Hy",
                      "object": "webhook_delivery",
                      "event": "evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn",
                      "endpoint": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "url": "https://example.com/webhooks/leap",
                      "status": "succeeded",
                      "attempts": [
                        {
                          "attempted_at": "2026-10-04T18:24:12.106Z",
                          "succeeded": true,
                          "status_code": 204,
                          "error": null,
                          "duration_ms": 184
                        }
                      ],
                      "next_attempt_at": null,
                      "created_at": "2026-10-04T18:24:12.040Z",
                      "completed_at": "2026-10-04T18:24:12.290Z"
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That event does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/events/{id}/redeliver": {
      "post": {
        "operationId": "redeliverEvent",
        "summary": "Redeliver an event",
        "description": "Sends the event again: to one endpoint with `{\"endpoint\": \"we_...\"}`, or else to every enabled endpoint that subscribes to its type and to the webhook URL its request named. It keeps the event's `webhook-id`, so a receiver that skips duplicates handles it once. A disabled endpoint, or nowhere to send, answers `409`. Tests and redeliveries share a budget of 100 an hour per workspace.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The event's ID, `evt_...`."
            },
            "required": true,
            "description": "The event's ID, `evt_...`."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "default": {},
                "type": "object",
                "properties": {
                  "endpoint": {
                    "description": "Send only to this endpoint. Without it, the event goes to every enabled endpoint that subscribes to its type, and to the webhook URL its request named.",
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The deliveries it queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "url": "/v1/events/evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn/deliveries",
                  "data": [
                    {
                      "id": "whd_8Rb3Hy6Tc1Vn4Lm7Qx2Wd9Pk",
                      "object": "webhook_delivery",
                      "event": "evt_9Wc3Yb1Dq7Hm2Vx4Lr8Kp6Tn",
                      "endpoint": "we_5Tq8Lm2Xv9Kr4Wn7Bc1Yd3Hp",
                      "url": "https://example.com/webhooks/leap",
                      "status": "pending",
                      "attempts": [],
                      "next_attempt_at": "2026-10-04T19:02:00.000Z",
                      "created_at": "2026-10-04T19:02:00.000Z",
                      "completed_at": null
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                },
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That event does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/files": {
      "post": {
        "operationId": "uploadFile",
        "summary": "Upload an image",
        "description": "Stores an image you send as the request body, with no multipart encoding: `curl --data-binary @photo.jpg`. PNG, JPEG or WebP, up to 4 MB; the type is read from the bytes. Pass the returned ID in a model's input. Send videos and sounds through `POST /v1/uploads` instead.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "filename",
            "schema": {
              "description": "A name to keep with the file, such as `portrait.jpg`.",
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "A name to keep with the file, such as `portrait.jpg`."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The image itself.",
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The stored file.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "The new resource's path, such as `/v1/generations/gen_...`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "file_3Kd9Qm2Xr7Lp4Vn8Tc1Wb6Ys",
                  "object": "file",
                  "content_type": "image/jpeg",
                  "bytes": 1843210,
                  "width": 1200,
                  "height": 1600,
                  "duration": null,
                  "filename": "grandma-1962.jpg",
                  "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                  "created_at": "2026-10-04T18:20:03.441Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/files/{id}": {
      "get": {
        "operationId": "retrieveFile",
        "summary": "Retrieve a file",
        "description": "A file's details, with a fresh signed link valid for 24 hours.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The file's ID, `file_...`."
            },
            "required": true,
            "description": "The file's ID, `file_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "file_3Kd9Qm2Xr7Lp4Vn8Tc1Wb6Ys",
                  "object": "file",
                  "content_type": "image/jpeg",
                  "bytes": 1843210,
                  "width": 1200,
                  "height": 1600,
                  "duration": null,
                  "filename": "grandma-1962.jpg",
                  "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                  "created_at": "2026-10-04T18:20:03.441Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That file does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "operationId": "deleteFile",
        "summary": "Delete a file",
        "description": "Deletes a file you uploaded, and its bytes. Runs that already used it keep their results, and their `input` still names the deleted ID. A file that points at a run's result, such as one made from an output to pass to another model, loses only its file ID: the run keeps its result. Answers `409 file_in_use` while a run that hasn't finished takes the file, or while it is someone's saved photo.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The file's ID, `file_...`."
            },
            "required": true,
            "description": "The file's ID, `file_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted file's ID.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "file_3Kd9Qm2Xr7Lp4Vn8Tc1Wb6Ys",
                  "object": "file",
                  "deleted": true
                },
                "schema": {
                  "$ref": "#/components/schemas/DeletedFile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That file does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/FileInUse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Start a video or sound upload",
        "description": "The first of three steps for a video or a sound: this answers with a URL. `PUT` the file's bytes there with exactly `upload_headers` within the hour, then complete the upload. Up to 1 GB of video (MP4, MOV, WebM) or 500 MB of audio (MP3, WAV, M4A), and up to 4 hours long. Needs credit on your balance. A workspace can upload 5 GB a day, with 10 uploads in flight at once.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Files"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Where and how to send the bytes.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "file_8Vb2Nc5Xm1Qz7Lk4Rt9Wd3Ph",
                  "object": "upload",
                  "content_type": "video/mp4",
                  "bytes": 48213992,
                  "filename": "interview.mp4",
                  "upload_url": "https://leap-media.public.blob.vercel-storage.com/media/uploads/file_8Vb2Nc5Xm1Qz7Lk4Rt9Wd3Ph",
                  "upload_method": "PUT",
                  "upload_headers": {
                    "x-api-version": "11",
                    "x-vercel-blob-access": "private",
                    "x-content-type": "video/mp4"
                  },
                  "expires_at": "2026-10-04T19:20:03.441Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "402": {
            "$ref": "#/components/responses/InsufficientCredit"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/uploads/{id}/complete": {
      "post": {
        "operationId": "completeUpload",
        "summary": "Complete an upload",
        "description": "After the `PUT`, makes the upload a file with the same ID, ready to pass in a model's input. Send a JSON body, even an empty one (`{}`). The file's type and length are read from its bytes.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The upload's ID, `file_...`."
            },
            "required": true,
            "description": "The upload's ID, `file_...`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The stored file.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "The new resource's path, such as `/v1/generations/gen_...`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "file_8Vb2Nc5Xm1Qz7Lk4Rt9Wd3Ph",
                  "object": "file",
                  "content_type": "video/mp4",
                  "bytes": 48213992,
                  "width": 1920,
                  "height": 1080,
                  "duration": 312.4,
                  "filename": "interview.mp4",
                  "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                  "created_at": "2026-10-04T18:21:17.902Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That upload has no file yet. Send its bytes to its upload URL first.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/characters": {
      "get": {
        "operationId": "listCharacters",
        "summary": "List characters",
        "description": "Your workspace's characters, newest first, the ones made in the studio included.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Maximum number of rows to return: 1 to 100; default 50.",
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Maximum number of rows to return: 1 to 100; default 50."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "Send next_cursor as cursor; omit it for the first page.",
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$"
            },
            "description": "Send next_cursor as cursor; omit it for the first page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of characters.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "list",
                  "url": "/v1/characters",
                  "data": [
                    {
                      "id": "chr_7Hq2Lm9Xc4Vb1Nz8Rt5Kw3Ys",
                      "object": "character",
                      "beta": true,
                      "name": "Rook",
                      "images": [
                        {
                          "file": "file_5Tn8Xc2Lq7Vm4Hb9Rz1Kw6Pd",
                          "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                          "width": 1024,
                          "height": 1536
                        }
                      ],
                      "created_at": "2026-10-17T14:02:11.204Z",
                      "updated_at": "2026-10-17T14:02:11.204Z"
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                },
                "schema": {
                  "$ref": "#/components/schemas/CharacterList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "post": {
        "operationId": "createCharacter",
        "summary": "Create a character",
        "description": "Keeps a character from 1 to 4 pictures you uploaded (`POST /v1/files`) or made (`POST /v1/generations/{id}/outputs/{index}/file`). Leap reads its look from them once. From then on, pass its `chr_...` ID wherever a model or recipe takes an image file: a list such as `images` gets all its pictures, a single image input its first. Free; a workspace keeps up to 200.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Characters"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CharacterRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The character.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "The new resource's path, such as `/v1/generations/gen_...`."
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "chr_7Hq2Lm9Xc4Vb1Nz8Rt5Kw3Ys",
                  "object": "character",
                  "beta": true,
                  "name": "Rook",
                  "images": [
                    {
                      "file": "file_5Tn8Xc2Lq7Vm4Hb9Rz1Kw6Pd",
                      "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                      "width": 1024,
                      "height": 1536
                    }
                  ],
                  "created_at": "2026-10-17T14:02:11.204Z",
                  "updated_at": "2026-10-17T14:02:11.204Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/Character"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/characters/{id}": {
      "get": {
        "operationId": "retrieveCharacter",
        "summary": "Retrieve a character",
        "description": "One character, with fresh links to its pictures.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The character's ID, `chr_...`."
            },
            "required": true,
            "description": "The character's ID, `chr_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The character.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "chr_7Hq2Lm9Xc4Vb1Nz8Rt5Kw3Ys",
                  "object": "character",
                  "beta": true,
                  "name": "Rook",
                  "images": [
                    {
                      "file": "file_5Tn8Xc2Lq7Vm4Hb9Rz1Kw6Pd",
                      "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                      "width": 1024,
                      "height": 1536
                    }
                  ],
                  "created_at": "2026-10-17T14:02:11.204Z",
                  "updated_at": "2026-10-17T14:02:11.204Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/Character"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That character does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "patch": {
        "operationId": "updateCharacter",
        "summary": "Update a character",
        "description": "Renames a character, or gives it new pictures in place of all the old ones; Leap then reads its look again. Runs that named it stay as they ran.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The character's ID, `chr_...`."
            },
            "required": true,
            "description": "The character's ID, `chr_...`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CharacterUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The character.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "chr_7Hq2Lm9Xc4Vb1Nz8Rt5Kw3Ys",
                  "object": "character",
                  "beta": true,
                  "name": "Rook",
                  "images": [
                    {
                      "file": "file_5Tn8Xc2Lq7Vm4Hb9Rz1Kw6Pd",
                      "url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
                      "width": 1024,
                      "height": 1536
                    }
                  ],
                  "created_at": "2026-10-17T14:02:11.204Z",
                  "updated_at": "2026-10-17T14:02:11.204Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/Character"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameterOrConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That character does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "operationId": "deleteCharacter",
        "summary": "Delete a character",
        "description": "Deletes a character. Its pictures stay as files in your workspace, and runs that named it keep their results.\n\nNeeds an API key with the `generations:write` scope.",
        "tags": [
          "Characters"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "The character's ID, `chr_...`."
            },
            "required": true,
            "description": "The character's ID, `chr_...`."
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted character's ID.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "chr_7Hq2Lm9Xc4Vb1Nz8Rt5Kw3Ys",
                  "object": "character",
                  "beta": true,
                  "deleted": true
                },
                "schema": {
                  "$ref": "#/components/schemas/DeletedCharacter"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "404": {
            "description": "`resource_not_found`",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "resource_not_found": {
                    "value": {
                      "error": {
                        "type": "invalid_request_error",
                        "code": "resource_not_found",
                        "message": "That character does not exist.",
                        "param": null,
                        "doc_url": null,
                        "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "operationId": "retrieveCredits",
        "summary": "Retrieve your balance",
        "description": "What your workspace can spend now, what running generations hold, whether auto top-up will add more when it runs low, its monthly membership if it has one, and whether it got the welcome credit, which workspaces made since 2026-10-14 don't get. Add credits, turn on auto top-up or join a membership at `add_credits_url`; your first top-up has no card fee, and none from $20.\n\nNeeds an API key with the `generations:read` scope.",
        "tags": [
          "Credits"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The balance.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "object": "credits",
                  "available_usd": "4.670000",
                  "held_usd": "0.800000",
                  "welcome": {
                    "status": "none",
                    "amount_usd": "0.000000"
                  },
                  "auto_top_up": {
                    "enabled": true,
                    "threshold_usd": "5.000000",
                    "amount_usd": "20.000000"
                  },
                  "membership": {
                    "plan": "plus",
                    "status": "active",
                    "monthly_price_usd": "20.000000",
                    "monthly_credit_usd": "22.000000",
                    "current_period_end": "2026-11-29T14:02:11.000Z",
                    "cancel_at_period_end": false
                  },
                  "add_credits_url": "https://app.tryleap.ai/go/settings/credits"
                },
                "schema": {
                  "$ref": "#/components/schemas/Credits"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ConflictingCredentials"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationRequired"
          },
          "403": {
            "$ref": "#/components/responses/PermissionDenied"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GenerationRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
            "description": "The model or preset to run, such as `black-forest-labs/flux-2-pro` or `leap/restore-photo@1`. A preset ID without `@N` runs its latest version."
          },
          "input": {
            "default": {},
            "description": "The model's input, as its `input_schema` from `GET /v1/models/{creator}/{name}` describes it. Fields you leave out take their defaults; unknown fields are refused. Files are `file_...` IDs.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "webhook": {
            "description": "An https URL to POST the generation.succeeded, generation.failed or generation.canceled event to when the run ends, signed with your workspace's default secret (GET /v1/webhooks/default/secret).",
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          }
        },
        "required": [
          "model"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "Where Leap POSTs events: an https URL that answers 2xx within 15 seconds."
          },
          "events": {
            "description": "The event types to send. [\"*\"], the default, sends every type, including types added later.",
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "*",
                "generation.succeeded",
                "generation.failed",
                "generation.canceled",
                "batch.completed"
              ]
            }
          },
          "description": {
            "default": null,
            "description": "A note for people, such as which app this is.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointUpdate": {
        "type": "object",
        "properties": {
          "url": {
            "description": "A new https URL for the endpoint.",
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          },
          "events": {
            "description": "The event types to send, replacing the current list. [\"*\"] sends every type.",
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "*",
                "generation.succeeded",
                "generation.failed",
                "generation.canceled",
                "batch.completed"
              ]
            }
          },
          "description": {
            "description": "A new note; null clears it.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled": {
            "description": "true stops deliveries to the endpoint; false starts them again and clears disabled_reason.",
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UploadRequest": {
        "type": "object",
        "properties": {
          "content_type": {
            "type": "string",
            "enum": [
              "video/mp4",
              "video/quicktime",
              "video/webm",
              "audio/mpeg",
              "audio/mp3",
              "audio/wav",
              "audio/x-wav",
              "audio/wave",
              "audio/mp4",
              "audio/x-m4a"
            ],
            "description": "The file's type: MP4, MOV or WebM video; MP3, WAV or M4A audio."
          },
          "bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1073741824,
            "description": "The file's exact size in bytes."
          },
          "filename": {
            "description": "A name to keep with the file, such as `interview.mp4`.",
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "content_type",
          "bytes"
        ],
        "additionalProperties": false
      },
      "CharacterRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "What you call the character, up to 40 characters. Leap never puts it in a picture unless your prompt does."
          },
          "images": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "1 to 4 pictures of the character, by file ID (`file_...`, from POST /v1/files or a run's result). The first one shows it; more angles keep it closer."
          }
        },
        "required": [
          "name",
          "images"
        ],
        "additionalProperties": false
      },
      "CharacterUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "description": "A new name.",
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "images": {
            "description": "New pictures, in place of all the old ones. Leap reads its look again from them.",
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "ModelList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            },
            "description": "Every model and preset at once. The catalog isn't paginated."
          }
        },
        "required": [
          "object",
          "data"
        ],
        "additionalProperties": false
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
            "description": "The ID to run it by: `creator/name` for a model, `leap/name@N` for a preset."
          },
          "object": {
            "type": "string",
            "const": "model"
          },
          "type": {
            "type": "string",
            "enum": [
              "model",
              "preset"
            ],
            "description": "`model` for a raw model, `preset` for a ready-made recipe built on one."
          },
          "name": {
            "type": "string",
            "description": "Its display name."
          },
          "creator": {
            "type": "string",
            "description": "Who made it."
          },
          "modality": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "3d",
              "text"
            ],
            "description": "What it makes: `image`, `video`, `audio`, `3d` or `text`."
          },
          "tasks": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "text-to-image",
                "image-edit",
                "outpaint",
                "upscale-image",
                "remove-background",
                "try-on",
                "text-to-video",
                "image-to-video",
                "video-to-video",
                "upscale-video",
                "lip-sync",
                "talking-avatar",
                "text-to-speech",
                "voice-clone",
                "text-to-music",
                "sound-effects",
                "image-to-3d",
                "text-to-3d",
                "video-to-audio",
                "speech-to-speech",
                "motion-transfer",
                "speech-to-text",
                "captions"
              ]
            },
            "description": "What it does, main task first, such as `text-to-image` or `image-to-video`."
          },
          "description": {
            "type": "string",
            "description": "What it's good at, in a sentence."
          },
          "revision": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "The date of its current schema and price."
          },
          "version": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A preset's version, the `N` in `@N`; null for a model."
          },
          "latest": {
            "type": "boolean",
            "description": "Whether a preset ID without `@N` runs this version. Always true for a model."
          },
          "status": {
            "type": "string",
            "enum": [
              "preview",
              "stable",
              "deprecated",
              "retired"
            ],
            "description": "`preview` (may still change), `stable`, `deprecated` (runs until its sunset) or `retired` (doesn't run)."
          },
          "deprecation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "deprecated_on": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "When it was deprecated."
                  },
                  "sunset": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "The day it stops running."
                  },
                  "replaced_by": {
                    "description": "The model or preset to move to, if any.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "upstream_retired",
                      "superseded",
                      "discontinued"
                    ],
                    "description": "Why it's going away."
                  }
                },
                "required": [
                  "deprecated_on",
                  "sunset",
                  "replaced_by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "When and why it's going away; null unless it's deprecated."
          },
          "added": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "pricing": {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "image",
                  "megapixel",
                  "second",
                  "character",
                  "output",
                  "minute"
                ]
              },
              "usd": {
                "type": "string"
              },
              "overrides": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "when": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": [
                          "string",
                          "number",
                          "boolean"
                        ]
                      }
                    },
                    "usd": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "when",
                    "usd"
                  ],
                  "additionalProperties": false
                }
              },
              "drivers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "adds": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "per": {
                          "type": "string",
                          "const": "input_second"
                        },
                        "of": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "usd": {
                          "type": "string"
                        },
                        "overrides": {
                          "default": [],
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "when": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean"
                                  ]
                                }
                              },
                              "usd": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "when",
                              "usd"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "per",
                        "of",
                        "usd",
                        "overrides"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "per": {
                          "type": "string",
                          "const": "prompt_character"
                        },
                        "over": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "usd": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "per",
                        "over",
                        "usd"
                      ],
                      "additionalProperties": false
                    }
                  ],
                  "type": "object"
                }
              },
              "length_of": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "length_step": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "unit",
              "usd",
              "overrides",
              "drivers"
            ],
            "additionalProperties": false
          },
          "guide": {
            "type": "object",
            "properties": {
              "hook": {
                "type": "string"
              },
              "steps": {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              },
              "next": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 100,
                  "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
                  "description": "The model to call, as creator/name. GET /v1/models lists them."
                }
              },
              "poster": {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "at"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "hook",
              "steps",
              "next"
            ],
            "additionalProperties": false
          },
          "outcome": {
            "description": "For a recipe sold as a finished set at one price: `title`, what you add (`uploads`), what you get (`gets`), how many images one run makes (`count`), and a recipe that makes a cheap first sample from the same upload (`sample`). Absent for the rest.",
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "uploads": {
                "type": "string"
              },
              "gets": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "sample": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
                "description": "The model to call, as creator/name. GET /v1/models lists them."
              }
            },
            "required": [
              "title",
              "uploads",
              "gets",
              "count"
            ],
            "additionalProperties": false
          },
          "cover": {
            "type": "object",
            "properties": {
              "poster": {
                "type": "string",
                "format": "uri"
              },
              "clip": {
                "type": "object",
                "properties": {
                  "mp4": {
                    "type": "string",
                    "format": "uri"
                  },
                  "webm": {
                    "type": "string",
                    "format": "uri"
                  },
                  "captions": {
                    "type": "string",
                    "format": "uri"
                  },
                  "sound": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "mp4"
                ],
                "additionalProperties": false
              },
              "width": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "height": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "alt": {
                "type": "string"
              },
              "peak": {
                "type": "number",
                "minimum": 0
              },
              "input": {
                "type": "object",
                "properties": {
                  "poster": {
                    "type": "string",
                    "format": "uri"
                  },
                  "width": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "height": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "alt": {
                    "type": "string"
                  },
                  "kept": {
                    "type": "string",
                    "const": "product"
                  }
                },
                "required": [
                  "poster",
                  "width",
                  "height",
                  "alt"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "poster",
              "width",
              "height",
              "alt"
            ],
            "additionalProperties": false
          },
          "gallery": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "poster": {
                  "type": "string",
                  "format": "uri"
                },
                "clip": {
                  "type": "object",
                  "properties": {
                    "mp4": {
                      "type": "string",
                      "format": "uri"
                    },
                    "webm": {
                      "type": "string",
                      "format": "uri"
                    },
                    "captions": {
                      "type": "string",
                      "format": "uri"
                    },
                    "sound": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "mp4"
                  ],
                  "additionalProperties": false
                },
                "width": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "height": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "alt": {
                  "type": "string"
                },
                "peak": {
                  "type": "number",
                  "minimum": 0
                },
                "input": {
                  "type": "object",
                  "properties": {
                    "poster": {
                      "type": "string",
                      "format": "uri"
                    },
                    "width": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "height": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "alt": {
                      "type": "string"
                    },
                    "kept": {
                      "type": "string",
                      "const": "product"
                    }
                  },
                  "required": [
                    "poster",
                    "width",
                    "height",
                    "alt"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "poster",
                "width",
                "height",
                "alt"
              ],
              "additionalProperties": false
            }
          },
          "photo": {
            "description": "For an effect: what its photo must show. `framing` is the least of the person it needs, `full` (head to toe), `waist` (waist up) or `face`; `setting` is `outdoor` when it needs sky or open ground around them, `any` otherwise. Check a photo against it with `POST /v1/photo-checks`.",
            "type": "object",
            "properties": {
              "framing": {
                "type": "string",
                "enum": [
                  "full",
                  "waist",
                  "face"
                ]
              },
              "setting": {
                "type": "string",
                "enum": [
                  "outdoor",
                  "any"
                ]
              }
            },
            "required": [
              "framing",
              "setting"
            ],
            "additionalProperties": false
          },
          "still": {
            "description": "For a video recipe that makes a still from the photo first: the frame of the clip it becomes (`first_frame` or `last_frame`, or `images` for a storyboard sheet the clip follows as its first reference image, or `character_image` for the performer a reference clip moves), and whether it shows as the generation's `preview` while the clip renders (never for `images`). Absent for a recipe that makes none.",
            "type": "object",
            "properties": {
              "becomes": {
                "type": "string",
                "enum": [
                  "first_frame",
                  "last_frame",
                  "images",
                  "character_image"
                ]
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "becomes",
              "preview"
            ],
            "additionalProperties": false
          },
          "expected_seconds": {
            "description": "How long Leap's own runs of it took at its defaults, in seconds, from the request to the stored file. A hint for how long to wait, not a promise. Absent until Leap has timed one.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "first_image_free": {
            "description": "`true` for a picture whose first run, at its defaults, is free for a new person in the Leap studio: one image, once per person. A run started with an API key or over MCP is never free. Absent for everything else.",
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "type",
          "name",
          "creator",
          "modality",
          "tasks",
          "description",
          "revision",
          "version",
          "latest",
          "status",
          "deprecation",
          "pricing"
        ],
        "additionalProperties": false,
        "description": "A model or preset you can run, with its price."
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "rate_limit_error",
                  "authentication_error",
                  "permission_error",
                  "conflict_error",
                  "billing_error",
                  "api_error"
                ],
                "description": "The kind of error. Branch on `type` and `code`, never on `message`."
              },
              "code": {
                "type": "string",
                "enum": [
                  "invalid_parameter",
                  "invalid_request",
                  "conflicting_credentials",
                  "placeholder_in_path",
                  "method_not_allowed",
                  "payload_too_large",
                  "unsupported_media_type",
                  "ip_rate_limit_exceeded",
                  "authentication_required",
                  "missing_api_key",
                  "invalid_api_key",
                  "permission_denied",
                  "not_found",
                  "resource_not_found",
                  "gone",
                  "conflict",
                  "file_in_use",
                  "unpaid_failure_cap",
                  "photo_blocked",
                  "sexualized_real_person",
                  "rate_limit_exceeded",
                  "insufficient_credit",
                  "top_up_required",
                  "service_unavailable",
                  "internal_error"
                ],
                "description": "A stable code for this error. Each one is explained at https://www.tryleap.ai/docs/errors."
              },
              "message": {
                "type": "string",
                "description": "What went wrong, written for a person. It can change; don't parse it."
              },
              "param": {
                "description": "For a `400`, the field at fault, such as `input.prompt`; otherwise null.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "doc_url": {
                "description": "A page that explains this error, when there is one.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "request_id": {
                "type": "string",
                "description": "This request's ID, as in the `X-Request-Id` header. Include it when you contact support."
              },
              "moderation_reason": {
                "description": "Only on `photo_blocked`: why the photo check refused the photo, `minor` (someone in it may be under 18) or `nudity`.",
                "type": "string",
                "enum": [
                  "minor",
                  "nudity"
                ]
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "param",
              "doc_url",
              "request_id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ModelWithSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
            "description": "The ID to run it by: `creator/name` for a model, `leap/name@N` for a preset."
          },
          "object": {
            "type": "string",
            "const": "model"
          },
          "type": {
            "type": "string",
            "enum": [
              "model",
              "preset"
            ],
            "description": "`model` for a raw model, `preset` for a ready-made recipe built on one."
          },
          "name": {
            "type": "string",
            "description": "Its display name."
          },
          "creator": {
            "type": "string",
            "description": "Who made it."
          },
          "modality": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "3d",
              "text"
            ],
            "description": "What it makes: `image`, `video`, `audio`, `3d` or `text`."
          },
          "tasks": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "text-to-image",
                "image-edit",
                "outpaint",
                "upscale-image",
                "remove-background",
                "try-on",
                "text-to-video",
                "image-to-video",
                "video-to-video",
                "upscale-video",
                "lip-sync",
                "talking-avatar",
                "text-to-speech",
                "voice-clone",
                "text-to-music",
                "sound-effects",
                "image-to-3d",
                "text-to-3d",
                "video-to-audio",
                "speech-to-speech",
                "motion-transfer",
                "speech-to-text",
                "captions"
              ]
            },
            "description": "What it does, main task first, such as `text-to-image` or `image-to-video`."
          },
          "description": {
            "type": "string",
            "description": "What it's good at, in a sentence."
          },
          "revision": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "The date of its current schema and price."
          },
          "version": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A preset's version, the `N` in `@N`; null for a model."
          },
          "latest": {
            "type": "boolean",
            "description": "Whether a preset ID without `@N` runs this version. Always true for a model."
          },
          "status": {
            "type": "string",
            "enum": [
              "preview",
              "stable",
              "deprecated",
              "retired"
            ],
            "description": "`preview` (may still change), `stable`, `deprecated` (runs until its sunset) or `retired` (doesn't run)."
          },
          "deprecation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "deprecated_on": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "When it was deprecated."
                  },
                  "sunset": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "The day it stops running."
                  },
                  "replaced_by": {
                    "description": "The model or preset to move to, if any.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "upstream_retired",
                      "superseded",
                      "discontinued"
                    ],
                    "description": "Why it's going away."
                  }
                },
                "required": [
                  "deprecated_on",
                  "sunset",
                  "replaced_by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "When and why it's going away; null unless it's deprecated."
          },
          "added": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "pricing": {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "image",
                  "megapixel",
                  "second",
                  "character",
                  "output",
                  "minute"
                ]
              },
              "usd": {
                "type": "string"
              },
              "overrides": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "when": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": [
                          "string",
                          "number",
                          "boolean"
                        ]
                      }
                    },
                    "usd": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "when",
                    "usd"
                  ],
                  "additionalProperties": false
                }
              },
              "drivers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "adds": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "per": {
                          "type": "string",
                          "const": "input_second"
                        },
                        "of": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "usd": {
                          "type": "string"
                        },
                        "overrides": {
                          "default": [],
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "when": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean"
                                  ]
                                }
                              },
                              "usd": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "when",
                              "usd"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "per",
                        "of",
                        "usd",
                        "overrides"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "per": {
                          "type": "string",
                          "const": "prompt_character"
                        },
                        "over": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "usd": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "per",
                        "over",
                        "usd"
                      ],
                      "additionalProperties": false
                    }
                  ],
                  "type": "object"
                }
              },
              "length_of": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "length_step": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "unit",
              "usd",
              "overrides",
              "drivers"
            ],
            "additionalProperties": false
          },
          "guide": {
            "type": "object",
            "properties": {
              "hook": {
                "type": "string"
              },
              "steps": {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              },
              "next": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 100,
                  "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
                  "description": "The model to call, as creator/name. GET /v1/models lists them."
                }
              },
              "poster": {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "at"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "hook",
              "steps",
              "next"
            ],
            "additionalProperties": false
          },
          "outcome": {
            "description": "For a recipe sold as a finished set at one price: `title`, what you add (`uploads`), what you get (`gets`), how many images one run makes (`count`), and a recipe that makes a cheap first sample from the same upload (`sample`). Absent for the rest.",
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "uploads": {
                "type": "string"
              },
              "gets": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "sample": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
                "description": "The model to call, as creator/name. GET /v1/models lists them."
              }
            },
            "required": [
              "title",
              "uploads",
              "gets",
              "count"
            ],
            "additionalProperties": false
          },
          "cover": {
            "type": "object",
            "properties": {
              "poster": {
                "type": "string",
                "format": "uri"
              },
              "clip": {
                "type": "object",
                "properties": {
                  "mp4": {
                    "type": "string",
                    "format": "uri"
                  },
                  "webm": {
                    "type": "string",
                    "format": "uri"
                  },
                  "captions": {
                    "type": "string",
                    "format": "uri"
                  },
                  "sound": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "mp4"
                ],
                "additionalProperties": false
              },
              "width": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "height": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "alt": {
                "type": "string"
              },
              "peak": {
                "type": "number",
                "minimum": 0
              },
              "input": {
                "type": "object",
                "properties": {
                  "poster": {
                    "type": "string",
                    "format": "uri"
                  },
                  "width": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "height": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "alt": {
                    "type": "string"
                  },
                  "kept": {
                    "type": "string",
                    "const": "product"
                  }
                },
                "required": [
                  "poster",
                  "width",
                  "height",
                  "alt"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "poster",
              "width",
              "height",
              "alt"
            ],
            "additionalProperties": false
          },
          "gallery": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "poster": {
                  "type": "string",
                  "format": "uri"
                },
                "clip": {
                  "type": "object",
                  "properties": {
                    "mp4": {
                      "type": "string",
                      "format": "uri"
                    },
                    "webm": {
                      "type": "string",
                      "format": "uri"
                    },
                    "captions": {
                      "type": "string",
                      "format": "uri"
                    },
                    "sound": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "mp4"
                  ],
                  "additionalProperties": false
                },
                "width": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "height": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "alt": {
                  "type": "string"
                },
                "peak": {
                  "type": "number",
                  "minimum": 0
                },
                "input": {
                  "type": "object",
                  "properties": {
                    "poster": {
                      "type": "string",
                      "format": "uri"
                    },
                    "width": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "height": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "alt": {
                      "type": "string"
                    },
                    "kept": {
                      "type": "string",
                      "const": "product"
                    }
                  },
                  "required": [
                    "poster",
                    "width",
                    "height",
                    "alt"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "poster",
                "width",
                "height",
                "alt"
              ],
              "additionalProperties": false
            }
          },
          "photo": {
            "description": "For an effect: what its photo must show. `framing` is the least of the person it needs, `full` (head to toe), `waist` (waist up) or `face`; `setting` is `outdoor` when it needs sky or open ground around them, `any` otherwise. Check a photo against it with `POST /v1/photo-checks`.",
            "type": "object",
            "properties": {
              "framing": {
                "type": "string",
                "enum": [
                  "full",
                  "waist",
                  "face"
                ]
              },
              "setting": {
                "type": "string",
                "enum": [
                  "outdoor",
                  "any"
                ]
              }
            },
            "required": [
              "framing",
              "setting"
            ],
            "additionalProperties": false
          },
          "still": {
            "description": "For a video recipe that makes a still from the photo first: the frame of the clip it becomes (`first_frame` or `last_frame`, or `images` for a storyboard sheet the clip follows as its first reference image, or `character_image` for the performer a reference clip moves), and whether it shows as the generation's `preview` while the clip renders (never for `images`). Absent for a recipe that makes none.",
            "type": "object",
            "properties": {
              "becomes": {
                "type": "string",
                "enum": [
                  "first_frame",
                  "last_frame",
                  "images",
                  "character_image"
                ]
              },
              "preview": {
                "type": "boolean"
              }
            },
            "required": [
              "becomes",
              "preview"
            ],
            "additionalProperties": false
          },
          "expected_seconds": {
            "description": "How long Leap's own runs of it took at its defaults, in seconds, from the request to the stored file. A hint for how long to wait, not a promise. Absent until Leap has timed one.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "first_image_free": {
            "description": "`true` for a picture whose first run, at its defaults, is free for a new person in the Leap studio: one image, once per person. A run started with an API key or over MCP is never free. Absent for everything else.",
            "type": "boolean",
            "const": true
          },
          "input_schema": {
            "type": "object",
            "additionalProperties": true,
            "description": "A JSON Schema (2020-12) of the `input` it takes: required fields, types, allowed values and defaults. Unknown fields are refused, and a field that takes a file has the pattern `^file_[0-9A-Za-z]{24}$`."
          }
        },
        "required": [
          "id",
          "object",
          "type",
          "name",
          "creator",
          "modality",
          "tasks",
          "description",
          "revision",
          "version",
          "latest",
          "status",
          "deprecation",
          "pricing",
          "input_schema"
        ],
        "additionalProperties": false,
        "description": "A model or preset with the JSON Schema of its input."
      },
      "Quote": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "quote"
          },
          "model": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
            "description": "The model or preset priced, with a preset's version."
          },
          "revision": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "The model's schema and price revision the price comes from."
          },
          "input": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                },
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": [
                      "string",
                      "number",
                      "boolean"
                    ]
                  }
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "description": "The input as it would run, checked and with its defaults filled in."
          },
          "cost_usd": {
            "type": "string",
            "description": "What the run would cost, as an exact decimal string in US dollars."
          },
          "hold_usd": {
            "type": "string",
            "description": "What the run holds from your balance until it ends. For a model billed by the length of your video or sound, the price of that length plus a second, or of the longest file the model takes when the length can't be read; you're charged only the run's price."
          }
        },
        "required": [
          "object",
          "model",
          "revision",
          "input",
          "cost_usd",
          "hold_usd"
        ],
        "additionalProperties": false,
        "description": "What a run would cost, without running it or holding credit."
      },
      "GenerationList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "description": "The list object discriminator."
          },
          "url": {
            "type": "string",
            "description": "The list's resource path, such as /v1/records."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Generation"
            },
            "description": "Resource objects in this page, in the requested order."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is available using next_cursor."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$",
                "description": "Opaque next_cursor from the previous page. It works only for the list and filters it came from."
              },
              {
                "type": "null"
              }
            ],
            "description": "Send as cursor to read the next page; null on the last page."
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "Forward list envelope. Live lists are not snapshots; totals are not promised."
      },
      "Generation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The generation's ID, `gen_` and 24 letters and digits."
          },
          "object": {
            "type": "string",
            "const": "generation"
          },
          "model": {
            "type": "string",
            "description": "The model or preset it runs, with a preset's version."
          },
          "modality": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "3d",
              "text"
            ],
            "description": "What it makes: `image`, `video`, `audio`, `3d` or `text`."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "canceled"
            ],
            "description": "`queued`, then `running`, then one of `succeeded`, `failed` or `canceled`. Only `succeeded` is charged."
          },
          "provider": {
            "description": "Which upstream ran it, once one did. Informational: the model ID and input stay the same whichever runs it.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "The model's schema and price revision the run used."
          },
          "input": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                },
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": [
                      "string",
                      "number",
                      "boolean"
                    ]
                  }
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "description": "The input as it runs, with the defaults filled in."
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "image",
                    "video",
                    "audio",
                    "3d",
                    "text"
                  ],
                  "description": "What the file is: `image`, `video`, `audio`, `3d` or `text`."
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "description": "A signed link to the file. Download what you keep: links expire after 24 hours, and reading the generation again signs fresh ones."
                },
                "expires_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
                  "description": "When `url` stops working, 24 hours after it was signed."
                },
                "content_type": {
                  "type": "string",
                  "description": "The file's media type, such as `image/jpeg` or `video/mp4`."
                },
                "width": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Width in pixels; null for a sound."
                },
                "height": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Height in pixels; null for a sound."
                },
                "poster": {
                  "description": "For a video: a JPEG of a frame from its middle, about 720 pixels on the long side. Absent when none was made.",
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "A signed link to the poster, which expires with the video's link."
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    "width": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "height": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "url",
                    "expires_at",
                    "width",
                    "height"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "type",
                "url",
                "expires_at",
                "content_type",
                "width",
                "height"
              ],
              "additionalProperties": false
            }
          },
          "preview": {
            "description": "While a preset that makes a still first is running: that still, once it exists, before the video it becomes. Absent for every other run, and for a run whose video also reads words or a photo you sent, such as a line to say or a photo the clip starts from: that still comes with the video. Also absent for the rest of a UTC day once 10 of the workspace's runs that showed one failed for their input.",
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "A signed link to a smaller JPEG of the still, about 960 pixels on the long side. It works for 10 minutes; read the run again for a fresh one. The still itself comes with the finished run's output."
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "width": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "height": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "url",
              "expires_at",
              "width",
              "height"
            ],
            "additionalProperties": false
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Why a `failed` run failed, such as a refused prompt or a provider error; null otherwise. A failed run isn't charged."
          },
          "failure_cause": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "provider_error",
                  "provider_refused",
                  "photo_blocked",
                  "timeout",
                  "outage",
                  "input_removed",
                  "input_rejected"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What made a `failed` run fail, for a program to branch on: `provider_error`, `provider_refused` (the model's safety filter said no), `photo_blocked` (the photo check refused the photo), `timeout`, `outage` (the provider had a declared incident or could not serve Leap), `input_removed` (an input file was gone) or `input_rejected` (the provider couldn't use an input file: too small, an unreadable format, or no face). Null for any other run, and for a failure from before causes were recorded."
          },
          "usage": {
            "type": "object",
            "properties": {
              "cost_usd": {
                "description": "What the run cost, as an exact decimal string in US dollars; null until it's charged.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "cost_usd"
            ],
            "additionalProperties": false,
            "description": "What the run cost your workspace."
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "studio",
                  "api",
                  "mcp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Where it was started: `api`, `mcp` or `studio`."
          },
          "batch_id": {
            "description": "The batch it belongs to, `bat_...`; null if none.",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created."
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it started running; null while queued."
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it reached a final status; null before."
          },
          "slow_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "While a preset runs: when it counts as slow, one and a half times what Leap's runs of it take after `started_at`, scaled to this run's length, resolution and count. From then on a cancel works whatever the run has done, even once its `preview` shows. Null for any other run."
          },
          "deadline_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "While a preset runs: when Leap stops it if it hasn't finished, three times what Leap's runs of it take after `started_at`, scaled to this run's length, resolution and count, between 5 minutes (2 for a picture) and 12. It then fails with the `failure_cause` `timeout` and costs nothing. Null for any other run."
          },
          "suggested_recipe": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[a-z0-9][a-z0-9-]*\\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$",
                    "description": "The recipe, with its version, such as `leap/virtual-try-on@1`."
                  },
                  "name": {
                    "type": "string",
                    "description": "The recipe's name: `Virtual try-on`."
                  },
                  "tuned_for": {
                    "type": "string",
                    "description": "What it is tuned for, in a few words: `outfits`."
                  },
                  "input": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        },
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": [
                              "string",
                              "number",
                              "boolean"
                            ]
                          }
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    },
                    "description": "The recipe's input from this run: its files in the recipe's slots, and the words it could fill. Send it to `POST /v1/generations` with `model` as it is, or add what the recipe still needs; `GET /v1/models/{creator}/{name}` has its schema."
                  },
                  "cost_usd": {
                    "description": "What a run of it with `input` costs, as an exact decimal string in US dollars; null for a recipe priced on the length of your video or sound, which `POST /v1/quotes` prices.",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "model",
                  "name",
                  "tuned_for",
                  "input",
                  "cost_usd"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "For a run of a model, not a recipe: the recipe made for what its words and files ask, when they clearly ask for one, such as two photos and \"put the outfit from photo 2 on photo 1\" on an image model (Virtual try-on), or a character sheet from a picture (Consistent character). Read from the words and files alone, so the same request always gets the same answer. Null when nothing matches clearly."
          }
        },
        "required": [
          "id",
          "object",
          "model",
          "modality",
          "status",
          "provider",
          "revision",
          "input",
          "output",
          "error",
          "failure_cause",
          "usage",
          "source",
          "batch_id",
          "created_at",
          "started_at",
          "completed_at",
          "slow_at",
          "deadline_at",
          "suggested_recipe"
        ],
        "additionalProperties": false,
        "description": "One run of a model or preset, with its status, its outputs and what it cost."
      },
      "File": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The file's ID, `file_...`. Pass it in a model's input."
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "content_type": {
            "type": "string",
            "description": "The type, read from the file's bytes, such as `image/jpeg` or `video/mp4`."
          },
          "bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "The size in bytes."
          },
          "width": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Width in pixels; null for a sound."
          },
          "height": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Height in pixels; null for a sound."
          },
          "duration": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "A video's or a sound's length in seconds; null for an image."
          },
          "filename": {
            "description": "The name you gave, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "A signed link to the file, valid for 24 hours. Read the file again for a fresh one."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was stored."
          }
        },
        "required": [
          "id",
          "object",
          "content_type",
          "bytes",
          "width",
          "height",
          "duration",
          "filename",
          "url",
          "created_at"
        ],
        "additionalProperties": false,
        "description": "A photo, video or sound stored in your workspace, to pass as a model input."
      },
      "Batch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The batch's ID, `bat_...`."
          },
          "object": {
            "type": "string",
            "const": "batch"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Generation"
            },
            "description": "Its generations, in the order you sent them."
          }
        },
        "required": [
          "id",
          "object",
          "data"
        ],
        "additionalProperties": false,
        "description": "Up to 50 generations priced and held together, each run on its own."
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "description": "The list object discriminator."
          },
          "url": {
            "type": "string",
            "description": "The list's resource path, such as /v1/records."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            },
            "description": "Resource objects in this page, in the requested order."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is available using next_cursor."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$",
                "description": "Opaque next_cursor from the previous page. It works only for the list and filters it came from."
              },
              {
                "type": "null"
              }
            ],
            "description": "Send as cursor to read the next page; null on the last page."
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "Forward list envelope. Live lists are not snapshots; totals are not promised."
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's ID, `we_...`."
          },
          "object": {
            "type": "string",
            "const": "webhook_endpoint"
          },
          "url": {
            "type": "string",
            "description": "Where Leap POSTs events."
          },
          "description": {
            "description": "Your note, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The event types it gets; [\"*\"] for every type, including types added later."
          },
          "disabled": {
            "type": "boolean",
            "description": "Whether deliveries to it are stopped."
          },
          "disabled_reason": {
            "description": "Why Leap disabled the endpoint, such as every delivery failing for 72 hours; null when it is on or you turned it off.",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed."
          }
        },
        "required": [
          "id",
          "object",
          "url",
          "description",
          "events",
          "disabled",
          "disabled_reason",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "A URL your workspace's events are POSTed to."
      },
      "WebhookEndpointWithSecret": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's ID, `we_...`."
          },
          "object": {
            "type": "string",
            "const": "webhook_endpoint"
          },
          "url": {
            "type": "string",
            "description": "Where Leap POSTs events."
          },
          "description": {
            "description": "Your note, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The event types it gets; [\"*\"] for every type, including types added later."
          },
          "disabled": {
            "type": "boolean",
            "description": "Whether deliveries to it are stopped."
          },
          "disabled_reason": {
            "description": "Why Leap disabled the endpoint, such as every delivery failing for 72 hours; null when it is on or you turned it off.",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it last changed."
          },
          "secret": {
            "type": "string",
            "description": "The signing secret, whsec_ and base64. Shown only here: keep it in your server's environment."
          }
        },
        "required": [
          "id",
          "object",
          "url",
          "description",
          "events",
          "disabled",
          "disabled_reason",
          "created_at",
          "updated_at",
          "secret"
        ],
        "additionalProperties": false,
        "description": "An endpoint with its signing secret, as create and rotate_secret return it."
      },
      "DeletedWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The removed endpoint's ID."
          },
          "object": {
            "type": "string",
            "const": "webhook_endpoint"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery's ID, `whd_...`."
          },
          "object": {
            "type": "string",
            "const": "webhook_delivery"
          },
          "event": {
            "type": "string",
            "description": "The event it carries, `evt_...`."
          },
          "endpoint": {
            "description": "The endpoint, or null for the webhook URL a request named.",
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "description": "Where it goes."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ],
            "description": "`pending` while tries remain, `succeeded` once your server answered 2xx, `failed` after the last try."
          },
          "attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attempted_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "succeeded": {
                  "type": "boolean"
                },
                "status_code": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Your server's HTTP status; null when it never answered."
                },
                "error": {
                  "description": "Why the try failed, when your server did not answer 2xx, such as a timeout.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "How long the try took."
                }
              },
              "required": [
                "attempted_at",
                "succeeded",
                "status_code",
                "error",
                "duration_ms"
              ],
              "additionalProperties": false
            },
            "description": "Every try so far, oldest first."
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When Leap tries again; null once it succeeded or gave up."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was queued."
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it succeeded or Leap gave up; null while tries remain."
          }
        },
        "required": [
          "id",
          "object",
          "event",
          "endpoint",
          "url",
          "status",
          "attempts",
          "next_attempt_at",
          "created_at",
          "completed_at"
        ],
        "additionalProperties": false,
        "description": "One event on its way to one URL, with every try so far."
      },
      "WebhookSecret": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "webhook_secret"
          },
          "secret": {
            "type": "string",
            "description": "The signing secret, whsec_ and base64. Keep it in your server's environment."
          }
        },
        "required": [
          "object",
          "secret"
        ],
        "additionalProperties": false,
        "description": "The secret that signs events sent to the webhook URL a request names."
      },
      "EventList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "description": "The list object discriminator."
          },
          "url": {
            "type": "string",
            "description": "The list's resource path, such as /v1/records."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "description": "Resource objects in this page, in the requested order."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is available using next_cursor."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$",
                "description": "Opaque next_cursor from the previous page. It works only for the list and filters it came from."
              },
              {
                "type": "null"
              }
            ],
            "description": "Send as cursor to read the next page; null on the last page."
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "Forward list envelope. Live lists are not snapshots; totals are not promised."
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's ID, `evt_...`, also sent as the `webhook-id` header. Skip any you've handled."
          },
          "object": {
            "type": "string",
            "const": "event"
          },
          "type": {
            "type": "string",
            "enum": [
              "generation.succeeded",
              "generation.failed",
              "generation.canceled",
              "batch.completed",
              "webhook.test"
            ],
            "description": "What happened."
          },
          "api_version": {
            "type": "string",
            "description": "The version of this payload's shape."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it happened."
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Generation"
                  },
                  {
                    "$ref": "#/components/schemas/Batch"
                  },
                  {
                    "$ref": "#/components/schemas/WebhookEndpoint"
                  }
                ],
                "description": "What it happened to, as the API returns it when the event is sent: a generation, a batch for `batch.completed`, or the endpoint for `webhook.test`."
              }
            },
            "required": [
              "object"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "object",
          "type",
          "api_version",
          "created_at",
          "data"
        ],
        "additionalProperties": false,
        "description": "Something that happened in your workspace, kept 30 days."
      },
      "WebhookDeliveryList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "description": "The list object discriminator."
          },
          "url": {
            "type": "string",
            "description": "The list's resource path, such as /v1/records."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "description": "Resource objects in this page, in the requested order."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is available using next_cursor."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$",
                "description": "Opaque next_cursor from the previous page. It works only for the list and filters it came from."
              },
              {
                "type": "null"
              }
            ],
            "description": "Send as cursor to read the next page; null on the last page."
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "Forward list envelope. Live lists are not snapshots; totals are not promised."
      },
      "DeletedFile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The deleted file's ID."
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ],
        "additionalProperties": false
      },
      "Upload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The upload's ID, `file_...`. Completing it makes a file with the same ID."
          },
          "object": {
            "type": "string",
            "const": "upload"
          },
          "content_type": {
            "type": "string",
            "description": "The type you declared."
          },
          "bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "The size you declared, in bytes."
          },
          "filename": {
            "description": "The name you gave, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "upload_url": {
            "type": "string",
            "description": "Where to send the file's bytes."
          },
          "upload_method": {
            "type": "string",
            "const": "PUT",
            "description": "The method to send them with."
          },
          "upload_headers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Headers to send with the bytes, exactly as given."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When `upload_url` stops working, an hour after it was made."
          }
        },
        "required": [
          "id",
          "object",
          "content_type",
          "bytes",
          "filename",
          "upload_url",
          "upload_method",
          "upload_headers",
          "expires_at"
        ],
        "additionalProperties": false,
        "description": "Where to send a video's or a sound's bytes before you complete the upload."
      },
      "CharacterList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "description": "The list object discriminator."
          },
          "url": {
            "type": "string",
            "description": "The list's resource path, such as /v1/records."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Character"
            },
            "description": "Resource objects in this page, in the requested order."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is available using next_cursor."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{43}$",
                "description": "Opaque next_cursor from the previous page. It works only for the list and filters it came from."
              },
              {
                "type": "null"
              }
            ],
            "description": "Send as cursor to read the next page; null on the last page."
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false,
        "description": "Forward list envelope. Live lists are not snapshots; totals are not promised."
      },
      "Character": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The character's ID, `chr_...`. Pass it wherever a model or recipe takes an image file."
          },
          "object": {
            "type": "string",
            "const": "character"
          },
          "beta": {
            "type": "boolean",
            "const": true,
            "description": "This endpoint is in beta: its shape can change, or it can go away, without the 180-day notice stable endpoints get."
          },
          "name": {
            "type": "string",
            "description": "The character's name."
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "file": {
                  "type": "string",
                  "description": "The picture's file, `file_...`."
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "description": "A signed link to the picture, valid for 24 hours. Read the character again for a fresh one."
                },
                "width": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "height": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "file",
                "url",
                "width",
                "height"
              ],
              "additionalProperties": false
            },
            "description": "Its pictures, first picture first."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When it was made."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
            "description": "When its name or pictures last changed."
          }
        },
        "required": [
          "id",
          "object",
          "beta",
          "name",
          "images",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "A character your workspace keeps. Put its ID in a run's input in place of an image file, and the run gets its pictures and a description of its look, so it comes out the same every time."
      },
      "DeletedCharacter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The deleted character's ID."
          },
          "object": {
            "type": "string",
            "const": "character"
          },
          "beta": {
            "type": "boolean",
            "const": true,
            "description": "This endpoint is in beta: its shape can change, or it can go away, without the 180-day notice stable endpoints get."
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "beta",
          "deleted"
        ],
        "additionalProperties": false
      },
      "Credits": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "credits"
          },
          "available_usd": {
            "type": "string",
            "description": "What you can spend now: your balance minus what running generations hold, as an exact decimal string in US dollars."
          },
          "held_usd": {
            "type": "string",
            "description": "What generations still running hold."
          },
          "welcome": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "granted",
                  "withheld",
                  "none"
                ],
                "description": "`granted` when your workspace got the welcome credit; `withheld` when it was due one but its sign-up went past the limits that stop sign-up farms, so none will come; `none` when it isn't a workspace that gets one. Workspaces made since 2026-10-14 get no welcome credit and read `none`."
              },
              "amount_usd": {
                "type": "string",
                "description": "How much was granted, as an exact decimal string in US dollars; `0.000000` unless `granted`."
              }
            },
            "required": [
              "status",
              "amount_usd"
            ],
            "additionalProperties": false,
            "description": "The one-time welcome credit that workspaces made before 2026-10-14 could get."
          },
          "auto_top_up": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "Whether auto top-up is on: when the balance falls below `threshold_usd`, it adds `amount_usd` from the card your last top-up saved."
              },
              "threshold_usd": {
                "description": "The balance it tops up below, as an exact decimal string in US dollars; null until it is set.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "amount_usd": {
                "description": "What each automatic top-up adds, as an exact decimal string in US dollars; null until it is set. From $20 there is no card fee.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "enabled",
              "threshold_usd",
              "amount_usd"
            ],
            "additionalProperties": false,
            "description": "Auto top-up, which keeps your keys running when the balance runs low. Turn it on at `add_credits_url`."
          },
          "membership": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "plan": {
                    "type": "string",
                    "enum": [
                      "plus",
                      "pro"
                    ],
                    "description": "`plus` or `pro`."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "incomplete",
                      "active",
                      "past_due"
                    ],
                    "description": "`active` when this month is paid; `past_due` when a renewal failed and the card is being tried again; `incomplete` when the first payment hasn't gone through."
                  },
                  "monthly_price_usd": {
                    "type": "string",
                    "description": "What it charges each month, as an exact decimal string in US dollars."
                  },
                  "monthly_credit_usd": {
                    "type": "string",
                    "description": "The credit each paid month adds to the balance, as an exact decimal string in US dollars. It works on any model or recipe, and what is left over stays."
                  },
                  "current_period_end": {
                    "type": "string",
                    "description": "When it renews, or ends when `cancel_at_period_end` is true, as an ISO 8601 timestamp."
                  },
                  "cancel_at_period_end": {
                    "type": "boolean",
                    "description": "True once it was cancelled: it ends at `current_period_end`, and the credit stays."
                  }
                },
                "required": [
                  "plan",
                  "status",
                  "monthly_price_usd",
                  "monthly_credit_usd",
                  "current_period_end",
                  "cancel_at_period_end"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Your workspace's monthly membership, or null when it has none. Join or cancel at `add_credits_url`."
          },
          "add_credits_url": {
            "type": "string",
            "description": "Where a person adds credit and turns on auto top-up, in the studio."
          }
        },
        "required": [
          "object",
          "available_usd",
          "held_usd",
          "welcome",
          "auto_top_up",
          "membership",
          "add_credits_url"
        ],
        "additionalProperties": false,
        "description": "Your workspace's balance."
      }
    },
    "headers": {
      "X-Request-Id": {
        "required": true,
        "description": "This request's ID. Include it when you contact support; it's also `request_id` in an error.",
        "schema": {
          "type": "string",
          "description": "This request's ID. Include it when you contact support; it's also `request_id` in an error.",
          "example": "req_01J9Z8Q4N2K7T5V3X6Y8B0C1D2"
        }
      },
      "RateLimit-Limit": {
        "required": true,
        "description": "Requests allowed per window from your client.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "Requests allowed per window from your client.",
          "example": 300
        }
      },
      "RateLimit-Remaining": {
        "required": true,
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "Requests left in the current window.",
          "example": 299
        }
      },
      "RateLimit-Reset": {
        "required": true,
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "Seconds until the window resets.",
          "example": 42
        }
      },
      "Retry-After": {
        "required": true,
        "description": "Seconds to wait before you retry.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "Seconds to wait before you retry.",
          "example": 42
        }
      }
    },
    "responses": {
      "ConflictingCredentials": {
        "description": "`conflicting_credentials`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "conflicting_credentials": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "conflicting_credentials",
                    "message": "Send one API key.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "AuthenticationRequired": {
        "description": "`authentication_required`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "authentication_required": {
                "value": {
                  "error": {
                    "type": "authentication_error",
                    "code": "authentication_required",
                    "message": "Authentication is required.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "PermissionDenied": {
        "description": "`permission_denied`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "permission_denied": {
                "value": {
                  "error": {
                    "type": "permission_error",
                    "code": "permission_denied",
                    "message": "Permission denied.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "RateLimitExceeded": {
        "description": "`rate_limit_exceeded`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "rate_limit_exceeded": {
                "value": {
                  "error": {
                    "type": "rate_limit_error",
                    "code": "rate_limit_exceeded",
                    "message": "Too Many Requests",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "ResourceNotFound": {
        "description": "`resource_not_found`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "resource_not_found": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "resource_not_found",
                    "message": "That resource does not exist.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "Gone": {
        "description": "`gone`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "gone": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "gone",
                    "message": "That resource was retired.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "InvalidParameterOrConflictingCredentials": {
        "description": "`invalid_parameter`, `conflicting_credentials`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "invalid_parameter": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "invalid_parameter",
                    "message": "Invalid request parameters.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              },
              "conflicting_credentials": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "conflicting_credentials",
                    "message": "Send one API key.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "`service_unavailable`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "service_unavailable": {
                "value": {
                  "error": {
                    "type": "api_error",
                    "code": "service_unavailable",
                    "message": "Service unavailable.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "InsufficientCreditOrTopUpRequired": {
        "description": "`insufficient_credit`, `top_up_required`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "insufficient_credit": {
                "value": {
                  "error": {
                    "type": "billing_error",
                    "code": "insufficient_credit",
                    "message": "Not enough credit. Add credits to keep generating.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              },
              "top_up_required": {
                "value": {
                  "error": {
                    "type": "billing_error",
                    "code": "top_up_required",
                    "message": "API keys run on paid credit, so this workspace's keys can start runs once it has topped up. Add $5 at https://app.tryleap.ai/go/api: the first top-up has no card fee, and your keys work as soon as it goes through.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "ConflictOrUnpaidFailureCap": {
        "description": "`conflict`, `unpaid_failure_cap`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "conflict": {
                "value": {
                  "error": {
                    "type": "conflict_error",
                    "code": "conflict",
                    "message": "The request conflicts with the current state.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              },
              "unpaid_failure_cap": {
                "value": {
                  "error": {
                    "type": "conflict_error",
                    "code": "unpaid_failure_cap",
                    "message": "6 video runs have ended without a charge, so video runs wait for your first top-up. Images still run.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "PhotoBlockedOrSexualizedRealPerson": {
        "description": "`photo_blocked`, `sexualized_real_person`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "photo_blocked": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "photo_blocked",
                    "message": "We can't use this photo. Leap only works with photos of adults, and this one may show someone under 18. Nothing ran and nothing was charged.",
                    "param": "input.photo",
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD",
                    "moderation_reason": "minor"
                  }
                }
              },
              "sexualized_real_person": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "sexualized_real_person",
                    "message": "Leap doesn't make sexual edits or videos of real people from their photos. Nothing ran and nothing was charged.",
                    "param": "input.prompt",
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "`conflict`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "conflict": {
                "value": {
                  "error": {
                    "type": "conflict_error",
                    "code": "conflict",
                    "message": "The request conflicts with the current state.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "`payload_too_large`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "payload_too_large": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "code": "payload_too_large",
                    "message": "Request payload is too large.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "FileInUse": {
        "description": "`file_in_use`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "file_in_use": {
                "value": {
                  "error": {
                    "type": "conflict_error",
                    "code": "file_in_use",
                    "message": "A generation that is still running uses this file. Delete it once the run ends.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      },
      "InsufficientCredit": {
        "description": "`insufficient_credit`",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimit-Limit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimit-Remaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "insufficient_credit": {
                "value": {
                  "error": {
                    "type": "billing_error",
                    "code": "insufficient_credit",
                    "message": "Not enough credit. Add credits to keep generating.",
                    "param": null,
                    "doc_url": null,
                    "request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
                  }
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your workspace API key, `leap_...`. Create one at https://app.tryleap.ai/go/api, and keep it on your server."
      },
      "Bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same API key as `Authorization: Bearer leap_...`, the way most HTTP clients and coding agents send one. Send one header or the other; two different keys are a `400`."
      }
    }
  }
}
