Those are two things:
1) A library is a set of widely used common functionality (Math is a good example, as is LWJL)
2) An API is a collection of exposed objects and interfaces that allow other programs/code to interface with another program/code without having to expose (make public) the implementation or source. An API is a contract that says, "I solemnly swear that these methods exist and do what the documentation says they do."
You just do.
I have one. I'm the only one using it, but I have it. It also happens to be both a library (I put my registry handlers in it) and an API (it is where I expose the interfaces for my capabilities).