This is found about Kalkeya here
Agastya dries up the ocean
In Krita Yuga, a demon named Vritrasura was troubling Indra and other gods in heaven. He was assisted by two other demons called Kaalakeyas. Indra could not defeat Vritrasura and approached Brahma to help them and protect them. Brahma asked Indra to approach Maharshi Dadheechi and request the sage to donate his bones and convert them into weapons as only through them can Vritrasura be killed. The sage was doing great tapas for many yugas and the power of that tapas was accumulated in the bones of the maharshi.
There is another version that once the gods deposited all their weapons with the sage for safe keeping and the sage swallowed all of them. When the gods did not come in time, the astras of gods got digested and became a part of the sage and went into the bones. So, when the gods finally came to take back their astras, the sage told them that the astras became a part of him right to his bones. He offered to give up his body so that they could recover their astras.
In any case, at Indra's request, the sage voluntarily vacated his body so that they could convert his bones into weapons. Because of his great tapas, the weapons got added power. Indra created the Vajra Ayudha from the spine of the sage and with that killed Vritrasura. But the other demons including Kaalakeyas escaped and hid themselves in the ocean.
They started killing many disciples of Sages Vasishtha, Chyavana and Bharadwaja. The sages approached Indra to kill the demons and rid the world of this danger. Indra in turn went to Brahma and Brahma in turn asked them to approach Vishnu. Vishnu asked them to approach sage Agastya telling them that only he is capable of drying up the ocean!
Approached by Indra and other gods, Agastya collected all the waters of the ocean into his palm and took the same into his mouth. All the water of the ocean was transformed into just three drops in his palm! All the living creatures in the ocean were safely present in those drops! Kaalakeyas and other demons were however exposed and were killed by Indra. Agastya released the water back into the ocean. Since the holy water of the ocean became impure by being taken into his mouth and became uchhishta, the sage proscribed taking a holy dip in the ocean daily. He gave a boon that on holy days, the impurity of the ocean will be removed and a bath only on those days will be purifying.
This above story is from the Aranya Parva of Mahabharat. There are variations to this story in other puranas.