Introducing a new way to review your PRs.

Read the announcement

solana-foundation / pay

CLI for Agentic payments (x402, MPP, AP2).

View on GitHub

30 documents · Updated Nov 11, 2026

docs / cli-skills-and-catalog

CLI skills and provider catalog

The skills and provider catalog gives Pay a shared way to discover payment-ready APIs and publish new provider entries. The CLI manages local catalog sources and test pins for users, while catalog commands help authors turn provider descriptions into checked and publishable catalog data.

See the Payment CLI for the full command surface. The catalog is also used by the CLI server and inference tooling and the MCP payment tools.

Skills catalog

The skills catalog is a searchable index of API providers. Each provider has a fully qualified name (FQN), human-readable metadata, a service URL, and a list of API endpoints with payment and price information.

Catalog sources and cache

The CLI reads provider sources from ~/…/skills.yaml. A source can be a catalog URL or a GitHub org/repo shorthand. The default Pay catalog is present when no local file exists, so discovery works before a user adds another source.

The CLI merges successful sources into one local view. It keeps a time-limited cache and fetches endpoint detail only when a command needs it. A source change creates a different cache identity, while pay skills update --force bypasses edge cache data when a fresh view is needed.

Some sources are temporary. A running local Pay API can register an ephemeral source so agents can see the API during its lifetime. These sources are refreshed on each load and are not treated as durable catalog data.

References: rust/…/config.rs• L15-23 rust/…/config.rs• L50-74 rust/…/config.rs• L205-239 rust/…/mod.rs• L1014-1123

Provider discovery and inspection

pay skills search helps a user move from a task to a provider or endpoint. It can filter by category and can return JSON for scripts and agents. The search first uses provider summaries, then loads endpoint detail for matching services so the result can include usable paths and prices.

The display changes with the number of matching services. One service shows its full endpoint list. Several services show a smaller set of endpoints with metered endpoints first and point to pay skills show <provider> for more detail. If endpoint detail cannot load, the command reports that service instead of presenting an incomplete actionable result as a working endpoint.

pay skills show <provider> accepts an FQN or short provider name. It loads all endpoint detail, or filters it to one resource group, and can emit JSON. pay skills list gives the broader provider view and marks providers supplied by a local pin.

flowchart LR
    A[Task or keyword] --> B[pay skills search]
    B --> C[Provider summaries]
    C --> D[Endpoint detail]
    D --> E[pay skills show]
    E --> F[Exact gateway URL for pay curl]

References: rust/…/search.rs• L13-95 rust/…/show.rs• L5-52 rust/…/list.rs• L7-45 rust/…/mod.rs• L235-340 rust/…/mod.rs• L789-842

Source and provider pin lifecycle

pay skills add <source> adds a durable catalog source and refreshes the local view. The top-level pay install <source> command is the same source-install path. A source may be removed with pay skills remove <source>; removing a source also refreshes the cache.

The add command has a second mode for testing one provider before its catalog change lands. With --pr, --branch, or --sha, it fetches one provider directory into a local overlay. The overlay shadows a canonical provider with the same FQN, so search, inspection, and other catalog consumers see the pinned content.

Pins use different anchors for different jobs:

  • A pull request pin follows the current PR head and can be refreshed.
  • A branch pin follows the branch and can move between installs.
  • A SHA pin identifies fixed content.

Replacing a different pin normally needs confirmation. Non-interactive use must pass --force when replacement would prompt. pay skills prune-merged checks PR pins against the upstream repository and removes pins whose PRs are merged; branch and SHA pins remain because they have no merge state. pay skills remove <fqn> --pin removes a pin without considering catalog sources.

References: rust/…/install.rs• L1-17 rust/…/install.rs• L30-70 rust/…/remove.rs• L5-59 rust/…/prune.rs• L1-39 rust/…/overlay.rs• L22-52 rust/…/pin.rs• L40-92

Provider catalog entries

Provider catalog work starts with a provider markdown entry. Its frontmatter describes the API and its endpoints, while the body can hold usage notes that help an agent form a safe request. The entry can describe endpoints inline or use an OpenAPI document as its endpoint source, but it must use one approach consistently.

Provider entry metadata

An entry identifies the provider with a path-derived FQN and a matching name. It also supplies a title, a useful description, a use case, a known category, a production HTTPS service URL, and at least one endpoint source.

Endpoint records describe the HTTP method, path, purpose, optional resource group, and optional pricing. An endpoint without pricing represents a free route. A priced endpoint is expected to expose a payment gate that the probe can verify. Affiliate and sandbox data are optional parts of the provider description.

The registry uses the path under providers/ to separate the operator that serves an API from the origin API owner. This lets one operator publish several upstream APIs without losing the identity used for discovery.

References: rust/…/registry.rs• L42-99 rust/…/registry.rs• L101-168 rust/…/mod.rs• L35-89

Provider scaffolding and synchronization

pay catalog scaffold starts a new provider entry from an OpenAPI document URL. It uses the document's basic API information and server address to create a starter PAY.md at the requested FQN. Fields that need product judgment, such as the category and use case, remain marked for review rather than being guessed.

When a provider already has a runtime paywall YAML, pay skills provider sync converts that runtime description into registry markdown. The conversion keeps the public metadata and endpoint description, turns metering data into catalog pricing, and leaves runtime-only settings out of the registry entry. The result still needs normal catalog checks before publication.

References: rust/…/scaffold.rs• L1-13 rust/…/scaffold.rs• L25-41 rust/…/scaffold.rs• L64-117 rust/…/provider.rs• L21-55 rust/…/provider.rs• L103-147

Catalog checks and live probes

pay catalog check is the read-only gate for provider entries. It first checks the entry shape and metadata. Unless --no-probe is set, it then sends requests to the listed routes and records whether each route is free, payment-gated, on the wrong network or currency, behind credentials, missing, or unreachable.

The check command supports three useful scopes:

  • A single file for local authoring.
  • A changed provider set for pull-request checks, supplied with --files or found with --changed-from.
  • The full registry for a broad review.

OpenAPI examples and parameter values help probes reach the route that an agent would call. The probe captures payment options and price data from recognized 402 Payment Required responses. It also keeps parameterized 404 results distinct from a plainly missing route because a stale example does not prove that the route is absent.

Reports can be a human table, JSON, or GitHub Actions annotations. A markdown summary can also be written for a CI step summary. A strict check turns a non-Solana payment gate from a warning into a blocking result.

flowchart LR
    A[PAY.md and OpenAPI data] --> B[Static validation]
    B -->|valid| C[Endpoint probes]
    C --> D[Payment and price facts]
    D --> E[Solana compatibility verdict]
    E --> F[Table, JSON, or CI report]

References: rust/…/check.rs• L1-12 rust/…/check.rs• L43-109 rust/…/check.rs• L146-204 rust/…/check.rs• L206-332 rust/…/probe.rs• L13-39 rust/…/probe.rs• L79-99 rust/…/probe.rs• L404-485

Provider verdicts

The verdict layer evaluates whether a provider is useful to Pay users, not only whether its HTTP routes respond. A provider passes normal checks when at least one endpoint accepts a Solana-compatible stablecoin payment. A credential-gated endpoint or a parameterized 404 can also keep the provider from being blocked because anonymous probes cannot verify the payment gate or may use a stale example resource.

The normal policy warns about non-Solana payment gates. It blocks a provider with no payable endpoint and no credential-gated or parameterized endpoint. Free routes and other indeterminate results do not exempt a provider because they do not show a usable Pay payment path. --strict also blocks when any endpoint requires a non-Solana payment path.

Endpoint outcomes are grouped into these user-facing categories:

  • ok: the endpoint accepts a Solana-compatible payment.
  • not_solana: the endpoint has a payment gate but does not advertise a Solana-compatible chain or currency.
  • tolerated_warning: a parameterized 404 may reflect a stale example resource.
  • free: the endpoint has no payment gate.
  • indeterminate: the probe cannot verify the route, such as when credentials or a request body are required.
  • error: the probe cannot reach the endpoint.

The verdict maps each provider to its providers/…/PAY.md path. This path is used in table output, JSON, and GitHub Actions annotations. The same mapping also lets changed sidecar files resolve to the provider entry for selective checks and builds.

References: rust/…/verdict.rs• L1-18 rust/…/verdict.rs• L28-46 rust/…/verdict.rs• L90-154 rust/…/verdict.rs• L157-224 rust/…/verdict.rs• L229-289

Catalog build

pay catalog build turns a checked registry into consumer data. It runs the same validation and probe stages as check, then writes a lightweight index and one detail record per provider. A failed build does not write a partial distribution, which prevents consumers from reading an artifact that hides invalid providers.

Build artifacts and rebuild scope

The index is designed for quick discovery. It contains provider metadata, endpoint counts, metering flags, price bounds, and content identity. Detail records contain the endpoint list, usage content, source data, and probe-derived payment facts. Consumers can load the index first and fetch detail only for a selected provider.

The default output is dist/ under the registry root. A build can use a different output directory, skip live probes for an offline result, or rebuild only selected FQNs from a previous distribution. Partial builds require that previous distribution so unchanged providers can pass through without being silently dropped.

References: rust/…/mod.rs• L11-31 rust/…/build.rs• L13-51 rust/…/build.rs• L53-117 rust/…/build.rs• L24-80 rust/…/build.rs• L155-181 rust/…/build.rs• L995-1059

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the provider FQN rules aligned between the providers/ path, PAY.md name, detail-file path, pin overlay, and search lookup.
  • Keep the catalog index and detail-file contract aligned with lazy endpoint loading and its content hash.
  • When changing probe status names or payment metadata, update the build output and verdict rules together.
  • Preserve the distinction between a canonical provider and a same-FQN local pin so search, list, show, inference selection, and MCP reads agree.
  • When changing OpenAPI or runtime YAML fields, check both scaffolded entries and the provider-sync conversion.
  • For partial builds, keep the selected FQN set and previous distribution behavior aligned so unchanged providers are not omitted.

Important failure modes

TriggerConsequenceGuard
All configured durable sources fail or return no providersCatalog load fails and discovery cannot proceedKeep a reachable source and use pay skills update to refresh it
Endpoint detail cannot be fetched or parsedSearch skips the service's actionable endpoint results; show reports the load errorRefresh the catalog and confirm the detail record exists for the current source hash
A pin has an invalid FQN, unsafe file path, or exceeds the size limitThe overlay install is rejectedUse URL-safe FQN segments and keep the fetched provider content within the pin limit
Provider metadata is invalid or openapi and inline endpoints are both setCheck and build stop before publishingRun pay catalog check after scaffolding or synchronization
A provider has only free, broken, or non-Solana endpoints and no credential-gated or parameterized routeThe provider receives a blocking verdict and is not publishedProbe with valid examples and verify at least one Pay-usable route
A partial build lacks the prior distribution for unchanged providersThe build cannot preserve the providers outside the selected rebuild setSupply --previous-dist with --only

Key files

FileWhy to read it
rust/…/mod.rsDefines the user-facing skills command groups and their aliases.
rust/…/mod.rsShows the catalog model, source loading, cache use, lazy detail loading, and query boundary.
rust/…/install.rsExplains source installation and PR, branch, and SHA provider pins.
rust/…/overlay.rsShows how a local pin replaces a same-FQN canonical provider.
rust/…/search.rsShows task search, endpoint hydration, adaptive output, and unavailable-service handling.
rust/…/check.rsShows the read-only validation modes and report flow.
rust/…/verdict.rsDefines provider verdicts, changed-file resolution, and Solana compatibility policy.
rust/…/build.rsShows the build command options and distribution write boundary.
rust/…/build.rsShows how provider entries become an index and detail records.
rust/…/registry.rsDefines the shared provider, endpoint, OpenAPI, affiliate, and probe data contracts.