In Num 22:20, it is the Lord who responds to Baalam; interestingly, in the Targums, it is the donkey who responds to him:
The donkey replied to
Bil’am: “Am I not the very same donkey that you have been riding on all your
life [from the time I became yours] until this very day? Was it ever my
habit to do this to you?” And he said: “No.” (Targum Onkelos)
And the ass said to Bileam, Woe to thee, Bileam, thou
wanting-in-mind when me, an unclean beast, who am to die in this world, and not
to enter the world to come, thou art not able to curse; how much less (canst
thou harm) the children of Abraham, Izhak, and Jakob, on account of whom the
world hath been created, but whom thou art going to curse! So hast thou
deceived these people, and hast said, This is not my ass, she is a loan in, my
hand, and my horses remain in the pasture. But am I not thine ass upon whom
thou hast ridden from thy youth unto this day? and have I been used to do thus
with thee? And he said, No. (Targum
Pseudo-Jonathan)