Kōkei 皇慶 (977–1049) was a major mid-Heian Tendai esoteric (Taimitsu 台密) master and the founder of the Tani-ryū 谷流 (Valley-lineage) — one of the two principal mid-Heian Taimitsu sub-lineages alongside the Kawa-ryū 川流 of his contemporary Chōen 長宴 (長宴). He is known by the sobriquet Tani-no-ajari 谷阿闍梨 (“the Ācārya of the Valley”) from his cloister in the Tani gorge of Mt. Hiei.

Kōkei studied under both Yokei 餘慶 of the Mudō-ji lineage and Kakuchō 覺超 (覺超) of the Yokawa Tosotsu-dani lineage, and synthesized their Taimitsu traditions into what became the dominant medieval Hiei-zan esoteric scholastic line. The Tani-ryū lineage spawned a dense network of sub-lineages, including the Renge-ryū 蓮華流 of his successor Chōen and the Sanmai-ryū 三昧流 of Ryōyū 良祐 (良祐).

Kōkei produced numerous procedural and analytical works. His KR6t0107 Suíyào jì 隨要記 (“Notes on the Essentials, As-Needed”) is a two-fascicle compendium of Garbhadhātu kanjō 灌頂 (consecration) procedure that became the canonical Tani-ryū reference for the Tendai-esoteric consecration platform.

His doctrinal-procedural orientation — focused on the practical reconstruction of the elaborate consecration platform with detailed prescriptions for hangings, robes, vessels, mantras and mudrās — distinguishes the Tani-ryū from the more theoretically-inclined Kawa-ryū, and made Kōkei’s works the principal procedural references for medieval Tendai kanjō practice.