The Ratirahasya is an early medieval Kashmiri sex manual written by Kokkoka, a poet, who is variously described as Koka or Koka Pandit. The exact date of its writing is not known, but it is estimated the text was written in the 11th or 12th century. It is speculated that Ratirahasya was written to please a king by the name Venudutta. Kokkoka describes himself in the book as siddha patiya pandita, i.e. "an ingenious man among learned men". The manual was written in Sanskrit.