Hi. You don't thank your friends for asking how you are, so it would be used in formal context. As for being sarcastic, it highly depends on the context.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.