Write API documentation – the API will describe what a function does, what the function’s parameters or arguments are, and what a function returns. It’s the collection of references, tutorials, and examples to help developers use your API.
Stripe API is a good example of how to write API documentation.