Numbers 22:18-21

22:18 Balaam replied to the servants of Balak, “Even if Balak would give me his palace full of silver and gold, I could not transgress the commandment of the Lord my God to do less or more. 22:19 Now therefore, please stay the night here also, that I may know what more the Lord might say to me.” 22:20 God came to Balaam that night, and said to him, “If the men have come to call you, get up and go with them; but the word that I will say to you, that you must do.” 22:21 So Balaam got up in the morning, saddled his donkey, and went with the princes of Moab.

Numbers 22:23

22:23 And the donkey saw the angel of the Lord standing in the road with his sword drawn in his hand, so the donkey turned aside from the road and went into the field. But Balaam beat the donkey, to make her turn back to the road.

Numbers 22:28

22:28 Then the Lord opened the mouth of the donkey, and she said to Balaam, “What have I done to you that you have beaten me these three times?”