{
  "openapi": "3.1.0",
  "info": {
    "title": "Zeltor Music Tools",
    "version": "1.0.0",
    "description": "Free music math for DJs, producers and AI assistants: whether two songs mix, Camelot keys, tempo and nightcore settings, and the song DNA from a shared Zeltor report. No key, read-only, CORS open. Every response includes a link to the zeltorlabs.com page where the person can make the actual audio file in their browser. Same tools over MCP at https://zeltorlabs.com/mcp.",
    "contact": {
      "email": "hello@zeltorlabs.com",
      "url": "https://zeltorlabs.com"
    }
  },
  "servers": [
    {
      "url": "https://zeltorlabs.com"
    }
  ],
  "paths": {
    "/api/mix": {
      "get": {
        "operationId": "checkMix",
        "summary": "Do two songs mix? Verdict, tempo change and key shift for track B.",
        "parameters": [
          {
            "name": "key_a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Track A key, e.g. \"A minor\", \"F#m\", \"Bb major\" or Camelot \"8A\"."
          },
          {
            "name": "bpm_a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 400
            }
          },
          {
            "name": "key_b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Track B key (the one to change)."
          },
          {
            "name": "bpm_b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          }
        }
      }
    },
    "/api/camelot": {
      "get": {
        "operationId": "camelot",
        "summary": "Camelot code for a key and the keys that mix with it.",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Camelot info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          }
        }
      }
    },
    "/api/tempo": {
      "get": {
        "operationId": "tempoChange",
        "summary": "Percent change and playback rate between two BPMs.",
        "parameters": [
          {
            "name": "from_bpm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 400
            }
          },
          {
            "name": "to_bpm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tempo change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          }
        }
      }
    },
    "/api/speed": {
      "get": {
        "operationId": "speedPitch",
        "summary": "Nightcore or slowed settings: pitch change for a speed, and the new BPM.",
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "nightcore",
                "slowed"
              ]
            }
          },
          {
            "name": "speed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0.5,
              "maximum": 2
            }
          },
          {
            "name": "bpm",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 20,
              "maximum": 400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Speed and pitch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          }
        }
      }
    },
    "/api/transpose": {
      "get": {
        "operationId": "transpose",
        "summary": "Move a key by semitones; new key name and Camelot code.",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "semitones",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": -12,
              "maximum": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transposed key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          }
        }
      }
    },
    "/api/report": {
      "get": {
        "operationId": "songReport",
        "summary": "Song DNA from a shared Zeltor report: key, Camelot, BPM, genre mix, structure, production DNA.",
        "parameters": [
          {
            "name": "link",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Share link like https://zeltorlabs.com/report/r/<code>, or the code."
          }
        ],
        "responses": {
          "200": {
            "description": "Song DNA",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Invalid"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Result": {
        "type": "object",
        "description": "Tool-specific fields, plus link, link_text and note pointing to the page that makes the audio file.",
        "properties": {
          "link": {
            "type": "string",
            "format": "uri"
          },
          "link_text": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    },
    "responses": {
      "Invalid": {
        "description": "The input could not be read; message says what to send.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
