NPM for APIs: repository of tools for AI Agents
I have been thinking about the whole concept of APIs as tools for AI agents. The idea of agentic software autonomously interacting with the internet through APIs fascinates me.

I have some thoughts regarding this. Some premises:

1. It seems probable to me that AI agentic software will rise to be the main consumer of the internet in the next couple of years.

2. I think that using APIs to interact with the wider internet programatically makes more sense than making tools for agents to mimic browser-based "human" interactions. GUIs were made for humans to surf the web, but they seem to be an inadequate and limited method for AI agents to do same.

3. Rather, I would expect that most interactions would happen through APIs (OpenAPI, GraphQL, gRPC...). This might result in the proliferation of AI-dedicated interfaces for web content, in the form of APIs.

If we expect a certain degree of autonomy from these agents we should not design them to be limited to a predefined set of APIs/tools. I would expect them to have the capacity (call it meta-tooling) to autonomously find and use the relevant API for their assign job. They will also have to pay for it somehow.

So we have three functionalities here:

1. Discovery: AI agents need to be able to find APIs for the job. This will probably include some sort of ranking.

2. Learning: AI agents need to be able to learn how to use an API, ie. they need access to some documentation, ideally machine-readable.

3. Payment: AI agents need a way to pay for access to APIs that they might not have used/encountered before.

How can these 3 problems be resolved? Thinking about this led me to existing platforms that solve similar problems in adjacent areas, and particularly to NPM (Node Package Manager for those not familiar with the JavaScript/Node.js ecosystem).

NPM solves 2 out of these 3 problems. 1) It provides a repository of code that can be (relatively) easily searched and where devs can discover packages for functionality they need to include in their projects; and 2) it also provides a central place to find documentation for said project (at least a starting point). It does not address 3) i.e. payments, because code in NPM is free, but more on that later.

So how about: an NPM for APIs? A machine-searchable repository of APIs, where any company/developer can publish their API linked to their backend, and where consumers (AI or human) can find machine-readable documentation (think OpenAPI specs) for said APIs. All APIs accessible through a single authentication key so that agents do not have to be pre-configured with access to specific ones...

And payments? It is clear to me that subscriptions do not work for this use case. I can delve in another post on all the evils of subscriptions and why I do not think they are the future of the internet economy. For this specific use case, we are considering irregular access to new APIs. Usage based monetisation, pay-per-request, seems to be far more practical. And it can be integrated into this platform:

Users can have a pool of prepaid credits, refillable at will, that can be used with any API. Each request for each endpoint can have a price, and credits can flow in near real-time from consumer wallets to API producer wallets within the platform. Paying per request can introduce very cool concepts itself, such as dynamic request pricing, but I will also share my thoughts on that in another post.

I am curious to see what you think of this concept. Me and some friends have started working on a product inspired by the above, and we already have many APIs that have come onboard following this vision. Happy for all to check it out and get some feedback: https://sparkhub.sulu.sh/