Probably a lifetime supply but the price is unbeatable. I'm going to guess that the connection you're making is not pulling much current and probably has something like a 10K resistor on it already internally, but you could measure that and see how much current is being pulled on a button press. On the raspberry pi side you would just want a 1K ohm resistor to protect the opto coupler from the current coming from the GPIo pin