{"openapi":"3.1.0","info":{"title":"Music Theory API","version":"1.0.0","description":"Music-theory maths as an API, computed locally and deterministically over the twelve-tone chromatic scale. The interval endpoint gives the number of semitones and the interval name between two notes — C to G is seven semitones, a perfect fifth. The transpose endpoint shifts one or more notes up or down by a number of semitones, so C E G transposed up seven becomes G B D and a negative value transposes down. The chord endpoint returns the notes of a chord from a root and a type — major, minor, diminished, augmented, the sevenths (major7, minor7, dominant7, diminished7, half-diminished7), sixths, suspended, add9, ninth and power chords — so C major is C E G and C7 is C E G B♭. The scale endpoint returns the notes of a scale from a root and a mode — the major and three minor scales, the seven church modes, the major and minor pentatonics, blues, whole-tone and chromatic — so C major is C D E F G A B and A natural-minor is A B C D E F G. Notes use C, C#, D♭ … B, and accidental=flat spells with flats. Everything is computed locally and deterministically, so it is instant and private. Ideal for music-education, ear-training, songwriting, DAW-plugin, notation and instrument app developers, chord-and-scale tools, and practice software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is pitch-class theory; for the actual frequency of a note use a music-note API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/musictheory-api","description":"oanor gateway"}],"tags":[{"name":"Music"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/chord":{"get":{"operationId":"get_v1_chord","tags":["Music"],"summary":"Chord tones","description":"","parameters":[{"name":"root","in":"query","required":true,"description":"Root note","schema":{"type":"string"},"example":"C"},{"name":"type","in":"query","required":false,"description":"major, minor, dominant7, …","schema":{"type":"string"},"example":"major"},{"name":"accidental","in":"query","required":false,"description":"sharp or flat","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Chord tones as semitone offsets from the root. C major = C E G (0,4,7); C7 = C E G B♭ (0,4,7,10).","notes":["C","E","G"],"inputs":{"root":"C","type":"major"},"intervals":[0,4,7],"notes_string":"C E G"},"meta":{"timestamp":"2026-06-05T19:50:11.827Z","request_id":"4de41e0f-189a-48a6-959f-2ddf81e53c96"},"status":"ok","message":"Chord","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/interval":{"get":{"operationId":"get_v1_interval","tags":["Music"],"summary":"Interval between two notes","description":"","parameters":[{"name":"from","in":"query","required":true,"description":"First note","schema":{"type":"string"},"example":"C"},{"name":"to","in":"query","required":true,"description":"Second note","schema":{"type":"string"},"example":"G"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Ascending interval from 'from' to 'to' within an octave (0–12 semitones). C to G is 7 semitones, a perfect 5th.","inputs":{"to":"G","from":"C"},"interval":"perfect 5th","semitones":7},"meta":{"timestamp":"2026-06-05T19:50:11.931Z","request_id":"af59208e-ad4a-4a09-8750-4b9b76321b90"},"status":"ok","message":"Interval","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/scale":{"get":{"operationId":"get_v1_scale","tags":["Music"],"summary":"Scale notes","description":"","parameters":[{"name":"root","in":"query","required":true,"description":"Tonic note","schema":{"type":"string"},"example":"C"},{"name":"mode","in":"query","required":false,"description":"major, natural-minor, dorian, …","schema":{"type":"string"},"example":"major"},{"name":"accidental","in":"query","required":false,"description":"sharp or flat","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Scale notes as semitone offsets from the tonic. C major = C D E F G A B; A natural-minor = A B C D E F G.","notes":["C","D","E","F","G","A","B"],"inputs":{"mode":"major","root":"C"},"degrees":[0,2,4,5,7,9,11],"notes_string":"C D E F G A B"},"meta":{"timestamp":"2026-06-05T19:50:12.039Z","request_id":"36ba9312-5648-4f59-a39b-6b80b217b8f0"},"status":"ok","message":"Scale","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/transpose":{"get":{"operationId":"get_v1_transpose","tags":["Music"],"summary":"Transpose notes","description":"","parameters":[{"name":"notes","in":"query","required":true,"description":"Notes (comma/space separated)","schema":{"type":"string"},"example":"C E G"},{"name":"semitones","in":"query","required":true,"description":"Semitones (±)","schema":{"type":"string"},"example":"7"},{"name":"accidental","in":"query","required":false,"description":"sharp or flat","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Each note shifted by the given number of semitones (negative transposes down). C +7 → G.","inputs":{"notes":["C","E","G"],"semitones":7},"transposed":["G","B","D"],"transposed_string":"G B D"},"meta":{"timestamp":"2026-06-05T19:50:12.131Z","request_id":"deade6c3-59ca-4eb2-aa17-5b0d0da4a33b"},"status":"ok","message":"Transpose","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"Notes use C, C#, Db … B (case-insensitive). Set accidental=flat to spell with flats. This is pitch-class theory; for note frequencies use a music-note API.","service":"musictheory-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/chord":"Chord tones from a root and chord type.","GET /v1/scale":"Scale notes from a root and mode.","GET /v1/interval":"Semitones and interval name between two notes.","GET /v1/transpose":"Transpose notes by a number of semitones."},"chord_types":["6","7","9","major","minor","diminished","augmented","major7","minor7","dominant7","diminished7","half-diminished7","minormajor7","sus2","sus4","minor6","add9","power"],"description":"Music theory: intervals, transposition, chords and scales over the 12-tone chromatic scale.","scale_modes":["major","natural-minor","minor","harmonic-minor","melodic-minor","dorian","phrygian","lydian","mixolydian","locrian","pentatonic-major","pentatonic-minor","blues","chromatic","whole-tone"]},"meta":{"timestamp":"2026-06-05T19:50:12.252Z","request_id":"e10d6720-2365-426a-9519-a15023759ac0"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":6700,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":390,"monthly_call_quota":67000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1090,"monthly_call_quota":315000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":3600,"monthly_call_quota":1670000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/musictheory-api"}