Write a function to log in to an API and calculate the total cost based on a list of orders.
You are practicing as a guest. Sign up free to get your answer graded with AI feedback. Your draft stays right here.