I was having at least one headache a day for several years up until earlier this year. I would take Excedrin migraine to help (note, that it contains caffeine). I was caught in a loop. I would drink coffee, tea, pop, etc. which would "energize" me for a while, then give me a headache. The Excedrin would help some, but usually the headache came back.
Finally, I tapered off ALL caffeine consumption over a period of a month or so.. The first four days at zero were murder!! Non-stop headaches. But now, I get much less than half of the number of headaches I'd been getting.
So, my personal, long-winded answer to your question is... 1 mg or more.