Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.faremeter.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The client side of a marketplace is intentionally thin: a discovery service tells you what APIs exist and what they cost; @faremeter/rides handles payment when you call them. There are no accounts, no API keys, and no per-marketplace SDKs.

The shape of every marketplace API

Regardless of which marketplace operator you talk to, every published API looks the same to you:
  • A proxy URL. Where your HTTP requests go. Returned by the marketplace’s discovery service.
  • An OpenAPI spec. Tells you what endpoints exist, what they accept, and (via x-faremeter-pricing extensions) what they cost.
  • A 402 challenge. When you call a paid endpoint without payment, the proxy responds with 402 Payment Required and the requirements for paying. @faremeter/rides handles this for you.

The flow

1

Discover

Query the operator’s discovery service for APIs by name, tag, or capability. Pick the one you want and read its OpenAPI spec to see the endpoints and pricing.
2

Fund a wallet

Any wallet supported by @faremeter/rides works — keypair file, Crossmint, Squads, Ledger. Fund it with the asset the API charges in (typically USDC on Solana or an EVM chain).
3

Call and pay

Make the HTTP request. rides reads the 402, signs payment locally, retries, and gives you back the response. You never touch the payment headers yourself.

Calling a marketplace API

If you already know the proxy URL, this is the entire client:
import { payer } from "@faremeter/rides";

await payer.addLocalWallet(process.env.PAYER_KEYPAIR_PATH);
const res = await payer.fetch("https://example-tenant.example-marketplace.dev/v1/quote");
const data = await res.json();
The payer.fetch call:
  1. Sends the request.
  2. Sees 402 Payment Required with the marketplace’s payment requirements.
  3. Signs a payment with your wallet.
  4. Retries the request with the payment header.
  5. Returns the response when the marketplace settles and the publisher’s backend replies.
For wallet options and configuration, see Wallet setup and Wallet configuration.

Discovering APIs

The Discovery API is a public, unauthenticated REST API. The hosted Corbits instance is at https://api.corbits.dev; a self-hosted marketplace exposes its own URL.
# Search for APIs by keyword
curl "https://api.corbits.dev/api/v1/search?q=openai"

# List all proxies
curl "https://api.corbits.dev/api/v1/proxies"

# Get a proxy's full OpenAPI spec
curl "https://api.corbits.dev/api/v1/proxies/61/openapi"
Typical response shape (truncated):
{
  "data": {
    "proxies": [
      {
        "id": 61,
        "name": "open-ai",
        "url": "https://openai.api.corbits.dev",
        "default_price_usdc": 10000,
        "default_scheme": "exact"
      }
    ]
  }
}
Use the url field as the base for your payer.fetch calls. Prices are integers in micro-USDC10000 means $0.01. For the full Discovery API surface (search, listing, OpenAPI spec retrieval, pagination), see the Corbits Discovery API reference. A self-hosted marketplace running the same OSS code exposes the same endpoints.

Agent-friendly

Because there are no accounts and no API keys, an AI agent can do everything above autonomously: search the catalog, pick an API, sign payments from its own wallet, and consume the response. This is the same pattern the AI agent payments recipe describes — the marketplace just gives the agent a directory to discover APIs in.

What’s next

Rides SDK

The minimal client for paying any x402-protected URL.

Wallet setup

Pick a wallet adapter and fund it.

Payment Schemes

Understand exact, charge, and flex charges you’ll see in the wild.

AI Agent Payments

Recipe for autonomous discovery + payment.