API billing logic

If i am using api to get response and if the api returns 5xx or other then success, will I be charged ?