pay.sh docs
ToolchainCommands

Developers

pay server, pay gate, and pay catalog — gate APIs or local inference, then make services discoverable.

The Developers group covers the publisher side: run a payment gateway in front of your API or local inference server, then publish a provider entry so agents can discover it.

For the narrative ("how do I gate my API and ship it?") see Building with pay → Getting started. This page is the syntax reference.

pay server

Manage gateway demos, paywall specs, and subscription plans.

pay server <subcommand>
SubcommandPurpose
demoLocal demo with a dashboard for tracing payments.
scaffoldGenerate a starter paywall.yml.
plans publishDerive on-chain Plan PDAs from a spec.

pay server demo

Start a local demo with a dashboard for tracing payments. Uses bundled endpoints — no spec required.

pay --sandbox server demo
pay --sandbox server demo --local
FlagTypeDefaultDescription
--bindstring0.0.0.0:1402Address to bind to.
--recipientstringRecipient wallet address for payments.
--currencystringUSDCPayment currency (USDC, USDT, SOL, …).
--localboolfalseUse local Surfpool (http://localhost:8899) instead of the hosted sandbox.
--otlp-sidecarHOST:PORTExport traces and metrics to an OTLP HTTP sidecar.

pay server scaffold

Generate a starter paywall.yml.

pay server scaffold paywall.yml
ArgumentTypeDefaultDescription
[OUTPUT]positionalpaywall.ymlOutput file path.

pay server plans publish

Derive on-chain Plan PDAs for subscription: endpoints in a spec. The default is a dry run that prints the derived PDAs without modifying the YAML.

pay server plans publish
pay server plans publish --spec pay-demo.yaml --dry-run
pay server plans publish --spec pay-demo.yaml --write
FlagTypeDefaultDescription
--specpathpay-demo.yamlYAML spec containing subscription: endpoints.
--ownerbase58Plan owner pubkey. Falls back to operator.recipient in the spec.
--dry-runbooltruePrint the derived Plan PDAs without modifying the YAML.
--writeboolfalseWrite the derived Plan PDAs back into the YAML. Use after publishing the Plan accounts on-chain through another tool — pay does not broadcast them in v0.

pay gate

Gate APIs or local inference with stablecoin payments.

pay gate <subcommand>
SubcommandPurpose
apiRun a gateway against a paywall YAML spec.
inferenceDiscover and gate local OpenAI-compatible inference servers.

pay gate api

Start a proxy that gates your API with stablecoin payments. Reads endpoint pricing and payment requirements from a paywall YAML.

pay --sandbox gate api paywall.yml
pay gate api paywall.yml --bind 0.0.0.0:8080
pay gate api paywall.yml --openapi openapi.json --public-url https://gateway.example.com
FlagTypeDefaultDescription
<PAYWALL>positionalPath to the paywall YAML file. Required.
--bindstring0.0.0.0:1402Address to bind to.
--recipientstringRecipient wallet address for payments. Overrides operator.recipient in the paywall.
--currencystringUSDCDefault payment currency for endpoints that don't specify one.
--rpc-urlstringRPC URL for payment verification.
--debuggerboolfalseLaunch the Payment Debugger UI alongside the gateway. Automatic under --sandbox.
--otlp-sidecarHOST:PORTExport traces and metrics to an OTLP HTTP sidecar.
--openapipathOpenAPI 3 or Google Discovery JSON describing the upstream API. The gateway re-serves it at GET /openapi.json with URLs rewritten to point at itself.
--public-urlURLOverride the public base URL used when rewriting servers[].url / rootUrl. Derived from the request Host header when omitted.
--no-registerboolfalseSkip decentralized provider registration when --public-url and a versioned API profile are present.

See YAML Specification for the paywall format and Defining pricing for how to price each endpoint.

pay server start and pay serve start remain accepted for backward compatibility. Use pay gate api in new scripts and documentation.

pay gate inference

Discover local Ollama, LM Studio, llama.cpp, vLLM, and exo servers, then expose them through one OpenAI-compatible gateway.

pay gate inference
pay --sandbox gate inference paywall.yml
pay --sandbox gate inference --price '*=0.10/0.30'
pay gate inference --providers ollama,vllm --no-tui --no-web
FlagTypeDefaultDescription
[PAYWALL]positionalOptional YAML with per-model input/output USD rates per 1 million tokens.
--bindHOST:PORT127.0.0.1:1402Public gateway bind address.
--public-urlURL or hostPublic address to advertise. Pass auto to discover the public IP.
--no-registerboolfalseSkip decentralized provider registration when --public-url is set.
--providersCSVallProbe only the listed provider slugs, such as ollama,vllm.
--probe-timeoutinteger400Per-endpoint probe timeout in milliseconds.
--no-tuiboolfalsePrint log lines instead of the live terminal UI.
--no-webboolfalseDisable the embedded web UI.
--watch-intervalinteger10Seconds between provider probes. Set to 0 to disable watching.
--specpathAdd a hand-written API spec alongside discovered providers. Repeat for multiple specs.
--sandboxboolfalseRequire localnet specs. The global pay --sandbox flag applies the same guard.
--pricestringInline model=input/output rates. Use *=input/output for the default.

pay catalog

Make your API discoverable in pay's public catalog.

pay catalog <subcommand>
SubcommandPurpose
scaffoldScaffold a starter PAY.md from an OpenAPI document.
checkRead-only validation — parse, frontmatter check, probe, Solana verdict.
buildFull registry build: validate, then emit dist/skills.json and per-provider detail files.

pay catalog scaffold

Scaffold a new provider PAY.md from an OpenAPI document URL. The leaf segment of the FQN becomes the name: field; the full FQN is used as a comment hint.

pay catalog scaffold quicknode/rpc https://example.com/openapi.json --output-dir providers
pay catalog scaffold quicknode/rpc https://example.com/openapi.json --output-dir providers --force
FlagTypeDefaultDescription
<FQN>positionalFully-qualified provider name, e.g. quicknode/rpc. Required.
<OPENAPI_URL>positionalURL to the OpenAPI document (JSON or YAML). Required.
--output-dirpath.Output directory. Written as <dir>/<fqn>/PAY.md. Use providers from the registry root.
--forceboolfalseOverwrite the output file if it already exists.

The scaffold command fetches a remote OpenAPI document as input. Published registry entries should commit that snapshot next to PAY.md and reference it with openapi.path.

pay catalog check

Read-only validation: parse, frontmatter check, live probe, Solana verdict. Used by PR CI and local development. Never writes to disk.

pay catalog check
pay catalog check ./providers/quicknode/rpc/PAY.md
pay catalog check . --changed-from origin/main
pay catalog check . --files providers/google/translate/PAY.md providers/google/maps/PAY.md
FlagTypeDefaultDescription
[PATH]positional.Registry root, or a single PAY.md. When pointed at a file, the FQN is derived from parent directories.
--no-probeboolfalseSkip live probing (frontmatter-only check).
--probe-timeoutseconds10Per-endpoint probe timeout.
--probe-concurrencyint5Max concurrent provider probes.
--currenciescsvUSDC,USDTAccepted stablecoin symbols. Non-listed currencies are flagged as wrong_currency.
--strictboolfalseTreat every non-Solana endpoint as a blocking error (default: warn).
--formatenumtableVerdict output format. table, json, or github (emits Actions ::warning::/::error:: annotations).
--verbose (-v)boolfalsePrint per-provider, per-endpoint probe + verdict breakdown.
--summary-outpathAlso write a GitHub-flavored markdown summary to this path, regardless of --format.
--filespathsSpecific PAY.md files to check (relative to the registry root when PATH is a directory). Mutually exclusive with --changed-from.
--changed-fromgit-refCheck providers whose PAY.md or sidecar files changed between <REF> and HEAD. Requires git on $PATH.

pay catalog build

Full registry build: run the same checks as check, then write dist/skills.json and per-provider detail files.

pay catalog build
pay catalog build --base-url https://catalog.pay.sh/v1
pay catalog build . --only quicknode/rpc,helius/das --previous-dist ./dist-prev
FlagTypeDefaultDescription
[PATH]positional.Registry root containing providers/, affiliates/, aggregators/.
--base-urlURLhttps://catalog.pay.sh/v1CDN base URL for detail-file references in the index.
--output (-o)path<path>/distOutput directory.
--no-probeboolfalseSkip live probing. Output omits probe-derived pricing/protocol/supported_usd metadata.
--probe-timeoutseconds10Per-endpoint probe timeout.
--probe-concurrencyint5Max concurrent provider probes.
--onlycsv FQNs(Re)build these providers from source; copy every other provider from --previous-dist. Fast partial rebuild at merge time.
--previous-distpathPath to a previously-built dist/ directory. Required when --only is set.

On this page