It seems to be used like "Thanks for inviting me". But it sounds like "Thank me, cause I was there".
Looking for a better explanation and situations it should be used in.
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
You can "have someone for dinner" or "have someone on your show" or "have someone over for coffee" or "have someone in for a chat." In other words, "having someone" means inviting + welcoming + being hospitable.
Thus: "thanks for having me" means thanks for any of those hospitable things. It in no way denotes or implies that the listener should thank the speaker for showing up. "Thanks for" + something is always an expression of appreciation, and never a demand for such.
It can be used in any situation that is friendly and somewhat social. That is, we wouldn't use it in purely business or professional situations.