The defendant, in an action for the recovery of money only, may, at any time before the trial, serve upon the plaintiff or his attorney an offer, in writing, to allow judgment to be taken against him for the sum specified therein. If the plaintiff accept the offer and give notice thereof to the defendant or his attorney, within five days after the offer was served, the offer, and an affidavit that the notice of acceptance was delivered within the time limited, may be filed by the plaintiff, or the defendant may file the acceptance, with a copy of the offer, verified by affidavit; and in either case, the offer and acceptance shall be noted in the journal, and judgment shall be rendered accordingly. If the notice of acceptance be not given in the period limited, the offer shall be deemed withdrawn, and shall not be given in evidence or mentioned on the trial. If the plaintiff fails to obtain judgment for more than was offered by the defendant, he shall pay the defendant's costs from the time of the offer.
Okla. Stat. tit. 12, § 1101