Chapter 23 of Numbers
2 And Balak did as Balaam had spoken; and Balak and Balaam offered on every altar a bullock and a ram.
5 And the LORD put a word in Balaam’s mouth, and said, Return unto Balak, and thus thou shalt speak.
6 And he returned unto him, and, lo, he stood by his burnt sacrifice, he, and all the princes of Moab.
12 And he answered and said, Must I not take heed to speak that which the LORD hath put in my mouth?
16 And the LORD met Balaam, and put a word in his mouth, and said, Go again unto Balak, and say thus.