S3 explicitly changed their license to allow copying the S3 API. I forget the year, ~2010? I was working an S3 at the time and it was a strongly debated decision.
Google’s initial launch of their cloud storage copied not just the S3 API, but also the error codes.