Providing an API is required if you do some other thing, but you are not required to do that other thing. Requirements that are triggered by engaging in some other activity are not compulsions if the activity they are triggered by is not compulsory. (Now, whether restricting the thing that triggers the requirement by adding the requirement is permissible is a legitimate question, but that is not the question that is addressed when you ignore the thing triggering the requirement and treat the requirement as a free-standing mandate.)