You’re misunderstanding your cookie analogy. You can’t copyright a single recipe that contains components of other recipes, but if you had written a book titled “My grandmas chocolate chip cookies from scratch”, where the first recipe is for homemade chocolate chips, the second is for how to grind your own flour for dough, and the third is for combining the previous two into a cookie, then yeah you can copyright that particular set of recipes. But someone else can use any one of your recipes independently without worrying about infringement.
Think of it like you put in the effort to curate a collection of recipes that work well together, and that curation is what’s copyrightable.
I don’t know what will happen with the law, and if APIs like this will be deemed a “curation”, but it makes a lot more sense to me from that perspective.
Ex.
Anyone can have a `Math.remainder` function, but the curation of an entire `Math` library might be copyrightable, since the effort was in collecting all of the correct things that work well together, even if they aren’t individually copyrightable.
A mega-recipe containing other recipes would be like making a `Math.AddAndThenMultiply`, which even if someone else had created the Add and Multiply methods, you aren’t stealing their API curation of methods, you’re just combining logic/algorithms (ingredients) from multiple methods (recipes) into a bigger method (mega-recipe).