Is it possible to "shut off" battery charging in OSX
I don't know I you already tried looking on Google, but this a problem multiple persons have tried to do. 

There doesn't seems to be a Public API (yet ?) also no "private" API has been found yet. 

Also, as stated in this question, MacBooks have intelligent battery management. This means your laptop will stop charging once the battery is full. 



Edit : 

Results I found : 


SO question : Is there a way to turn off battery charging programmatically in OSX?
Mac Rumors topic : Make battery stop charging at a certain level
Mac rumors topic : Program to disable charging
Ask Different question : How to disable battery charging?