At the rivers Jala and Upajala by the Yamuna, Lomasha tells how Indra as a hawk and Agni as a pigeon tested King Ushinara at his sacrifice. The hawk argues at length that a duty which defeats another duty is none. The king offers an ox, boar, deer or buffalo and then his kingdom. Asked for his own flesh by weight, he cuts until none is left and mounts the balance. The hawk declares himself Indra and the pigeon Agni; the king's fame will last as long as men speak of him.
The gods resolve to try Shibi son of Ushinara. The pigeon falls in his lap; the priest calls it an omen; the pigeon says it is a learned sage in bird form; the hawk says the pigeon may have been the king's father in another birth. The king offers a bull cooked with rice. The hawk asks for flesh from the right thigh. When the king mounts the scale the hawk says 'Saved' and vanishes. The pigeon reveals itself as Agni Vaishvanara and the hawk as Indra, makes the wounds golden and fragrant, and promises a son, Kapotaroman, born from the king's side.
What is different here:
King is Shibi, not Ushinara; the dove speaks; the right thigh is named; Agni, not Indra, makes the revelation and heals; a son is promised.
A pigeon chased by a hawk takes refuge with King Vrishadarbha of Kashi, also called Ushinara and Shibi in the passage. The hawk says a king's rule does not reach the birds of the sky. The king cuts flesh from flanks, arms and thighs while his wives and ministers wail and the earth trembles, then mounts the scale. The gods gather, flowers and nectar rain down and a heavenly car takes him up.
What is different here:
No revelation that the birds are gods; the king rules Kashi; the weeping household and the heavenly car are added.
King Sivi of Aritthapura vows to give any part of himself that is asked for. Sakka comes as a blind brahmin and asks for an eye; the king gives both, removed by the surgeon Sivaka who three times offers to stop. Blind, he retires to a park. Sakka returns; the king makes two acts of truth about his joy in giving and both eyes are restored as eyes of truth that see through rock and wall. The Buddha says he was King Sivi.
What is different here:
No dove, hawk, scales or Agni; the gift is eyes; restoration is by an act of truth; the frame is the Buddha's former birth.
Chola kings of the Tamil country used the title Sembiyan, taken to mean descendant of Shibi, and counted the king who saved the dove among their legendary ancestors.
What is different here:
A genealogy, not a different plot; historians treat the claim as borrowed from the northern legend.
Later Buddhist dove version; Borobudur and Dunhuang art
Southeast Asia · Borobudur, Java; Dunhuang; GandharaBuddhist
A later Buddhist Sanskrit telling has King Sibi ransom a dove from Sakka in hawk form with flesh from his thigh, Sakka revealing himself as the weighing begins. The scales with the dove appear on a Borobudur panel; Xuanzang recorded a stupa where King Sivika cut his body to ransom a dove.
What is different here:
Sakka is the hawk; Agni is absent; in Dhammika's summary the test stops before the cutting.
Sources: The Mahabharata, tr. K. M. Ganguli (1883-96), sections read for the Vedic layer; The Jataka, vol. IV, tr. W. H. D. Rouse (Cambridge, 1901): no. 499 Sivi-Jataka; List of legendary early Chola kings - Wikipedia; An Eye Transplant and a Pound of Flesh (Essays on Buddhist History and Culture), S. Dhammika