In American English, the most common phrase would be to chip in, as in I would be happy to chip in for a cake:
to give some money, esp. when several people are giving money to pay for something together
An alternative is to pitch in, though in my experience this connotes a contribution of labor rather than capital. Both chip in and pitch in can also mean to make a small (and perhaps unnecessary) comment, so don't be surprised if a request for others to chip in yields more quips than coins.
Speaking for myself, I would offer to go in on a cake casually, meaning to join or
to be involved in an activity that involves others
but which my peers and I often use in the sense of investing in or purchasing something together, like a pizza or a vacation condo.
More formally, I would offer to contribute towards a cake. That is, I don't intend to purchase the entire thing, in which case I would contribute a cake, but rather I want
to provide money or support to help another person, company, or organization to achieve its goal