He wrote numerous works in praise of his patron, of such skill and eloquence that on one occasion the Abbasid caliphs al-Mansur () and al-Mahdi () are said to have taken offence at the lavish praise, and to have excluded him from their presence for one year thereafter.