{
  "openapi": "3.1.0",
  "info": {
    "title": "Mozart API",
    "version": "v1",
    "description": "The Mozart REST API makes songs, covers, stems, MIDI, masters, lyrics and cover art, rewrites a section of a song and makes solo instrument loops, from your own code.\n\nAuthenticate with an API key (`Authorization: Bearer mzk_...`) made in the Mozart web app, or with an OAuth access token from a connected app. A REST key needs an API plan (Starter, Build, Scale or Growth) or prepaid API credits, and spends API credits.\n\nWork that takes time starts a job: the call answers at once with `job.id`; read it with `GET /v1/jobs/{job_id}` or wait on it with `POST /v1/jobs/wait`.\n\nEvery error has the same body: `{ \"error\": { type, code, message, request_id, details } }`. A `/v1` shape never changes in place: fields and operations are only added; anything removed is announced six months ahead with `Deprecation` and `Sunset` headers."
  },
  "servers": [
    {
      "url": "https://api.mozartai.com",
      "description": "The Mozart API"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "x-mozart-scope-descriptions": {
    "account:read": "Read the account, plan, credits and limits.",
    "library:read": "Read songs, personas, jobs and uploads in the library.",
    "library:write": "Rename, change the visibility of, or delete songs.",
    "generate": "Start generation jobs.",
    "credits:spend": "Spend the account's credits.",
    "download": "Get download links for songs and files.",
    "uploads:write": "Upload audio files.",
    "personas:write": "Create personas.",
    "webhooks:manage": "Add, list and delete webhook endpoints."
  },
  "tags": [
    {
      "name": "songs",
      "description": "Songs"
    },
    {
      "name": "audioTools",
      "description": "Audio tools"
    },
    {
      "name": "textAndImage",
      "description": "Lyrics and cover art"
    },
    {
      "name": "personasAndSamples",
      "description": "Personas and samples"
    },
    {
      "name": "jobs",
      "description": "Jobs"
    },
    {
      "name": "uploads",
      "description": "Uploads"
    },
    {
      "name": "account",
      "description": "Account and limits"
    },
    {
      "name": "webhooks",
      "description": "Webhooks"
    }
  ],
  "paths": {
    "/v1/songs": {
      "post": {
        "operationId": "songs.create",
        "tags": [
          "songs"
        ],
        "summary": "Starts a job that makes two new songs from a text prompt with Hans 2.0, with optional lyrics.",
        "description": "When to use: The user asks for a new song. Pass `prompt`; add `lyrics` for words to sing, or `instrumental` for no vocals. The answer comes back at once with `job.id` and `project_id`; then call `POST /v1/jobs/wait` until the job has `succeeded`.\n\nWhen not to use: To remake an existing song or uploaded audio in a new style, use `POST /v1/covers`. For lyrics only, use `POST /v1/lyrics`.\n\nCost: 25 credits per call; each call is one press that makes two songs. To check the balance first, call `POST /v1/estimates` or send `dry_run` as true; both are free and start nothing. The charge is in `credits_charged`: null until the job settles, then what was debited, and refunded if the job fails.\n\nSide effects: Creates one job and two songs in the user's library, private, in the key's current project or `project_id`. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_MODEL_NOT_AVAILABLE`: pick one of `allowed_models`. `PUBLIC_API_PROJECT_SONG_LIMIT_REACHED`: call again without `project_id`.\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000,
                    "description": "What the song should be: style, mood, instruments, subject. Hans 2.0 rewrites a prompt over 1,000 characters to fit before it generates."
                  },
                  "lyrics": {
                    "description": "Words to sing, with optional section labels such as [Verse] and [Chorus]. Leave out both this and instrumental to have lyrics written from the prompt.",
                    "type": "string",
                    "maxLength": 3000
                  },
                  "instrumental": {
                    "default": false,
                    "description": "Make the songs without vocals. Not allowed with lyrics.",
                    "type": "boolean"
                  },
                  "title": {
                    "description": "The title of both songs. Leave it out to have titles written from the prompt.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "model": {
                    "description": "The model that makes the songs. Leave it out to use the default model. Only the models in the models list are accepted.",
                    "type": "string",
                    "enum": [
                      "hans-2"
                    ]
                  },
                  "duration_seconds": {
                    "description": "The song length in seconds, for a model whose `max_duration_seconds` in the models list is a number. A model whose `max_duration_seconds` is null picks its own length and refuses this field with GENERATION_INPUT_NOT_SUPPORTED_BY_MODEL.",
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 300
                  },
                  "project_id": {
                    "description": "The project to put the songs in. Leave it out to use the key's current project.",
                    "type": "string"
                  },
                  "dry_run": {
                    "default": false,
                    "description": "Return the price and balance without starting a job or spending credits.",
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "prompt"
                ]
              },
              "example": {
                "prompt": "An upbeat synth-pop song about a summer road trip",
                "instrumental": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "fixed",
          "fixed_credits": 25
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "create_song",
        "x-mozart-cli-command": "mozart songs create"
      },
      "get": {
        "operationId": "songs.list",
        "tags": [
          "songs"
        ],
        "summary": "Lists the user's songs, newest first, one page at a time, optionally for one project or one source.",
        "description": "When to use: You need a song id the user did not give you, or the user asks what songs they have. Filter with `project_id` or `source`. When `has_more` is true, pass `next_cursor` as `cursor` to read the next page.\n\nWhen not to use: When you already have a song id, use `GET /v1/songs/{song_id}`. To follow a running job, use `POST /v1/jobs/wait`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again. `PUBLIC_API_INPUT_INVALID`: the cursor is from another query; start again without it.\n\nScopes: `library:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Only songs started this way: `api` with an API key, or `mcp` or `cli` from a connected app signed in with a Mozart account.",
            "schema": {
              "description": "Only songs started this way: `api` with an API key, or `mcp` or `cli` from a connected app signed in with a Mozart account.",
              "type": "string",
              "enum": [
                "api",
                "mcp",
                "cli"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "song"
                          },
                          "project_id": {
                            "description": "The project the song is in. Null on the shared sample song a test key's jobs return, which is in no project of yours.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "generating",
                              "ready",
                              "failed"
                            ]
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "private",
                              "unlisted",
                              "public"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "api",
                              "mcp",
                              "cli",
                              "webDesktop",
                              "webMobile",
                              "iphone",
                              "unknown"
                            ],
                            "description": "How the song was started: `api` with an API key; `mcp` or `cli` from a connected app signed in with a Mozart account; `webDesktop`, `webMobile` or `iphone` in the Mozart apps; `unknown` when it was not recorded."
                          },
                          "model": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "duration_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "waveform_ready": {
                            "type": "boolean"
                          },
                          "lyrics": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "cover_art_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "app_url": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "project_id",
                          "title",
                          "status",
                          "visibility",
                          "source",
                          "model",
                          "duration_seconds",
                          "waveform_ready",
                          "lyrics",
                          "cover_art_url",
                          "app_url",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "next_cursor",
                    "has_more"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.list",
        "x-mozart-scopes": [
          "library:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "list_songs",
        "x-mozart-cli-command": "mozart songs list"
      }
    },
    "/v1/covers": {
      "post": {
        "operationId": "covers.create",
        "tags": [
          "songs"
        ],
        "summary": "Starts a job that remakes an existing song or an uploaded audio file in a new style, keeping its melody, as two covers.",
        "description": "When to use: The user wants a cover. Pass `source_song_id` for a song in their library, or `source_upload_id` for a file brought in with `POST /v1/uploads` once its status is `ready`. Add `prompt` for the new style. A cover of a library song sings the source's lyrics unless you pass `lyrics` or `instrumental`; an upload needs one of the two. Then call `POST /v1/jobs/wait` with `job.id`.\n\nWhen not to use: For a new song from a text prompt, use `POST /v1/songs`. To split a song into vocals and instruments, use `POST /v1/songs/{song_id}/stems`.\n\nCost: 27 credits per call; each call is one press that makes two covers. To check the balance first, call `POST /v1/estimates` or send `dry_run` as true; both are free and start nothing.\n\nSide effects: Creates one job and a new song in the user's library; the source is not changed. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_INPUT_INVALID`: send exactly one of `source_song_id` or `source_upload_id`. `PUBLIC_API_RESOURCE_NOT_FOUND`: check the id, or wait for the upload to be `ready`.\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_song_id": {
                    "type": "string"
                  },
                  "source_upload_id": {
                    "type": "string"
                  },
                  "prompt": {
                    "description": "The new style for the cover. Required.",
                    "type": "string",
                    "maxLength": 1000
                  },
                  "lyrics": {
                    "description": "Words for the cover to sing.",
                    "type": "string",
                    "maxLength": 3000
                  },
                  "instrumental": {
                    "default": false,
                    "description": "Make the cover without vocals. A cover of a library song sings the source's lyrics by default; a cover of an upload needs either lyrics or instrumental: true.",
                    "type": "boolean"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "hans-2-cover"
                    ]
                  },
                  "project_id": {
                    "type": "string"
                  },
                  "dry_run": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "source_upload_id": "6e2f4a91-8c3b-4d75-b0e6-2a9d1f7c5b38",
                "prompt": "Acoustic folk with soft female vocals"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "covers.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "fixed",
          "fixed_credits": 27
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "create_cover",
        "x-mozart-cli-command": "mozart covers create"
      }
    },
    "/v1/inpaints": {
      "post": {
        "operationId": "inpaints.create",
        "tags": [
          "songs"
        ],
        "summary": "Starts a job that rewrites one section of a song or an uploaded audio file, 3 to 60 seconds long, and blends it into the music on each side, as two new songs.",
        "description": "When to use: The user wants to change part of a song: new words, a new style or no vocals for a few bars. Pass `source_song_id` or `source_upload_id`, the section as `start_seconds` and `end_seconds`, and a `prompt`, `lyrics` or both. Then call `POST /v1/jobs/wait` with `job.id`; the two new songs are in `song_ids`.\n\nWhen not to use: To remake the whole song in a new style, use `POST /v1/covers`. For a new song from a prompt, use `POST /v1/songs`.\n\nCost: Billed on the length of the source song: 33 credits cover up to one minute, then 33 credits a minute, billed per second and rounded up. One call makes both songs. To see the price first, call `POST /v1/estimates` or send `dry_run` as true; both are free and start nothing.\n\nSide effects: Creates one job and two new songs in the user's library, linked to the source; the source is not changed. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_INPUT_INVALID`: send one source, a 3 to 60 second section inside the song, and a prompt or lyrics.\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_song_id": {
                    "description": "A song in your library to edit. Send this or source_upload_id.",
                    "type": "string"
                  },
                  "source_upload_id": {
                    "description": "An uploaded audio file to edit, once its upload is `ready`. Send this or source_song_id.",
                    "type": "string"
                  },
                  "start_seconds": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Where the section to rewrite starts, in seconds from the start."
                  },
                  "end_seconds": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "description": "Where the section to rewrite ends, in seconds. The section is 3 to 60 seconds long and ends inside the song; the music on each side is kept and the new section blends into it."
                  },
                  "prompt": {
                    "description": "How the section should change: style, mood, instruments. Send a prompt, lyrics, or both.",
                    "type": "string",
                    "maxLength": 1000
                  },
                  "lyrics": {
                    "description": "The song's lyrics with the new words for the section. Leave out to keep the source's lyrics; an upload needs lyrics or instrumental: true.",
                    "type": "string",
                    "maxLength": 3000
                  },
                  "instrumental": {
                    "default": false,
                    "description": "Make the rewritten section without vocals. Not allowed with lyrics.",
                    "type": "boolean"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "mozart-inpaint-1"
                    ]
                  },
                  "project_id": {
                    "type": "string"
                  },
                  "dry_run": {
                    "default": false,
                    "description": "Return the price and balance without starting a job or spending credits.",
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "start_seconds",
                  "end_seconds"
                ]
              },
              "example": {
                "source_song_id": "5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14",
                "start_seconds": 42,
                "end_seconds": 58,
                "prompt": "Make this chorus soar with gospel backing vocals"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "inpaints.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "variable",
          "fixed_credits": null
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "inpaint_song",
        "x-mozart-cli-command": "mozart inpaint create"
      }
    },
    "/v1/stems": {
      "post": {
        "operationId": "stems.generate",
        "tags": [
          "songs"
        ],
        "summary": "Starts a job that makes a new solo loop of one instrument, in a key and tempo you choose, as two songs cut exactly on the bar.",
        "description": "When to use: The user wants a loop to build on: a bassline, a drum groove, chords on keys. Pass `instrument`, `bars` (8, 16, 32 or 64), `bpm`, `key` and `key_mode`, with an optional style `prompt`. Then call `POST /v1/jobs/wait` with `job.id`. Each is a song you can cover, master, split or turn into MIDI with the other tools.\n\nWhen not to use: To pull the instruments out of an existing song, use `POST /v1/songs/{song_id}/stems`. For a full song, use `POST /v1/songs`.\n\nCost: Billed on the loop length, bars x 4 x 60 / bpm seconds: 33 credits cover up to one minute, then 33 credits a minute, billed per second and rounded up. One call makes both songs. To see the price first, call `POST /v1/estimates` or send `dry_run` as true; both are free and start nothing.\n\nSide effects: Creates one job and two new songs in the user's library. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_INPUT_INVALID`: check `bars`, `bpm` and `instrument` against the allowed values.\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "instrument": {
                    "type": "string",
                    "enum": [
                      "drums",
                      "bass",
                      "keys",
                      "guitar",
                      "synth",
                      "strings",
                      "pad",
                      "vocal_chops",
                      "other"
                    ],
                    "description": "The one instrument the loop plays, solo."
                  },
                  "bars": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 8
                      },
                      {
                        "type": "number",
                        "const": 16
                      },
                      {
                        "type": "number",
                        "const": 32
                      },
                      {
                        "type": "number",
                        "const": 64
                      }
                    ],
                    "description": "The loop length in bars of 4/4."
                  },
                  "bpm": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 200,
                    "description": "The tempo. The loop is exactly bars x 4 x 60 / bpm seconds long and is cut on the bar, ready to repeat."
                  },
                  "key": {
                    "type": "string",
                    "enum": [
                      "C",
                      "C#",
                      "Db",
                      "D",
                      "D#",
                      "Eb",
                      "E",
                      "F",
                      "F#",
                      "Gb",
                      "G",
                      "G#",
                      "Ab",
                      "A",
                      "A#",
                      "Bb",
                      "B"
                    ],
                    "description": "The key's root note."
                  },
                  "key_mode": {
                    "type": "string",
                    "enum": [
                      "major",
                      "minor"
                    ],
                    "description": "Whether the key is major or minor."
                  },
                  "prompt": {
                    "description": "The style of the loop: genre, mood, playing, sound.",
                    "type": "string",
                    "maxLength": 1000
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "mozart-stem-1"
                    ]
                  },
                  "project_id": {
                    "type": "string"
                  },
                  "dry_run": {
                    "default": false,
                    "description": "Return the price and balance without starting a job or spending credits.",
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "instrument",
                  "bars",
                  "bpm",
                  "key",
                  "key_mode"
                ]
              },
              "example": {
                "instrument": "bass",
                "bars": 8,
                "bpm": 120,
                "key": "A",
                "key_mode": "minor",
                "prompt": "Warm deep house bassline"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "stems.generate",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "variable",
          "fixed_credits": null
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "create_stem",
        "x-mozart-cli-command": "mozart stems generate"
      }
    },
    "/v1/songs/{song_id}": {
      "get": {
        "operationId": "songs.get",
        "tags": [
          "songs"
        ],
        "summary": "Gets one song: title, status, model, length, lyrics, cover art and a link to open it in Mozart.",
        "description": "When to use: You have a song id and need its details or its `app_url` to give the user.\n\nWhen not to use: For a file to play or save, use `POST /v1/songs/{song_id}/download`. To find a song id, use `GET /v1/songs`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `library:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "song"
                    },
                    "project_id": {
                      "description": "The project the song is in. Null on the shared sample song a test key's jobs return, which is in no project of yours.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "generating",
                        "ready",
                        "failed"
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "private",
                        "unlisted",
                        "public"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "api",
                        "mcp",
                        "cli",
                        "webDesktop",
                        "webMobile",
                        "iphone",
                        "unknown"
                      ],
                      "description": "How the song was started: `api` with an API key; `mcp` or `cli` from a connected app signed in with a Mozart account; `webDesktop`, `webMobile` or `iphone` in the Mozart apps; `unknown` when it was not recorded."
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duration_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "waveform_ready": {
                      "type": "boolean"
                    },
                    "lyrics": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cover_art_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "app_url": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "project_id",
                    "title",
                    "status",
                    "visibility",
                    "source",
                    "model",
                    "duration_seconds",
                    "waveform_ready",
                    "lyrics",
                    "cover_art_url",
                    "app_url",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.get",
        "x-mozart-scopes": [
          "library:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "get_song",
        "x-mozart-cli-command": "mozart songs get"
      },
      "patch": {
        "operationId": "songs.update",
        "tags": [
          "songs"
        ],
        "summary": "Renames a song or changes who can see it.",
        "description": "When to use: The user asks to rename a song (`title`) or to make it `private`, `unlisted` or `public` (`visibility`). Change visibility only when the user asked for it.\n\nWhen not to use: To change the music itself, make a new song with `POST /v1/songs` or `POST /v1/covers`; songs cannot be edited.\n\nCost: Free.\n\nSide effects: Changes the song's title or visibility. Making it `public` shows it to everyone on Mozart. Repeating the same change is safe.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_SCOPE_MISSING`: the key lacks `library:write`; tell the user.\n\nScopes: `library:write`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "visibility": {
                    "description": "Who can open the song: `private` is only the owner, `unlisted` is anyone with the link, `public` also shows it on Discover. Leave it out to keep the current setting.",
                    "type": "string",
                    "enum": [
                      "private",
                      "unlisted",
                      "public"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "title": "Road Trip Summer"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "song"
                    },
                    "project_id": {
                      "description": "The project the song is in. Null on the shared sample song a test key's jobs return, which is in no project of yours.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "generating",
                        "ready",
                        "failed"
                      ]
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "private",
                        "unlisted",
                        "public"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "api",
                        "mcp",
                        "cli",
                        "webDesktop",
                        "webMobile",
                        "iphone",
                        "unknown"
                      ],
                      "description": "How the song was started: `api` with an API key; `mcp` or `cli` from a connected app signed in with a Mozart account; `webDesktop`, `webMobile` or `iphone` in the Mozart apps; `unknown` when it was not recorded."
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duration_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "waveform_ready": {
                      "type": "boolean"
                    },
                    "lyrics": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cover_art_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "app_url": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "project_id",
                    "title",
                    "status",
                    "visibility",
                    "source",
                    "model",
                    "duration_seconds",
                    "waveform_ready",
                    "lyrics",
                    "cover_art_url",
                    "app_url",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.update",
        "x-mozart-scopes": [
          "library:write"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "update_song",
        "x-mozart-cli-command": "mozart songs update"
      },
      "delete": {
        "operationId": "songs.delete",
        "tags": [
          "songs"
        ],
        "summary": "Deletes a song from the user's library.",
        "description": "When to use: The user clearly asks to delete a specific song. Confirm the song's title with the user before calling.\n\nWhen not to use: To hide a song from others, use `PATCH /v1/songs/{song_id}` with `visibility` set to `private` instead.\n\nCost: Free. Credits spent on the song are not returned.\n\nSide effects: Removes the song from the library and its links stop working. Repeating the call is safe and answers the same.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_SCOPE_MISSING`: the key lacks `library:write`; tell the user.\n\nScopes: `library:write`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "song"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "deleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.delete",
        "x-mozart-scopes": [
          "library:write"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "delete_song",
        "x-mozart-cli-command": "mozart songs delete"
      }
    },
    "/v1/songs/{song_id}/download": {
      "post": {
        "operationId": "songs.download",
        "tags": [
          "songs"
        ],
        "summary": "Returns a short-lived link to the audio file of a finished song in mp3, wav, flac or m4a.",
        "description": "When to use: The song is ready and the user wants to listen to it or save it. Give the user `url`; it expires at `url_expires_at`, so ask for a new link after that.\n\nWhen not to use: For the separate vocals and instruments, use `POST /v1/songs/{song_id}/stems`. For the song's page in Mozart, use `app_url` from `GET /v1/songs/{song_id}`.\n\nCost: Free. Each link counts toward the daily download link limit.\n\nSide effects: Creates a new link each call; nothing in the library changes. Reuse a link until it expires instead of asking again.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_DAILY_LIMIT_REACHED`: reuse a link you already have, or wait for `resets_at`. If the song is still generating, call `POST /v1/jobs/wait` first.\n\nScopes: `download`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "default": "mp3",
                    "type": "string",
                    "enum": [
                      "mp3",
                      "wav",
                      "flac",
                      "m4a"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "format": "mp3"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "song_id": {
                      "type": "string"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "mp3",
                        "wav",
                        "flac",
                        "m4a"
                      ]
                    },
                    "url": {
                      "type": "string"
                    },
                    "url_expires_at": {
                      "type": "string"
                    },
                    "content_type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "song_id",
                    "format",
                    "url",
                    "url_expires_at",
                    "content_type"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.download",
        "x-mozart-scopes": [
          "download"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "downloadLinks",
        "x-mozart-mcp-tool": "get_download_link",
        "x-mozart-cli-command": "mozart songs download"
      }
    },
    "/v1/songs/{song_id}/waveform": {
      "get": {
        "operationId": "songs.waveform",
        "tags": [
          "songs"
        ],
        "summary": "Returns the loudness outline of a song as a list of peaks between 0 and 1.",
        "description": "When to use: You are drawing a waveform or need to find the loud and quiet parts of a song. Set `points` for how many peaks you need.\n\nWhen not to use: To listen to the song, use `POST /v1/songs/{song_id}/download`. For its length alone, use `GET /v1/songs/{song_id}`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. A song made moments ago may not be measured yet: `PUBLIC_API_WAVEFORM_NOT_READY` (409) with `retry_after_seconds`; retry after that, or wait until the song's `waveform_ready` is true. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `library:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "points",
            "in": "query",
            "required": false,
            "schema": {
              "default": 80,
              "type": "integer",
              "minimum": 16,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "song_id": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "number"
                    },
                    "peaks": {
                      "type": "array",
                      "items": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  },
                  "required": [
                    "song_id",
                    "duration_seconds",
                    "peaks"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "songs.waveform",
        "x-mozart-scopes": [
          "library:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "get_waveform",
        "x-mozart-cli-command": "mozart songs waveform"
      }
    },
    "/v1/songs/{song_id}/stems": {
      "post": {
        "operationId": "stems.create",
        "tags": [
          "audioTools"
        ],
        "summary": "Starts a job that splits a song into separate stems: vocals and instrumental (`twoStem`, 1 to 3 files), or up to nine labelled instrument stems (`fourStem`).",
        "description": "When to use: The user wants the parts of a song apart, to practise with or to mix again. Pass `song_id` and `mode`: `twoStem` or `fourStem`. Then call `POST /v1/jobs/wait` with `job.id`; each stem is an entry in `outputs` with a `label` and a `url`.\n\nWhen not to use: For the whole song as one file, use `POST /v1/songs/{song_id}/download`. For notes instead of audio, use `POST /v1/midi`.\n\nCost: 23 credits for each started minute of the song, for either `mode`. When the price is unclear, call `POST /v1/estimates` or send `dry_run` as true first; both are free and start nothing.\n\nSide effects: Creates one job; the song is not changed. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_DAILY_LIMIT_REACHED`: stop and tell the user when it resets (`resets_at`).\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "default": "fourStem",
                    "description": "`twoStem` splits the vocals from the instrumental, as 1 to 3 stems: Vocals or Lead Vocals and Backing Vocals, plus Instrumental. `fourStem` returns up to nine labelled stems: Vocals, Bass, Drums, Guitars, Strings, Piano, Keys, Wind and Other. Silent stems are left out, so read each output's `label`.",
                    "type": "string",
                    "enum": [
                      "twoStem",
                      "fourStem"
                    ]
                  },
                  "dry_run": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "mode": "fourStem"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "stems.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "variable",
          "fixed_credits": null
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "stemSplits",
        "x-mozart-mcp-tool": "separate_stems",
        "x-mozart-cli-command": "mozart stems create"
      }
    },
    "/v1/midi": {
      "post": {
        "operationId": "midi.create",
        "tags": [
          "audioTools"
        ],
        "summary": "Starts a job that turns the audio of a song or an uploaded file into a MIDI file of its notes.",
        "description": "When to use: The user wants the notes of a song to edit in a music program. Pass `song_id`, or `upload_id` for a file brought in with `POST /v1/uploads`. Then call `POST /v1/jobs/wait` with `job.id`; the MIDI file is in `outputs`.\n\nWhen not to use: For separate audio parts, use `POST /v1/songs/{song_id}/stems`. For the audio file itself, use `POST /v1/songs/{song_id}/download`.\n\nCost: 16 credits per job, whatever the length.\n\nSide effects: Creates one job; the source is not changed. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_DAILY_LIMIT_REACHED`: stop and tell the user when it resets (`resets_at`). `PUBLIC_API_INPUT_INVALID`: send exactly one of `song_id` or `upload_id`.\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "song_id": {
                    "type": "string"
                  },
                  "upload_id": {
                    "type": "string"
                  },
                  "dry_run": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "song_id": "5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "midi.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "fixed",
          "fixed_credits": 16
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "audioToMidi",
        "x-mozart-mcp-tool": "audio_to_midi",
        "x-mozart-cli-command": "mozart midi create"
      }
    },
    "/v1/songs/{song_id}/master": {
      "post": {
        "operationId": "masters.create",
        "tags": [
          "audioTools"
        ],
        "summary": "Starts a job that masters a song in place: balances its loudness and tone, and the master replaces the song's audio on the same `song_id`.",
        "description": "When to use: The user asks to master a finished song. Pass `song_id`, then call `POST /v1/jobs/wait` with `job.id`; the mastered audio is in `outputs`.\n\nWhen not to use: To change the style or arrangement, use `POST /v1/covers`. To keep the unmastered audio, call `POST /v1/songs/{song_id}/download` before mastering: afterwards it returns the master.\n\nCost: 725 credits per song, whatever the length. Confirm with the user first; `dry_run` as true shows the price and balance without starting anything.\n\nSide effects: Creates one job. When it succeeds, the master replaces the song's audio on the same `song_id`: playback, `POST /v1/songs/{song_id}/download` and the waveform return the master; v1 cannot fetch the unmastered audio. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job. Never create again while the job is running.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_DAILY_LIMIT_REACHED`: stop and tell the user when it resets (`resets_at`).\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dry_run": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "masters.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "fixed",
          "fixed_credits": 725
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "mastering",
        "x-mozart-mcp-tool": "master_song",
        "x-mozart-cli-command": "mozart master create"
      }
    },
    "/v1/lyrics": {
      "post": {
        "operationId": "lyrics.create",
        "tags": [
          "textAndImage"
        ],
        "summary": "Writes song lyrics and a title from a short prompt and returns them in the answer.",
        "description": "When to use: The user wants lyrics written for them, or you want to show lyrics before making a song. Pass `prompt` and, if needed, `language`. Pass the returned `lyrics` to `POST /v1/songs` as `lyrics`, and the returned `title` as `title` if the user likes it.\n\nWhen not to use: When the user already has lyrics, pass them straight to `POST /v1/songs`. That call can also write lyrics itself from its prompt.\n\nCost: Free.\n\nSide effects: Nothing is saved; the lyrics and title are only in the answer. Each call without an idempotency key writes new lyrics and counts against the daily lyrics limit again; with the same key it returns the first lyrics and title. `title` is null only when no title could be written; the lyrics are still usable.\n\nErrors: `PUBLIC_API_DAILY_LIMIT_REACHED`: stop and tell the user when it resets (`resets_at`). `content_refused`: revise the prompt once; never reword to get around the refusal.\n\nScopes: `generate`, `credits:spend`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1
                  },
                  "language": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 35
                  },
                  "dry_run": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "prompt"
                ]
              },
              "example": {
                "prompt": "A bittersweet song about leaving your hometown",
                "language": "en"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lyrics": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "credits_charged": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "balance_after": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "title",
                    "lyrics",
                    "credits_charged",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "lyrics.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend"
        ],
        "x-mozart-cost": {
          "kind": "fixed",
          "fixed_credits": 0
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "optional",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "lyrics",
        "x-mozart-mcp-tool": "write_lyrics",
        "x-mozart-cli-command": "mozart lyrics create"
      }
    },
    "/v1/songs/{song_id}/cover-art": {
      "post": {
        "operationId": "coverArt.create",
        "tags": [
          "textAndImage"
        ],
        "summary": "Starts a job that makes a new cover image for a song and sets it as the song's cover art.",
        "description": "When to use: The user asks for new cover art. Pass `song_id` and, for a specific look, `prompt`. Then call `POST /v1/jobs/wait` with `job.id`; the image is in `outputs`.\n\nWhen not to use: To read the current cover, use `cover_art_url` from `GET /v1/songs/{song_id}`.\n\nCost: Free.\n\nSide effects: Creates one job and replaces the song's cover art when it succeeds. Repeating the call with the same idempotency key returns the first job and spends nothing; a new key starts and charges a second job.\n\nErrors: `INSUFFICIENT_CREDITS` (type `insufficient_credits`): stop, tell the user (with `plans_url` if set); never retry. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then retry once with the same idempotency key. `PUBLIC_API_DAILY_LIMIT_REACHED`: stop and tell the user when it resets (`resets_at`).\n\nScopes: `generate`, `credits:spend`, `library:write`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "song_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": true,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string"
                  },
                  "dry_run": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "prompt": "A vintage car on a coastal road at sunset, film photo"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The job started (or, with `dry_run`, the price it would cost).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "estimate": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "credits_required": {
                              "type": "number"
                            },
                            "balance": {
                              "type": "number",
                              "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                            },
                            "balance_after": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "credits_required",
                            "balance",
                            "balance_after"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The price check. Always filled on a dry run. On a real start some operations fill it and others leave it null (song and cover starts do), so read it only on a dry run and read the charge from `job.credits_charged`."
                    },
                    "job": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "object": {
                              "type": "string",
                              "const": "job"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem",
                                "stems",
                                "midi",
                                "master",
                                "cover_art",
                                "persona"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "succeeded",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "playable": {
                              "type": "boolean"
                            },
                            "project_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "song_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outputs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "audio",
                                      "stem",
                                      "midi",
                                      "image",
                                      "persona"
                                    ]
                                  },
                                  "song_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "persona_id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "label": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "url_expires_at": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "content_type": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "duration_seconds": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "type",
                                  "song_id",
                                  "persona_id",
                                  "label",
                                  "url",
                                  "url_expires_at",
                                  "content_type",
                                  "duration_seconds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "credits_charged": {
                              "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "credits_refunded": {
                              "type": "boolean"
                            },
                            "error": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "message": {
                                      "type": "string"
                                    },
                                    "next_step": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message",
                                    "next_step"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "poll_after_seconds": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "completed_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "object",
                            "kind",
                            "status",
                            "playable",
                            "project_id",
                            "song_ids",
                            "outputs",
                            "credits_charged",
                            "credits_refunded",
                            "error",
                            "poll_after_seconds",
                            "created_at",
                            "completed_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "balance_after": {
                      "description": "The balance after this call's hold, when the operation reports it; null on song and cover starts. Read `GET /v1/credits` for the current balance.",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "dry_run",
                    "estimate",
                    "job",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "coverArt.create",
        "x-mozart-scopes": [
          "generate",
          "credits:spend",
          "library:write"
        ],
        "x-mozart-cost": {
          "kind": "fixed",
          "fixed_credits": 0
        },
        "x-mozart-starts-job": true,
        "x-mozart-idempotency": "required",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "coverArt",
        "x-mozart-mcp-tool": "create_cover_art",
        "x-mozart-cli-command": "mozart cover-art create"
      }
    },
    "/v1/jobs/{job_id}": {
      "get": {
        "operationId": "jobs.get",
        "tags": [
          "jobs"
        ],
        "summary": "Gets the current state of one job at once, without waiting: status, outputs, credits charged and any error.",
        "description": "When to use: You have a job id and want its state right now. If `status` is `queued` or `running`, call again after `poll_after_seconds`.\n\nWhen not to use: To wait for a job to finish, or to check several jobs in one call, use `POST /v1/jobs/wait`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat as often as you need.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `library:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "job"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "song",
                        "cover",
                        "inpaint",
                        "stem",
                        "stems",
                        "midi",
                        "master",
                        "cover_art",
                        "persona"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "running",
                        "succeeded",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "playable": {
                      "type": "boolean"
                    },
                    "project_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "song_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "outputs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "audio",
                              "stem",
                              "midi",
                              "image",
                              "persona"
                            ]
                          },
                          "song_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "persona_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url_expires_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "content_type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "duration_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "song_id",
                          "persona_id",
                          "label",
                          "url",
                          "url_expires_at",
                          "content_type",
                          "duration_seconds"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "credits_charged": {
                      "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "credits_refunded": {
                      "type": "boolean"
                    },
                    "error": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            },
                            "next_step": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "message",
                            "next_step"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poll_after_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "kind",
                    "status",
                    "playable",
                    "project_id",
                    "song_ids",
                    "outputs",
                    "credits_charged",
                    "credits_refunded",
                    "error",
                    "poll_after_seconds",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "jobs.get",
        "x-mozart-scopes": [
          "library:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": null,
        "x-mozart-cli-command": "mozart jobs get"
      }
    },
    "/v1/jobs/wait": {
      "post": {
        "operationId": "jobs.wait",
        "tags": [
          "jobs"
        ],
        "summary": "Checks up to 20 jobs and waits up to 25 seconds for them to become playable or finish.",
        "description": "When to use: After any call that started a job. Pass `job_ids` and `wait_seconds` (up to 25). A song, cover, stems or master is `playable` once its final file is ready, so `until` as `playable` and `complete` both wait for the final files; `outputs` stay empty until then. If `all_settled` is false, call again; the job is still working.\n\nWhen not to use: Never start the job again to check on it. Use `POST /v1/songs/{song_id}/download` for a lasting file once the job has `succeeded`.\n\nCost: Free. Waiting spends nothing.\n\nSide effects: None. Reads only; safe to repeat. Keep calling until `all_settled` is true.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again. A job with `status` `failed` has `error` with `next_step`, and its credits are refunded (`credits_refunded`); tell the user before trying again.\n\nScopes: `library:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "job_ids": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "wait_seconds": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 25
                  },
                  "until": {
                    "default": "complete",
                    "type": "string",
                    "enum": [
                      "playable",
                      "complete"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "job_ids"
                ]
              },
              "example": {
                "job_ids": [
                  "9800c7dc4b2e41f6a3d58c7e0f1b9a2d6c4e8f0a1b3d5c7e9f2a4b6c8d0e1f3a"
                ],
                "wait_seconds": 25,
                "until": "playable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "job"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "song",
                              "cover",
                              "inpaint",
                              "stem",
                              "stems",
                              "midi",
                              "master",
                              "cover_art",
                              "persona"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "running",
                              "succeeded",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "playable": {
                            "type": "boolean"
                          },
                          "project_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "song_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "audio",
                                    "stem",
                                    "midi",
                                    "image",
                                    "persona"
                                  ]
                                },
                                "song_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "persona_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "label": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url_expires_at": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "content_type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "duration_seconds": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "song_id",
                                "persona_id",
                                "label",
                                "url",
                                "url_expires_at",
                                "content_type",
                                "duration_seconds"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "credits_charged": {
                            "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "credits_refunded": {
                            "type": "boolean"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "next_step": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "next_step"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poll_after_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "kind",
                          "status",
                          "playable",
                          "project_id",
                          "song_ids",
                          "outputs",
                          "credits_charged",
                          "credits_refunded",
                          "error",
                          "poll_after_seconds",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "all_settled": {
                      "type": "boolean"
                    },
                    "poll_after_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "jobs",
                    "all_settled",
                    "poll_after_seconds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "jobs.wait",
        "x-mozart-scopes": [
          "library:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "get_job",
        "x-mozart-cli-command": "mozart jobs wait"
      }
    },
    "/v1/jobs/{job_id}/cancel": {
      "post": {
        "operationId": "jobs.cancel",
        "tags": [
          "jobs"
        ],
        "summary": "Cancels a job that has not yet been sent to the music or image provider.",
        "description": "When to use: The user asks to stop a job, or you started one by mistake, and you call this soon after starting it. The job ends as `cancelled`. Persona training cannot be cancelled.\n\nWhen not to use: To remove a song that already exists, use `DELETE /v1/songs/{song_id}`. To check a job, use `POST /v1/jobs/wait`.\n\nCost: Free. Whether credits come back is shown in `credits_refunded`.\n\nSide effects: Stops the job; nothing it would have made is kept. Repeating the call is safe.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_JOB_NOT_CANCELLABLE`: the job already finished, or its provider already started on it and will finish it; read it with `POST /v1/jobs/wait`.\n\nScopes: `generate`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "job"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "song",
                        "cover",
                        "inpaint",
                        "stem",
                        "stems",
                        "midi",
                        "master",
                        "cover_art",
                        "persona"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "running",
                        "succeeded",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "playable": {
                      "type": "boolean"
                    },
                    "project_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "song_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "outputs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "audio",
                              "stem",
                              "midi",
                              "image",
                              "persona"
                            ]
                          },
                          "song_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "persona_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url_expires_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "content_type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "duration_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "song_id",
                          "persona_id",
                          "label",
                          "url",
                          "url_expires_at",
                          "content_type",
                          "duration_seconds"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "credits_charged": {
                      "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "credits_refunded": {
                      "type": "boolean"
                    },
                    "error": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            },
                            "next_step": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "message",
                            "next_step"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poll_after_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "kind",
                    "status",
                    "playable",
                    "project_id",
                    "song_ids",
                    "outputs",
                    "credits_charged",
                    "credits_refunded",
                    "error",
                    "poll_after_seconds",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "jobs.cancel",
        "x-mozart-scopes": [
          "generate"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "cancel_job",
        "x-mozart-cli-command": "mozart jobs cancel"
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "uploads.create",
        "tags": [
          "uploads"
        ],
        "summary": "Brings an audio file into Mozart for a cover or for MIDI, from a public link or a one-time upload link.",
        "description": "When to use: The user has an audio file to use. Set `purpose`. With `source_url`, Mozart fetches the file. Without it, give the user `upload_page_url` to drop the file, or send the bytes to `upload_url`. Use the upload id once `status` is `ready`.\n\nWhen not to use: For a song already in the library, pass its song id to `POST /v1/covers` or `POST /v1/midi` instead.\n\nCost: Free. Counts toward the daily upload file and size limits.\n\nSide effects: Creates an upload. `upload_url` lets anyone holding it send a file: never show it to anyone but the user. A repeat call without the same idempotency key makes a second upload.\n\nErrors: `PUBLIC_API_DAILY_LIMIT_REACHED`: stop and tell the user when it resets (`resets_at`). `PUBLIC_API_URL_NOT_ALLOWED`: use a public https link. `PUBLIC_API_UPLOAD_TOO_LARGE`: ask for a smaller file.\n\nScopes: `uploads:write`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "cover",
                      "midi",
                      "persona"
                    ],
                    "description": "What the file is for: `cover` for a cover source, `midi` for audio to MIDI. `persona` is refused: personas are not available in v1 yet."
                  },
                  "source_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "content_type": {
                    "type": "string"
                  },
                  "size_bytes": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false,
                "required": [
                  "purpose"
                ]
              },
              "example": {
                "purpose": "cover",
                "source_url": "https://example.com/demo.mp3",
                "filename": "demo.mp3"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "upload"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_file",
                        "processing",
                        "ready",
                        "failed"
                      ]
                    },
                    "purpose": {
                      "type": "string",
                      "enum": [
                        "cover",
                        "midi",
                        "persona"
                      ]
                    },
                    "upload_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "upload_method": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "PUT",
                            "POST"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "upload_headers": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "upload_url_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "upload_page_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duration_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "status",
                    "purpose",
                    "upload_url",
                    "upload_method",
                    "upload_headers",
                    "upload_url_expires_at",
                    "upload_page_url",
                    "duration_seconds",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "uploads.create",
        "x-mozart-scopes": [
          "uploads:write"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "optional",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": "uploadFiles",
        "x-mozart-mcp-tool": "create_upload_link",
        "x-mozart-cli-command": "mozart uploads create"
      }
    },
    "/v1/uploads/{upload_id}": {
      "get": {
        "operationId": "uploads.get",
        "tags": [
          "uploads"
        ],
        "summary": "Gets the state of an upload: waiting for the file, processing, ready or failed.",
        "description": "When to use: After `POST /v1/uploads`, to learn when the file is `ready` to use, or why it `failed`.\n\nWhen not to use: To bring in a new file, use `POST /v1/uploads`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again. `PUBLIC_API_UPLOAD_FETCH_FAILED`: the link could not be read; ask the user for another.\n\nScopes: `uploads:write`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "upload"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_file",
                        "processing",
                        "ready",
                        "failed"
                      ]
                    },
                    "purpose": {
                      "type": "string",
                      "enum": [
                        "cover",
                        "midi",
                        "persona"
                      ]
                    },
                    "upload_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "upload_method": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "PUT",
                            "POST"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "upload_headers": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "upload_url_expires_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "upload_page_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "duration_seconds": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "status",
                    "purpose",
                    "upload_url",
                    "upload_method",
                    "upload_headers",
                    "upload_url_expires_at",
                    "upload_page_url",
                    "duration_seconds",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "uploads.get",
        "x-mozart-scopes": [
          "uploads:write"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": null,
        "x-mozart-cli-command": "mozart uploads get"
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "account.get",
        "tags": [
          "account"
        ],
        "summary": "Shows who is signed in: the user, their plan, the key or app in use, its scopes and whether it is in test mode.",
        "description": "When to use: At the start of a session to confirm access, or when a call fails with `PUBLIC_API_SCOPE_MISSING` and you need to see the `scopes` held. In `test_mode`, results are canned and nothing is spent.\n\nWhen not to use: For the credit balance, use `GET /v1/credits`. For limits and usage, use `GET /v1/limits`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_KEY_INVALID`, `PUBLIC_API_KEY_REVOKED` or `PUBLIC_API_TOKEN_INVALID`: stop and ask the user to sign in again. `PUBLIC_API_PLAN_REQUIRED`: the API needs Pro or higher; tell the user. `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `account:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "plan": {
                      "type": "string",
                      "description": "The tier this caller's limits follow: the user's Mozart plan for MCP and CLI, and at least pro for a REST key, whose calls bill to `api_plan` and the API credit balance instead."
                    },
                    "api_plan": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "starter",
                            "build",
                            "scale",
                            "growth"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "For a REST API key: the API plan its calls bill to while that plan is active. Null when the key spends only top-up credits, and for MCP, CLI and app callers, which spend Mozart plan credits."
                    },
                    "caller": {
                      "type": "string",
                      "enum": [
                        "api",
                        "mcp",
                        "cli",
                        "webDesktop",
                        "webMobile",
                        "iphone",
                        "unknown"
                      ]
                    },
                    "key_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "app_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "account:read",
                          "library:read",
                          "library:write",
                          "generate",
                          "credits:spend",
                          "download",
                          "uploads:write",
                          "personas:write",
                          "webhooks:manage"
                        ]
                      }
                    },
                    "test_mode": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "user_id",
                    "display_name",
                    "plan",
                    "api_plan",
                    "caller",
                    "key_name",
                    "app_name",
                    "scopes",
                    "test_mode"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "account.get",
        "x-mozart-scopes": [
          "account:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "whoami",
        "x-mozart-cli-command": "mozart whoami"
      }
    },
    "/v1/limits": {
      "get": {
        "operationId": "limits.get",
        "tags": [
          "account"
        ],
        "summary": "Lists every limit that applies to the caller with how much is used, how much remains and when it resets.",
        "description": "When to use: Before a batch of work, to check it fits today's limits, or after `PUBLIC_API_DAILY_LIMIT_REACHED` or `PUBLIC_API_CONCURRENCY_LIMIT_REACHED` to tell the user when work can go on (`resets_at`).\n\nWhen not to use: For the credit balance, use `GET /v1/credits`. To price one request, use `POST /v1/estimates`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `account:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "limits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "window": {
                            "type": "string",
                            "enum": [
                              "minute",
                              "hour",
                              "day",
                              "month",
                              "concurrent",
                              "total"
                            ]
                          },
                          "limit": {
                            "type": "number"
                          },
                          "used": {
                            "type": "number"
                          },
                          "remaining": {
                            "type": "number"
                          },
                          "resets_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "window",
                          "limit",
                          "used",
                          "remaining",
                          "resets_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "limits"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "limits.get",
        "x-mozart-scopes": [
          "account:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "get_limits",
        "x-mozart-cli-command": "mozart limits"
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "models.list",
        "tags": [
          "account"
        ],
        "summary": "Lists the music models this key may use, what each can make and which is the default.",
        "description": "When to use: Before passing a model to `POST /v1/songs` or `POST /v1/covers`, or after `PUBLIC_API_MODEL_NOT_AVAILABLE`. Check `capabilities`, `supports_lyrics` and `credits_per_request`. Tell the user which model you pick.\n\nWhen not to use: When the user has no model preference, skip this and call `POST /v1/songs` without a model; the default is used.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `account:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "enum": [
                              "hans-2",
                              "hans-2-cover",
                              "mozart-inpaint-1",
                              "mozart-stem-1"
                            ]
                          },
                          "object": {
                            "type": "string",
                            "const": "model"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "song",
                                "cover",
                                "inpaint",
                                "stem"
                              ]
                            }
                          },
                          "supports_lyrics": {
                            "type": "boolean"
                          },
                          "supports_persona": {
                            "type": "boolean"
                          },
                          "max_duration_seconds": {
                            "description": "The longest song, in seconds, this model makes when a request sets `duration_seconds`. Null when the model picks its own length: it refuses `duration_seconds`.",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "is_default": {
                            "type": "boolean"
                          },
                          "credits_per_request": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Credits one request with this model costs; a song press is one request."
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "name",
                          "description",
                          "capabilities",
                          "supports_lyrics",
                          "supports_persona",
                          "max_duration_seconds",
                          "is_default",
                          "credits_per_request"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "models.list",
        "x-mozart-scopes": [
          "account:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "list_models",
        "x-mozart-cli-command": "mozart models list"
      }
    },
    "/v1/credits": {
      "get": {
        "operationId": "credits.get",
        "tags": [
          "account"
        ],
        "summary": "Shows the user's credit balance, what this key spent today against its daily limit, what each spending operation costs, and the plans page link.",
        "description": "When to use: Before several spends, or when the user asks how many credits are left. Show the user `available`: what they can spend now. `balance` also counts credits held by jobs still running, so it stays higher until those jobs settle. When credits run out, give the user `plans_url` if it is set.\n\nWhen not to use: To price one request, use `POST /v1/estimates`. For other limits, use `GET /v1/limits`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again.\n\nScopes: `account:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance": {
                      "type": "number",
                      "description": "Credits on the account, including credits held by jobs that have not finished. Show users `available` instead: `balance` drops only when those jobs settle."
                    },
                    "available": {
                      "type": "number",
                      "description": "Credits that can be spent now: the balance minus credits held by jobs that have not finished. This is the number to show users, and the one estimates and spending checks use."
                    },
                    "key_daily_limit": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "key_spent_today": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "plans_url": {
                      "description": "Where this caller gets more credits: the API pricing page for an API key spending the API wallet, the Mozart plans page for every other caller, and null for an app that shows no plan links.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "wallet": {
                      "type": "string",
                      "enum": [
                        "api",
                        "plan"
                      ]
                    },
                    "allowance_credits": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "top_up_credits": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "allowance_resets_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "operation_credits": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "operation": {
                                "type": "string",
                                "enum": [
                                  "songs.create",
                                  "covers.create",
                                  "stems.create",
                                  "midi.create",
                                  "masters.create",
                                  "lyrics.create",
                                  "coverArt.create",
                                  "inpaints.create",
                                  "stems.generate"
                                ]
                              },
                              "credits": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "per": {
                                "type": "string",
                                "enum": [
                                  "request",
                                  "inputMinute",
                                  "minuteBilledPerSecond"
                                ]
                              }
                            },
                            "required": [
                              "operation",
                              "credits",
                              "per"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "What each spending operation costs this caller, in credits per request or per started minute of input audio."
                    }
                  },
                  "required": [
                    "balance",
                    "available",
                    "key_daily_limit",
                    "key_spent_today",
                    "plans_url",
                    "wallet",
                    "allowance_credits",
                    "top_up_credits",
                    "allowance_resets_at",
                    "operation_credits"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "credits.get",
        "x-mozart-scopes": [
          "account:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "get_credit_balance",
        "x-mozart-cli-command": "mozart credits"
      }
    },
    "/v1/estimates": {
      "post": {
        "operationId": "estimates.create",
        "tags": [
          "account"
        ],
        "summary": "Prices a request without running it: the credits it needs, the balance now and the balance after.",
        "description": "When to use: The cost is unclear: a song, cover, stems or mastering, or several of them. Pass `operation`, `count` as the number of calls (one `POST /v1/songs` call is one press) and, as known, `model`; for stems, `stem_mode` and the song length in `duration_seconds`. Tell the user the price before a large spend.\n\nWhen not to use: For the balance alone, use `GET /v1/credits`. To check one exact request, you can also send that request itself as a dry run.\n\nCost: Free. Nothing is started or spent.\n\nSide effects: None; safe to repeat. The price is a quote: the real call can still be refused, for example by a daily limit.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again. `PUBLIC_API_MODEL_NOT_AVAILABLE`: pick a model from `GET /v1/models`.\n\nScopes: `account:read`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "operation": {
                    "type": "string",
                    "enum": [
                      "songs.create",
                      "covers.create",
                      "stems.create",
                      "midi.create",
                      "masters.create",
                      "lyrics.create",
                      "coverArt.create",
                      "inpaints.create",
                      "stems.generate"
                    ]
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "hans-2",
                      "hans-2-cover"
                    ]
                  },
                  "duration_seconds": {
                    "description": "For stems.create: the length of the audio to split, priced per started minute. For inpaints.create: the length of the source song, which is the length billed. For songs.create and covers.create: only for a model whose `max_duration_seconds` is a number; a model that picks its own length refuses it, as songs.create does. Covers never take a length, so covers.create refuses it.",
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "count": {
                    "default": 1,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "bars": {
                    "description": "For stems.generate only: the loop length in bars.",
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 8
                      },
                      {
                        "type": "number",
                        "const": 16
                      },
                      {
                        "type": "number",
                        "const": 32
                      },
                      {
                        "type": "number",
                        "const": 64
                      }
                    ]
                  },
                  "bpm": {
                    "description": "For stems.generate only: the tempo of the loop.",
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 200
                  },
                  "stem_mode": {
                    "description": "For stems.create only: the split to price. Defaults to fourStem, as stems.create does.",
                    "type": "string",
                    "enum": [
                      "twoStem",
                      "fourStem"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "operation"
                ]
              },
              "example": {
                "operation": "songs.create",
                "model": "hans-2",
                "count": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credits_required": {
                      "type": "number"
                    },
                    "balance": {
                      "type": "number",
                      "description": "The credits available now: the balance minus credits held by jobs that have not finished, the same number as `available` in the credits read."
                    },
                    "balance_after": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "credits_required",
                    "balance",
                    "balance_after"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "estimates.create",
        "x-mozart-scopes": [
          "account:read"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": "estimate_cost",
        "x-mozart-cli-command": "mozart estimate"
      }
    },
    "/v1/webhooks": {
      "post": {
        "operationId": "webhooks.create",
        "tags": [
          "webhooks"
        ],
        "summary": "Registers an https address that Mozart calls when a job becomes playable, succeeds, fails or is cancelled.",
        "description": "When to use: A program that runs many jobs wants to be told when each ends instead of checking. Pass `url` and `event_types`. Store `secret` from the answer: it is shown once and signs every delivery.\n\nWhen not to use: For one job in a conversation, call `POST /v1/jobs/wait` instead; it needs no server of your own.\n\nCost: Free.\n\nSide effects: Creates a webhook endpoint that receives events for every job of the user. A repeat call without the same idempotency key registers a second endpoint and doubles deliveries.\n\nErrors: `PUBLIC_API_URL_NOT_ALLOWED`: use a public https address. `PUBLIC_API_WEBHOOK_ENDPOINT_LIMIT_REACHED`: delete an endpoint with `DELETE /v1/webhooks/{webhook_id}` first. `PUBLIC_API_SCOPE_MISSING`: the key lacks `webhooks:manage`.\n\nScopes: `webhooks:manage`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "description": "A unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "event_types": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "job.playable",
                        "job.succeeded",
                        "job.failed",
                        "job.cancelled"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url",
                  "event_types"
                ]
              },
              "example": {
                "url": "https://example.com/mozart/events",
                "event_types": [
                  "job.succeeded",
                  "job.failed"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "webhook_endpoint"
                    },
                    "url": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "job.playable",
                          "job.succeeded",
                          "job.failed",
                          "job.cancelled"
                        ]
                      }
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    },
                    "secret": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "url",
                    "description",
                    "event_types",
                    "status",
                    "secret",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "webhooks.create",
        "x-mozart-scopes": [
          "webhooks:manage"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "optional",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": null,
        "x-mozart-cli-command": "mozart webhooks create"
      },
      "get": {
        "operationId": "webhooks.list",
        "tags": [
          "webhooks"
        ],
        "summary": "Lists the user's webhook endpoints with their address, event types and status.",
        "description": "When to use: To see which endpoints exist before adding one, or to find an endpoint id to delete. An endpoint that keeps failing becomes `disabled`.\n\nWhen not to use: To add an endpoint, use `POST /v1/webhooks`.\n\nCost: Free.\n\nSide effects: None. Reads only; safe to repeat. `secret` is not shown again.\n\nErrors: `PUBLIC_API_RATE_LIMITED`: wait `retry_after_seconds`, then call again. `PUBLIC_API_SCOPE_MISSING`: the key lacks `webhooks:manage`.\n\nScopes: `webhooks:manage`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "webhook_endpoint"
                          },
                          "url": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "event_types": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "job.playable",
                                "job.succeeded",
                                "job.failed",
                                "job.cancelled"
                              ]
                            }
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled"
                            ]
                          },
                          "secret": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "url",
                          "description",
                          "event_types",
                          "status",
                          "secret",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "data",
                    "next_cursor",
                    "has_more"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "webhooks.list",
        "x-mozart-scopes": [
          "webhooks:manage"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "read",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": null,
        "x-mozart-cli-command": "mozart webhooks list"
      }
    },
    "/v1/webhooks/{webhook_id}": {
      "delete": {
        "operationId": "webhooks.delete",
        "tags": [
          "webhooks"
        ],
        "summary": "Deletes a webhook endpoint so it receives no more events.",
        "description": "When to use: The address is no longer used, or you need room under the endpoint limit. Get the id from `GET /v1/webhooks`.\n\nWhen not to use: To read endpoints without changing them, use `GET /v1/webhooks`.\n\nCost: Free.\n\nSide effects: Stops all deliveries to that address at once. Repeating the call is safe.\n\nErrors: `PUBLIC_API_RESOURCE_NOT_FOUND`: the id is wrong or not yours; list to find it.\n\nScopes: `webhooks:manage`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/RequestId"
              },
              "x-mozart-api-version": {
                "$ref": "#/components/headers/ApiVersion"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "idempotent-replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "const": "webhook_endpoint"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "deleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "402": {
            "$ref": "#/components/responses/Error402"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "x-mozart-operation": "webhooks.delete",
        "x-mozart-scopes": [
          "webhooks:manage"
        ],
        "x-mozart-cost": {
          "kind": "free",
          "fixed_credits": null
        },
        "x-mozart-starts-job": false,
        "x-mozart-idempotency": "none",
        "x-mozart-rate-limit-class": "write",
        "x-mozart-daily-limit": null,
        "x-mozart-mcp-tool": null,
        "x-mozart-cli-command": "mozart webhooks delete"
      }
    }
  },
  "webhooks": {
    "job.playable": {
      "post": {
        "operationId": "webhook.job.playable",
        "tags": [
          "webhooks"
        ],
        "summary": "The `job.playable` event",
        "description": "Mozart sends this to each endpoint subscribed to `job.playable`, signed with the endpoint's secret. Answer with any 2xx status within a few seconds. A failed delivery is retried up to 8 times over 24 hours; the same event `id` can arrive more than once.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "object": {
                    "type": "string",
                    "const": "event"
                  },
                  "type": {
                    "type": "string",
                    "const": "job.playable"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "job": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "job"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "song",
                              "cover",
                              "inpaint",
                              "stem",
                              "stems",
                              "midi",
                              "master",
                              "cover_art",
                              "persona"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "running",
                              "succeeded",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "playable": {
                            "type": "boolean"
                          },
                          "project_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "song_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "audio",
                                    "stem",
                                    "midi",
                                    "image",
                                    "persona"
                                  ]
                                },
                                "song_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "persona_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "label": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url_expires_at": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "content_type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "duration_seconds": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "song_id",
                                "persona_id",
                                "label",
                                "url",
                                "url_expires_at",
                                "content_type",
                                "duration_seconds"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "credits_charged": {
                            "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "credits_refunded": {
                            "type": "boolean"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "next_step": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "next_step"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poll_after_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "kind",
                          "status",
                          "playable",
                          "project_id",
                          "song_ids",
                          "outputs",
                          "credits_charged",
                          "credits_refunded",
                          "error",
                          "poll_after_seconds",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "job"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created_at",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "The endpoint received the event."
          }
        }
      }
    },
    "job.succeeded": {
      "post": {
        "operationId": "webhook.job.succeeded",
        "tags": [
          "webhooks"
        ],
        "summary": "The `job.succeeded` event",
        "description": "Mozart sends this to each endpoint subscribed to `job.succeeded`, signed with the endpoint's secret. Answer with any 2xx status within a few seconds. A failed delivery is retried up to 8 times over 24 hours; the same event `id` can arrive more than once.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "object": {
                    "type": "string",
                    "const": "event"
                  },
                  "type": {
                    "type": "string",
                    "const": "job.succeeded"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "job": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "job"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "song",
                              "cover",
                              "inpaint",
                              "stem",
                              "stems",
                              "midi",
                              "master",
                              "cover_art",
                              "persona"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "running",
                              "succeeded",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "playable": {
                            "type": "boolean"
                          },
                          "project_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "song_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "audio",
                                    "stem",
                                    "midi",
                                    "image",
                                    "persona"
                                  ]
                                },
                                "song_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "persona_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "label": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url_expires_at": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "content_type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "duration_seconds": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "song_id",
                                "persona_id",
                                "label",
                                "url",
                                "url_expires_at",
                                "content_type",
                                "duration_seconds"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "credits_charged": {
                            "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "credits_refunded": {
                            "type": "boolean"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "next_step": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "next_step"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poll_after_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "kind",
                          "status",
                          "playable",
                          "project_id",
                          "song_ids",
                          "outputs",
                          "credits_charged",
                          "credits_refunded",
                          "error",
                          "poll_after_seconds",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "job"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created_at",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "The endpoint received the event."
          }
        }
      }
    },
    "job.failed": {
      "post": {
        "operationId": "webhook.job.failed",
        "tags": [
          "webhooks"
        ],
        "summary": "The `job.failed` event",
        "description": "Mozart sends this to each endpoint subscribed to `job.failed`, signed with the endpoint's secret. Answer with any 2xx status within a few seconds. A failed delivery is retried up to 8 times over 24 hours; the same event `id` can arrive more than once.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "object": {
                    "type": "string",
                    "const": "event"
                  },
                  "type": {
                    "type": "string",
                    "const": "job.failed"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "job": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "job"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "song",
                              "cover",
                              "inpaint",
                              "stem",
                              "stems",
                              "midi",
                              "master",
                              "cover_art",
                              "persona"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "running",
                              "succeeded",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "playable": {
                            "type": "boolean"
                          },
                          "project_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "song_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "audio",
                                    "stem",
                                    "midi",
                                    "image",
                                    "persona"
                                  ]
                                },
                                "song_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "persona_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "label": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url_expires_at": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "content_type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "duration_seconds": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "song_id",
                                "persona_id",
                                "label",
                                "url",
                                "url_expires_at",
                                "content_type",
                                "duration_seconds"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "credits_charged": {
                            "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "credits_refunded": {
                            "type": "boolean"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "next_step": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "next_step"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poll_after_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "kind",
                          "status",
                          "playable",
                          "project_id",
                          "song_ids",
                          "outputs",
                          "credits_charged",
                          "credits_refunded",
                          "error",
                          "poll_after_seconds",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "job"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created_at",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "The endpoint received the event."
          }
        }
      }
    },
    "job.cancelled": {
      "post": {
        "operationId": "webhook.job.cancelled",
        "tags": [
          "webhooks"
        ],
        "summary": "The `job.cancelled` event",
        "description": "Mozart sends this to each endpoint subscribed to `job.cancelled`, signed with the endpoint's secret. Answer with any 2xx status within a few seconds. A failed delivery is retried up to 8 times over 24 hours; the same event `id` can arrive more than once.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "object": {
                    "type": "string",
                    "const": "event"
                  },
                  "type": {
                    "type": "string",
                    "const": "job.cancelled"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "job": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "job"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "song",
                              "cover",
                              "inpaint",
                              "stem",
                              "stems",
                              "midi",
                              "master",
                              "cover_art",
                              "persona"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "queued",
                              "running",
                              "succeeded",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "playable": {
                            "type": "boolean"
                          },
                          "project_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "song_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "outputs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "audio",
                                    "stem",
                                    "midi",
                                    "image",
                                    "persona"
                                  ]
                                },
                                "song_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "persona_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "label": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url_expires_at": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "content_type": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "duration_seconds": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "song_id",
                                "persona_id",
                                "label",
                                "url",
                                "url_expires_at",
                                "content_type",
                                "duration_seconds"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "credits_charged": {
                            "description": "null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "credits_refunded": {
                            "type": "boolean"
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "next_step": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "next_step"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poll_after_seconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "kind",
                          "status",
                          "playable",
                          "project_id",
                          "song_ids",
                          "outputs",
                          "credits_charged",
                          "credits_refunded",
                          "error",
                          "poll_after_seconds",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "job"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "object",
                  "type",
                  "created_at",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "The endpoint received the event."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "mzk_...",
        "description": "An API key made in the Mozart web app, sent as `Authorization: Bearer <key>`. The key carries the scopes chosen when it was made; each operation names the scopes it needs in `x-mozart-scopes`. The REST API takes no tokens from connected apps: they work only through the MCP server."
      }
    },
    "schemas": {
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "authentication",
                  "permission",
                  "not_found",
                  "conflict",
                  "insufficient_credits",
                  "payment_required",
                  "rate_limited",
                  "limit_reached",
                  "content_refused",
                  "provider_unavailable",
                  "service_unavailable",
                  "internal"
                ]
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "properties": {
                  "parameter": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "string"
                  },
                  "limit_value": {
                    "type": "number"
                  },
                  "remaining": {
                    "type": "number"
                  },
                  "retry_after_seconds": {
                    "type": "number"
                  },
                  "resets_at": {
                    "type": "string"
                  },
                  "credits_required": {
                    "type": "number"
                  },
                  "credits_available": {
                    "type": "number"
                  },
                  "plans_url": {
                    "type": "string"
                  },
                  "free_app_url": {
                    "type": "string"
                  },
                  "allowed_models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "required_scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "matched_text": {
                    "type": "string"
                  },
                  "next_step": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "request_id",
              "details"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    },
    "headers": {
      "RequestId": {
        "description": "The id of this request; quote it when asking for help.",
        "schema": {
          "type": "string"
        }
      },
      "ApiVersion": {
        "description": "The API version that answered.",
        "schema": {
          "type": "string",
          "const": "v1"
        }
      },
      "RateLimitLimit": {
        "description": "Requests allowed in the current window for this caller.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "When the window resets, in Unix seconds.",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotentReplayed": {
        "description": "`true` when this answer is the stored answer to an earlier call with the same idempotency key; the work was not done again.",
        "schema": {
          "type": "string",
          "const": "true"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      },
      "WwwAuthenticate": {
        "description": "The authentication scheme to use.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error400": {
        "description": "`invalid_request`: The request is malformed or an input is invalid.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error401": {
        "description": "`authentication`: The key or token is missing, invalid or revoked.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          },
          "www-authenticate": {
            "$ref": "#/components/headers/WwwAuthenticate"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error402": {
        "description": "`insufficient_credits`: The account has too few credits for this call. A REST key also needs an API plan (Starter, Build, Scale or Growth) or API credits; with neither, every call is refused with `PUBLIC_API_CREDITS_REQUIRED`. `payment_required`: The account's plan does not include this; it needs an upgrade.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error403": {
        "description": "`permission`: The caller may not do this: a missing scope, a Mozart CLI sign-in whose account is below Pro, or access not enabled.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error404": {
        "description": "`not_found`: The resource or route does not exist for this caller.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error409": {
        "description": "`conflict`: The request conflicts with the current state, or an idempotency key was reused with a different body.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error422": {
        "description": "`content_refused`: The input was refused by content screening.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error429": {
        "description": "`rate_limited`: Too many requests; retry after `Retry-After` seconds. `limit_reached`: A daily, concurrent or total limit was reached.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          },
          "retry-after": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "x-ratelimit-limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "x-ratelimit-remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "x-ratelimit-reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error500": {
        "description": "`internal`: Mozart failed to answer; retry later.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error503": {
        "description": "`provider_unavailable`: A generation provider is unavailable; retry later. `service_unavailable`: A Mozart check the request needs, such as content screening, is temporarily unavailable; retry after `retry_after_seconds`.",
        "headers": {
          "x-request-id": {
            "$ref": "#/components/headers/RequestId"
          },
          "x-mozart-api-version": {
            "$ref": "#/components/headers/ApiVersion"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      }
    }
  }
}
