Inspiration

The $4.5 trillion API economy runs on credentials that are completely illiquid, non-transferable, and privately controlled. Billions in unused API quota expires every month with zero recovery mechanism.

As developers, we have all experienced the frustration of paying for AI API subscriptions and not fully using our monthly credits. Many platforms require you to prepay for a fixed quota of tokens or requests, but in reality, most users never consume 100% of what they purchased. The unused credits simply expire, which means wasted money.

That inefficiency sparked our idea. What if unused API credits could be resold instead of wasted? If someone has leftover credits they do not intend to use, or even free promotional credits, they should be able to sell them. Sellers recover value from something that would otherwise expire, and buyers get access to cheaper API usage. Everyone benefits.

This problem is especially significant for founders, particularly those from marginalized communities such as Black entrepreneurs and other underrepresented groups. Starting a company already requires significant resources, and API costs can quickly become one of the largest expenses. For example, during development of this project, we spent over $120 worth of Claude API credits alone. That cost may be manageable for well-funded startups, but for underprivileged founders with fewer financial resources, it can be a serious barrier.

In low-income countries, it is difficult for founders to get enough capital for these expensive subscription models. apiXchange offers a cheaper alternative and eases the entry for builders across the world.

By creating a decentralized marketplace where API credits can be resold at lower prices using various Stablecoins on the blockchain, we reduce waste and lower the financial barrier to building for everyone.


What it does

apiXchange allows people to sell unused API credits at a price they set per token.

  • Sellers list their available API credits, specifying the price per token they are willing to accept.
  • By aggregating all listings, we calculate the live market price for each type of API credit.
  • Buyers who want cheaper API access can view the current market price and put Buy Orders to fulfill at a given price for a chosen number of tokens.

When a buyer makes a request using their proxy key, the request is sent to our proxy endpoint. Our system then replaces the proxy key with the actual underlying API key. The request is forwarded to the real API provider, usage is tracked, and the appropriate number of tokens is deducted from the buyer’s balance. The API response is then returned to the buyer.

From the user’s perspective, it works just like using a normal API key, but at a lower cost.


How we built it

apiXchange is built on top of the XRP Ledger (XRPL).

  • When a seller chooses to sell API credits, they create an offer on XRPL.
  • Buyers can browse these offers and purchase directly from sellers.

Flow:

  1. Sellers list API credits as tokens on XRPL.
  2. Buyers pay in XRP.
  3. Sellers receive StableCoins/Cryptocurrency in exchange for issuing API-specific tokens.
  4. Each token type represents a specific API.
  5. Buyers receive tokens corresponding to API usage rights.

Where Ripple Comes in

When a buyer wants to sell their credits, their API key is first encrypted and stored with a proxy key referencing it. This proxy key is minted on XRPL as a token, which allows fractional purchases by multiple buyers.

Once the receiving buyer purchases the tokens, they enter a contract to use the credits in a set period. Once the credits are used, the transaction is complete and the seller is paid.

We also implemented Smart Contracts on the XRPL EVM Sidechain to track and monitor token usage. This ensures accountability and transparency in billing.

Monitization Model

International founders struggle to cover full subscription services and will end up wasting most of their investment. Why force yourself to subcscribe when you can PAYG (Pay as you go). apiXchange takes a fixed cut from purchases on its exchange, but reserves the right to exclude cuts on approved founders who are using apiXchange as a means to cheaper access.

From the buyer’s perspective, only requires a few extra lines:

const proxyUrl = "http://18.209.63.122:3000/proxy";
const targetUrl = "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent";
const apiKey = "<your proxy api key>"
const payload = {contents: [parts: [{text: "Explain how AI works in a few words"}]}]};
const url = `${proxyUrl}?api_type=google&target=${encodeURIComponent(targetUrl)}`;
const response = await fetch(url, {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "x-goog-api-key": apiKey
    },
    body: JSON.stringify(payload)
});

For Testing: Please download the following snippet, there is currently active keys listed on gemini marketplace that can be purchased with a demo xrpl wallet, give it a try :). Full SDK in progress...coming soon https://drive.google.com/file/d/1_Pn5-_QHrWQ7tRZ1WmcDavYczfYv-o8R/view?usp=sharing

Listing API Keys requires additional approval => api keys must be configured with rate limiting, account monitoring and token balance minimums to be approved for posting.

Share this project:

Updates