{
  "openapi": "3.1.0",
  "info": {
    "title": "Ziztu API",
    "version": "1.0.0",
    "summary": "Create a project, let the Director plan it and make frames and clips, with a spend cap on every paid call.",
    "description": "The Ziztu REST API. Send an API key, create a project, let the Director plan it, make first frames, clips and music, and export the film. The Studio apps (animate, manga, kamishibai, manzai and zukai) run from a prompt.\n\nAuthentication: make an API key in the Studio under Settings, API keys, and send it as Authorization: Bearer sk_sakuga_your_key or as X-API-Key. Keys have scopes: read for every GET, generate for every change including paid work, and export for renders and downloads. Apps that sign a person in can use OAuth 2.1 with PKCE instead.\n\nPrices are credits, and a price is quoted before anything runs. Every call that costs credits needs max_credits: the call is refused if the real price is higher, and nothing is started. Add dry_run: true to get the exact quote and start nothing. Above 5,000 credits a real call also needs confirm: true. Send an Idempotency-Key header on a paid POST to make a retry safe: the same key and body returns the first answer for 24 hours.\n\nLimits: by default 120 requests a minute per key and 30 paid POSTs a minute. A response carries X-RateLimit-Limit and X-RateLimit-Remaining. When you pass the limit you get HTTP 429 and a Retry-After header with the seconds to wait.\n\nErrors are JSON: {\"error\": {\"code\", \"message\"}}, with field, scope, needed or quote when they help. The codes are unauthenticated (401), invalid_api_key (401), insufficient_scope (403), rate_limited (429), bad_request (400), max_credits_required (400), over_max_credits (402), confirm_required (409), blocked (422), nothing_to_do (422), not_found (404), idempotency_key_reused (422), idempotency_in_progress (409), tool_unavailable (503).\n\nThe guide, with a full session in curl and the model ids, is at https://getziztu.com/docs/api.",
    "termsOfService": "https://getziztu.com/terms",
    "contact": {
      "name": "Ziztu support",
      "url": "https://getziztu.com",
      "email": "support@getziztu.com"
    }
  },
  "servers": [
    {
      "url": "https://getziztu.com",
      "description": "Ziztu"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    },
    {
      "oauth2": [
        "read"
      ]
    }
  ],
  "tags": [
    {
      "name": "Projects",
      "description": "Create, read, change and delete film projects."
    },
    {
      "name": "Characters",
      "description": "The cast of a project."
    },
    {
      "name": "Places",
      "description": "The places of a project."
    },
    {
      "name": "Shots",
      "description": "The shots of a project, in order."
    },
    {
      "name": "Music",
      "description": "The music tracks of a project."
    },
    {
      "name": "Director",
      "description": "Plan or change a project in plain words. The reply proposes actions."
    },
    {
      "name": "Script",
      "description": "The AI Script Writer. Text in, text out: nothing here makes an image, a clip or a sound."
    },
    {
      "name": "Generate",
      "description": "Paid work: first frames, clips, music, character images and place plates. Every call needs max_credits."
    },
    {
      "name": "Export",
      "description": "Render the film and download media."
    },
    {
      "name": "Jobs",
      "description": "Follow and cancel background jobs."
    },
    {
      "name": "Credits",
      "description": "The credit balance and plan."
    },
    {
      "name": "Tools",
      "description": "The Studio apps: animate, manga, kamishibai, manzai and zukai."
    },
    {
      "name": "API keys",
      "description": "Make and revoke keys. These routes need a signed in session."
    }
  ],
  "externalDocs": {
    "description": "The Ziztu API docs",
    "url": "https://getziztu.com/docs/api"
  },
  "paths": {
    "/api/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "tags": [
          "Projects"
        ],
        "summary": "List projects",
        "description": "Every project of the account, newest first. Needs the read scope.",
        "responses": {
          "200": {
            "description": "The projects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProjectSummary"
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      },
      "post": {
        "operationId": "createProject",
        "tags": [
          "Projects"
        ],
        "summary": "Create a project",
        "description": "Makes an empty project. Use aspect 9:16 for a vertical micro drama. Needs the plan or generate scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectSummary"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}": {
      "get": {
        "operationId": "getProject",
        "tags": [
          "Projects"
        ],
        "summary": "Get a project",
        "description": "The project with its characters, places, shots, music and exports. Add ?full=1 for the raw document. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "200": {
            "description": "The project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      },
      "patch": {
        "operationId": "updateProject",
        "tags": [
          "Projects"
        ],
        "summary": "Update a project",
        "description": "A partial update. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The project summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectSummary"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      },
      "delete": {
        "operationId": "deleteProject",
        "tags": [
          "Projects"
        ],
        "summary": "Delete a project",
        "description": "Deletes the project and its media. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/characters": {
      "post": {
        "operationId": "createCharacter",
        "tags": [
          "Characters"
        ],
        "summary": "Add a character",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CharacterInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The character.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Character"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/characters/{cid}": {
      "patch": {
        "operationId": "updateCharacter",
        "tags": [
          "Characters"
        ],
        "summary": "Update a character",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/CharacterId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The character.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Character"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      },
      "delete": {
        "operationId": "deleteCharacter",
        "tags": [
          "Characters"
        ],
        "summary": "Delete a character",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/CharacterId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/places": {
      "post": {
        "operationId": "createPlace",
        "tags": [
          "Places"
        ],
        "summary": "Add a place",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Place"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/places/{lid}": {
      "patch": {
        "operationId": "updatePlace",
        "tags": [
          "Places"
        ],
        "summary": "Update a place",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/PlaceId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Place"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      },
      "delete": {
        "operationId": "deletePlace",
        "tags": [
          "Places"
        ],
        "summary": "Delete a place",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/PlaceId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/shots": {
      "get": {
        "operationId": "listShots",
        "tags": [
          "Shots"
        ],
        "summary": "List shots",
        "description": "All shots in order. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "200": {
            "description": "The shots.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Shot"
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      },
      "post": {
        "operationId": "createShot",
        "tags": [
          "Shots"
        ],
        "summary": "Add a shot",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShotInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The shot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shot"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/shots/{sid}": {
      "patch": {
        "operationId": "updateShot",
        "tags": [
          "Shots"
        ],
        "summary": "Update a shot",
        "description": "Set model to choose the video model of the shot. The ids are listed on the API docs page. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/ShotId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShotInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The shot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shot"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      },
      "delete": {
        "operationId": "deleteShot",
        "tags": [
          "Shots"
        ],
        "summary": "Delete a shot",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/ShotId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/music": {
      "get": {
        "operationId": "listMusic",
        "tags": [
          "Music"
        ],
        "summary": "List music tracks",
        "description": "Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "200": {
            "description": "The tracks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MusicTrack"
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      },
      "post": {
        "operationId": "createMusic",
        "tags": [
          "Music"
        ],
        "summary": "Add a music track",
        "description": "Plans a track. It makes no audio until you call generate/music. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The track.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicTrack"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/music/{mid}": {
      "patch": {
        "operationId": "updateMusic",
        "tags": [
          "Music"
        ],
        "summary": "Update a music track",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/MusicId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The track.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicTrack"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      },
      "delete": {
        "operationId": "deleteMusic",
        "tags": [
          "Music"
        ],
        "summary": "Delete a music track",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/MusicId"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/director/plan": {
      "post": {
        "operationId": "directorPlan",
        "tags": [
          "Director"
        ],
        "summary": "Preview a scene plan",
        "description": "Scene specs for a story idea. Nothing is saved, so to build the project use the chat route. Credits: The Director is metered by use and its messages come off the credit balance. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DirectorPlanRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The scene specs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The planned scenes.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "The Director is metered by use and its messages come off the credit balance."
      }
    },
    "/api/v1/projects/{pid}/director/chat": {
      "post": {
        "operationId": "directorChat",
        "tags": [
          "Director"
        ],
        "summary": "Ask the Director",
        "description": "Plan or change the project in plain words. The reply has an id and the actions it proposes. Apply them with apply-all or one at a time. Credits: The Director is metered by use and its messages come off the credit balance. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DirectorChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Director reply.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectorMessage"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "The Director is metered by use and its messages come off the credit balance."
      }
    },
    "/api/v1/projects/{pid}/director/messages/{mid}/apply-all": {
      "post": {
        "operationId": "applyDirectorActions",
        "tags": [
          "Director"
        ],
        "summary": "Apply every action that costs no credits",
        "description": "Applies the actions of a reply that cost nothing, which adds the cast, places and shots. Actions that make images, video or audio are never applied here: use the generate routes. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/MessageId"
          }
        ],
        "responses": {
          "200": {
            "description": "One result per action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The action id."
                          },
                          "ok": {
                            "type": "boolean",
                            "description": "True when it was applied."
                          },
                          "result": {},
                          "error": {
                            "type": "string",
                            "description": "Why it failed."
                          }
                        },
                        "required": [
                          "id",
                          "ok"
                        ]
                      }
                    }
                  },
                  "required": [
                    "results"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/director/messages/{mid}/actions/{aid}/apply": {
      "post": {
        "operationId": "applyDirectorAction",
        "tags": [
          "Director"
        ],
        "summary": "Apply one action",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/MessageId"
          },
          {
            "$ref": "#/components/parameters/ActionId"
          }
        ],
        "responses": {
          "200": {
            "description": "The result of the action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {}
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/script": {
      "get": {
        "operationId": "readScript",
        "tags": [
          "Script"
        ],
        "summary": "Read the script",
        "description": "The outline of every scene and the Fountain text. Query: scenes (for example 1,2), include_text (0 leaves the text out) and max_chars. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "200": {
            "description": "The outline and the Fountain text.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The script view.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/script/draft": {
      "post": {
        "operationId": "startScriptDraft",
        "tags": [
          "Script"
        ],
        "summary": "Write a draft",
        "description": "A guided draft: a story plan, then the scenes, then an editor pass. It returns a job at once, which GET /projects/{pid}/script/jobs/{jid} follows. A draft takes a few minutes. Credits: A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first. Needs the plan or generate scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptDraftRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the price. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The quote.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "The job started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The job: its id, the project id and the price.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first."
      }
    },
    "/api/v1/projects/{pid}/script/jobs/{jid}": {
      "get": {
        "operationId": "getScriptJob",
        "tags": [
          "Script"
        ],
        "summary": "Follow a script job",
        "description": "The steps, the story plan and the result. Add ?wait=<seconds, up to 25> to return early when a step finishes. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The job view.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/script/ask": {
      "post": {
        "operationId": "askScriptEditor",
        "tags": [
          "Script"
        ],
        "summary": "Ask the script editor",
        "description": "Ask a question or ask for a change. The answer carries proposed edits with ids, and nothing changes until you apply one. It returns a job when it takes longer than 25 seconds. Credits: A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptAskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer and the proposed edits, or a job.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The editor reply.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first."
      }
    },
    "/api/v1/projects/{pid}/script/edits": {
      "post": {
        "operationId": "decideScriptEdits",
        "tags": [
          "Script"
        ],
        "summary": "Apply or reject proposed edits",
        "description": "Applying saves a version of the script first. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptEditsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per edit.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The results and the new size of the script.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/script/doctor": {
      "post": {
        "operationId": "runScriptDoctor",
        "tags": [
          "Script"
        ],
        "summary": "Run the Script Doctor",
        "description": "Notes on the problems in the script, their root causes and exact fixes. It changes nothing. It returns a job when it takes longer than 25 seconds. Credits: A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptDoctorRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The notes, or a job.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The Doctor notes.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first."
      }
    },
    "/api/v1/projects/{pid}/script/versions": {
      "get": {
        "operationId": "listScriptVersions",
        "tags": [
          "Script"
        ],
        "summary": "List script versions",
        "description": "The saved versions. Add ?compare=<id>&to=<id or now> for a comparison. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "200": {
            "description": "The versions, or a comparison.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The versions view.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/script/versions/{vid}/restore": {
      "post": {
        "operationId": "restoreScriptVersion",
        "tags": [
          "Script"
        ],
        "summary": "Restore a script version",
        "description": "Brings a version back. The script as it is now is saved first. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/VersionId"
          }
        ],
        "responses": {
          "200": {
            "description": "The restored script.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The result.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/script/import": {
      "post": {
        "operationId": "importScript",
        "tags": [
          "Script"
        ],
        "summary": "Import a script",
        "description": "Fountain, Final Draft or plain text, into a project or a new one. Needs the plan or generate scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The imported script.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The result.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/script/export": {
      "post": {
        "operationId": "exportScript",
        "tags": [
          "Script"
        ],
        "summary": "Export the script",
        "description": "Fountain comes back as text. pdf and fdx come back as a link that works for ten minutes. The link needs no sign in, because its token is the credential. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The text, or the link.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The text or the link.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/script/shots": {
      "post": {
        "operationId": "scriptToShots",
        "tags": [
          "Script"
        ],
        "summary": "Plan shots from scenes",
        "description": "The cast, places and shots of some scenes as a Director message. Add them to the project with apply-all. It returns a job when it takes longer than 25 seconds. Credits: A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first. Needs the plan or generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptShotsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The shot plan, or a job.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The Director message or a job.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "plan"
            ]
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "A step that uses a text model is priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the price first."
      }
    },
    "/api/v1/projects/{pid}/generate/frames": {
      "post": {
        "operationId": "generateFrames",
        "tags": [
          "Generate"
        ],
        "summary": "Make first frames",
        "description": "The still image each shot starts from. Set model to choose the image model. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateFramesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the exact quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "Started: the first frame images are being made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "207": {
            "description": "Some items started and a later one failed. errors says which. The credits of the items that started are spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/projects/{pid}/generate/animate": {
      "post": {
        "operationId": "generateClips",
        "tags": [
          "Generate"
        ],
        "summary": "Make clips",
        "description": "The video clip of each shot. The shot model value chooses the video model. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateAnimateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the exact quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "Started: the clips are being made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "207": {
            "description": "Some items started and a later one failed. errors says which. The credits of the items that started are spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/projects/{pid}/generate/music": {
      "post": {
        "operationId": "generateMusic",
        "tags": [
          "Generate"
        ],
        "summary": "Make music",
        "description": "The audio of the planned music tracks. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateMusicRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the exact quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "Started: the music is being made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "207": {
            "description": "Some items started and a later one failed. errors says which. The credits of the items that started are spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/projects/{pid}/generate/character-images": {
      "post": {
        "operationId": "generateCharacterImages",
        "tags": [
          "Generate"
        ],
        "summary": "Make character images",
        "description": "A sheet or a portrait of one character. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateCharacterImagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the exact quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "Started: the character images are being made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "207": {
            "description": "Some items started and a later one failed. errors says which. The credits of the items that started are spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/projects/{pid}/generate/place-plates": {
      "post": {
        "operationId": "generatePlacePlates",
        "tags": [
          "Generate"
        ],
        "summary": "Make place plates",
        "description": "Background plates of one place. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePlacePlatesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the exact quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "Started: the place plates are being made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "207": {
            "description": "Some items started and a later one failed. errors says which. The credits of the items that started are spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/projects/{pid}/generate/director-action": {
      "post": {
        "operationId": "generateDirectorAction",
        "tags": [
          "Generate"
        ],
        "summary": "Run a paid Director action",
        "description": "Runs one proposed action of a Director reply that costs credits. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateDirectorActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the exact quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "202": {
            "description": "Started: the action is running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "207": {
            "description": "Some items started and a later one failed. errors says which. The credits of the items that started are spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/projects/{pid}/quote": {
      "post": {
        "operationId": "quoteOperation",
        "tags": [
          "Generate"
        ],
        "summary": "Quote an operation",
        "description": "The exact price of frames, animate, music, character_images, place_plates or director_action. Nothing is spent. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteAnswer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/export": {
      "post": {
        "operationId": "exportFilm",
        "tags": [
          "Export"
        ],
        "summary": "Export the film",
        "description": "Starts the render of the timeline to one MP4 and needs no max_credits. Follow the job with GET /jobs/{jid}. Needs the export scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "202": {
            "description": "The export started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The export job.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "export"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/export/plan": {
      "get": {
        "operationId": "getExportPlan",
        "tags": [
          "Export"
        ],
        "summary": "Get the export plan",
        "description": "The length, the clips and the drafts. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          }
        ],
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The export plan.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/projects/{pid}/media/{aid}/file": {
      "get": {
        "operationId": "downloadMedia",
        "tags": [
          "Export"
        ],
        "summary": "Download a media file",
        "description": "Redirects to the file. A client that follows redirects receives the file. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/MediaId"
          }
        ],
        "responses": {
          "200": {
            "description": "The file, after the redirect is followed.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "302": {
            "description": "Redirect to the file.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Location": {
                "description": "Where the file is.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/jobs": {
      "get": {
        "operationId": "listJobs",
        "tags": [
          "Jobs"
        ],
        "summary": "List jobs",
        "description": "Needs the read scope.",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Only the jobs of this project.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/jobs/{jid}": {
      "get": {
        "operationId": "getJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Get a job",
        "description": "Poll until final is true. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/jobs/{jid}/cancel": {
      "post": {
        "operationId": "cancelJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Cancel a job",
        "description": "Cancels a running job. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/credits": {
      "get": {
        "operationId": "getCredits",
        "tags": [
          "Credits"
        ],
        "summary": "Get the credit balance",
        "description": "Your credits and plan. A call with a valid key is also the quickest way to check the key. Needs the read scope.",
        "responses": {
          "200": {
            "description": "The balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credits"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "tags": [
          "Tools"
        ],
        "summary": "List the Studio apps",
        "description": "The apps that /tools/{tool}/runs can start. Needs no key.",
        "responses": {
          "200": {
            "description": "The tools.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ToolInfo"
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/tools/recommend": {
      "post": {
        "operationId": "recommendTool",
        "tags": [
          "Tools"
        ],
        "summary": "Recommend a tool",
        "description": "Describe what you want to make and get the best Studio app for it. Needs the read scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolRecommendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The recommendation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The recommended tools.",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/tools/{tool}/runs": {
      "get": {
        "operationId": "listToolRuns",
        "tags": [
          "Tools"
        ],
        "summary": "List runs of a tool",
        "description": "Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          }
        ],
        "responses": {
          "200": {
            "description": "The runs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ToolRunSummary"
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      },
      "post": {
        "operationId": "startToolRun",
        "tags": [
          "Tools"
        ],
        "summary": "Start a run",
        "description": "Starts a Studio app from a prompt. The app asks for budgets as it plans, and the call approves them only within max_credits. When a budget does not fit, the run waits with status needs_approval until you raise the cap with the approve route. Credits: Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolRunRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With dry_run: true, the quote. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRunStarted"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "202": {
            "description": "The run started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRunStarted"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Priced in credits and quoted before it runs. Send max_credits, and dry_run: true to see the exact price first."
      }
    },
    "/api/v1/tools/{tool}/runs/{pid}": {
      "get": {
        "operationId": "getToolRun",
        "tags": [
          "Tools"
        ],
        "summary": "Get a run",
        "description": "The status of a run, including the budget gate it waits at, the question it asks and its outputs. Add ?full=1 for the whole view of the tool. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          },
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/v1/tools/{tool}/runs/{pid}/approve": {
      "post": {
        "operationId": "approveToolRun",
        "tags": [
          "Tools"
        ],
        "summary": "Raise the budget of a run",
        "description": "Raises max_credits for a run that waits for approval, and approves its open budget gate when it fits. Credits: Raising the cap lets the run spend more credits. Nothing above max_credits is ever approved. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          },
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolApproveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ],
        "x-credits": "Raising the cap lets the run spend more credits. Nothing above max_credits is ever approved."
      }
    },
    "/api/v1/tools/{tool}/runs/{pid}/stop": {
      "post": {
        "operationId": "stopToolRun",
        "tags": [
          "Tools"
        ],
        "summary": "Stop a run",
        "description": "Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          },
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/tools/{tool}/runs/{pid}/message": {
      "post": {
        "operationId": "messageToolRun",
        "tags": [
          "Tools"
        ],
        "summary": "Send a message to a run",
        "description": "Send text, or answer a question of the app with item_id and answer. Needs the generate scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          },
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "generate"
            ]
          }
        ]
      }
    },
    "/api/v1/tools/{tool}/quote": {
      "post": {
        "operationId": "quoteToolRun",
        "tags": [
          "Tools"
        ],
        "summary": "Quote a run",
        "description": "The price of a run before it starts. Nothing is spent. Some tools give no price until they plan: then known is false. Needs the read scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ToolId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolQuote"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          },
          {
            "oauth2": [
              "read"
            ]
          }
        ]
      }
    },
    "/api/account/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "API keys"
        ],
        "summary": "List your API keys",
        "description": "Works with a signed in Studio session, not with an API key. A key cannot make other keys.",
        "responses": {
          "200": {
            "description": "The keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "description": "saas on getziztu.com."
                    },
                    "keys": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "A scope you can give a key."
                      }
                    },
                    "defaults": {
                      "type": "object",
                      "description": "The default and the highest rate limit.",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "keys"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "cookieAuth": []
          }
        ]
      },
      "post": {
        "operationId": "createApiKey",
        "tags": [
          "API keys"
        ],
        "summary": "Create an API key",
        "description": "Works with a signed in Studio session, not with an API key. A key cannot make other keys. The key is shown once, so copy it from the answer. You can have up to 20 active keys.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key, shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "The full key, starting with sk_sakuga_. It is shown once."
                    },
                    "record": {
                      "$ref": "#/components/schemas/ApiKey"
                    },
                    "note": {
                      "type": "string",
                      "description": "A reminder to copy the key."
                    }
                  },
                  "required": [
                    "key",
                    "record"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "cookieAuth": []
          }
        ]
      }
    },
    "/api/account/api-keys/{id}": {
      "delete": {
        "operationId": "revokeApiKey",
        "tags": [
          "API keys"
        ],
        "summary": "Revoke an API key",
        "description": "Works with a signed in Studio session, not with an API key. A key cannot make other keys. The key stops working at once.",
        "parameters": [
          {
            "$ref": "#/components/parameters/KeyId"
          }
        ],
        "responses": {
          "200": {
            "description": "The revoked key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/ApiKey"
                    }
                  },
                  "required": [
                    "record"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [
          {
            "cookieAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "sk_sakuga_...",
        "description": "An API key made in the Studio under Settings, API keys, sent as Authorization: Bearer sk_sakuga_your_key. A key acts as your account and spends its credits. An OAuth access token from the oauth2 scheme is sent the same way."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The same API key in the X-API-Key header. Use this or the bearer header."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1, authorization code with PKCE (S256 is required), for apps that sign a person in to Ziztu. Clients are public (no client secret) and register at https://getziztu.com/oauth/register. The server metadata is at https://getziztu.com/.well-known/oauth-authorization-server. The person ticks the scopes on the sign-in screen and a token can never do more than they ticked. Access tokens last an hour and renew with a refresh token, which lasts 30 days after its last use.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://getziztu.com/oauth/authorize",
            "tokenUrl": "https://getziztu.com/oauth/token",
            "refreshUrl": "https://getziztu.com/oauth/token",
            "scopes": {
              "read": "See projects, characters, shots, jobs and the credit balance.",
              "generate": "Create and edit projects, and start paid work within max_credits.",
              "export": "Render finished films and download them.",
              "plan": "Create projects, talk to the Director and write scripts. It never allows paid generation or export."
            }
          }
        }
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "sakuga_sid",
        "description": "The signed in Studio session. Only the API key routes use it: a key cannot make other keys."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A machine readable code. The codes the docs list are in the description of this API."
              },
              "message": {
                "type": "string",
                "description": "A sentence for a person."
              },
              "field": {
                "type": "string",
                "description": "For a 400: the field that is missing or wrong."
              },
              "scope": {
                "type": "string",
                "description": "For a 403: the scope the call needs."
              },
              "needed": {
                "type": "number",
                "description": "For over_max_credits: the real price in credits."
              },
              "max_credits": {
                "type": "number",
                "description": "For over_max_credits: the cap that was sent."
              },
              "quote": {
                "$ref": "#/components/schemas/Quote"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "error"
        ]
      },
      "Quote": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "description": "What was priced.",
            "enum": [
              "frames",
              "animate",
              "music",
              "character_images",
              "place_plates",
              "director_action"
            ]
          },
          "total_credits": {
            "type": "number",
            "description": "The exact price in credits of the items that can run. Nothing is spent by a quote."
          },
          "demo": {
            "type": "boolean",
            "description": "True while the Studio is in demo mode."
          },
          "charge_now": {
            "type": "number",
            "description": "The credits taken by this call."
          },
          "confirm_above": {
            "type": "number",
            "description": "Above this many credits a call also needs confirm: true."
          },
          "needs_confirm": {
            "type": "boolean",
            "description": "True when confirm: true is required for this call."
          },
          "confirm_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Why a confirmation is needed."
            }
          },
          "blocked": {
            "type": "integer",
            "description": "How many items cannot run yet."
          },
          "balance": {
            "type": [
              "number",
              "null"
            ],
            "description": "The credit balance of the account."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuoteItem"
            }
          }
        },
        "required": [
          "operation",
          "total_credits",
          "items"
        ],
        "additionalProperties": true
      },
      "QuoteItem": {
        "type": "object",
        "properties": {
          "shot_id": {
            "type": "string",
            "description": "For a shot item."
          },
          "track_id": {
            "type": "string",
            "description": "For a music item."
          },
          "character_id": {
            "type": "string",
            "description": "For a character image item."
          },
          "place_id": {
            "type": "string",
            "description": "For a place plate item."
          },
          "message_id": {
            "type": "string",
            "description": "For a Director action item."
          },
          "action_id": {
            "type": "string",
            "description": "For a Director action item."
          },
          "label": {
            "type": "string",
            "description": "What the item is."
          },
          "credits": {
            "type": "number",
            "description": "The price of this item in credits."
          },
          "requests": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "endpoint": {
                  "type": "string",
                  "description": "The model endpoint."
                },
                "credits": {
                  "type": "number",
                  "description": "Credits for this request."
                },
                "priced": {
                  "type": "boolean",
                  "description": "True when the price is known."
                }
              },
              "additionalProperties": true
            }
          },
          "gate": {
            "type": [
              "object",
              "null"
            ],
            "description": "The spend gate outcome for this item.",
            "additionalProperties": true
          },
          "blocked": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the item cannot run yet, or null."
          }
        },
        "required": [
          "label",
          "credits"
        ],
        "additionalProperties": true
      },
      "QuoteAnswer": {
        "type": "object",
        "properties": {
          "quote": {
            "$ref": "#/components/schemas/Quote"
          }
        },
        "required": [
          "quote"
        ]
      },
      "PaidResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "started when every item began, partial when one failed after others began.",
            "enum": [
              "started",
              "partial"
            ]
          },
          "job_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A job id."
            }
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Job"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "An item that could not start.",
              "additionalProperties": true
            }
          },
          "spent_credits": {
            "type": "number",
            "description": "Credits reserved by this call."
          },
          "max_credits": {
            "type": "number",
            "description": "The cap that was sent."
          },
          "quote": {
            "$ref": "#/components/schemas/Quote"
          }
        },
        "required": [
          "status",
          "job_ids"
        ],
        "additionalProperties": true
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The job id."
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The project the job belongs to."
          },
          "kind": {
            "type": "string",
            "description": "The kind of job."
          },
          "label": {
            "type": "string",
            "description": "A short name."
          },
          "status": {
            "type": "string",
            "description": "The state of the job."
          },
          "progress": {
            "type": "number",
            "description": "From 0 to 1."
          },
          "credits": {
            "type": [
              "number",
              "null"
            ],
            "description": "Credits charged for the job."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The failure, when there is one."
          },
          "outputs": {
            "type": "array",
            "items": {},
            "description": "What the job made."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it began.",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it ended.",
            "format": "date-time"
          },
          "final": {
            "type": "boolean",
            "description": "True when the job will not change again: poll until it is true."
          }
        },
        "required": [
          "id",
          "status",
          "final"
        ],
        "additionalProperties": true
      },
      "Media": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The media id."
          },
          "kind": {
            "type": "string",
            "description": "image, video or audio."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The file name."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pixels."
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pixels."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Seconds."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where it came from."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was made."
          },
          "file_url": {
            "type": "string",
            "description": "The API download of the file (GET with your key; it redirects to the file)."
          },
          "studio_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Studio address of the file."
          }
        },
        "required": [
          "id",
          "file_url"
        ],
        "additionalProperties": true
      },
      "ProjectSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The project id."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "aspect": {
            "type": "string",
            "description": "The aspect ratio, for example 9:16."
          },
          "preset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The style preset."
          },
          "shots": {
            "type": "integer",
            "description": "How many shots."
          },
          "clips": {
            "type": "integer",
            "description": "How many shots have a clip."
          },
          "characters": {
            "type": "integer",
            "description": "How many characters."
          },
          "places": {
            "type": "integer",
            "description": "How many places."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Seconds."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made."
          },
          "updated_at": {
            "type": "string",
            "description": "When it last changed."
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The project id."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "aspect": {
            "type": "string",
            "description": "The aspect ratio, for example 9:16."
          },
          "preset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The style preset."
          },
          "clips": {
            "type": "integer",
            "description": "How many shots have a clip."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Seconds."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made."
          },
          "updated_at": {
            "type": "string",
            "description": "When it last changed."
          },
          "rev": {
            "type": "integer",
            "description": "Counts every change."
          },
          "style": {
            "type": "object",
            "properties": {
              "preset_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The style preset."
              },
              "aspect": {
                "type": "string",
                "description": "The aspect ratio."
              },
              "style_line": {
                "type": "string",
                "description": "The style sentence."
              }
            }
          },
          "brief": {
            "type": [
              "object",
              "null"
            ],
            "description": "The brief of the project.",
            "additionalProperties": true
          },
          "characters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Character"
            }
          },
          "places": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Place"
            }
          },
          "shots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Shot"
            }
          },
          "music": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MusicTrack"
            }
          },
          "captions": {
            "type": "integer",
            "description": "How many captions."
          },
          "media": {
            "type": "integer",
            "description": "How many media files."
          },
          "exports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Media"
            },
            "description": "The exported films, newest first."
          },
          "document": {
            "type": "object",
            "description": "The raw project document. Only with ?full=1.",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "Character": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The character id."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "description": {
            "type": "string",
            "description": "Who they are."
          },
          "identity": {
            "type": "string",
            "description": "The identity line used in prompts."
          },
          "voice": {
            "type": "string",
            "description": "The voice."
          },
          "color": {
            "type": "string",
            "description": "The color tag."
          },
          "looks": {
            "type": "string",
            "description": "What they look like."
          },
          "sheet_prompt": {
            "type": "string",
            "description": "The prompt of the character sheet."
          },
          "portrait_prompt": {
            "type": "string",
            "description": "The prompt of the portrait."
          },
          "sheet_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The media id of the sheet."
          },
          "portrait_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The media id of the portrait."
          },
          "ref_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          },
          "image_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "Place": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The place id."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "description": {
            "type": "string",
            "description": "What it is."
          },
          "identity": {
            "type": "string",
            "description": "The identity line used in prompts."
          },
          "time_of_day": {
            "type": "string",
            "description": "The time of day."
          },
          "weather": {
            "type": "string",
            "description": "The weather."
          },
          "mood": {
            "type": "string",
            "description": "The mood."
          },
          "plate_prompt": {
            "type": "string",
            "description": "The prompt of the plate."
          },
          "plate_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The media id of the main plate."
          },
          "plate_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          },
          "ref_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "Shot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The shot id."
          },
          "index": {
            "type": "integer",
            "description": "The position, from 1."
          },
          "kind": {
            "type": "string",
            "description": "The kind of shot."
          },
          "title": {
            "type": "string",
            "description": "The title."
          },
          "idea": {
            "type": "string",
            "description": "What happens."
          },
          "duration": {
            "type": "number",
            "description": "The length in seconds."
          },
          "on_screen": {
            "type": [
              "number",
              "null"
            ],
            "description": "The length on screen in seconds."
          },
          "model": {
            "type": "string",
            "description": "The video model id. The ids are listed on the API docs page."
          },
          "resolution": {
            "type": "string",
            "description": "The size."
          },
          "mood": {
            "type": "string",
            "description": "The mood."
          },
          "shot": {
            "type": "object",
            "properties": {
              "size": {
                "type": "string",
                "description": "The shot size."
              },
              "angle": {
                "type": "string",
                "description": "The angle."
              },
              "camera": {
                "type": "string",
                "description": "The camera move."
              },
              "distance_m": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Distance in meters."
              }
            },
            "additionalProperties": true
          },
          "character_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A character id."
            }
          },
          "place_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The place id."
          },
          "dialogue": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "character_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Who speaks."
                },
                "line": {
                  "type": "string",
                  "description": "The line."
                },
                "delivery": {
                  "type": "string",
                  "description": "How it is said."
                }
              }
            }
          },
          "shot_description": {
            "type": "string",
            "description": "The shot described."
          },
          "start": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "description": "keyframe, continue, plate or none."
              },
              "asset_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The first frame media id."
              },
              "from_shot_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The shot this one continues."
              }
            }
          },
          "end_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last frame media id."
          },
          "first_frame_options": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          },
          "takes": {
            "type": "integer",
            "description": "How many takes."
          },
          "clip": {
            "type": [
              "object",
              "null"
            ],
            "description": "The active clip: take_id, video (Media), trim_in, trim_out.",
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "description": "What the shot needs next.",
            "enum": [
              "clip",
              "ready_to_animate",
              "needs_first_frame"
            ]
          }
        },
        "required": [
          "id",
          "index",
          "status"
        ],
        "additionalProperties": true
      },
      "MusicTrack": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The track id."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "start": {
            "type": "number",
            "description": "Where it starts, in seconds."
          },
          "length": {
            "type": "number",
            "description": "Its length in seconds."
          },
          "model": {
            "type": "string",
            "description": "The music model id."
          },
          "prompt": {
            "type": "string",
            "description": "What the music should be."
          },
          "lyrics": {
            "type": "string",
            "description": "Lyrics, when the model sings."
          },
          "volume": {
            "type": "number",
            "description": "The volume."
          },
          "audio": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Media"
              },
              {
                "type": "null"
              }
            ]
          },
          "versions": {
            "type": "array",
            "items": {}
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The job that is making it."
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "DirectorAction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The action id."
          },
          "type": {
            "type": "string",
            "description": "What the action does."
          },
          "label": {
            "type": "string",
            "description": "A short description."
          },
          "paid": {
            "type": "boolean",
            "description": "True when the action costs credits."
          },
          "status": {
            "type": "string",
            "description": "The state of the action."
          },
          "gate": {
            "type": [
              "object",
              "null"
            ],
            "description": "The spend gate outcome.",
            "additionalProperties": true
          },
          "result": {},
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The failure, when there is one."
          }
        },
        "required": [
          "id",
          "type"
        ],
        "additionalProperties": true
      },
      "DirectorMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The message id. Use it with apply-all."
          },
          "role": {
            "type": "string",
            "description": "Who wrote it."
          },
          "text": {
            "type": "string",
            "description": "The reply."
          },
          "at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model that wrote it."
          },
          "error": {
            "type": "boolean",
            "description": "True when the message is an error."
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectorAction"
            },
            "description": "The changes the Director proposes."
          }
        },
        "required": [
          "id",
          "text"
        ],
        "additionalProperties": true
      },
      "Credits": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "description": "saas on getziztu.com."
          },
          "credits": {
            "type": "number",
            "description": "The credit balance."
          },
          "plan": {
            "type": [
              "object",
              "null"
            ],
            "description": "The plan of the account.",
            "additionalProperties": true
          }
        },
        "required": [
          "mode"
        ],
        "additionalProperties": true
      },
      "ToolInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The tool id, the value of {tool}.",
            "enum": [
              "animate",
              "manga",
              "kamishibai",
              "manzai",
              "zukai"
            ]
          },
          "name": {
            "type": "string",
            "description": "The name of the Studio app."
          },
          "makes": {
            "type": [
              "string",
              "null"
            ],
            "description": "What it makes."
          },
          "ready": {
            "type": "boolean",
            "description": "True when the tool can run now."
          },
          "registered": {
            "type": "boolean",
            "description": "True when the tool is available."
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": true
      },
      "ToolQuote": {
        "type": "object",
        "properties": {
          "tool": {
            "type": "string",
            "description": "The tool id."
          },
          "known": {
            "type": "boolean",
            "description": "True when the tool gave a price. False means max_credits caps what the run may approve."
          },
          "credits": {
            "type": [
              "number",
              "null"
            ],
            "description": "The estimate in credits."
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "description": "What it is."
                },
                "credits": {
                  "type": "number",
                  "description": "Credits."
                },
                "count": {
                  "type": "integer",
                  "description": "How many."
                }
              }
            }
          },
          "estimate": {
            "type": "boolean",
            "description": "True for an estimate."
          },
          "note": {
            "type": "string",
            "description": "How to read the price."
          },
          "max_credits": {
            "type": [
              "number",
              "null"
            ],
            "description": "The cap that was sent."
          },
          "needs_confirm": {
            "type": "boolean",
            "description": "True when confirm: true is required."
          },
          "confirm_above": {
            "type": "number",
            "description": "Above this many credits a call also needs confirm: true."
          }
        },
        "required": [
          "tool",
          "known",
          "credits"
        ],
        "additionalProperties": true
      },
      "ToolRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The run id, the value of {pid} on the run routes."
          },
          "tool": {
            "type": "string",
            "description": "The tool id."
          },
          "status": {
            "type": "string",
            "description": "needs_approval and needs_answer wait for you. running, idle or done otherwise."
          },
          "agent_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The status the app reports."
          },
          "running": {
            "type": "boolean",
            "description": "True while the app works."
          },
          "demo": {
            "type": "boolean",
            "description": "True in demo mode."
          },
          "phase": {
            "type": [
              "string",
              "null"
            ],
            "description": "The phase."
          },
          "gate": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The gate id."
              },
              "title": {
                "type": "string",
                "description": "What is asked."
              },
              "credits": {
                "type": "number",
                "description": "Credits it asks for."
              },
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "A line of the price.",
                  "additionalProperties": true
                }
              }
            }
          },
          "question": {
            "type": [
              "object",
              "null"
            ],
            "description": "A question the app asks you. Answer it with the message route.",
            "additionalProperties": true
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The stage id."
                },
                "label": {
                  "type": "string",
                  "description": "The stage."
                },
                "state": {
                  "type": "string",
                  "description": "Its state."
                },
                "credits": {
                  "type": "number",
                  "description": "Credits."
                }
              }
            }
          },
          "budget": {
            "type": "object",
            "properties": {
              "approved_credits": {
                "type": "number",
                "description": "Credits approved so far."
              },
              "spent_credits": {
                "type": "number",
                "description": "Credits spent so far."
              }
            }
          },
          "api": {
            "type": [
              "object",
              "null"
            ],
            "description": "The cap and the approvals of this run: max_credits, confirm, approved_credits, waiting, decisions, last_error.",
            "additionalProperties": true
          },
          "last": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "The last steps: kind and text.",
              "additionalProperties": true
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The failure, when there is one."
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Media"
            },
            "description": "The newest results."
          }
        },
        "required": [
          "id",
          "tool",
          "status"
        ],
        "additionalProperties": true
      },
      "ToolRunSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The run id."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "The title."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The state."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it last changed."
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "ToolRunStarted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "quote for a dry run, started when the run began.",
            "enum": [
              "quote",
              "started"
            ]
          },
          "quote": {
            "$ref": "#/components/schemas/ToolQuote"
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The project of the run, when you sent one."
          },
          "run": {
            "$ref": "#/components/schemas/ToolRun"
          }
        },
        "required": [
          "status",
          "quote"
        ],
        "additionalProperties": true
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The key id."
          },
          "name": {
            "type": "string",
            "description": "The name you gave it."
          },
          "prefix": {
            "type": "string",
            "description": "The start of the key, to tell keys apart."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A scope.",
              "enum": [
                "read",
                "generate",
                "export"
              ]
            }
          },
          "rate_limit_per_min": {
            "type": "integer",
            "description": "Requests a minute for this key."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was last used."
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was revoked."
          },
          "active": {
            "type": "boolean",
            "description": "False once revoked."
          }
        },
        "required": [
          "id",
          "name",
          "scopes"
        ],
        "additionalProperties": true
      },
      "PaidFields": {
        "type": "object",
        "properties": {
          "max_credits": {
            "type": "number",
            "description": "The most this call may spend. Required. The call is refused if the real price is higher, and nothing starts.",
            "minimum": 0
          },
          "confirm": {
            "type": "boolean",
            "description": "Required above 5,000 credits, or when the quote asks for a review."
          },
          "skip_blocked": {
            "type": "boolean",
            "description": "Run the items that can run and leave out the blocked ones."
          },
          "dry_run": {
            "type": "boolean",
            "description": "Return the exact quote and start nothing."
          }
        },
        "required": [
          "max_credits"
        ]
      },
      "ProjectCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the project."
          },
          "aspect": {
            "type": "string",
            "description": "The aspect ratio, for example 9:16 for a vertical drama."
          },
          "presetId": {
            "type": "string",
            "description": "A style preset id."
          }
        },
        "required": [
          "name"
        ]
      },
      "ProjectPatch": {
        "type": "object",
        "description": "The fields to change. Fields you leave out stay as they are.",
        "additionalProperties": true
      },
      "CharacterInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name."
          },
          "description": {
            "type": "string",
            "description": "Who they are."
          },
          "identity": {
            "type": "string",
            "description": "The identity line."
          },
          "voice": {
            "type": "string",
            "description": "The voice."
          },
          "color": {
            "type": "string",
            "description": "The color tag."
          },
          "looks": {
            "type": "string",
            "description": "What they look like."
          },
          "sheet_prompt": {
            "type": "string",
            "description": "The sheet prompt."
          },
          "portrait_prompt": {
            "type": "string",
            "description": "The portrait prompt."
          },
          "ref_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          },
          "sheet_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A media id."
          },
          "portrait_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A media id."
          }
        },
        "additionalProperties": false
      },
      "PlaceInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name."
          },
          "description": {
            "type": "string",
            "description": "What it is."
          },
          "identity": {
            "type": "string",
            "description": "The identity line."
          },
          "time_of_day": {
            "type": "string",
            "description": "The time of day."
          },
          "weather": {
            "type": "string",
            "description": "The weather."
          },
          "mood": {
            "type": "string",
            "description": "The mood."
          },
          "plate_prompt": {
            "type": "string",
            "description": "The plate prompt."
          },
          "ref_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A media id."
            }
          },
          "plate_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A media id."
          }
        },
        "additionalProperties": false
      },
      "ShotInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "The title."
          },
          "idea": {
            "type": "string",
            "description": "What happens."
          },
          "duration": {
            "type": "number",
            "description": "The length in seconds."
          },
          "model": {
            "type": "string",
            "description": "The video model id. The ids are listed on the API docs page."
          },
          "resolution": {
            "type": "string",
            "description": "The size."
          },
          "mood": {
            "type": "string",
            "description": "The mood."
          },
          "shot": {
            "type": "object",
            "properties": {
              "size": {
                "type": "string",
                "description": "The shot size."
              },
              "angle": {
                "type": "string",
                "description": "The angle."
              },
              "camera": {
                "type": "string",
                "description": "The camera move."
              },
              "distance_m": {
                "type": "number",
                "description": "Distance in meters."
              }
            },
            "additionalProperties": true
          },
          "character_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A character id."
            }
          },
          "enter_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A character id."
            }
          },
          "place_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The place id."
          },
          "dialogue": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "character_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Who speaks."
                },
                "line": {
                  "type": "string",
                  "description": "The line."
                },
                "delivery": {
                  "type": "string",
                  "description": "How it is said."
                }
              }
            }
          },
          "soundscape": {},
          "music": {},
          "shot_description": {
            "type": "string",
            "description": "The shot described."
          },
          "motion_prompt": {
            "type": "string",
            "description": "The motion prompt."
          },
          "keyframe_prompt": {
            "type": "string",
            "description": "The first frame prompt."
          },
          "seed": {
            "type": "integer",
            "description": "The seed."
          },
          "start_mode": {
            "type": "string",
            "description": "How the shot starts.",
            "enum": [
              "keyframe",
              "continue",
              "plate",
              "none"
            ]
          },
          "start_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A media id."
          },
          "end_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A media id."
          }
        },
        "additionalProperties": false
      },
      "MusicInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name."
          },
          "start": {
            "type": "number",
            "description": "Where it starts, in seconds."
          },
          "length": {
            "type": "number",
            "description": "Its length in seconds."
          },
          "prompt": {
            "type": "string",
            "description": "What the music should be."
          },
          "model": {
            "type": "string",
            "description": "The music model id. The ids are listed on the API docs page."
          },
          "lyrics": {
            "type": "string",
            "description": "Lyrics."
          },
          "mood": {
            "type": "string",
            "description": "The mood."
          },
          "volume": {
            "type": "number",
            "description": "The volume."
          },
          "fade_in": {
            "type": "number",
            "description": "Fade in, in seconds."
          },
          "fade_out": {
            "type": "number",
            "description": "Fade out, in seconds."
          }
        },
        "additionalProperties": false
      },
      "DirectorPlanRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "The story idea."
          }
        },
        "required": [
          "text"
        ],
        "additionalProperties": true
      },
      "DirectorChatRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "What to plan or change, in plain words."
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": true
      },
      "GenerateFramesRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "shot_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A shot id."
                },
                "description": "Leave out for every shot without a first frame."
              },
              "count": {
                "type": "integer",
                "description": "Images per shot.",
                "minimum": 1,
                "maximum": 4
              },
              "model": {
                "type": "string",
                "description": "The image model id."
              }
            }
          }
        ]
      },
      "GenerateAnimateRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "shot_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A shot id."
                },
                "description": "Leave out for every shot without a clip."
              }
            }
          }
        ]
      },
      "GenerateMusicRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "track_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "A music track id."
                },
                "description": "Leave out for every planned track without audio."
              }
            }
          }
        ]
      },
      "GenerateCharacterImagesRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "character_id": {
                "type": "string",
                "description": "The character."
              },
              "kind": {
                "type": "string",
                "description": "sheet or portrait.",
                "enum": [
                  "sheet",
                  "portrait"
                ]
              },
              "count": {
                "type": "integer",
                "description": "Images.",
                "minimum": 1,
                "maximum": 4
              },
              "model": {
                "type": "string",
                "description": "The image model id."
              }
            },
            "required": [
              "character_id"
            ]
          }
        ]
      },
      "GeneratePlacePlatesRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "place_id": {
                "type": "string",
                "description": "The place."
              },
              "count": {
                "type": "integer",
                "description": "Images.",
                "minimum": 1,
                "maximum": 4
              },
              "model": {
                "type": "string",
                "description": "The image model id."
              }
            },
            "required": [
              "place_id"
            ]
          }
        ]
      },
      "GenerateDirectorActionRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "message_id": {
                "type": "string",
                "description": "The Director message."
              },
              "action_id": {
                "type": "string",
                "description": "The action in that message."
              }
            },
            "required": [
              "message_id",
              "action_id"
            ]
          }
        ]
      },
      "QuoteRequest": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "description": "What to price.",
            "enum": [
              "frames",
              "animate",
              "music",
              "character_images",
              "place_plates",
              "director_action"
            ]
          },
          "shot_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A shot id."
            }
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A music track id."
            }
          },
          "count": {
            "type": "integer",
            "description": "Images per item.",
            "minimum": 1,
            "maximum": 4
          },
          "model": {
            "type": "string",
            "description": "The model id."
          },
          "character_id": {
            "type": "string",
            "description": "For character_images."
          },
          "place_id": {
            "type": "string",
            "description": "For place_plates."
          },
          "message_id": {
            "type": "string",
            "description": "For director_action."
          },
          "action_id": {
            "type": "string",
            "description": "For director_action."
          }
        },
        "required": [
          "operation"
        ],
        "additionalProperties": true
      },
      "ScriptDraftRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "idea": {
                "type": "string",
                "description": "The story idea."
              },
              "format": {
                "type": "string",
                "description": "The kind of script.",
                "enum": [
                  "short-film",
                  "anime-ep",
                  "ad",
                  "youtube"
                ]
              },
              "project_id": {
                "type": "string",
                "description": "Write into this project."
              },
              "name": {
                "type": "string",
                "description": "The name of a new project."
              },
              "aspect": {
                "type": "string",
                "description": "The aspect ratio of a new project."
              },
              "plan_only": {
                "type": "boolean",
                "description": "Write the story plan and stop."
              },
              "plan_job_id": {
                "type": "string",
                "description": "Continue from the story plan of an earlier job."
              },
              "story_plan": {
                "type": "object",
                "description": "A story plan to use.",
                "additionalProperties": true
              },
              "replace_existing": {
                "type": "boolean",
                "description": "Replace the script the project has."
              }
            }
          }
        ]
      },
      "ScriptAskRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "The question or the change you want."
              },
              "scene": {
                "type": "integer",
                "description": "A scene number, from 1."
              },
              "scope": {
                "type": "string",
                "description": "What the question is about."
              }
            },
            "required": [
              "message"
            ]
          }
        ]
      },
      "ScriptEditsRequest": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "description": "The message that proposed the edits."
          },
          "decision": {
            "type": "string",
            "description": "applied or rejected.",
            "enum": [
              "applied",
              "rejected"
            ]
          },
          "edit_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An edit id."
            },
            "description": "Leave out for all of them."
          }
        },
        "required": [
          "message_id",
          "decision"
        ]
      },
      "ScriptDoctorRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "scope": {
                "type": "string",
                "description": "The whole draft or one scene.",
                "enum": [
                  "draft",
                  "scene"
                ]
              },
              "scene": {
                "type": "integer",
                "description": "A scene number, from 1."
              },
              "lens": {
                "type": "string",
                "description": "The story lens."
              },
              "focus": {
                "type": "string",
                "description": "What to look at, up to 600 characters."
              }
            }
          }
        ]
      },
      "ScriptImportRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Fountain, Final Draft or plain text."
          },
          "project_id": {
            "type": "string",
            "description": "Import into this project."
          },
          "name": {
            "type": "string",
            "description": "The name of a new project."
          },
          "format": {
            "type": "string",
            "description": "The format of the text."
          },
          "mode": {
            "type": "string",
            "description": "replace or append.",
            "enum": [
              "replace",
              "append"
            ]
          },
          "replace_existing": {
            "type": "boolean",
            "description": "Replace a script the project has."
          },
          "aspect": {
            "type": "string",
            "description": "The aspect ratio of a new project."
          }
        },
        "required": [
          "text"
        ]
      },
      "ScriptExportRequest": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string",
            "description": "fountain comes back as text. pdf and fdx come back as a ten minute link.",
            "enum": [
              "fountain",
              "pdf",
              "fdx"
            ]
          },
          "title_page": {
            "type": "boolean",
            "description": "Add a title page."
          }
        },
        "required": [
          "format"
        ]
      },
      "ScriptShotsRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "scenes": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "description": "A scene number."
                },
                "description": "Leave out for every scene."
              }
            }
          }
        ]
      },
      "ToolRecommendRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "What you want to make."
          }
        },
        "required": [
          "query"
        ]
      },
      "ToolRunRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaidFields"
          },
          {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string",
                "description": "What to make, up to 4000 characters.",
                "maxLength": 4000
              },
              "settings": {
                "type": "object",
                "description": "Settings of the tool.",
                "additionalProperties": true
              },
              "project_id": {
                "type": "string",
                "description": "Continue an existing run."
              },
              "title": {
                "type": "string",
                "description": "A title."
              },
              "inputs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "asset_id": {
                      "type": "string",
                      "description": "A media id."
                    },
                    "role": {
                      "type": "string",
                      "description": "What the file is for."
                    },
                    "note": {
                      "type": "string",
                      "description": "A note."
                    }
                  }
                },
                "description": "Up to 6 files."
              }
            },
            "required": [
              "prompt"
            ]
          }
        ]
      },
      "ToolApproveRequest": {
        "type": "object",
        "properties": {
          "max_credits": {
            "type": "number",
            "description": "The most this run may spend in all.",
            "minimum": 0
          },
          "confirm": {
            "type": "boolean",
            "description": "Required above 5,000 credits."
          }
        },
        "required": [
          "max_credits"
        ]
      },
      "ToolMessageRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "A message to the app, up to 4000 characters."
          },
          "item_id": {
            "type": "string",
            "description": "The id of the question you answer."
          },
          "answer": {
            "type": "string",
            "description": "The answer."
          }
        }
      },
      "ToolQuoteRequest": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "What to make."
          },
          "settings": {
            "type": "object",
            "description": "Settings of the tool.",
            "additionalProperties": true
          }
        }
      },
      "ApiKeyCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "A name for the key, up to 60 characters."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A scope.",
              "enum": [
                "read",
                "generate",
                "export"
              ]
            },
            "description": "Defaults to read."
          },
          "rate_limit_per_min": {
            "type": "integer",
            "description": "Requests a minute, from 1 to 1200.",
            "minimum": 1,
            "maximum": 1200
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "responses": {
      "BadRequest": {
        "description": "A field is missing or wrong (bad_request, max_credits_required). The error says which field.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "No key was sent (unauthenticated) or the key or token is not valid (invalid_api_key, invalid_token).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "The price is higher than max_credits (over_max_credits), or the account has too few credits. Nothing was started.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the scope the call needs (insufficient_scope). The error says which.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The project, shot, job or run does not exist for this account (not_found).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "confirm_required (send confirm: true) or idempotency_in_progress.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "blocked, nothing_to_do or idempotency_key_reused.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "More than 120 requests a minute per key by default, or 30 paid POSTs a minute. Wait for Retry-After seconds.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "The Studio app is not available right now (tool_unavailable).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "parameters": {
      "ProjectId": {
        "name": "pid",
        "in": "path",
        "required": true,
        "description": "The project id.",
        "schema": {
          "type": "string"
        }
      },
      "ShotId": {
        "name": "sid",
        "in": "path",
        "required": true,
        "description": "The shot id.",
        "schema": {
          "type": "string"
        }
      },
      "CharacterId": {
        "name": "cid",
        "in": "path",
        "required": true,
        "description": "The character id.",
        "schema": {
          "type": "string"
        }
      },
      "PlaceId": {
        "name": "lid",
        "in": "path",
        "required": true,
        "description": "The place id.",
        "schema": {
          "type": "string"
        }
      },
      "MusicId": {
        "name": "mid",
        "in": "path",
        "required": true,
        "description": "The music track id.",
        "schema": {
          "type": "string"
        }
      },
      "MessageId": {
        "name": "mid",
        "in": "path",
        "required": true,
        "description": "The Director message id (the id of the reply).",
        "schema": {
          "type": "string"
        }
      },
      "ActionId": {
        "name": "aid",
        "in": "path",
        "required": true,
        "description": "The id of one proposed action in the reply.",
        "schema": {
          "type": "string"
        }
      },
      "MediaId": {
        "name": "aid",
        "in": "path",
        "required": true,
        "description": "The media id.",
        "schema": {
          "type": "string"
        }
      },
      "JobId": {
        "name": "jid",
        "in": "path",
        "required": true,
        "description": "The job id.",
        "schema": {
          "type": "string"
        }
      },
      "VersionId": {
        "name": "vid",
        "in": "path",
        "required": true,
        "description": "The script version id.",
        "schema": {
          "type": "string"
        }
      },
      "ToolId": {
        "name": "tool",
        "in": "path",
        "required": true,
        "description": "The tool id.",
        "schema": {
          "type": "string",
          "enum": [
            "animate",
            "manga",
            "kamishibai",
            "manzai",
            "zukai"
          ]
        }
      },
      "RunId": {
        "name": "pid",
        "in": "path",
        "required": true,
        "description": "The run id (returned as id by the run routes).",
        "schema": {
          "type": "string"
        }
      },
      "KeyId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The API key id.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Makes a paid call safe to retry. 8 to 128 characters: letters, digits and _ . : - The first call runs and its answer is kept for 24 hours. The same key and body returns that answer with Idempotent-Replayed: true. The same key with another body is refused (idempotency_key_reused).",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
        }
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Requests a minute allowed for this key.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in this minute.",
        "schema": {
          "type": "integer"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before the next request.",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotentReplayed": {
        "description": "true when this is the first answer replayed because the Idempotency-Key was used before.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    }
  }
}