Skip to content

Sell your Solana service to agents

Put an x402 price on an endpoint and an agent can pay for it by the request in USDC: no account, no API key, no invoice. Check your endpoint here, then ask for it to be listed in Pipe Market.

Taking listing requestsx402 version 2Solana mainnetUSDC

Check your endpoint

See what an agent sees when it calls your endpoint, and whether a standard x402 client can pay it.

Pipe calls the address once, without a payment, and reads the 402 answer. It must be a public hostname over HTTPS. A POST is sent an empty JSON object.

No endpoint yet? Generate one

Choose a framework, a price and the wallet to pay. The wizard writes the server code that charges for the route.

A segment written :city or [city] is a path parameter: /weather/:city.

In dollars: one dollar is one USDC.

A Solana address with a USDC account.

Agents read this when they choose a service. Up to 200 characters.

What catalogues call it, in up to 32 characters.

Up to 5, separated by commas. Catalogues filter by them.

Nothing typed here leaves this page. The code is rewritten as you type.

  1. Install the packages

    The x402 server packages for your framework, with the Solana scheme and the discovery extension. Node.js 20 or newer.

    Terminal
    npm install express @x402/express@2.24.0 @x402/core@2.24.0 \
      @x402/svm@2.24.0 @x402/extensions@2.24.0 @solana/kit@5.5.1
  2. Save this as server.ts

    Replace the example answer and the example input with your own.

    server.ts
    // server.ts: one route with an x402 price, paid in USDC on Solana.
    import express from "express";
    import { paymentMiddleware, x402ResourceServer } from "@x402/express";
    import { HTTPFacilitatorClient } from "@x402/core/server";
    import { ExactSvmScheme } from "@x402/svm/exact/server";
    import {
      bazaarResourceServerExtension,
      declareDiscoveryExtension,
    } from "@x402/extensions/bazaar";
    
    const SOLANA_MAINNET = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
    
    // The facilitator checks each payment, settles it on Solana and pays the
    // network fee. Use one that supports x402 version 2 with the "exact" scheme
    // on Solana mainnet, and set its address in FACILITATOR_URL.
    const facilitator = new HTTPFacilitatorClient({
      url: process.env.FACILITATOR_URL,
    });
    
    const payments = new x402ResourceServer(facilitator)
      .register(SOLANA_MAINNET, new ExactSvmScheme())
      .registerExtension(bazaarResourceServerExtension);
    
    const app = express();
    app.use(express.json());
    
    app.use(
      paymentMiddleware(
        {
          "GET /v1/price": {
            accepts: {
              scheme: "exact",
              // In dollars: one dollar is one USDC.
              price: "$0.001",
              network: SOLANA_MAINNET,
              // The wallet that is paid. It needs a USDC account.
              payTo: "YOUR_SOLANA_WALLET_ADDRESS",
            },
            description: "Describe what one request returns.",
            mimeType: "application/json",
            // Tells an agent how to call the route. Replace the examples with yours.
            extensions: {
              ...declareDiscoveryExtension({
                input: { symbol: "SOL" },
                inputSchema: {
                  properties: { symbol: { type: "string" } },
                  required: ["symbol"],
                },
                output: { example: { symbol: "SOL", price: 151.2 } },
              }),
            },
          },
        },
        payments,
      ),
    );
    
    // Runs only for a request that has paid.
    app.get("/v1/price", (request, response) => {
      response.json({ symbol: "SOL", price: 151.2 });
    });
    
    app.listen(Number(process.env.PORT ?? 3000));
    
  3. Point it at a facilitator and run it

    A facilitator checks each payment, settles it on Solana and pays the network fee, so your server holds no keys. Any x402 version 2 facilitator that supports the exact scheme on Solana mainnet works. An unpaid request should answer 402.

    Terminal
    FACILITATOR_URL=https://your-facilitator.example npx tsx server.ts
    curl -i http://localhost:3000/v1/price
  4. Deploy it, then check it here

    Put it on a public hostname over HTTPS, give the wallet a USDC account, and check the endpoint above. When every check passes you can ask for it to be listed.

How a listing works

What Pipe checks

  • Called without a payment over HTTPS, the endpoint answers 402 Payment Required.
  • It states its terms in x402 version 2, in the PAYMENT-REQUIRED header.
  • It takes an exact amount of USDC on Solana mainnet, to a valid wallet.
  • It names the account that pays the network fee, so a buyer needs no SOL.
  • Worth having: a description, and the discovery extension that tells an agent how to call it.

Who is paid

  • Your wallet. A payment goes from the buyer to the wallet your endpoint names, settled by your facilitator. Pipe does not hold it and takes no share of it.
  • The price is whatever your endpoint’s 402 answer states when it is called. The catalogue shows the price Pipe last read, and the day it read it.
  • A listing is shown as yours: your hostname and your wallet, marked as not run by Pipe.
  • Pipe may decline a listing, or remove one that stops answering or misleads buyers.

From an agent or a script

Check an endpoint

The same check as the form above, as JSON: each check with its result, and the price and wallet the endpoint states.
Terminal
curl -sS https://pipe.network/api/market/v1/sell/validate \
  -H 'content-type: application/json' \
  -d '{
    "url": "https://api.example.com/price",
    "method": "GET"
  }'

Ask for a listing

Pipe checks the endpoint again when the request arrives. Listed endpoints are at /api/market/v1/sell/listings.
Terminal
curl -sS https://pipe.network/api/market/v1/sell/listings \
  -H 'content-type: application/json' \
  -d '{
    "url": "https://api.example.com/price",
    "method": "GET",
    "name": "Token price feed",
    "description": "Spot price of a Solana token in USD.",
    "category": "trading",
    "contact": "you@example.com"
  }'

Questions sellers ask

Do I need an account with Pipe?

No. Checking an endpoint and asking for a listing need no account. We ask for an email address so we can reach you about the listing; it is never shown.

What does a listing cost?

Nothing. Buyers pay your wallet through your facilitator, and Pipe takes no share. Your facilitator may charge for settling payments.

Which networks and currencies are listed?

USDC on Solana mainnet. An endpoint may take payment on other networks as well; Pipe Market lists its Solana price.

My endpoint answers 400, not 402. Why?

It is checking the request before it asks for payment. The check sends no query, and an empty JSON object with POST. The x402 middleware asks for payment first, so put it ahead of your own validation.

Can I change my price after I am listed?

Yes. A buyer always pays what your endpoint’s 402 answer states at the time. Write to hello@pipe.network and we read the new price into the catalogue.

How do I change or remove a listing?

Write to hello@pipe.network from the address you gave with the request.

Browse the catalogue How agents pay llms.txt