You wrote "API that allows me to listen to calls in realtime ...". Did you mean to listen to incoming call (ringing) or to listen to the call after the call is picked up?
If you want to listen to incoming call while it is ringing, use the presence push notification or the telephony session API.
If you want to listen to the voice of the call, then the WebRTC would help.
Also, you wrote ".. reply programmatically to the call in realtime", did you mean to pick a ringing call programmatically? If so, I am afraid that you cannot do that unless you make a call handling rule to direct the call to a voicemail.