Never? There are many cases of highly successful businesses being based upon a 3rd party API. E.g.: every successful software company that sold CP/M, DOS, Windows or UNIX software.
Perhaps a better statement would be: understand that there are risks inherent to building for any given API, study those risks, and mitigate them.
CP/M seems to be dying off? Hope you've started your DOS port already :)