{
  "openapi": "3.1.0",
  "info": {
    "title": "Nokai API",
    "version": "v1",
    "description": "A unified API for AI media generation — drive image, video, and audio models through one async create-task / poll-result surface, with credits, file uploads, signed webhooks, and per-key rate limits. Submit a generation, poll `recordInfo` (or receive a webhook), then fetch the result URLs.",
    "contact": {
      "name": "nokai",
      "url": "https://nokai.studio"
    }
  },
  "servers": [
    {
      "url": "https://nokai.studio",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Generation",
      "description": "Create async image / video / audio generations and poll their result. The core of the API."
    },
    {
      "name": "Files",
      "description": "Upload reference media (URL / base64 / multipart) and re-sign download URLs."
    },
    {
      "name": "Credits",
      "description": "Read your credit balance and top up via Stripe Checkout. 1 credit ≈ $0.005."
    },
    {
      "name": "Account",
      "description": "Current user, customer, plan, and profile preferences."
    },
    {
      "name": "API Keys",
      "description": "Issue / revoke / list keys. The secret is shown exactly once."
    },
    {
      "name": "Rate limits",
      "description": "Read-only headroom peek (no consumption)."
    },
    {
      "name": "Webhooks",
      "description": "Subscribe to generation + credit events — endpoint config + signed delivery log."
    },
    {
      "name": "Support",
      "description": "Support tickets (dashboard-only auth)."
    },
    {
      "name": "Studio",
      "description": "Build videos programmatically: projects → scenes → shots (+ a character / asset library). The web Studio and this API share one surface; the full action set is also an MCP server."
    },
    {
      "name": "Status",
      "description": "Operational probes (no auth)."
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "agw_<token>",
        "description": "Issue from the dashboard (`/api-keys` → New). Full secret is shown once. Send as `Authorization: Bearer agw_…`."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "msg": {
            "type": "string"
          },
          "data": {
            "type": "null"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "msg",
          "data"
        ]
      },
      "CreateTaskBody": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1
          },
          "callBackUrl": {
            "type": "string",
            "format": "uri"
          },
          "input": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32000
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "mp4",
                  "mov"
                ]
              },
              "aspect_ratio": {
                "type": "string",
                "maxLength": 32
              },
              "duration_seconds": {
                "type": "number",
                "minimum": 0,
                "maximum": 3600
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "videos": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "reference_audio_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "reference_image_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "reference_video_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "route": {
                "type": "string",
                "enum": [
                  "t2v",
                  "i2v",
                  "first_last",
                  "omni_reference",
                  "video_edit",
                  "video_extend"
                ]
              },
              "mux_reference_audio": {
                "type": "boolean"
              },
              "resolution": {
                "type": "string",
                "minLength": 1,
                "maxLength": 12
              },
              "reference_has_person": {
                "type": "boolean"
              },
              "guide": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "hybrid",
                      "depth",
                      "skeleton",
                      "auto"
                    ]
                  },
                  "vocals": {
                    "type": "boolean"
                  },
                  "people": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4
                  },
                  "required": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "required": [
          "model",
          "input"
        ]
      },
      "CreateTaskEnvelope": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "msg": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "taskId": {
                "type": "string"
              },
              "priceUsd": {
                "type": "number",
                "minimum": 0
              },
              "estimatedWaitSeconds": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "taskId"
            ]
          }
        },
        "required": [
          "code",
          "msg",
          "data"
        ]
      },
      "RecordInfoData": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "queuing",
              "generating",
              "success",
              "fail"
            ]
          },
          "param": {
            "type": "string"
          },
          "resultJson": {
            "type": "string"
          },
          "sourceTaskIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "thumbUrl": {
            "type": "string"
          },
          "failCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "failMsg": {
            "type": [
              "string",
              "null"
            ]
          },
          "failReason": {
            "type": "string",
            "enum": [
              "content_blocked_prompt",
              "content_blocked_reference",
              "content_blocked",
              "input_invalid",
              "provider_busy",
              "provider_outage",
              "timeout",
              "insufficient_balance",
              "cancelled",
              "internal"
            ]
          },
          "failDetail": {
            "type": "object",
            "properties": {
              "subject": {
                "type": "string",
                "enum": [
                  "prompt",
                  "reference",
                  "output"
                ]
              },
              "referenceKind": {
                "type": "string",
                "enum": [
                  "image",
                  "video",
                  "audio"
                ]
              },
              "cause": {
                "type": "string",
                "enum": [
                  "real_person",
                  "copyright",
                  "explicit",
                  "policy"
                ]
              },
              "field": {
                "type": "string",
                "enum": [
                  "duration_too_short",
                  "duration_too_long",
                  "duration_out_of_range",
                  "file_unreachable",
                  "file_unsupported",
                  "too_many_references",
                  "resolution",
                  "parameters"
                ]
              },
              "minSeconds": {
                "type": "number"
              },
              "maxSeconds": {
                "type": "number"
              }
            }
          },
          "failRetryable": {
            "type": "boolean"
          },
          "refunded": {
            "type": "boolean"
          },
          "costTime": {
            "type": "integer"
          },
          "completeTime": {
            "type": [
              "integer",
              "null"
            ]
          },
          "createTime": {
            "type": "integer"
          },
          "updateTime": {
            "type": "integer"
          },
          "progress": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "creditsConsumed": {
            "type": "integer"
          },
          "chargedUsdMicro": {
            "type": "integer",
            "minimum": 0
          },
          "priceUsdMicro": {
            "type": "integer"
          },
          "priceUsd": {
            "type": "number",
            "minimum": 0
          },
          "charged": {
            "type": "boolean"
          },
          "attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                },
                "attempt": {
                  "type": "integer"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "success",
                    "fail",
                    "refused"
                  ]
                },
                "failCode": {
                  "type": "string"
                }
              },
              "required": [
                "model",
                "attempt",
                "state"
              ]
            }
          },
          "stage": {
            "type": "string",
            "enum": [
              "guiding",
              "generating"
            ]
          },
          "guide": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "ready",
                  "skipped"
                ]
              },
              "mode": {
                "type": "string",
                "enum": [
                  "hybrid",
                  "depth",
                  "skeleton",
                  "auto"
                ]
              },
              "sourceUrl": {
                "type": "string"
              },
              "sourceSha256": {
                "type": "string"
              },
              "fileUrl": {
                "type": "string"
              },
              "vocalsUrl": {
                "type": "string"
              },
              "info": {
                "type": "object",
                "additionalProperties": {}
              },
              "skipped": {
                "type": "string",
                "enum": [
                  "no_people",
                  "leak",
                  "bad_source",
                  "failed",
                  "timeout",
                  "unavailable"
                ]
              },
              "taskId": {
                "type": "string"
              },
              "cached": {
                "type": "boolean"
              },
              "priceUsdMicro": {
                "type": "integer",
                "minimum": 0
              },
              "chargedUsdMicro": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "status",
              "mode",
              "sourceUrl"
            ]
          },
          "recast": {
            "type": "object",
            "properties": {
              "images": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cutOut": {
                "type": "integer",
                "minimum": 0
              },
              "scene": {
                "type": "string"
              },
              "prompt": {
                "type": "string"
              }
            },
            "required": [
              "images",
              "scene"
            ]
          }
        },
        "required": [
          "taskId",
          "model",
          "state",
          "param",
          "resultJson",
          "failCode",
          "failMsg",
          "costTime",
          "completeTime",
          "createTime",
          "updateTime",
          "progress",
          "creditsConsumed"
        ]
      },
      "RecordInfoEnvelope": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "msg": {
            "type": "string"
          },
          "data": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "taskId": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "state": {
                "type": "string",
                "enum": [
                  "waiting",
                  "queuing",
                  "generating",
                  "success",
                  "fail"
                ]
              },
              "param": {
                "type": "string"
              },
              "resultJson": {
                "type": "string"
              },
              "sourceTaskIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "thumbUrl": {
                "type": "string"
              },
              "failCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "failMsg": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "failReason": {
                "type": "string",
                "enum": [
                  "content_blocked_prompt",
                  "content_blocked_reference",
                  "content_blocked",
                  "input_invalid",
                  "provider_busy",
                  "provider_outage",
                  "timeout",
                  "insufficient_balance",
                  "cancelled",
                  "internal"
                ]
              },
              "failDetail": {
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "enum": [
                      "prompt",
                      "reference",
                      "output"
                    ]
                  },
                  "referenceKind": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video",
                      "audio"
                    ]
                  },
                  "cause": {
                    "type": "string",
                    "enum": [
                      "real_person",
                      "copyright",
                      "explicit",
                      "policy"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "enum": [
                      "duration_too_short",
                      "duration_too_long",
                      "duration_out_of_range",
                      "file_unreachable",
                      "file_unsupported",
                      "too_many_references",
                      "resolution",
                      "parameters"
                    ]
                  },
                  "minSeconds": {
                    "type": "number"
                  },
                  "maxSeconds": {
                    "type": "number"
                  }
                }
              },
              "failRetryable": {
                "type": "boolean"
              },
              "refunded": {
                "type": "boolean"
              },
              "costTime": {
                "type": "integer"
              },
              "completeTime": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "createTime": {
                "type": "integer"
              },
              "updateTime": {
                "type": "integer"
              },
              "progress": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "creditsConsumed": {
                "type": "integer"
              },
              "chargedUsdMicro": {
                "type": "integer",
                "minimum": 0
              },
              "priceUsdMicro": {
                "type": "integer"
              },
              "priceUsd": {
                "type": "number",
                "minimum": 0
              },
              "charged": {
                "type": "boolean"
              },
              "attempts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "attempt": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "success",
                        "fail",
                        "refused"
                      ]
                    },
                    "failCode": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "model",
                    "attempt",
                    "state"
                  ]
                }
              },
              "stage": {
                "type": "string",
                "enum": [
                  "guiding",
                  "generating"
                ]
              },
              "guide": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "ready",
                      "skipped"
                    ]
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "hybrid",
                      "depth",
                      "skeleton",
                      "auto"
                    ]
                  },
                  "sourceUrl": {
                    "type": "string"
                  },
                  "sourceSha256": {
                    "type": "string"
                  },
                  "fileUrl": {
                    "type": "string"
                  },
                  "vocalsUrl": {
                    "type": "string"
                  },
                  "info": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "skipped": {
                    "type": "string",
                    "enum": [
                      "no_people",
                      "leak",
                      "bad_source",
                      "failed",
                      "timeout",
                      "unavailable"
                    ]
                  },
                  "taskId": {
                    "type": "string"
                  },
                  "cached": {
                    "type": "boolean"
                  },
                  "priceUsdMicro": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "chargedUsdMicro": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "status",
                  "mode",
                  "sourceUrl"
                ]
              },
              "recast": {
                "type": "object",
                "properties": {
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "cutOut": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "scene": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "images",
                  "scene"
                ]
              }
            },
            "required": [
              "taskId",
              "model",
              "state",
              "param",
              "resultJson",
              "failCode",
              "failMsg",
              "costTime",
              "completeTime",
              "createTime",
              "updateTime",
              "progress",
              "creditsConsumed"
            ]
          }
        },
        "required": [
          "code",
          "msg",
          "data"
        ]
      },
      "FileUrlUploadBody": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "uploadPath": {
            "type": "string",
            "maxLength": 256
          },
          "fileName": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "url"
        ]
      },
      "FileBase64UploadBody": {
        "type": "object",
        "properties": {
          "base64": {
            "type": "string",
            "minLength": 1
          },
          "mimeType": {
            "type": "string",
            "minLength": 1
          },
          "uploadPath": {
            "type": "string",
            "maxLength": 256
          },
          "fileName": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "base64",
          "mimeType"
        ]
      },
      "FileUploadData": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string"
          },
          "fileUrl": {
            "type": "string"
          },
          "downloadUrl": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "fileName",
          "fileUrl",
          "downloadUrl",
          "mimeType",
          "size",
          "expiresAt"
        ]
      },
      "FileUploadEnvelope": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "msg": {
            "type": "string"
          },
          "data": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "fileName": {
                "type": "string"
              },
              "fileUrl": {
                "type": "string"
              },
              "downloadUrl": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "expiresAt": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "fileName",
              "fileUrl",
              "downloadUrl",
              "mimeType",
              "size",
              "expiresAt"
            ]
          }
        },
        "required": [
          "code",
          "msg",
          "data"
        ]
      },
      "DownloadUrlBody": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "url"
        ]
      },
      "BalanceSnapshot": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "balanceUsdMicro": {
            "type": "integer"
          },
          "lowBalanceThresholdUsdMicro": {
            "type": "integer",
            "minimum": 0
          },
          "unlimited": {
            "type": "boolean"
          }
        },
        "required": [
          "customerId",
          "balanceUsdMicro",
          "lowBalanceThresholdUsdMicro"
        ]
      },
      "TopUpRequest": {
        "type": "object",
        "properties": {
          "packId": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "credits_1000",
                  "credits_4000",
                  "credits_10000",
                  "credits_20000"
                ]
              },
              {
                "type": "string"
              }
            ]
          },
          "paymentMethod": {
            "type": "string",
            "enum": [
              "card",
              "pix"
            ]
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "packId",
          "paymentMethod",
          "requestId"
        ]
      },
      "TopUpResponse": {
        "type": "object",
        "properties": {
          "checkoutUrl": {
            "type": "string",
            "format": "uri"
          },
          "sessionId": {
            "type": "string"
          }
        },
        "required": [
          "checkoutUrl",
          "sessionId"
        ]
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "customer_id",
          "name",
          "prefix",
          "last_used_at",
          "expires_at",
          "created_at",
          "revoked_at"
        ]
      },
      "CreateApiKeyBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "name"
        ]
      },
      "IssuedApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "secret": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "name",
          "prefix",
          "last_used_at",
          "expires_at",
          "created_at",
          "revoked_at",
          "secret"
        ]
      },
      "RateLimits": {
        "type": "object",
        "properties": {
          "per_customer": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "limit": {
                "type": "integer",
                "minimum": 0
              },
              "remaining": {
                "type": "integer",
                "minimum": 0
              },
              "reset_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "limit",
              "remaining",
              "reset_at"
            ]
          },
          "per_key": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "limit": {
                "type": "integer",
                "minimum": 0
              },
              "remaining": {
                "type": "integer",
                "minimum": 0
              },
              "reset_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "limit",
              "remaining",
              "reset_at"
            ]
          }
        },
        "required": [
          "per_customer",
          "per_key"
        ]
      },
      "RateLimitBucket": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 0
          },
          "remaining": {
            "type": "integer",
            "minimum": 0
          },
          "reset_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "limit",
          "remaining",
          "reset_at"
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "customer_id": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "job.completed",
                "job.failed",
                "credits.low_balance",
                "credits.topped_up"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "has_custom_signing_secret": {
            "type": "boolean"
          },
          "provider_filter": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "customer_id",
          "url",
          "events",
          "enabled",
          "has_custom_signing_secret",
          "provider_filter",
          "created_at",
          "updated_at"
        ]
      },
      "CreateWebhookEndpointBody": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "job.completed",
                "job.failed",
                "credits.low_balance",
                "credits.topped_up"
              ]
            }
          },
          "provider_filter": {
            "type": "string"
          },
          "signing_secret": {
            "type": "string",
            "minLength": 16,
            "maxLength": 255
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "url",
          "events"
        ]
      },
      "UpdateWebhookEndpointBody": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "job.completed",
                "job.failed",
                "credits.low_balance",
                "credits.topped_up"
              ]
            }
          },
          "signing_secret": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 16,
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "provider_filter": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "endpoint_id": {
            "type": "string",
            "minLength": 1
          },
          "customer_id": {
            "type": "string",
            "minLength": 1
          },
          "event": {
            "type": "string",
            "enum": [
              "job.completed",
              "job.failed",
              "credits.low_balance",
              "credits.topped_up"
            ]
          },
          "event_id": {
            "type": "string"
          },
          "payload": {},
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "success",
              "failed",
              "retrying"
            ]
          },
          "attempt_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_response_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "customer_id",
          "event",
          "event_id",
          "payload",
          "status",
          "attempt_count",
          "last_error",
          "last_response_status",
          "next_attempt_at",
          "delivered_at",
          "created_at",
          "updated_at"
        ]
      },
      "WebhookEnvelope": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string",
            "enum": [
              "v1"
            ]
          },
          "event_id": {
            "type": "string",
            "minLength": 1
          },
          "event": {
            "type": "string",
            "enum": [
              "job.completed",
              "job.failed",
              "credits.low_balance",
              "credits.topped_up"
            ]
          },
          "customer_id": {
            "type": "string",
            "minLength": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {}
        },
        "required": [
          "api_version",
          "event_id",
          "event",
          "customer_id",
          "created_at",
          "data"
        ]
      },
      "DeleteAccountBody": {
        "type": "object",
        "properties": {
          "reason_code": {
            "type": "string",
            "enum": [
              "too_expensive",
              "missing_feature",
              "too_complex",
              "found_alternative",
              "no_longer_needed",
              "just_testing",
              "other"
            ]
          },
          "reason_freetext": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "reason_code"
        ]
      },
      "SupportTicket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "customer_id": {
            "type": "string",
            "minLength": 1
          },
          "user_id": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "bug",
              "question",
              "feature_request",
              "billing",
              "integration",
              "other"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "in_progress",
              "waiting_on_customer",
              "resolved",
              "closed"
            ]
          },
          "description": {
            "type": "string"
          },
          "last_message_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "message_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "customer_id",
          "user_id",
          "subject",
          "category",
          "severity",
          "status",
          "description",
          "last_message_at",
          "message_count",
          "created_at",
          "updated_at"
        ]
      },
      "SupportTicketDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "customer_id": {
            "type": "string",
            "minLength": 1
          },
          "user_id": {
            "type": "string",
            "minLength": 1
          },
          "subject": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "bug",
              "question",
              "feature_request",
              "billing",
              "integration",
              "other"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "in_progress",
              "waiting_on_customer",
              "resolved",
              "closed"
            ]
          },
          "description": {
            "type": "string"
          },
          "last_message_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "message_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "ticket_id": {
                  "type": "string",
                  "minLength": 1
                },
                "author_type": {
                  "type": "string",
                  "enum": [
                    "customer",
                    "team"
                  ]
                },
                "author_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "body": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "ticket_id",
                "author_type",
                "author_id",
                "body",
                "created_at"
              ]
            }
          }
        },
        "required": [
          "id",
          "customer_id",
          "user_id",
          "subject",
          "category",
          "severity",
          "status",
          "description",
          "last_message_at",
          "message_count",
          "created_at",
          "updated_at",
          "messages"
        ]
      },
      "SupportTicketMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "ticket_id": {
            "type": "string",
            "minLength": 1
          },
          "author_type": {
            "type": "string",
            "enum": [
              "customer",
              "team"
            ]
          },
          "author_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "ticket_id",
          "author_type",
          "author_id",
          "body",
          "created_at"
        ]
      },
      "CreateSupportTicketBody": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "minLength": 3,
            "maxLength": 200
          },
          "category": {
            "type": "string",
            "enum": [
              "bug",
              "question",
              "feature_request",
              "billing",
              "integration",
              "other"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ]
          },
          "description": {
            "type": "string",
            "minLength": 20,
            "maxLength": 2000
          }
        },
        "required": [
          "subject",
          "category",
          "description"
        ]
      },
      "ReplySupportTicketBody": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          }
        },
        "required": [
          "body"
        ]
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "aspectRatio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "4:5",
              "4:3",
              "3:4",
              "21:9"
            ]
          },
          "defaultResolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "draft",
              "standard",
              "high"
            ]
          },
          "styleLookbookAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "customerId",
          "name",
          "aspectRatio",
          "createdAt"
        ]
      },
      "Scene": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "order": {
            "type": "number"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string",
                  "maxLength": 120
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "width": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10000
                },
                "height": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10000
                }
              },
              "required": [
                "id",
                "name",
                "x",
                "y",
                "width",
                "height"
              ]
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "text": {
                  "type": "string",
                  "maxLength": 4000
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "width": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 2000
                },
                "height": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 2000
                }
              },
              "required": [
                "id",
                "text",
                "x",
                "y",
                "width",
                "height"
              ]
            }
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "projectId",
          "customerId",
          "name",
          "order",
          "createdAt"
        ]
      },
      "Shot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sceneId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "order": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "modelSlug": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "camera": {
            "type": "object",
            "properties": {
              "angle": {
                "type": "string",
                "enum": [
                  "eye-level",
                  "low-angle",
                  "high-angle",
                  "overhead",
                  "dutch",
                  "over-the-shoulder",
                  "pov",
                  "birds-eye",
                  "worms-eye"
                ]
              },
              "lens": {
                "type": "string",
                "enum": [
                  "24mm-wide",
                  "35mm",
                  "50mm",
                  "85mm-portrait",
                  "macro",
                  "telephoto",
                  "fisheye"
                ]
              },
              "move": {
                "type": "string",
                "enum": [
                  "static",
                  "pan-left",
                  "pan-right",
                  "tilt-up",
                  "tilt-down",
                  "dolly-in",
                  "dolly-out",
                  "truck-left",
                  "truck-right",
                  "crane-up",
                  "crane-down",
                  "orbit-left",
                  "orbit-right",
                  "zoom-in",
                  "zoom-out",
                  "handheld"
                ]
              }
            }
          },
          "refAssetIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startFrameAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "endFrameAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "audioAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationSeconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "audioMode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "full",
              "music",
              "dialog",
              "off"
            ]
          },
          "aspectRatio": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "4:5",
              "4:3",
              "3:4",
              "21:9"
            ]
          },
          "options": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "takes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "taskId": {
                  "type": "string"
                },
                "resultUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "durationSeconds": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "modelSlug": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "thumbUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "taskId",
                "createdAt"
              ]
            }
          },
          "selectedTakeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "queued",
              "generating",
              "ready",
              "failed"
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastErrorTaskId": {
            "type": [
              "string",
              "null"
            ]
          },
          "canvasX": {
            "type": [
              "number",
              "null"
            ]
          },
          "canvasY": {
            "type": [
              "number",
              "null"
            ]
          },
          "canvasW": {
            "type": [
              "number",
              "null"
            ]
          },
          "canvasH": {
            "type": [
              "number",
              "null"
            ]
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sceneId",
          "projectId",
          "customerId",
          "order",
          "modelSlug",
          "createdAt"
        ]
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "character",
              "prop",
              "audio"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "storagePath": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "projectId",
          "customerId",
          "name",
          "kind",
          "url",
          "storagePath",
          "createdAt"
        ]
      },
      "Storyboard": {
        "type": "object",
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "scenes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "projectId": {
                  "type": "string"
                },
                "customerId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "order": {
                  "type": "number"
                },
                "groups": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "x": {
                        "type": "number"
                      },
                      "y": {
                        "type": "number"
                      },
                      "width": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 10000
                      },
                      "height": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 10000
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "x",
                      "y",
                      "width",
                      "height"
                    ]
                  }
                },
                "notes": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "x": {
                        "type": "number"
                      },
                      "y": {
                        "type": "number"
                      },
                      "width": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2000
                      },
                      "height": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2000
                      }
                    },
                    "required": [
                      "id",
                      "text",
                      "x",
                      "y",
                      "width",
                      "height"
                    ]
                  }
                },
                "createdAt": {
                  "type": "string"
                },
                "shots": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Shot"
                  }
                }
              },
              "required": [
                "id",
                "projectId",
                "customerId",
                "name",
                "order",
                "createdAt",
                "shots"
              ]
            }
          }
        },
        "required": [
          "project",
          "scenes"
        ]
      },
      "CreateProjectBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "aspectRatio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "4:5",
              "4:3",
              "3:4",
              "21:9"
            ]
          },
          "defaultResolution": {
            "type": "string",
            "maxLength": 12
          },
          "quality": {
            "type": "string",
            "enum": [
              "draft",
              "standard",
              "high"
            ]
          },
          "styleLookbookAssetId": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "PatchProjectBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "aspectRatio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "4:5",
              "4:3",
              "3:4",
              "21:9"
            ]
          },
          "defaultResolution": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 12
          },
          "quality": {
            "type": "string",
            "enum": [
              "draft",
              "standard",
              "high"
            ]
          },
          "styleLookbookAssetId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CreateSceneBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "order": {
            "type": "number"
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateShotBody": {
        "type": "object",
        "properties": {
          "modelSlug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "prompt": {
            "type": "string",
            "maxLength": 20000
          },
          "camera": {
            "type": "object",
            "properties": {
              "angle": {
                "type": "string",
                "enum": [
                  "eye-level",
                  "low-angle",
                  "high-angle",
                  "overhead",
                  "dutch",
                  "over-the-shoulder",
                  "pov",
                  "birds-eye",
                  "worms-eye"
                ]
              },
              "lens": {
                "type": "string",
                "enum": [
                  "24mm-wide",
                  "35mm",
                  "50mm",
                  "85mm-portrait",
                  "macro",
                  "telephoto",
                  "fisheye"
                ]
              },
              "move": {
                "type": "string",
                "enum": [
                  "static",
                  "pan-left",
                  "pan-right",
                  "tilt-up",
                  "tilt-down",
                  "dolly-in",
                  "dolly-out",
                  "truck-left",
                  "truck-right",
                  "crane-up",
                  "crane-down",
                  "orbit-left",
                  "orbit-right",
                  "zoom-in",
                  "zoom-out",
                  "handheld"
                ]
              }
            }
          },
          "order": {
            "type": "number"
          },
          "resolution": {
            "type": "string",
            "maxLength": 12
          },
          "quality": {
            "type": "string",
            "maxLength": 24
          },
          "durationSeconds": {
            "type": "number",
            "minimum": 0,
            "maximum": 3600
          },
          "audioMode": {
            "type": "string",
            "enum": [
              "full",
              "music",
              "dialog",
              "off"
            ]
          },
          "aspectRatio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "4:5",
              "4:3",
              "3:4",
              "21:9"
            ]
          },
          "options": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "refAssetIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startFrameAssetId": {
            "type": "string"
          },
          "endFrameAssetId": {
            "type": "string"
          },
          "audioAssetId": {
            "type": "string"
          },
          "canvasX": {
            "type": "number"
          },
          "canvasY": {
            "type": "number"
          },
          "canvasW": {
            "type": "number",
            "minimum": 0,
            "maximum": 4000
          },
          "canvasH": {
            "type": "number",
            "minimum": 0,
            "maximum": 4000
          }
        },
        "required": [
          "modelSlug"
        ]
      },
      "PatchShotBody": {
        "type": "object",
        "properties": {
          "sceneId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "modelSlug": {
            "type": "string",
            "minLength": 1
          },
          "prompt": {
            "type": "string",
            "maxLength": 20000
          },
          "camera": {
            "type": "object",
            "properties": {
              "angle": {
                "type": "string",
                "enum": [
                  "eye-level",
                  "low-angle",
                  "high-angle",
                  "overhead",
                  "dutch",
                  "over-the-shoulder",
                  "pov",
                  "birds-eye",
                  "worms-eye"
                ]
              },
              "lens": {
                "type": "string",
                "enum": [
                  "24mm-wide",
                  "35mm",
                  "50mm",
                  "85mm-portrait",
                  "macro",
                  "telephoto",
                  "fisheye"
                ]
              },
              "move": {
                "type": "string",
                "enum": [
                  "static",
                  "pan-left",
                  "pan-right",
                  "tilt-up",
                  "tilt-down",
                  "dolly-in",
                  "dolly-out",
                  "truck-left",
                  "truck-right",
                  "crane-up",
                  "crane-down",
                  "orbit-left",
                  "orbit-right",
                  "zoom-in",
                  "zoom-out",
                  "handheld"
                ]
              }
            }
          },
          "order": {
            "type": "number"
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 12
          },
          "quality": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 24
          },
          "durationSeconds": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 3600
          },
          "audioMode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "full",
              "music",
              "dialog",
              "off"
            ]
          },
          "aspectRatio": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "16:9",
              "9:16",
              "1:1",
              "4:5",
              "4:3",
              "3:4",
              "21:9"
            ]
          },
          "options": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "refAssetIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startFrameAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "endFrameAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "audioAssetId": {
            "type": [
              "string",
              "null"
            ]
          },
          "canvasX": {
            "type": [
              "number",
              "null"
            ]
          },
          "canvasY": {
            "type": [
              "number",
              "null"
            ]
          },
          "canvasW": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 4000
          },
          "canvasH": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 4000
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ImportAssetBody": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "character",
              "prop",
              "audio"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            }
          }
        },
        "required": [
          "url",
          "name"
        ]
      },
      "SelectTakeBody": {
        "type": "object",
        "properties": {
          "takeId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "takeId"
        ]
      }
    }
  },
  "paths": {
    "/api/v1/jobs/createTask": {
      "post": {
        "tags": [
          "Generation"
        ],
        "summary": "Create a generation task",
        "description": "Kick off an async image / video / audio generation. Pass the `model` id and a model-agnostic `input` (prompt, reference `images`/`videos`, `aspect_ratio`, `output_format`). Credits are reserved on accept and charged on success. Send an `Idempotency-Key` header to make retries safe. Poll `recordInfo` or set `callBackUrl` for a webhook on completion.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task accepted — returns the `taskId` to poll",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTaskEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unknown model or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/recordInfo": {
      "get": {
        "tags": [
          "Generation"
        ],
        "summary": "Get a task status + result",
        "description": "Poll a single task by id. `state` walks `waiting → queuing → generating → success | fail`. On success, `resultJson` is a JSON string holding `{ \"resultUrls\": [...] }`.",
        "parameters": [
          {
            "name": "taskId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Task id returned by createTask."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordInfoEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Task not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs": {
      "get": {
        "tags": [
          "Generation"
        ],
        "summary": "List your generation tasks",
        "description": "Newest-first. With no query params, returns the most recent 50. Pass `limit`/`offset` (and optional `state`/`order`) to paginate the full history.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "waiting",
                "queuing",
                "generating",
                "success",
                "fail"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RecordInfoData"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/file-url-upload": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Upload a file from a public URL",
        "description": "Fetches the URL server-side and stores it, returning a durable `fileUrl` you can pass into a generation `input`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUrlUploadBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/file-base64-upload": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Upload a base64-encoded file",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileBase64UploadBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/file-stream-upload": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Upload a file via multipart/form-data",
        "description": "Stream raw bytes as `multipart/form-data`. Returns the same envelope as the URL/base64 variants.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/common/download-url": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Re-sign a stored file URL for download",
        "description": "Exchange a stored `fileUrl` for a fresh, time-limited download URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DownloadUrlBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/balance": {
      "get": {
        "tags": [
          "Credits"
        ],
        "summary": "Current credit balance",
        "description": "Returns your balance in USD-micro-cents plus the low-balance alert threshold. 1 credit ≈ $0.005.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/credit": {
      "get": {
        "tags": [
          "Credits"
        ],
        "summary": "Remaining credits (integer)",
        "description": "Shortcut: `data` is your remaining whole-credit count.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "enum": [
                        200
                      ]
                    },
                    "msg": {
                      "type": "string"
                    },
                    "data": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/balance": {
      "get": {
        "tags": [
          "Credits"
        ],
        "summary": "Credit balance (dashboard auth)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/checkout-session": {
      "post": {
        "tags": [
          "Credits"
        ],
        "summary": "Start a Stripe checkout to top up credits",
        "description": "Creates a Stripe Checkout session for the given USD amount and returns the hosted `checkoutUrl` to redirect the user to.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TopUpRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopUpResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Billing temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Current user + customer + plan",
        "description": "Returns the authenticated user, their customer account, plan, and credit balance.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Account"
        ],
        "summary": "Update profile preferences (locale / theme)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "enum": [
                      "en",
                      "pt-BR",
                      "es",
                      "ja",
                      "zh-CN"
                    ]
                  },
                  "theme": {
                    "type": "string",
                    "enum": [
                      "system",
                      "light",
                      "dark"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-keys": {
      "get": {
        "tags": [
          "API Keys"
        ],
        "summary": "List API keys (prefix-only)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "API Keys"
        ],
        "summary": "Issue a new key (full secret shown once)",
        "description": "The `secret` is returned exactly once, here. Store it now — it is HMAC-hashed and unrecoverable afterward.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedApiKey"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Requires a signed-in dashboard session — an API key cannot issue or revoke keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "tags": [
          "API Keys"
        ],
        "summary": "Revoke a key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — echoes the revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Requires a signed-in dashboard session — an API key cannot issue or revoke keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/limits": {
      "get": {
        "tags": [
          "Rate limits"
        ],
        "summary": "Rate-limit headroom (read-only peek, no consumption)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimits"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook endpoints",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Register a webhook endpoint",
        "description": "Subscribe an HTTPS URL to one or more events (`job.completed`, `job.failed`, `credits.low_balance`, `credits.topped_up`). Deliveries are signed; supply your own `signing_secret` or let one be generated.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{id}": {
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Recent webhook delivery log",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "success",
                "failed",
                "retrying"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-deliveries/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "One delivery attempt (status, response, retries)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/support/tickets": {
      "get": {
        "tags": [
          "Support"
        ],
        "summary": "List your support tickets",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SupportTicket"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Open a support ticket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSupportTicketBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicket"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/support/tickets/{id}": {
      "get": {
        "tags": [
          "Support"
        ],
        "summary": "Ticket detail (with messages)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicketDetail"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/support/tickets/{id}/messages": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Reply to a ticket",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplySupportTicketBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicketMessage"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Create a project",
        "description": "The top-level container for scenes, shots, and the per-project asset library. Set the `aspectRatio` and `quality` new shots inherit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Studio"
        ],
        "summary": "List your projects",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Project"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects/{pid}": {
      "get": {
        "tags": [
          "Studio"
        ],
        "summary": "Get a project",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Studio"
        ],
        "summary": "Update a project",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchProjectBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Studio"
        ],
        "summary": "Delete a project (cascades scenes, shots, assets)",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects/{pid}/storyboard": {
      "get": {
        "tags": [
          "Studio"
        ],
        "summary": "Get the full storyboard tree",
        "description": "The project, its scenes, and each scene’s ordered shots hydrated with live generation state and result URLs. One call to inspect everything and to poll generation progress.",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Storyboard"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects/{pid}/assets": {
      "get": {
        "tags": [
          "Studio"
        ],
        "summary": "List a project’s asset library",
        "description": "Characters, props, and reference images/videos. A character is simply an asset with `kind: character`.",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Asset"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects/{pid}/assets/url-import": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Import an asset (character / prop / reference) from a URL",
        "description": "Add a reusable asset to the library from a public media URL (SSRF-gated). Use `kind: character` to create a character. The returned asset id is referenced by shots via `refAssetIds` / `startFrameAssetId`.",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportAssetBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Imported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects/{pid}/scenes": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Create a scene",
        "description": "A scene groups ordered shots inside a project.",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSceneBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Scene"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/scenes/{sid}/shots": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Create a shot",
        "description": "A shot is a generatable panel. Pick a `modelSlug` from GET /api/v1/models, add a `prompt`, an optional `camera` block, and reference asset ids. Creating a shot is free — call the generate endpoint to produce media.",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShotBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shot"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Scene not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/shots/{shid}": {
      "patch": {
        "tags": [
          "Studio"
        ],
        "summary": "Update a shot",
        "description": "Edit the prompt, model, camera, references, duration, canvas position, or `connections` (the directed edges of the storyboard graph). Move a shot to another scene via `sceneId`.",
        "parameters": [
          {
            "name": "shid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchShotBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shot"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/shots/{shid}/estimate": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Estimate a shot’s generation cost",
        "parameters": [
          {
            "name": "shid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/shots/{shid}/generate": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Generate a shot (paid)",
        "description": "Fire the paid generation job for a shot. Returns a `taskId`; poll with GET /api/v1/jobs/recordInfo or the storyboard endpoint. Debits your balance.",
        "parameters": [
          {
            "name": "shid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "taskId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Insufficient credits / invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/scenes/{sid}/generate": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Generate every shot in a scene (paid)",
        "description": "Batch-fire one paid job per non-in-flight shot in the scene.",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accepted"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/shots/{shid}/use-asset": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Attach an owned asset as the shot result (free)",
        "description": "Use your own uploaded/imported image or video as the shot’s result — no generation. The asset lands as a ready, selectable take.",
        "parameters": [
          {
            "name": "shid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "assetId": {
                    "type": "string"
                  }
                },
                "required": [
                  "assetId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shot"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/shots/{shid}/select-take": {
      "post": {
        "tags": [
          "Studio"
        ],
        "summary": "Select a shot’s canonical take",
        "parameters": [
          {
            "name": "shid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectTakeBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shot"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/healthz": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Liveness probe",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/readyz": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Readiness probe (database + queue reachable)",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing / malformed / revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (X-RateLimit-* + Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Not ready"
          }
        }
      }
    }
  }
}