{
 "openapi": "3.1.0",
 "info": {
  "title": "mus.io",
  "version": "0.2.6",
  "summary": "Real recorded instruments for AI agents: search instruments, read their cards, render parts to audio and scores.",
  "description": "The plain HTTP API of the mus.io MCP service (https://mus.io/mcp offers the same as MCP tools; each operation names its tool in x-mcp-tool). Start with https://mus.io/agents.md. Build 0.2.6+6cce5e7."
 },
 "externalDocs": {
  "description": "Agent guide",
  "url": "https://mus.io/agents.md"
 },
 "servers": [
  {
   "url": "https://mus.io"
  }
 ],
 "security": [
  {
   "musioOAuth": [
    "render"
   ]
  },
  {
   "agentKey": []
  }
 ],
 "paths": {
  "/v1/instruments": {
   "get": {
    "operationId": "search_instruments",
    "summary": "Search instruments",
    "description": "Find instruments mus.io can play: each with its id, library, developer, range, sweet spot, articulations and mics. Words in `search` must all match (library, name or developer). Results are grouped by instrument (the name before the first \"|\"); FX patches are listed after the main hits (fx=exclude hides them, fx=only lists only FX). When a word does not find what it names (an upright or jazz bass, a nylon or acoustic guitar, a brush kit) the answer has a \"hint\" that says which patches to use and the \"closest\" patches.",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "search_instruments",
    "parameters": [
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "developer",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "library",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "family",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "one of: strings, brass, woodwinds, choir, percussion, keys, synth, guitars, other (voice finds choir; guitars holds every plucked, fretted instrument: the Studio Guitars nylon guitar, the D-35, ukuleles and banjo); third-party instruments have families too"
     },
     {
      "name": "fx",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "after",
        "exclude",
        "only"
       ]
      },
      "description": "after (default): FX patches below the main hits; exclude: hide FX; only: FX patches only"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 200,
       "default": 20
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     }
    ]
   }
  },
  "/v1/instruments/{instrument_id}": {
   "get": {
    "operationId": "get_instrument_card",
    "summary": "Instrument card",
    "description": "One instrument's full card: playable range, sweet spot, articulations (and what each is for, with how to ask for it), mics and tips. Read it before writing that instrument's part.",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "get_instrument_card",
    "parameters": [
     {
      "name": "instrument_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f]{32}$"
      },
      "description": "the id from search_instruments; the same id goes in a part's \"instrument\""
     }
    ]
   }
  },
  "/v1/guide": {
   "get": {
    "operationId": "get_playing_guide",
    "summary": "Playing guide",
    "description": "How to get the best sound from mus.io: the job format and every field, project_json, ranges, articulations, dynamics (controller 1), legato, attack compensation, loudness, presets, voicing and mixing. Read once before writing parts. (mus.io build 0.2.6+6cce5e7; every submit_job dry run and get_job reply carries the same \"build\".)",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "get_playing_guide"
   }
  },
  "/v1/jobs": {
   "post": {
    "operationId": "submit_job",
    "summary": "Render music",
    "description": "Queue a cloud render. type \"render\": a phrase -> mix.wav. type \"project\": project_json (the same format, up to 32 parts, with title, meter and key) with outputs from \"mix\" and \"score\" (PDF, PNG pages, MusicXML). Every field is checked: one the service does not use is refused with the field named. By default notes start early by each patch's measured attack (attack_compensation), levels are evened per patch and the mix is brought to -16 LUFS (target_lufs); a project's mix gets exactly the same, while its score shows the notes as written (a staff per part named by the part, modal keys with the right signature), so one project job gives both audio and score. Each part's measured level comes back in part_levels (\"part_levels\": false skips it). Faster revisions: \"mode\": \"draft\" renders every part side by side and reuses the parts that did not change since an earlier job (no master limiter, part levels or score; seconds instead of minutes for a one-part change); \"section\": {\"start\", \"end\"} plays only that passage (beats with tempo_bpm) with a pre-roll and tail; outputs [\"score\"] alone engraves the score with no audio. Send the final with the default \"mode\": \"full\". Fast loop: \"dry_run\": true checks everything and returns every error at once plus the facts of the instruments used, with nothing queued or counted; a submit's reply also lists those facts (\"instruments\": range, articulations, key map). The mix comes as mix.mp3 (small, the default \"format\") beside mix.wav. \"mode\": \"draft\" with \"auto_full\": true renders the draft first and then the full render on its own (get_job's \"full\", get_outputs' mix_mp3_full / mix_full). Values are checked before anything is queued, exactly as the render checks them: mix.volume_db is -100 to +6 dB (as are master.volume_db and a bus's level_db), pan -1 to 1, reverb and sends 0 to 1, mic names from the card, effect types and their settings' ranges, and notes of one keyswitch part that start together must share one articulation; a dry run lists every such error at once. tempo_bpm is quarter notes per minute in every meter (6/8 or 9/8 at dotted quarter = 110: send 165). Counts against this connection's monthly rendered minutes and the account's daily limits (an auto_full counts both), and is paid from the account's minutes: every account has 5 trial minutes once, which play any instrument here; Musio Complete adds 30 minutes each month. The trial pays first. Returns the job id; then get_job with wait_seconds 60. (mus.io build 0.2.6+6cce5e7)",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "submit_job",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Job"
       },
       "examples": {
        "smallest": {
         "summary": "three notes on a piano",
         "value": {
          "type": "render",
          "phrase": {
           "tempo_bpm": 90,
           "parts": [
            {
             "instrument": "b598b67578a14239834c92e16b8f7b32",
             "notes": [
              {
               "t": 0,
               "dur": 1,
               "pitch": "C4",
               "vel": 80
              },
              {
               "t": 1,
               "dur": 1,
               "pitch": "E4",
               "vel": 80
              },
              {
               "t": 2,
               "dur": 2,
               "pitch": "G4",
               "vel": 90
              }
             ]
            }
           ]
          }
         }
        },
        "dry_run": {
         "summary": "the same, checked for free",
         "value": {
          "type": "render",
          "phrase": {
           "tempo_bpm": 90,
           "parts": [
            {
             "instrument": "b598b67578a14239834c92e16b8f7b32",
             "notes": [
              {
               "t": 0,
               "dur": 1,
               "pitch": "C4",
               "vel": 80
              },
              {
               "t": 1,
               "dur": 1,
               "pitch": "E4",
               "vel": 80
              },
              {
               "t": 2,
               "dur": 2,
               "pitch": "G4",
               "vel": 90
              }
             ]
            }
           ]
          },
          "dry_run": true
         }
        },
        "score": {
         "summary": "the same notes as a project: mix and score",
         "value": {
          "type": "project",
          "outputs": [
           "mix",
           "score"
          ],
          "project_json": {
           "tempo_bpm": 90,
           "parts": [
            {
             "instrument": "b598b67578a14239834c92e16b8f7b32",
             "notes": [
              {
               "t": 0,
               "dur": 1,
               "pitch": "C4",
               "vel": 80
              },
              {
               "t": 1,
               "dur": 1,
               "pitch": "E4",
               "vel": 80
              },
              {
               "t": 2,
               "dur": 2,
               "pitch": "G4",
               "vel": 90
              }
             ]
            }
           ],
           "title": "My idea",
           "meter": "4/4",
           "key": "C major"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}": {
   "get": {
    "operationId": "get_job",
    "summary": "Job status",
    "description": "A job's state and phase: queued (waiting for a render machine, with queue_position and estimated_seconds_left), running (progress: phase, parts_done of parts_total, percent and eta_seconds from the render machine; estimated_seconds_left counts down), succeeded (length, loudness with level.note / level.limiter_pass, part_levels: each part's integrated LUFS, RMS and peak in dBFS and offset_db from the loudest part, measured on its own render before the mix, with part_levels.balance and a warning when one part is far above the rest or a part is nearly inaudible (15 dB or more under); ending: last_note_off_s, sound_ended_s, file_seconds and trailing_silence_s on every finished mix (a warning only when 3 s or more of the file's end is silence); what was applied for every part, including applied.score; warnings; build: the mus.io build that answered, rendered_by: the render machine's build; timing: where the machine's time went (mix_render_s, part_levels_wait_s, score_s, stems_s, upload_s); draft: stems rendered and reused; files with download links) or failed (why). A finished job is read from its finished record, never shown as queued or running. With \"wait_seconds\" (up to 60) the call holds on and answers the moment the job finishes, so there is no need to poll on a timer; an auto_full draft also shows its full render under \"full\".",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "get_job",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f]{16}$"
      },
      "description": "the id submit_job returned"
     },
     {
      "name": "wait_seconds",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 60
      },
      "description": "hold on up to this long for the job to finish (recommended 60)"
     }
    ]
   },
   "delete": {
    "operationId": "cancel_job_delete",
    "summary": "Cancel a job (same as POST /cancel)",
    "description": "Cancel one of your jobs. A queued job is removed and is not charged. A running job is stopped on the render machine and is charged the render time already used at the moment cancel was received (warmup, mix, stems and part-level renders; charged_seconds), never more than this job's quoted this_job_minutes (asked_seconds) so cancelling never costs more than finishing. Time spent stopping the engine or uploading is not charged. An unfinished auto_full child (the full render queued after a draft) is cancelled too. Owner only: someone else's job is not found.",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "cancel_job",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f]{16}$"
      },
      "description": "the id submit_job returned"
     }
    ]
   }
  },
  "/v1/jobs/{job_id}/outputs": {
   "get": {
    "operationId": "get_outputs",
    "summary": "Download links",
    "description": "Signed download links (valid one hour) for a finished job's files, by kind: mix_mp3 (the small MP3), mix (WAV), mix_mp3_full / mix_full (an auto_full draft's full render, once done), score_pdf, score_png, score_musicxml, project (.musiostudio), and the outputs that are not available for this job, with why; also part_levels (each part's measured LUFS, RMS, peak and offset_db from the loudest), the mix's level, its ending and the job's warnings. With \"wait_seconds\" (up to 60) the call holds on and answers the moment the job finishes, the same as get_job (it does not return \"running\" immediately).",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "get_outputs",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f]{16}$"
      },
      "description": "the id submit_job returned"
     },
     {
      "name": "wait_seconds",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 60
      },
      "description": "hold on up to this long for the job to finish (recommended 60; same long-poll as get_job)"
     }
    ]
   }
  },
  "/v1/jobs/{job_id}/cancel": {
   "post": {
    "operationId": "cancel_job",
    "summary": "Cancel a job",
    "description": "Cancel one of your jobs. A queued job is removed and is not charged. A running job is stopped on the render machine and is charged the render time already used at the moment cancel was received (warmup, mix, stems and part-level renders; charged_seconds), never more than this job's quoted this_job_minutes (asked_seconds) so cancelling never costs more than finishing. Time spent stopping the engine or uploading is not charged. An unfinished auto_full child (the full render queued after a draft) is cancelled too. Owner only: someone else's job is not found.",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "403": {
      "$ref": "#/components/responses/Refusal"
     },
     "404": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    },
    "x-mcp-tool": "cancel_job",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f]{16}$"
      },
      "description": "the id submit_job returned"
     }
    ]
   }
  },
  "/v1/status": {
   "get": {
    "operationId": "get_status",
    "summary": "Today's limits and the queue",
    "description": "Your account's daily limits and what is used today, its minutes (trial and this month), the queue, the build and the start-here text.",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     },
     "503": {
      "$ref": "#/components/responses/Refusal"
     }
    }
   }
  },
  "/v1/usage": {
   "get": {
    "operationId": "get_usage",
    "summary": "Your usage by day",
    "description": "Rendered minutes and jobs by day for your own account (default: the last 30 days), and its minutes left (trial and this month).",
    "security": [
     {
      "musioOAuth": [
       "render"
      ]
     },
     {
      "agentKey": []
     }
    ],
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "first day (YYYY-MM-DD, UTC)"
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "last day (YYYY-MM-DD, UTC)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/Refusal"
     },
     "401": {
      "$ref": "#/components/responses/Refusal"
     },
     "429": {
      "$ref": "#/components/responses/Refusal"
     }
    }
   }
  },
  "/oauth/device": {
   "post": {
    "operationId": "device_authorization",
    "summary": "Start a device code sign-in (RFC 8628)",
    "description": "For an agent without MCP or a browser. Show the person verification_uri_complete; then poll /oauth/token.",
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/x-www-form-urlencoded": {
       "schema": {
        "type": "object",
        "required": [
         "client_id"
        ],
        "properties": {
         "client_id": {
          "type": "string",
          "default": "musio-device",
          "description": "musio-device (built in, no registration) or a registered client's id"
         },
         "scope": {
          "type": "string",
          "default": "render"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "the codes",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "device_code": {
           "type": "string"
          },
          "user_code": {
           "type": "string"
          },
          "verification_uri": {
           "type": "string"
          },
          "verification_uri_complete": {
           "type": "string"
          },
          "expires_in": {
           "type": "integer"
          },
          "interval": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/OAuthError"
     }
    }
   }
  },
  "/oauth/token": {
   "post": {
    "operationId": "token",
    "summary": "Get or refresh a token",
    "description": "grant_type urn:ietf:params:oauth:grant-type:device_code (poll every interval seconds; authorization_pending means keep waiting, slow_down means wait longer), refresh_token (each refresh returns a new refresh token), or authorization_code with code_verifier (PKCE).",
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/x-www-form-urlencoded": {
       "schema": {
        "type": "object",
        "required": [
         "grant_type",
         "client_id"
        ],
        "properties": {
         "grant_type": {
          "type": "string",
          "enum": [
           "urn:ietf:params:oauth:grant-type:device_code",
           "refresh_token",
           "authorization_code"
          ]
         },
         "client_id": {
          "type": "string"
         },
         "device_code": {
          "type": "string"
         },
         "refresh_token": {
          "type": "string"
         },
         "code": {
          "type": "string"
         },
         "code_verifier": {
          "type": "string"
         },
         "redirect_uri": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "tokens",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "access_token": {
           "type": "string"
          },
          "token_type": {
           "type": "string"
          },
          "expires_in": {
           "type": "integer"
          },
          "refresh_token": {
           "type": "string"
          },
          "scope": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/OAuthError"
     },
     "401": {
      "$ref": "#/components/responses/OAuthError"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "musioOAuth": {
    "type": "oauth2",
    "description": "Sign in as the person, render scope only. Agents without a browser use the device code (x-deviceAuthorization; client_id musio-device, no registration). MCP clients discover all of it from https://mus.io/.well-known/oauth-authorization-server.",
    "flows": {
     "authorizationCode": {
      "authorizationUrl": "https://mus.io/oauth/authorize",
      "tokenUrl": "https://mus.io/oauth/token",
      "refreshUrl": "https://mus.io/oauth/token",
      "scopes": {
       "render": "Make music with your mus.io instruments: search instruments, read their cards, render audio and scores, and read the jobs this connection made."
      }
     },
     "x-deviceAuthorization": {
      "deviceAuthorizationUrl": "https://mus.io/oauth/device",
      "tokenUrl": "https://mus.io/oauth/token",
      "refreshUrl": "https://mus.io/oauth/token",
      "grantType": "urn:ietf:params:oauth:grant-type:device_code",
      "clientId": "musio-device",
      "scopes": {
       "render": "Make music with your mus.io instruments: search instruments, read their cards, render audio and scores, and read the jobs this connection made."
      }
     }
    }
   },
   "agentKey": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "mk_ agent key",
    "description": "An agent key the person made (mk_...), for an agent with nobody at a browser. Not for web pages."
   }
  },
  "schemas": {
   "Job": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "render",
       "project"
      ]
     },
     "phrase": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "tempo_bpm": {
        "type": "number",
        "minimum": 20,
        "maximum": 400,
        "description": "quarter notes per minute, 10-400, in every meter (6/8 or 9/8 felt at dotted quarter = 110: send 165); then t and dur are in beats (quarter notes), else seconds. One tempo per phrase"
       },
       "parts": {
        "type": "array",
        "items": {
         "type": "object",
         "additionalProperties": false,
         "properties": {
          "instrument": {
           "type": "string",
           "description": "the instrument's id (32 hex characters, from search_instruments), or its exact name"
          },
          "name": {
           "type": "string",
           "description": "a name for the part (score staff names)"
          },
          "articulation": {
           "type": "string",
           "description": "the articulation for the whole part (keyswitch patches)"
          },
          "articulations": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "t": {
              "type": "number"
             },
             "name": {
              "type": "string"
             }
            },
            "required": [
             "t",
             "name"
            ]
           },
           "description": "timed switches: [{\"t\", \"name\"}]"
          },
          "dynamics": {
           "type": "integer",
           "minimum": 0,
           "maximum": 127,
           "description": "the starting CC1 (0-127; default 100: the service sends it before the first note when the part has no CC1 of its own)"
          },
          "notes": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
             "t": {
              "type": "number",
              "minimum": 0,
              "description": "start, in beats when tempo_bpm is set (else seconds)"
             },
             "dur": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "length, in beats (legato: overlap the next note by 0.05-0.08 beat)"
             },
             "pitch": {
              "type": [
               "string",
               "integer"
              ],
              "description": "\"C4\" (= 60) or a MIDI number"
             },
             "vel": {
              "type": "integer",
              "minimum": 1,
              "maximum": 127,
              "description": "velocity; what it changes depends on the patch (see its card)"
             },
             "articulation": {
              "type": "string",
              "description": "this note's articulation (keyswitch patches): switched to just before the note; names from the card"
             },
             "swell": {
              "type": "boolean",
              "description": "true: this note is a swell on purpose (a key that swells rather than hits), so it gets no swell warning; the sound is the same"
             }
            },
            "required": [
             "t",
             "dur",
             "pitch"
            ]
           }
          },
          "cc": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
             "t": {
              "type": "number",
              "minimum": 0
             },
             "cc": {
              "type": "integer",
              "minimum": 0,
              "maximum": 127,
              "description": "1 dynamics, 11 expression, 64 sustain pedal"
             },
             "value": {
              "type": "integer",
              "minimum": 0,
              "maximum": 127
             }
            },
            "required": [
             "t",
             "cc",
             "value"
            ],
            "description": "a controller point; points are joined by straight lines (CC 64-69 step), so put one where the curve turns"
           },
           "description": "controller points: [{\"t\", \"cc\", \"value\"}], e.g. cc 1 dynamics, 11 expression, 64 sustain pedal"
          },
          "mix": {
           "type": "object",
           "properties": {
            "volume_db": {
             "type": "number",
             "minimum": -100,
             "maximum": 6,
             "description": "the part's fader in dB: -100 to +6 (0 is the default; above +6 is refused: raise velocity or CC1/CC11, or lower the other parts)"
            },
            "pan": {
             "type": "number",
             "minimum": -1,
             "maximum": 1
            },
            "reverb": {
             "type": "number",
             "minimum": 0,
             "maximum": 1,
             "description": "reverb send"
            },
            "mute": {
             "type": "boolean"
            },
            "solo": {
             "type": "boolean"
            },
            "sends": {
             "type": "object"
            },
            "mics": {
             "type": "object",
             "description": "mic name (from the card) -> level in dB, or {\"on\": false}"
            }
           }
          },
          "effects": {
           "type": "array",
           "description": "insert effects on the part, at most 8: [{\"type\": eq|compressor|reverb|echo|filter|drive|chorus|deesser, \"params\": {...}}]; settings go inside \"params\" and each is range-checked at submit"
          },
          "attack_compensation": {
           "type": "boolean",
           "description": "false to play this part's notes exactly as written"
          },
          "level_trim": {
           "type": "boolean",
           "description": "false to leave this part's level as it is (no library trim)"
          }
         },
         "required": [
          "instrument",
          "notes"
         ]
        },
        "minItems": 1,
        "maxItems": 16,
        "description": "the parts, at most 16 in a render (32 in a project)"
       },
       "master": {
        "type": "object",
        "description": "the master block: {\"volume_db\": -100..+6, \"effects\": [...], \"limiter\": {\"gain\": 0-24 dB driven into the limiter (louder), \"ceiling\": -12..0 dBTP, \"release\": 0-1000 ms (0 = auto), \"style\": transparent|punchy|loud, \"bypass\": true|false}, ...}. Fields you leave out keep the preset's (every preset: ceiling -1, gain 0 orchestral/folk, 3 trailer, 13 solo_piano)"
       },
       "buses": {
        "type": "object",
        "description": "effect buses, e.g. {\"reverb\": {\"room\": \"Hall\" (Studio, Room, Hall or Cathedral), \"level_db\": -100..+6, \"params\": {...}}, \"echo\": {\"level_db\": -6, \"effects\": [{\"type\": \"echo\", \"params\": {...}}]}}; at most 8 besides the reverb; a part reaches one with mix.sends"
       },
       "title": {
        "type": "string"
       },
       "meter": {
        "type": "string",
        "description": "e.g. \"3/4\" (scores)"
       },
       "key": {
        "type": "string",
        "description": "e.g. \"D minor\" (scores)"
       },
       "preset": {
        "type": "string",
        "enum": [
         "folk",
         "orchestral",
         "solo_piano",
         "trailer"
        ],
        "description": "a mix preset: orchestral, trailer, folk or solo_piano"
       },
       "target_lufs": {
        "type": [
         "number",
         "null"
        ],
        "minimum": -40,
        "maximum": -6,
        "description": "the mix's loudness target (default -16; null for none)"
       },
       "attack_compensation": {
        "type": "boolean",
        "description": "true (default): notes start early by each patch's measured attack time"
       },
       "level_trims": {
        "type": "boolean",
        "description": "true (default): per-patch library level trims (listed in the job's \"applied\" and warnings); false: none"
       },
       "tail_seconds": {
        "type": "number",
        "minimum": 0,
        "maximum": 20,
        "description": "the ending: how long the file runs after the last note ends (0-20 s); default: until the sound has died away (up to 20 s)"
       },
       "fade_seconds": {
        "type": "number",
        "minimum": 0,
        "maximum": 10,
        "description": "with tail_seconds: fade out over the last this-many seconds of the file (default: the smaller of 2 s and the tail)"
       },
       "part_levels": {
        "type": "boolean",
        "description": "true (default): the finished job reports each part's measured level (integrated LUFS, RMS, peak and its dB offset from the loudest part) in \"part_levels\", so a balance check needs no solo renders; false skips it (a little faster)"
       },
       "hide_warnings": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "words: a warning containing any of them (or about a part whose name or instrument contains one) is left out of the job's answer. [\"swell\"] hides every swell warning on every patch (tam-tam, cymbals, gongs); [\"tam-tam\"] hides the warnings about tam-tam parts; [\"balance\"] hides the loud / nearly inaudible part warnings a finished job adds from part_levels, [\"level:\"] the submit-time notes on patches known to be very loud or very quiet, [\"ending\"] the trailing-silence warning. To mark single notes instead, give the note \"swell\": true. The sound is unchanged."
       }
      },
      "required": [
       "parts"
      ]
     },
     "project_json": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "parts"
      ],
      "description": "a project: the phrase format plus a name, up to 32 parts; it makes a score and a mix",
      "properties": {
       "tempo_bpm": {
        "type": "number",
        "minimum": 20,
        "maximum": 400,
        "description": "quarter notes per minute, 10-400, in every meter (6/8 or 9/8 felt at dotted quarter = 110: send 165); then t and dur are in beats (quarter notes), else seconds. One tempo per phrase"
       },
       "parts": {
        "type": "array",
        "items": {
         "type": "object",
         "additionalProperties": false,
         "properties": {
          "instrument": {
           "type": "string",
           "description": "the instrument's id (32 hex characters, from search_instruments), or its exact name"
          },
          "name": {
           "type": "string",
           "description": "a name for the part (score staff names)"
          },
          "articulation": {
           "type": "string",
           "description": "the articulation for the whole part (keyswitch patches)"
          },
          "articulations": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "t": {
              "type": "number"
             },
             "name": {
              "type": "string"
             }
            },
            "required": [
             "t",
             "name"
            ]
           },
           "description": "timed switches: [{\"t\", \"name\"}]"
          },
          "dynamics": {
           "type": "integer",
           "minimum": 0,
           "maximum": 127,
           "description": "the starting CC1 (0-127; default 100: the service sends it before the first note when the part has no CC1 of its own)"
          },
          "notes": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
             "t": {
              "type": "number",
              "minimum": 0,
              "description": "start, in beats when tempo_bpm is set (else seconds)"
             },
             "dur": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "length, in beats (legato: overlap the next note by 0.05-0.08 beat)"
             },
             "pitch": {
              "type": [
               "string",
               "integer"
              ],
              "description": "\"C4\" (= 60) or a MIDI number"
             },
             "vel": {
              "type": "integer",
              "minimum": 1,
              "maximum": 127,
              "description": "velocity; what it changes depends on the patch (see its card)"
             },
             "articulation": {
              "type": "string",
              "description": "this note's articulation (keyswitch patches): switched to just before the note; names from the card"
             },
             "swell": {
              "type": "boolean",
              "description": "true: this note is a swell on purpose (a key that swells rather than hits), so it gets no swell warning; the sound is the same"
             }
            },
            "required": [
             "t",
             "dur",
             "pitch"
            ]
           }
          },
          "cc": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
             "t": {
              "type": "number",
              "minimum": 0
             },
             "cc": {
              "type": "integer",
              "minimum": 0,
              "maximum": 127,
              "description": "1 dynamics, 11 expression, 64 sustain pedal"
             },
             "value": {
              "type": "integer",
              "minimum": 0,
              "maximum": 127
             }
            },
            "required": [
             "t",
             "cc",
             "value"
            ],
            "description": "a controller point; points are joined by straight lines (CC 64-69 step), so put one where the curve turns"
           },
           "description": "controller points: [{\"t\", \"cc\", \"value\"}], e.g. cc 1 dynamics, 11 expression, 64 sustain pedal"
          },
          "mix": {
           "type": "object",
           "properties": {
            "volume_db": {
             "type": "number",
             "minimum": -100,
             "maximum": 6,
             "description": "the part's fader in dB: -100 to +6 (0 is the default; above +6 is refused: raise velocity or CC1/CC11, or lower the other parts)"
            },
            "pan": {
             "type": "number",
             "minimum": -1,
             "maximum": 1
            },
            "reverb": {
             "type": "number",
             "minimum": 0,
             "maximum": 1,
             "description": "reverb send"
            },
            "mute": {
             "type": "boolean"
            },
            "solo": {
             "type": "boolean"
            },
            "sends": {
             "type": "object"
            },
            "mics": {
             "type": "object",
             "description": "mic name (from the card) -> level in dB, or {\"on\": false}"
            }
           }
          },
          "effects": {
           "type": "array",
           "description": "insert effects on the part, at most 8: [{\"type\": eq|compressor|reverb|echo|filter|drive|chorus|deesser, \"params\": {...}}]; settings go inside \"params\" and each is range-checked at submit"
          },
          "attack_compensation": {
           "type": "boolean",
           "description": "false to play this part's notes exactly as written"
          },
          "level_trim": {
           "type": "boolean",
           "description": "false to leave this part's level as it is (no library trim)"
          }
         },
         "required": [
          "instrument",
          "notes"
         ]
        },
        "minItems": 1,
        "maxItems": 32,
        "description": "the parts, at most 16 in a render (32 in a project)"
       },
       "master": {
        "type": "object",
        "description": "the master block: {\"volume_db\": -100..+6, \"effects\": [...], \"limiter\": {\"gain\": 0-24 dB driven into the limiter (louder), \"ceiling\": -12..0 dBTP, \"release\": 0-1000 ms (0 = auto), \"style\": transparent|punchy|loud, \"bypass\": true|false}, ...}. Fields you leave out keep the preset's (every preset: ceiling -1, gain 0 orchestral/folk, 3 trailer, 13 solo_piano)"
       },
       "buses": {
        "type": "object",
        "description": "effect buses, e.g. {\"reverb\": {\"room\": \"Hall\" (Studio, Room, Hall or Cathedral), \"level_db\": -100..+6, \"params\": {...}}, \"echo\": {\"level_db\": -6, \"effects\": [{\"type\": \"echo\", \"params\": {...}}]}}; at most 8 besides the reverb; a part reaches one with mix.sends"
       },
       "title": {
        "type": "string"
       },
       "meter": {
        "type": "string",
        "description": "e.g. \"3/4\" (scores)"
       },
       "key": {
        "type": "string",
        "description": "e.g. \"D minor\" (scores)"
       },
       "preset": {
        "type": "string",
        "enum": [
         "folk",
         "orchestral",
         "solo_piano",
         "trailer"
        ],
        "description": "a mix preset: orchestral, trailer, folk or solo_piano"
       },
       "target_lufs": {
        "type": [
         "number",
         "null"
        ],
        "minimum": -40,
        "maximum": -6,
        "description": "the mix's loudness target (default -16; null for none)"
       },
       "attack_compensation": {
        "type": "boolean",
        "description": "true (default): notes start early by each patch's measured attack time"
       },
       "level_trims": {
        "type": "boolean",
        "description": "true (default): per-patch library level trims (listed in the job's \"applied\" and warnings); false: none"
       },
       "tail_seconds": {
        "type": "number",
        "minimum": 0,
        "maximum": 20,
        "description": "the ending: how long the file runs after the last note ends (0-20 s); default: until the sound has died away (up to 20 s)"
       },
       "fade_seconds": {
        "type": "number",
        "minimum": 0,
        "maximum": 10,
        "description": "with tail_seconds: fade out over the last this-many seconds of the file (default: the smaller of 2 s and the tail)"
       },
       "part_levels": {
        "type": "boolean",
        "description": "true (default): the finished job reports each part's measured level (integrated LUFS, RMS, peak and its dB offset from the loudest part) in \"part_levels\", so a balance check needs no solo renders; false skips it (a little faster)"
       },
       "hide_warnings": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "words: a warning containing any of them (or about a part whose name or instrument contains one) is left out of the job's answer. [\"swell\"] hides every swell warning on every patch (tam-tam, cymbals, gongs); [\"tam-tam\"] hides the warnings about tam-tam parts; [\"balance\"] hides the loud / nearly inaudible part warnings a finished job adds from part_levels, [\"level:\"] the submit-time notes on patches known to be very loud or very quiet, [\"ending\"] the trailing-silence warning. To mark single notes instead, give the note \"swell\": true. The sound is unchanged."
       },
       "name": {
        "type": "string"
       },
       "time_signature": {
        "type": "string"
       }
      }
     },
     "outputs": {
      "type": "array",
      "items": {
       "type": "string",
       "enum": [
        "mix",
        "score",
        "project"
       ]
      },
      "description": "project jobs only; default [\"mix\"]. \"mix\" and \"score\" are made in the cloud; \"project\" is the Musio Studio file (.musiostudio, opens in Musio Studio 2.1+), made only when \"project\" is in outputs, with Musio Complete (while it is switched off for cloud jobs, a job asking for it is refused)"
     },
     "range": {
      "type": "string",
      "enum": [
       "warn",
       "refuse"
      ],
      "description": "notes outside an instrument's playable range (render and project): refuse (default, with the note, part, range and a suggestion) or warn"
     },
     "mode": {
      "type": "string",
      "enum": [
       "full",
       "draft"
      ],
      "description": "full (default): the final sound, with part levels and the score. draft: a quick preview: every part rendered as its own stem at the same time and added, parts that did not change since an earlier job reused, the master limiter bypassed; a plain gain toward the loudness target (held under the peak ceiling) so previews are comparable: drafts with enough headroom land at the target, peaky ones come in under it; no part levels, score or second limiter pass"
     },
     "section": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "start",
       "end"
      ],
      "description": "play only a passage: notes sounding between start and end (beats with tempo_bpm, else seconds), from a pre-roll before it (notes already sounding are struck again there; controllers start at their value), cut to the passage plus its tail. Not loudness-matched; no score. Works with mode full or draft",
      "properties": {
       "start": {
        "type": "number",
        "minimum": 0
       },
       "end": {
        "type": "number",
        "exclusiveMinimum": 0
       },
       "pre_roll_seconds": {
        "type": "number",
        "minimum": 0,
        "maximum": 10,
        "description": "default 2"
       },
       "tail_seconds": {
        "type": "number",
        "minimum": 0,
        "maximum": 20,
        "description": "default 3"
       }
      }
     },
     "format": {
      "type": "string",
      "enum": [
       "mp3",
       "wav"
      ],
      "description": "mp3 (default): mix.mp3 (160 kbps for a draft, 192 kbps for full; about 1-1.5 MB a minute) beside mix.wav. wav: mix.wav only"
     },
     "dry_run": {
      "type": "boolean",
      "description": "true: check the job (fields, values such as mix.volume_db -100..+6, effects, buses, instruments, articulations including chords that mix articulations, ranges, plan) and return every error at once, the warnings, the estimated render time, the instruments' facts, and today's remaining job and minute caps (jobs_per_day, minutes_per_day); warns if this submit would exceed them; the minutes left (minutes: trial, month, remaining_total) and which would pay (this_job_funded_by: trial, month or mixed); nothing is queued or counted"
     },
     "auto_full": {
      "type": "boolean",
      "description": "with mode \"draft\": after the draft, the full render runs by itself (a second job, shown in get_job's \"full\" and in get_outputs as mix_mp3_full / mix_full); counts both"
     }
    },
    "required": [
     "type"
    ],
    "description": "Queue a cloud render. type \"render\": a phrase -> mix.wav. type \"project\": project_json (the same format, up to 32 parts, with title, meter and key) with outputs from \"mix\" and \"score\" (PDF, PNG pages, MusicXML). Every field is checked: one the service does not use is refused with the field named. By default notes start early by each patch's measured attack (attack_compensation), levels are evened per patch and the mix is brought to -16 LUFS (target_lufs); a project's mix gets exactly the same, while its score shows the notes as written (a staff per part named by the part, modal keys with the right signature), so one project job gives both audio and score. Each part's measured level comes back in part_levels (\"part_levels\": false skips it). Faster revisions: \"mode\": \"draft\" renders every part side by side and reuses the parts that did not change since an earlier job (no master limiter, part levels or score; seconds instead of minutes for a one-part change); \"section\": {\"start\", \"end\"} plays only that passage (beats with tempo_bpm) with a pre-roll and tail; outputs [\"score\"] alone engraves the score with no audio. Send the final with the default \"mode\": \"full\". Fast loop: \"dry_run\": true checks everything and returns every error at once plus the facts of the instruments used, with nothing queued or counted; a submit's reply also lists those facts (\"instruments\": range, articulations, key map). The mix comes as mix.mp3 (small, the default \"format\") beside mix.wav. \"mode\": \"draft\" with \"auto_full\": true renders the draft first and then the full render on its own (get_job's \"full\", get_outputs' mix_mp3_full / mix_full). Values are checked before anything is queued, exactly as the render checks them: mix.volume_db is -100 to +6 dB (as are master.volume_db and a bus's level_db), pan -1 to 1, reverb and sends 0 to 1, mic names from the card, effect types and their settings' ranges, and notes of one keyswitch part that start together must share one articulation; a dry run lists every such error at once. tempo_bpm is quarter notes per minute in every meter (6/8 or 9/8 at dotted quarter = 110: send 165). Counts against this connection's monthly rendered minutes and the account's daily limits (an auto_full counts both), and is paid from the account's minutes: every account has 5 trial minutes once, which play any instrument here; Musio Complete adds 30 minutes each month. The trial pays first. Returns the job id; then get_job with wait_seconds 60. (mus.io build 0.2.6+6cce5e7)"
   },
   "Refusal": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean",
      "const": false
     },
     "error": {
      "type": "string"
     },
     "errors": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "reason": {
      "type": "string",
      "enum": [
       "revoked",
       "leaked",
       "spend_capped",
       "rate_limited",
       "reauth_required",
       "scope",
       "unavailable"
      ]
     },
     "hint": {
      "type": "string"
     },
     "retry_after": {
      "type": "integer"
     }
    },
    "required": [
     "ok",
     "error"
    ]
   },
   "OAuthError": {
    "type": "object",
    "properties": {
     "error": {
      "type": "string"
     },
     "error_description": {
      "type": "string"
     }
    },
    "required": [
     "error"
    ]
   }
  },
  "responses": {
   "Refusal": {
    "description": "refused: error says why, hint what to do",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Refusal"
      }
     }
    }
   },
   "OAuthError": {
    "description": "an OAuth error (RFC 6749 5.2, RFC 8628 3.5)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/OAuthError"
      }
     }
    }
   }
  }
 }
}