The advice that I would give anyone.
Don't attribute to malice what can be attributed to ignorance.
This has a an addendum, once is coincidence, twice is enemy action.
Without knowing who you are/ who this person who just ribbed you is/more context on the situation as a whole. Its really hard to judge.
It could be sexism, but I wouldn't be so quick to assume that.
2 assumptions I am making.
This is your first real job, and you haven't worked around/with a lot of men before. I am basing this off of your unreasonable concern for your job security.
This is not a part of a larger pattern. I am basing this off of thte fact that you have only described a one-off event, and didn't have a hundred examples of how Mr. X. was sexist.
Men do this thing which is referred to by anthropologists as "Ritual opposition" or sport/play fighting. When they are young, boys roughhouse, wrestle etc... As they grow older they start engaging in verbal sparring. This includes ribbing, banter, insults, and nicknames (which are almost exclusively something that makes fun of you). In fact the closer men are to each other the worse the ribbing/banter/insults become. This can become extremely habitual to men, that often they will rag someone when the opportunity arises out of habit, without thinking.
To a women this might seem very confrontational/uncomfortable/unfriendly environment to be in. But for guys its the opposite, it reduces stress, and makes them feel welcome.
TLDR: Don't stress about it. Or better yet join in. If the guys are ribbing you it means you are one of them.