Sex an obligation in a relationship ?

So my my boyfriend of 4 years just told me I was “selfish “ because I believe consent to sex goes both ways. What I mean by this is I just feel like I’m not obligated to have sex if I don’t feel like it but he feels like I’m selfish because of that thinking . Is it ? He knows me and he knows sometimes I want to and sometimes I don’t just based off past shi I’m just not interesting in sex often but he was cool with it( he’s been with me four years !) . He then gives the scenario that if we were married and in a committed relationship he can’t step out to have sex as an example so I should be willing to at times when I don’t want to . Am I wrong for feeling hurt ? Cuz wym by a committed relationship ? What are we ? Doesn’t the desire for sex go both ways ? Why would you wanna have sex with someone half in it ? Or is a requirement in marriage

Please leave me anything . Criticism , advice , opinions

Update : after four years it’s well known I have a s

low sex drive and his is a high one . In all Aspects we are compatible except this . There may be times I wanna go at it 6 days straight and then for a week or so I just don’t have that drive anymore and I don’t like feeling like I’m half in it( current situation ) . I don’t deny months at a time