Infinitive with 'to' after these verbs: agree, hope, plan, afford, need, prefer, intend, refuse:
She agreed to talk to us, but refused to help.
Object + infinitive with 'to' after these verbs: ask, expect, get, help, inspire, want:
She inspired me (= object) to write my first novel.