# Documentation

> Every function of the ChordMuse engine over HTTP: the same requests and results as the ChordMuse apps.

## Your first call

Send your key in the `Authorization` header and a JSON request. Keys come from [your dashboard](https://developers.chordmuse.app/dashboard); keep them on your servers, never in a website's or app's code.

```sh
curl https://engine-api.chordmuse.app/v1/progressions \
  -H "Authorization: Bearer $CHORDMUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mood": "Happy", "key": "G"}'
```

## Functions

Engine 0.4.0. The full schemas are in the OpenAPI 3.1 spec: https://engine-api.chordmuse.app/v1/openapi.json. Interactive reference: https://engine-api.chordmuse.app/docs.

- `GET /v1/health`
- `POST /v1/catalogue`: The moods and genres the progression generator accepts (in the data's order), and the ids the song builder accepts.
- `POST /v1/chords-from-numerals`: Roman numerals (I, vi, bVII, V/V, IVmaj7…) as chords in a key: quality from the numeral's case, V/x as the dominant seventh of degree x, borrowed b degrees and flat keys spelled with flats. A numeral it can't read comes back unchanged.
- `POST /v1/diatonic-chords`: The seven diatonic chords of one of the 26 keys with a table (I…vii° major, i…VII natural minor).
- `POST /v1/famous-song-progressions`: Up to count of a genre's famous songs as progressions ("Inspired by …"), shuffled.
- `POST /v1/famous-songs`: The 26 famous-song progressions; one genre's when given.
- `POST /v1/guitar-fingerings`: Chord-box data for the chord library's guitar voicings: frets, fingers, barres and base fret, first the shape midi and perform play. Only engines built with the chord library have it (the API does); without it every fingering is null.
- `POST /v1/midi`: A chord progression as a Standard MIDI File. Format 1, 480 ticks per quarter note: chord and bass tracks in a rhythm pattern, with tempo, meter, key signature and a marker for each chord. Guitar and piano chords use the chord library's voicings, else close position.
- `POST /v1/pack-recommendations`: 10–20 progression recommendations from one Progression Pack.
- `POST /v1/parse-chord`: Parses a chord symbol into its root, quality, slash bass, display name and pitch classes.
- `POST /v1/perform`: A chord progression's playable events, in quarter-note beats: the notes midi writes, for an app to schedule live at any tempo. Each hit (events), each note (notes), and each chord's voicing and place (chords).
- `POST /v1/progression-packs`: The Progression Packs, in sortOrder.
- `POST /v1/progressions`: Chord progressions for a catalogue mood or genre, in a key or any key.
- `POST /v1/progressions-by-chord`: The Pop progression in every key that contains the chord, then a circle of fifths from the chord.
- `POST /v1/rhythm-catalogue`: The rhythm patterns and meters midi and perform take, with labels and descriptions, the defaults and the tempo's limits, for pickers.
- `POST /v1/roman-numerals`: Each chord's basic numeral in a key: a diatonic degree in upper case, or lower case for a minor or diminished chord ("vi"); a degree a semitone below a major-scale degree as a borrowed numeral, always upper case ("bVII"); null otherwise, or for a chord the parser can't read.
- `POST /v1/song`: Every section of a song form, with a title, tempo, explanation, insights and tips.
- `POST /v1/song-part`: Chords for one song part, built to fit the song's other parts.
- `POST /v1/template-explanation`: The long explanation of a progression: its template's entry, else its mood's or genre's.
- `POST /v1/transpose`: Moves chords by a number of semitones: roots are spelled C C# D Eb E F F# G Ab A Bb B and qualities normalised ("C#m7/G#" up 2 → "Ebm7/Bb"). A chord the parser can't read comes back unchanged.
- `POST /v1/voice`: Chords as MIDI notes: in close position, or with voicing "library" the chord library's guitar or piano voicing (the notes midi plays).

## Errors and limits

- Errors are `{"error": {"code", "message"}}`. Check the `code`; the message is for people and may change.
- `400` for a request the engine can't use (`invalid_key`, `invalid_chord`…), `401` for a missing or unknown key, `403` for a revoked key, `429` over your plan's limit: `rate_limited` for calls per minute, `quota_exceeded` for calls per day.
- Every response carries `RateLimit-Remaining` and `RateLimit-Reset` for the minute, and, when your plan has a daily quota, `ChordMuse-Daily-Remaining` and `ChordMuse-Daily-Reset` for the day (UTC). A `429` also carries `Retry-After` in seconds.
- The same request and `seed` always give the same result; the `ChordMuse-Engine-Version` header says which engine answered.

## AI assistants

`GET /v1/tools` lists every function as a tool definition (name, description, input schema) for an AI model. For assistants that speak MCP, add the engine as a remote MCP server (Streamable HTTP) with your key. MCP calls count against your plan like any other.

### Claude Code

```sh
claude mcp add --transport http chordmuse https://engine-api.chordmuse.app/mcp \
  --header "Authorization: Bearer <your key>"
```

### Cursor, VS Code and other tools that take a URL with headers

```json
{
  "mcpServers": {
    "chordmuse": {
      "url": "https://engine-api.chordmuse.app/mcp",
      "headers": { "Authorization": "Bearer <your key>" }
    }
  }
}
```

### Claude Desktop

Its custom connectors can't send a key yet, so connect through `mcp-remote`: Settings → Developer → Edit Config, then restart Claude Desktop.

```json
{
  "mcpServers": {
    "chordmuse": {
      "command": "npx",
      "args": ["mcp-remote", "https://engine-api.chordmuse.app/mcp", "--header", "Authorization:${AUTH}"],
      "env": { "AUTH": "Bearer <your key>" }
    }
  }
}
```