As a consequence of the calumnies of their antagonists Hai and his father were imprisoned together, and their property was confiscated, by the caliph al-Qadir in 997. The imprisonment was brief, but shortly thereafter (in 998) the aged and infirm Sherira appointed his son to the position of gaon. Hai's installation was greeted with great enthusiasm by the Jewish population. An old tradition says that on the Sabbath after Sherira's death, at the end of the reading of the weekly lesson, the passage in which Moses asks for an able follower was read in honor of Hai. Thereupon, as haftarah, the story of Solomon's accession to the throne was read, the last verse being modified as follows: "And Hai sat on the throne of Sherira his father, and his government was firmly established." Hai remained gaon until his death in 1038. He was celebrated by the Spanish poet Solomon ibn Gabirol and by Samuel ha-Nagid.
Hai ben Sherira's chief claim to recognition rests on his numerous responsa, in which he gives decisions affecting the social and religious life of the Diaspora. Questions reached him from Germany, France, Iberia, Anatolia, the Maghreb, and even India and Ethiopia. His responsa, more than eight hundred in number, deal with civil law, especially laws concerning women, with ritual, holidays, etc. Many of them contain explanations of certain halakhot, aggadot, and Talmudic matters. In halakhic decisions he quotes the Jerusalem Talmud, but without ascribing any authority to it. Many of his responsa may have been written in Arabic; only a few of them have been preserved.
Hai ben Sherira codified various branches of Talmudic law. He wrote in Arabic a treatise on purchases, translated into Hebrew by Isaac Albargeloni with the title Ha-Meqaḥ weha-Mimkar (1078); Sefer ha-Mashkon, a treatise on mortgage, anonymously translated into Hebrew; Mishpete ha-Tena'im, a treatise on conditions, also anonymously translated into Hebrew. These three treatises were published together (Venice, 1604); later editions also contain commentaries by Eleazar ben Aryeh (Vienna, 1800) and by Hananiah Isaac Michael Aryeh (Salonica, 1814). Another anonymous translation of them exists in manuscript under the title "Dine Mamonot." According to Rabbi David Azulai, Hai also wrote in Arabic Sha'are Shebu'ot, a treatise on oaths. According to another Hebrew source, the original title was Kitab al-Aiman. This treatise was twice anonymously translated into Hebrew: (1) Mishpeṭe Shebu'ot (Venice, 1602; Altona, 1782); (2) Sefer Mehubbar be-Kotzer Min ha-Dinim be-Bi'ur Kelalim we-'liqarim be-Helqe Hiyyub la-Shebu'ah The Sha'are Shebu'ot were metrically arranged by an anonymous writer, probably of the thirteenth century, under the title Sha'are Dine Mamonot we-Sha'are Shebu'ot, and by Levi ben Jacob Alkalai. Hai's treatise on boundary litigations, "Metzranut," is known only through quotations. Hilkot Tefillin, Siddur Tefillah and Metibot are also quoted as his
Hai ben Sherira's philological abilities were directed to the expounding of the Mishnah; of this work only the portion on Seder Tohorot is extant; it was published by T. Rosenberg in "Qobetz Ma'aseh" (Berlin, 1856). This commentary contains especially interesting linguistic notes, Arabic and Aramaic being often adduced for comparison. The author quotes the Mishnah, the two Talmuds, the Tosefta, the Sifra, Targums Onkelos and Jonathan, the Septuagint, the works of Saadia Gaon, the Sifre Refu'ah, and other anonymous sources. He also quotes his own commentary on Zera'im (p. 34) and on Baba Batra (p. 43). These quotations, and many others cited by the 'Aruk, prove that the commentary extended to the whole Mishnah, containing among other explanations historical and archeological notes. Some passages of the commentary are quoted by Alfasi and Hananeel on Yoma, and by Solomon ibn Adret in his Hiddushim. while Abu al-Walid ibn Janah cites Hai's commentary to Shabbat frequently. It is uncertain whether Hai wrote commentaries in Arabic on the Bible as a whole or on parts of it. Abraham ibn Ezra, however, in his commentary on the Book of Job quotes several of his explanations.
Hai compiled also a dictionary of especially difficult words in the Bible, Targum, and Talmud, the Arabic title of which was al-Hawi. Abraham ibn Ezra translated this title, in his Moznayim, into "Ha-Me'assef," while Abu Bukrat's translation, Ha-Kolel, and Moses Botarel's translation, "Ha-Qemitzah," did not become popular. Fragments of this dictionary were discovered by Harkavy, and published by him in "Mitzpah" (St. Petersburg, 1886), in Hadashim Gam Yeshanim (No. 7), and in Mi-Mizrah umi-Ma'Arab (1896, iii. 94 et seq.); these show that the work was arranged according to an alphabetic-phonetic plan of three consonants in every group; for instance, s.v. it quotes the permutations . Judah ibn Balaam is the earliest Jewish author who expressly quotes this dictionary. Moses ibn Ezra and some North African rabbis of the twelfth and thirteenth centuries also mention it.
Of Hai's poetical writings few have been preserved, and even of these the genuineness is doubted. The didactic poem "Musar Haskel" is generally regarded as authentic, though Dukes expressed some doubts as to its genuineness, as old Jewish authors like al-Harizi and ibn Tibbon do not mention it; and Steinschneider also regarded it as of doubtful authenticity. The first edition appeared about 1505 (see Fano); others were published in Constantinople (1531), in Paris (1559), and elsewhere. The modern editions are as follows: Dukes, Ehrensäulen, p. 96; Grätz, Blumenlese, p. 27; Steinschneider, Musar Haskel, Berlin, 1860; Weiss, Liqquṭe Qadmonim, Warsaw, 1893; Philipp, Sämmtliche Gedichte des R. Hai Gaon, Lemberg, 1881; a Latin translation by Jean Mercier, Cantica Eruditionis Intellectus Auctore per Celebri R. Hai, Paris, 1561; another by Caspar Seidel, Carmen Morale ΣτροφορυΘμον Elegantissimum R. Chai, etc., Leiptzig, 1638. The "Musar Haskel" consists of 189 double verses in the Arabic meter "rajaz," and it is said to have therefore received the title of "Arjuzah." If it really belongs to Hai, he was, as far as is known, the first Eastern writer to use an Arabic meter in Hebrew poetry. Every strophe is complete in itself, and independent of the preceding strophe.
Some piyyutim are ascribed to him, as the piyyut beginning with the words "Shema' qoli," preserved in the Sephardic liturgy for the evening of Yom Kippur.
Many spurious writings have been ascribed to Hai, especially by later kabalists. Among them are a Sefer kol ha-Shem ba-Koah; Pitron Halomot, Ferrara, 1552; Sefer Refafot, ib.; Perush me-'Alenu; Teshubah, on the thirteen rules of R. Ishmael and on the Ten Sefirot; A Letter to the Priests of Africa. Some of the responsa attributed to him are mere forgeries. Others again were falsified or mutilated by later additions and interpolations, as, for instance, the one containing attacks upon Aristotle and his philosophy
Hai was not only a master of Hebrew lore, but was also familiar with the Quran and the Hadith, with Plato, Aristotle, Alfarabi, the grammarian al-Halil, the Septuagint, the Greek calendar, Greek history, and the Persian language translation of Kalilah wa-Dimnah. He did not hesitate to consult even the Catholicos of the Assyrian Christians in an exegetical difficulty over Psalms cxli. 5, as the Sicilian dayyan Matzliah ibn al-Basak relates in his biography of Hai. Hai justified his action by saying that scholars in former times did not hesitate to receive explanations from those of other beliefs. He had an exact knowledge of the theological movements of his time, of which that of the orthodox Ash'ariyyah attracted him the most. Moses ibn Ezra, in his Poetik (fol. 1196), even called him a Mutakalam. He was also competent to argue with Muslim theologians, and sometimes adopted their polemical methods. Hai was orthodox as regards tradition, and upheld minhag to its fullest extent. He established the principle that where the Talmud gives no decision traditional customs must be adhered to. He even went so far as to recommend the observance of every custom not in direct opposition to law. In many passages of his responsa he warns against deviating from a custom even when the meaning of its origin has been lost, as in the case of the practice of not drinking water during the Tekufot. But this did not prevent him from opposing the abuses common to his time. Thus he protested against the practice of declaring null and void all oaths and promises which may be made during the coming year, and against the refusal to grant an honorable burial to excommunicated persons and their connections
Hai's conservative standpoint explains the fact that in the study of esoteric sciences he detected a danger to the religious life and a deterrent to the study of the Law. He warned against the study of philosophy, even when pursued with the plea that it leads to a better knowledge of G-d.
Of his own views on religious-philosophical subjects only those regarding the anthropomorphisms of the Bible (expressed in his appeal to a well-known dictum of R. Ishmael: "The Torah spoke in language of men") and one or two other subjects were known prior to the publication of ibn Balaam's commentary on the Book of Isaiah. A responsum of Hai given in this commentary discloses his opinion on the subjects of divine fore-knowledge and the predestined length of human life. The essence of divine prescience seems to consist, according to him, in a preknowledge of both hypothetical and actual occurrences. In this he shows the influence of Saadia.
His attitude toward the Kabbalah is determined by his conservative standpoint. Its elements, as far as they can be traced back to the Talmud, he considered to be true. When the inhabitants of Fez made inquiries regarding the proportions of God, he answered, as one of the signers of the responsum, that God is above any corporeal qualification and that the Talmud forbids the public discussion of these things. His answer to the question regarding the interpretation of the Talmudic tradition that four men entered paradise is interesting, and has caused much discussion. He refers to the opinion of various scholars that specially favored persons could attain, by means of castigation and the reciting of psalms, to an ecstatic state in which they might behold the heavenly halls ("hekalot") as vividly as if they really had entered them. Contrary to his father-in-law, Samuel ben Hofni, gaon of Sura, he followed former scholars in deeming it not impossible that God should reveal the marvels of heaven to the pious while in this state of ecstasy. But all the elements of the later Kabbalah not found in Talmudic tradition, as the belief that miracles could be performed with the names of God, he designated as foolishness not credited by any sensible man.
The best characterization of Hai is given by Steinschneider;: "Certain Kabbalistic pieces were ascribed to him; but in truth he was no mystic in the usual sense of the word. In fact he fought against superstition. He was an orthodox Jew, in possession of general culture, but hostile to deeper philosophical research."
Hai's students included Rabbeinu Chananel and Rav Nissim, the head of the academy at Kairouan.