{
  "openapi": "3.1.0",
  "info": {
    "title": "Daydream Music Generator API",
    "version": "1.0.0",
    "contact": {
      "name": "Daydream",
      "email": "hello@daydream.live",
      "url": "https://daydream.live"
    },
    "x-guidance": "To make a song with no account, POST /v1/songs with {\"prompt\": \"…\"} and no Authorization: the 402 offers MPP (Tempo or Base) and x402 (Base), 0.05 USD in USDC. Pay, send the same request again, then poll GET /v1/songs/{id} with the access_token as a Bearer key until status is done, and download takes[n].mp3_url. Or POST /v1/packs for 10 songs at 0.50 USD (USDC, or a card through Link): its access_token makes them as the Bearer key on POST /v1/songs. With a Daydream API key, the same calls spend the account's credits (5 a song).",
    "description": "Describe a song, get it back as an MP3 and a WAV. Royalty-free: use it in commercial games and videos. Through the API, a song is 5 credits ($0.05) from a credit pack, from $3 for 60 songs: a free account's free songs are for gen.daydream.live, Studio, and ChatGPT and Claude. Docs and examples: https://gen.daydream.live/docs."
  },
  "servers": [
    {
      "url": "https://gen.daydream.live/v1"
    }
  ],
  "x-service-info": {
    "categories": [
      "media",
      "music"
    ],
    "docs": {
      "homepage": "https://gen.daydream.live/",
      "apiReference": "https://gen.daydream.live/docs",
      "llms": "https://gen.daydream.live/llms.txt"
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/songs": {
      "post": {
        "operationId": "createSong",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 255
            },
            "description": "Paying with no key: send the same value again (or the same payment) within 24 hours to get the same answer back, not a second charge. After 24 hours a retry is a new song. See /docs#retries."
          }
        ],
        "summary": "Make a song",
        "description": "Puts the song in line and returns it at once, status queued. Poll GET /songs/{id} every 2 seconds until status is done or failed. Counts one song against the month (given back if it fails). Or, with no key, pay 0.05 USD for it over HTTP 402: the 402 offers MPP (WWW-Authenticate: Payment, USDC on Tempo or Base) and x402 (PAYMENT-REQUIRED, USDC on Base); send the request again with the payment, and the song comes back with an access_token to poll it with. A paid song that fails is refunded. https://gen.daydream.live/docs#pay",
        "security": [
          {
            "bearer": []
          },
          {}
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.05"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50"
              }
            }
          ],
          "offers": [
            {
              "method": "tempo",
              "intent": "charge",
              "amount": "50000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50"
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 400,
                    "description": "What the song is, in words. Instrumental only: words asking for vocals or lyrics are dropped. Artist names are not allowed and are removed from prompts before generation (the answer then has artist_names_removed: true)."
                  },
                  "duration": {
                    "type": "number",
                    "minimum": 2,
                    "maximum": 120,
                    "default": 120,
                    "description": "Seconds. Trimmed to whole bars with a short fade out (none when loop is on)."
                  },
                  "bpm": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 200,
                    "description": "Default: a tempo the words name, else the genre's usual one, else 100."
                  },
                  "key": {
                    "type": "string",
                    "description": "One of the 24 major and minor keys, e.g. \"C major\", \"A minor\". Default: none."
                  },
                  "loop": {
                    "type": "boolean",
                    "default": false,
                    "description": "Make it a seamless loop: 8 bars unless duration says otherwise, in whole bars, no fade."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647,
                    "description": "Default: random. The same seed and settings make the same song."
                  },
                  "variations": {
                    "type": "integer",
                    "enum": [
                      1,
                      2
                    ],
                    "default": 1,
                    "description": "How many versions. Either way it counts as one song."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The song, in line.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "id",
                        "status",
                        "prompt",
                        "duration",
                        "bpm",
                        "seed",
                        "variations",
                        "created_at",
                        "takes"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The song's id.",
                          "examples": [
                            "sng_4hT2kq9XbV1nLm0pQe3rZa"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "queued",
                            "rendering",
                            "done",
                            "failed"
                          ],
                          "description": "Where it is: in line, being made, ready, or failed."
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "song",
                            "sfx"
                          ],
                          "description": "What the description asked for: \"song\" (music, with stems), or \"sfx\" (a sound with no music in it: one stereo take up to 30 seconds, no stems). Decided when it's made; nothing to set."
                        },
                        "position": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Place in line while queued (1 is next), else null."
                        },
                        "prompt": {
                          "type": "string"
                        },
                        "duration": {
                          "type": "number",
                          "description": "The length asked for, in seconds."
                        },
                        "bpm": {
                          "type": "integer"
                        },
                        "key": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "loop": {
                          "type": "boolean"
                        },
                        "seed": {
                          "type": "integer"
                        },
                        "variations": {
                          "type": "integer",
                          "enum": [
                            1,
                            2
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "finished_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "error": {
                          "oneOf": [
                            {
                              "type": "null"
                            },
                            {
                              "$ref": "#/components/schemas/Error"
                            }
                          ]
                        },
                        "takes": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Take"
                          },
                          "description": "One per variation once done; empty until then."
                        },
                        "playable": {
                          "type": "array",
                          "description": "Only while it's being made: the versions whose MP3 is up already, to play before the song is done. The WAV and stems come with done.",
                          "items": {
                            "type": "object",
                            "required": [
                              "n",
                              "duration",
                              "waveform",
                              "mp3_url"
                            ],
                            "properties": {
                              "n": {
                                "type": "integer"
                              },
                              "duration": {
                                "type": "number"
                              },
                              "waveform": {
                                "type": "array",
                                "items": {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 1
                                }
                              },
                              "mp3_url": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "artist_names_removed": {
                          "type": "boolean",
                          "description": "Present and true when artist names were taken out of the prompt before generation."
                        },
                        "access_token": {
                          "type": "string",
                          "description": "Paid with no key: the key for this one song (GET /songs/{id}). Keep it."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "A field is invalid (the message names it).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "A key that doesn't work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "error is pack_required (a free account through the API has no credits: songs through the API are 5 credits each, bought at buy_url), limit (this month's songs are used up), payment_required (no key: pay 0.05 USD, the challenge in the WWW-Authenticate and PAYMENT-REQUIRED headers) or payment_failed (a payment that didn't go through; the message says why, and a new challenge comes with it).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": "integer"
                        },
                        "used": {
                          "type": "integer"
                        },
                        "plan": {
                          "type": "string"
                        },
                        "upgrade_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "buy_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "pack_required: where to buy credits."
                        },
                        "price_usd": {
                          "type": "string",
                          "description": "payment_required and payment_failed: the song's price."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "More than 3 of your songs are already in line or being made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The generator is unavailable; try again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSongs",
        "summary": "Your songs, newest first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_cursor from the last page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of songs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "songs",
                    "next_cursor"
                  ],
                  "properties": {
                    "songs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Song"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that doesn't work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/songs/{id}": {
      "get": {
        "operationId": "getSong",
        "summary": "A song: its status, place in line and files",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The song.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "prompt",
                    "duration",
                    "bpm",
                    "seed",
                    "variations",
                    "created_at",
                    "takes"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The song's id.",
                      "examples": [
                        "sng_4hT2kq9XbV1nLm0pQe3rZa"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "rendering",
                        "done",
                        "failed"
                      ],
                      "description": "Where it is: in line, being made, ready, or failed."
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "song",
                        "sfx"
                      ],
                      "description": "What the description asked for: \"song\" (music, with stems), or \"sfx\" (a sound with no music in it: one stereo take up to 30 seconds, no stems). Decided when it's made; nothing to set."
                    },
                    "position": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Place in line while queued (1 is next), else null."
                    },
                    "prompt": {
                      "type": "string"
                    },
                    "duration": {
                      "type": "number",
                      "description": "The length asked for, in seconds."
                    },
                    "bpm": {
                      "type": "integer"
                    },
                    "key": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "loop": {
                      "type": "boolean"
                    },
                    "seed": {
                      "type": "integer"
                    },
                    "variations": {
                      "type": "integer",
                      "enum": [
                        1,
                        2
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "finished_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "$ref": "#/components/schemas/Error"
                        }
                      ]
                    },
                    "takes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Take"
                      },
                      "description": "One per variation once done; empty until then."
                    },
                    "playable": {
                      "type": "array",
                      "description": "Only while it's being made: the versions whose MP3 is up already, to play before the song is done. The WAV and stems come with done.",
                      "items": {
                        "type": "object",
                        "required": [
                          "n",
                          "duration",
                          "waveform",
                          "mp3_url"
                        ],
                        "properties": {
                          "n": {
                            "type": "integer"
                          },
                          "duration": {
                            "type": "number"
                          },
                          "waveform": {
                            "type": "array",
                            "items": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            }
                          },
                          "mp3_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that doesn't work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such song on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/songs/{id}/{n}.mp3": {
      "get": {
        "operationId": "getSongMp3",
        "summary": "A version's MP3 (no auth)",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirects to the file (a short-lived signed link). The link itself is stable: store it, load it from a game engine."
          },
          "404": {
            "description": "No such file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/songs/{id}/{n}.wav": {
      "get": {
        "operationId": "getSongWav",
        "summary": "A version's WAV (no auth)",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirects to the file."
          },
          "404": {
            "description": "No such file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/songs/{id}/{n}/{stem}.flac": {
      "get": {
        "operationId": "getStemFlac",
        "summary": "One stem's FLAC (no auth)",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2
              ]
            }
          },
          {
            "name": "stem",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "drums",
                "bass",
                "guitar",
                "keys",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirects to the file."
          },
          "404": {
            "description": "No such file, or the version has no stems.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "redoStem",
        "summary": "Make one stem again, or undo the last redo",
        "description": "`redo`: this stem made again with the other four exactly as they are; counts as one song; poll the song until its version's `redo.making` is gone (about a minute), then the version plays the new stem and the mix made with it. `undo`: the version back to how it was before its last redo, free; only the last redo can be undone.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2
              ]
            }
          },
          {
            "name": "stem",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "drums",
                "bass",
                "guitar",
                "keys",
                "other"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "redo",
                      "undo"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Undone: the song, its version back as it was.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Song"
                }
              }
            }
          },
          "202": {
            "description": "Redoing: the song, its version's `redo.making` naming the stem.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Song"
                }
              }
            }
          },
          "400": {
            "description": "`action` isn't `redo` or `undo`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that doesn't work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of songs or credits, as for a new song.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No song with that id on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`no_stems` (the version has none), `redoing` (one is being made: wait for it) or `nothing_to_undo`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/packs": {
      "post": {
        "operationId": "buyPack",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 255
            },
            "description": "Paying with no key: send the same value again (or the same payment) within 24 hours to get the same answer back, not a second charge. After 24 hours a retry is a new song. See /docs#retries."
          }
        ],
        "summary": "Buy 10 songs",
        "description": "No key needed: answers 402 for 0.50 USD, payable over MPP (WWW-Authenticate: Payment; USDC on Tempo or Base, or a card through Link's agent wallet) or x402 (PAYMENT-REQUIRED; USDC on Base). Send the request again with the payment, and the answer is an access_token that makes 10 songs: send it as the Bearer key on POST /songs. A song that fails goes back to the pack. https://gen.daydream.live/docs#packs",
        "security": [
          {}
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.50"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20C000000000000000000000b9537d11c60E8b50"
              }
            },
            {
              "mpp": {
                "method": "stripe",
                "intent": "charge",
                "currency": "usd"
              }
            }
          ],
          "offers": [
            {
              "method": "tempo",
              "intent": "charge",
              "amount": "500000",
              "currency": "0x20C000000000000000000000b9537d11c60E8b50"
            }
          ]
        },
        "responses": {
          "201": {
            "description": "The pack, paid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "access_token",
                    "songs",
                    "songs_left",
                    "price_usd"
                  ],
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "description": "The key for the pack's 10 songs. Keep it."
                    },
                    "songs": {
                      "type": "integer"
                    },
                    "songs_left": {
                      "type": "integer"
                    },
                    "price_usd": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "payment_required (pay 0.50 USD, the challenge in the WWW-Authenticate and PAYMENT-REQUIRED headers) or payment_failed (the message says why; a new challenge comes with it).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Songs used and left this month",
        "responses": {
          "200": {
            "description": "This month's songs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "plan",
                    "limit",
                    "used",
                    "resets_at"
                  ],
                  "properties": {
                    "plan": {
                      "type": "string",
                      "enum": [
                        "anonymous",
                        "free",
                        "songs",
                        "pro",
                        "max",
                        "internal",
                        "pay_per_song",
                        "pack"
                      ]
                    },
                    "limit": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Songs a month; null when unlimited. Through the API on a free account: the songs its credits make."
                    },
                    "used": {
                      "type": "integer"
                    },
                    "songs_left": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "api_uses_credits": {
                      "type": "boolean",
                      "description": "A free account through the API: its songs come from credits only (5 a song)."
                    },
                    "buy_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "With api_uses_credits and no credits: where to buy them."
                    },
                    "resets_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When the month's songs start again; null through the API on a free account."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that doesn't work.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A Daydream API key: https://app.daydream.live/dashboard/api-keys"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "A code to branch on."
          },
          "message": {
            "type": "string",
            "description": "What went wrong, in plain words."
          }
        }
      },
      "Song": {
        "type": "object",
        "required": [
          "id",
          "status",
          "prompt",
          "duration",
          "bpm",
          "seed",
          "variations",
          "created_at",
          "takes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The song's id.",
            "examples": [
              "sng_4hT2kq9XbV1nLm0pQe3rZa"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "rendering",
              "done",
              "failed"
            ],
            "description": "Where it is: in line, being made, ready, or failed."
          },
          "kind": {
            "type": "string",
            "enum": [
              "song",
              "sfx"
            ],
            "description": "What the description asked for: \"song\" (music, with stems), or \"sfx\" (a sound with no music in it: one stereo take up to 30 seconds, no stems). Decided when it's made; nothing to set."
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Place in line while queued (1 is next), else null."
          },
          "prompt": {
            "type": "string"
          },
          "duration": {
            "type": "number",
            "description": "The length asked for, in seconds."
          },
          "bpm": {
            "type": "integer"
          },
          "key": {
            "type": [
              "string",
              "null"
            ]
          },
          "loop": {
            "type": "boolean"
          },
          "seed": {
            "type": "integer"
          },
          "variations": {
            "type": "integer",
            "enum": [
              1,
              2
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Error"
              }
            ]
          },
          "takes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Take"
            },
            "description": "One per variation once done; empty until then."
          },
          "playable": {
            "type": "array",
            "description": "Only while it's being made: the versions whose MP3 is up already, to play before the song is done. The WAV and stems come with done.",
            "items": {
              "type": "object",
              "required": [
                "n",
                "duration",
                "waveform",
                "mp3_url"
              ],
              "properties": {
                "n": {
                  "type": "integer"
                },
                "duration": {
                  "type": "number"
                },
                "waveform": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "mp3_url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "Take": {
        "type": "object",
        "required": [
          "n",
          "seed",
          "duration",
          "waveform",
          "mp3_url",
          "wav_url"
        ],
        "properties": {
          "n": {
            "type": "integer",
            "description": "1 or 2."
          },
          "seed": {
            "type": "integer",
            "description": "The song's seed plus n - 1."
          },
          "duration": {
            "type": "number",
            "description": "Its length in seconds."
          },
          "waveform": {
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "description": "Its shape for drawing: 200 peaks from 0 to 1, start to end."
          },
          "mp3_url": {
            "type": "string",
            "format": "uri",
            "description": "MP3, 192 kbps, stereo, 48 kHz. A stable link, no auth: it redirects to the file."
          },
          "wav_url": {
            "type": "string",
            "format": "uri",
            "description": "WAV, 16-bit, stereo, 48 kHz. A stable link, no auth."
          },
          "stems_ready": {
            "type": "boolean",
            "description": "Only on a version made with stems: false while its stems are still being made (a few seconds after the song is done; poll the song), true once stems and stem_waveforms are there. Absent: the version has no stems."
          },
          "stems": {
            "type": "object",
            "description": "Only on a version made with stems: each stem as FLAC (lossless, 16-bit, stereo, 48 kHz, lined up with the others; they add up to the mix). Stable links, no auth.",
            "properties": {
              "drums": {
                "type": "string",
                "format": "uri"
              },
              "bass": {
                "type": "string",
                "format": "uri"
              },
              "guitar": {
                "type": "string",
                "format": "uri"
              },
              "keys": {
                "type": "string",
                "format": "uri"
              },
              "other": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "stem_waveforms": {
            "type": "object",
            "description": "Only on a version made with stems: each stem's shape for drawing, 100 peaks from 0 to 1.",
            "properties": {
              "drums": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "bass": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "guitar": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "keys": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "other": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              }
            }
          },
          "redo": {
            "type": "object",
            "description": "Only while a stem of this version is being made again (`making`), or when its last redo can be undone (`undo`): the stem each names.",
            "properties": {
              "making": {
                "type": "string",
                "enum": [
                  "drums",
                  "bass",
                  "guitar",
                  "keys",
                  "other"
                ]
              },
              "undo": {
                "type": "string",
                "enum": [
                  "drums",
                  "bass",
                  "guitar",
                  "keys",
                  "other"
                ]
              }
            }
          }
        }
      }
    }
  }
}