This is a traditional story that goes back to the ancient Panchatantra, and the version I am sharing here is told by the modern author, Shovona Devi (a niece of Rabindranath Tagore); she included the story in her collection of Indian Fables and Folktales.
THE FROG-KING'S FOLLY
The King of the Frogs, named Yal-Pada, the Web-Footed One, was apprised of the coming of this dangerous stranger. He went to the snake, attended by all the frogs, to enquire why, of all places on earth, it had chosen the vicinity of this particular pool for its home.
"I am named Manda-Vish, Slow Poison, O King Yal-Pada," said the snake, lowering its hood. "I am under a curse and forbidden to harm frogs without the leave of their king. Once I pursued a frog and by accident bit a Brahmin. He died, pronouncing this curse on me: May you die if you eat a frog again unless with the leave of the King of the Frogs. O King Yal-Pada, I mean to do penance for my sin in slaying the Brahmin," said the snake. "Let it be my penance to bear your majesty on my head wherever it shall please you to ride."
Without more ado Yal-Pada leaped onto the hood of the snake, which crawled away, swaying its body gracefully to and fro. The other frogs looked on amazed, but some bolder spirits amongst them followed their king at a distance.
After a time the snake stopped, gasping.
"Why do you stay, O Manda-Vish?" asked Yal-Pada.
"O King of the Frogs, I am famished and faint," replied the wily serpent. "I cannot bear you back to the pool unless you grant me something to eat. To eat a frog without your leave, I have told you, would mean my death."
King Yal-Pada had enjoyed his ride immensely, and did not like the idea of losing his dignity by hopping back to the pool, so he offered one of his attendant frogs to the snake. Having thus appeased its hunger, Manda-Vish took the King of the Frogs up on its hood again and crawled away back to the pool.
In this way the snake was provided with a frog every day, and in return for its meals it took Yal-Pada out on its hood for a ride. Thus one by one all the frogs were eaten up.
When there were no more frogs left for it, Manda-Vish made its last meal off King Yal-Pada, and then departed to find fresh folly to be the victim of its guile.