API cost control