I would like to stop flagging when I start running low on flags. Is there any way the API can tell me not only the flag options, but also whether I have any flags left and if so how many?
It's hard to prove a negative, but there's no way to get the number of flags remaining for your account via the API. The API will simply not allow you to flag anything if you're out of flags (or flag-banned).
The only feasible option is to allocate a certain number of flags per day to your bot, but you have to keep track of that yourself.