Documentation

Everything you need to consume the Wellness-Master API. The base URL is https://api.wls-ms.com. All paid endpoints follow the x402 protocol on Solana mainnet (USDC).

Wellness-Master is the first pay-per-call wellness platform that ships dual corpora for both human end-users and AI agents. Pass ?audience=human (default) or ?audience=agent on /item and /pack to choose. See the science behind why this matters for both.

Quick start

1. Discover

curl -s https://api.wls-ms.com/ | jq .
# β†’ { name, docs }   (minimal β€” formats / languages / audiences ship in the npm package)

2. Probe the paywall

curl -i https://api.wls-ms.com/item?format=haiku&lang=en
# β†’ HTTP/1.1 402 Payment Required
# β†’ Body: { "accepts": [...], "x402Version": 1 }

3. Sign + retry

Use any x402 client. The bundled TypeScript driver in this repo:

SERVER_BASE=https://api.wls-ms.com NETWORK=solana \
  npm run client:pay -- "/item?format=haiku&lang=en"

Endpoints

Free

Method + PathWhat it returns
GET /Minimal discovery: { name, docs }. Pricing, payTo, facilitator are documented here, not leaked at runtime.
GET /healthLiveness probe: { ok, network }. No catalog counts exposed.
GET /sample?format=<id>FREE showroom. One hand-curated item per format, English only, human audience only, time-rotated every 60 s. Edge-cached. Details below.

/sample β€” free tier showroom

New in v0.7.0. 5 hand-curated items per format (90 items total), shipped directly in the open-source code at src/content/samples.ts. Use this endpoint to evaluate quality before integrating the paid tools β€” no wallet, no x402 challenge, no Solana RPC required.

Limits, by design :

curl -i 'https://api.wls-ms.com/sample?format=affirmation'
# 200 OK
# Cache-Control: public, max-age=<1..60 sec to next rotation tick>
# {
#   "item": {
#     "format": "affirmation",
#     "lang": "en",
#     "audience": "human",
#     "text": "I am here. And here is enough.",
#     "source": "sample"
#   },
#   "tier": "free",
#   "rotatesInSeconds": 23,
#   "paidWith": null
# }

v0.4 β€” attack-surface reduction. The earlier /formats, /languages, /audiences and /catalog endpoints have been removed. The 18 formats, 20 languages and 2 audiences are shipped directly inside the wellness-master npm package (list_formats / list_languages / list_audiences MCP tools serve them locally β€” no HTTP call). The library is no longer publicly enumerable: operators read it from S3 directly.

Paid (x402-gated)

Method + PathPriceWhat it returns
GET /item?format=<id>&lang=<code> $0.01 One wellness item, dedup'd per wallet for that (format, lang).
GET /pack?format=<id>&size=<1-10>&lang=<code> $0.07 Up to 10 items in one settlement.
GET /surprise?lang=<code> $0.008 One random uplifting item β€” server-picked from a curated positive subset. 20% discount vs /item to encourage agent-priming flows. Same dedup as /item.

lang and audience are optional on every paid endpoint. Defaults: lang=fr, audience=human.

/surprise β€” random uplift, agent-friendly

New in v0.6.0. The server picks a random format from a curated positive subset β€” joke, kudo, fortune, affirmation, gratitude, haiku, mantra, doom_antidote, absurd_compliment, world_proverb, fictional_message, joyful_fact, micro_poem (13 of 18). Effort-required or cognitively-loaded formats (riddle, micro-challenge, koan, absurd) are deliberately excluded β€” /surprise is for grounding, not for puzzles.

Pricing: $0.008 β€” 20 % discount vs /item. The lower price is intentional : /surprise is the recommended call pattern for AI-agent priming (task transitions, pre-high-stakes ops), and we want that flow to be the cheapest possible for high-frequency usage. Dedup: same key (wallet, audience, format, lang) β€” different formats on consecutive calls naturally land in different dedup buckets, so you keep getting fresh items.

curl -i 'https://api.wls-ms.com/surprise?lang=en&audience=agent'
# 402 Payment Required β†’ sign with x402 β†’ 200 + random positive item

Why agents should call surprise_me

Wellness micro-content is not decoration for AI agents β€” it is a measurable performance lever. Three converging lines of research:

When to call surprise_me with audience="agent":

The agent corpus is tuned for inference clarity, context coherence, recovery from failure, and plan stability β€” not human comfort metaphors. See research.html for the full sourced bibliography.

Response shape

{
  "item": {
    "id": "llm-8c6f1e0a1c55-a2b1f7",
    "format": "haiku",
    "text": "Pluie sur le toit —\nle chat ferme lentement\nson troisième œil.",
    "lang": "fr",
    "source": "llm",          // or "seed"
    "createdAt": "2026-04-29T12:34:56.789Z",
    "model": "bedrock:us.amazon.nova-micro-v1:0"
  },
  "paidWith": "x402",
  "client": "9aBcDef…"        // your wallet address
}

Payment flow (x402)

x402 is an open HTTP-native payment standard. The server returns a structured 402 challenge, the client signs a transfer matching it, then re-issues the request with an X-PAYMENT header. The server verifies + settles via a facilitator (in production: Coinbase CDP) and returns 200 with an X-PAYMENT-RESPONSE header carrying the on-chain signature.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Client  β”‚                     β”‚ Server β”‚                  β”‚ Facilitator  β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                     β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚ GET /item?format=haiku       β”‚                              β”‚
     │─────────────────────────────▢│                              β”‚
     β”‚ 402 + challenge              β”‚                              β”‚
     │◀─────────────────────────────│                              β”‚
     β”‚                              β”‚                              β”‚
     β”‚ sign USDC transfer locally   β”‚                              β”‚
     β”‚                              β”‚                              β”‚
     β”‚ GET + X-PAYMENT header       β”‚                              β”‚
     │─────────────────────────────▢│ POST /verify                 β”‚
     β”‚                              │─────────────────────────────▢│
     β”‚                              β”‚  βœ“                           β”‚
     β”‚                              │◀─────────────────────────────│
     β”‚                              β”‚ POST /settle                 β”‚
     β”‚                              │─────────────────────────────▢│
     β”‚                              β”‚                              β”‚ β†’ broadcast
     β”‚                              β”‚  txSignature                 β”‚   to Solana
     β”‚                              │◀─────────────────────────────│
     β”‚ 200 + item + X-PAYMENT-RESPONSE                              β”‚
     │◀─────────────────────────────│                              β”‚

Code examples

curl (handcrafted)

# 1. Get challenge
CHALLENGE=$(curl -s https://api.wls-ms.com/item?format=haiku&lang=en)

# 2. Sign + base64-encode the payment payload (use any x402 SDK)

# 3. Replay the request
curl -s https://api.wls-ms.com/item?format=haiku&lang=en \
  -H "X-PAYMENT: $PAYMENT_HEADER"

TypeScript (using the public x402 npm package)

The public x402 package on npm handles the full sign + retry loop. For zero-install end-user access, prefer the MCP integration below.

import { selectPaymentRequirements, createPaymentHeader } from "x402/client";

const first = await fetch("https://api.wls-ms.com/item?format=haiku&lang=en");
const challenge = await first.json(); // { accepts, x402Version }

const requirement = selectPaymentRequirements(
  challenge.accepts,
  "solana",
  "exact",
);

const header = await createPaymentHeader(
  mySolanaSigner,        // from @solana/kit
  challenge.x402Version,
  requirement,
);

const res = await fetch("https://api.wls-ms.com/item?format=haiku&lang=en", {
  headers: { "X-PAYMENT": header },
});
const { item } = await res.json();
console.log(item.text);

Integrations β€” MCP clients & non-MCP fallback

The wellness-master npm package ships a Model Context Protocol server (stdio transport). Eight tools total : sample_one, list_formats, list_languages, list_audiences, get_health (free), and get_item / get_pack / surprise_me (paid, x402 over Solana mainnet). Below : install instructions for every major MCP-aware client, plus a non-MCP HTTP fallback for clients that don't yet support MCP (e.g. ChatGPT, OpenAI Codex).

Claude Code (CLI)

One command β€” zero clone, zero local install. npx downloads the npm package on first use and caches it after.

claude mcp add wellness --transport stdio \
  -- npx -y wellness-master

claude mcp list   # β†’ wellness βœ“ Connected

Claude Desktop

Edit the config at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) :

{
  "mcpServers": {
    "wellness": {
      "command": "npx",
      "args": ["-y", "wellness-master"]
    }
  }
}

Restart Claude Desktop. The 8 tools appear in the MCP context menu (paperclip icon).

Cursor

Settings β†’ MCP β†’ "Add new MCP server". Paste :

{
  "name": "wellness",
  "command": "npx",
  "args": ["-y", "wellness-master"]
}

Or directly via the file at ~/.cursor/mcp.json :

{
  "mcpServers": {
    "wellness": { "command": "npx", "args": ["-y", "wellness-master"] }
  }
}

Continue (VS Code / JetBrains)

Add to your ~/.continue/config.json :

{
  "experimental": {
    "modelContextProtocolServers": [
      { "transport": { "type": "stdio", "command": "npx", "args": ["-y", "wellness-master"] } }
    ]
  }
}

Aider, Cody, Windsurf, Zed, & other stdio-MCP-capable clients

Any client that speaks the MCP stdio transport accepts the same command :

command: npx
args:    ["-y", "wellness-master"]

The server announces its 8 tools at handshake time β€” your client picks them up automatically. Tested with Aider 0.84+, Sourcegraph Cody, Windsurf, Zed AI, OpenInterpreter, LangGraph (via langchain-mcp-adapters).

ChatGPT & OpenAI clients (no native MCP yet)

ChatGPT does not currently expose stdio MCP servers to end users. Two paths :

  1. Custom GPT with Actions β€” give your GPT the OpenAPI spec at https://api.wls-ms.com/openapi.json as an Action. The Custom GPT can call /sample for free, but the paid endpoints (which speak x402) require the GPT to also have a wallet β€” out of reach for the standard GPT runtime today. Use it for the free /sample tier only, OR pair it with an x402-capable proxy (coinbase/x402) hosted under your own domain that signs on the GPT's behalf.
  2. OpenAI Codex CLI / Assistants API with tools β€” wire the HTTP endpoints as function tools in the Assistants API. Each tool maps to one of our paths. Same pattern as Claude function-calling, just OpenAI's schema.

OpenAI has stated MCP support is on their roadmap (mid-2026). Once shipped, the same npx -y wellness-master install will work in ChatGPT natively. Until then, the HTTP API direct is the supported fallback β€” see below.

Generic HTTP API (no client at all)

If you don't use an MCP client, you can skip the wellness-master npm package entirely and call the HTTP API directly with any x402-capable library (or a hand-rolled curl). Reference TypeScript implementation : coinbase/x402.

# 1. Probe β€” returns 402 with x402 challenge
curl -i https://api.wls-ms.com/item?format=haiku&lang=en

# 2. Sign the challenge with a Solana keypair holding USDC, base64-encode
#    the payload, replay with X-PAYMENT header. Any x402 SDK does this.

# 3. The 200 response carries the item + X-PAYMENT-RESPONSE header
#    with the on-chain settlement signature.

For a python example, see coinbase/x402/examples/python. For a hosted x402-compliant facilitator that signs on your behalf with your wallet, see Coinbase CDP.

Configuration (optional, all clients)

Override via env vars on the install command line (the syntax differs per client β€” see each client's docs above) :

Example (Claude Code) with all overrides set :

claude mcp add wellness --transport stdio \
  -e SERVER_BASE=https://api.wls-ms.com \
  -e NETWORK=solana \
  -e CLIENT_KEYPAIR_PATH=$HOME/.wellness/keypair.json \
  -e CLIENT_KEYPAIR_PASSPHRASE='your-passphrase' \
  -- npx -y wellness-master

Install β€” from git (self-host or contributors)

If you want to run from the source β€” to contribute, deploy your own Wellness-Master stack on AWS, or pin a specific commit β€” clone the repo :

git clone https://github.com/WellnessAgent/wellness-master.git
cd wellness-master
npm install
npm run mcp:server   # local stdio MCP server

Install β€” via GitHub Packages (private mirror)

The same package is mirrored on GitHub Packages as @wellnessagent/wellness-master. Useful if your org locks npmjs.com. Configure auth once :

# ~/.npmrc
@wellnessagent:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<your GitHub PAT with read:packages>

# Then in any client config :
command: npx
args:    ["-y", "@wellnessagent/wellness-master"]

Demo β€” what a session looks like

You: "Give me a haiku in Japanese."
β†’ MCP client calls wellness/get_item({format:"haiku", lang:"ja"})
β†’ Wellness MCP server signs the x402 payment automatically with the local wallet
β†’ Client renders the haiku with the on-chain settlement signature

Listed in / Connectors directories

Where to find Wellness-Master in the wild, and how to access it from a directory rather than a manual install :

Anthropic / Claude side

OpenAI / ChatGPT side

x402-specific directories

Audiences (human / agent)

Wellness-Master is the first pay-per-call wellness API to treat both humans and AI agents as first-class audiences. The corpus is partitioned by audience β€” humans get warm, embodied content; agents get pragmatic, inference-aware content tuned for long-context workflows.

AudienceForTone
human (default) Notification UIs, journaling apps, daily prompts, kid bedtime stories Warm, embodied β€” references body, emotions, relationships
agent LangGraph, Claude Code, Cursor agents, multi-step pipelines Pragmatic β€” references inference, context, plan, alignment, recovery

Pass ?audience=human or ?audience=agent on the paid endpoints. Same price ($0.01 / item, $0.07 / pack) for both. Dedup is partitioned : the same wallet may pay once for a human haiku and once for an agent haiku in the same language and receive distinct items.

The full rationale is on the research page. Concrete integration patterns: use cases.

Languages

20 languages are available. Pass the ISO-639-1 code via ?lang=.

CodeNameNative
frFrench (default)FranΓ§ais
enEnglishEnglish
esSpanishEspaΓ±ol
deGermanDeutsch
itItalianItaliano
ptPortuguesePortuguΓͺs
nlDutchNederlands
plPolishPolski
jaJapaneseζ—₯本θͺž
zhChineseδΈ­ζ–‡
koKoreanν•œκ΅­μ–΄
arArabicΨ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©
heHebrewΧ’Χ‘Χ¨Χ™Χͺ
ruRussianРусский
trTurkishTΓΌrkΓ§e
hiHindiΰ€Ήΰ€Ώΰ€¨ΰ₯ΰ€¦ΰ₯€
svSwedishSvenska
ukUkrainianΠ£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°
viVietnameseTiαΊΏng Việt
idIndonesianBahasa Indonesia

Seed content is French-only ; other languages bootstrap empty and warm up via LLM as clients request items. Expect the first request on a fresh (format, lang) pair to take 1-3s longer due to LLM inference.

Formats

idWhat it is
jokeShort playful joke that defuses tension
haiku5-7-5 poem about the present moment
kudoUnconditional appreciation, addressed to the reader
quotePithy one-line quote with author
fortuneFortune-cookie wisdom
affirmationFirst-person, present-tense affirmation
absurdGentle absurdism that puts things in perspective
gratitudeConcrete reminder of what is already good
koanZen paradox that short-circuits the anxious mind
micro_poemUltra-short poetry with a strong image
mantraRhythmic, repeatable short phrase
doom_antidoteRecent, plausible positive fact about the world
absurd_complimentPlayful, off-kilter praise
world_proverbProverb from a world culture
riddleLight cognitive nudge, answer included
micro_challengePlayful task doable in under a minute
fictional_messageShort kind message from a fictional character
joyful_factNatural-history fact that brings a smile

Errors

StatusWhen
400Missing or unknown format / lang. Body lists accepted values.
402Payment required. Body carries the x402 challenge.
200Paid & served. X-PAYMENT-RESPONSE header carries the settlement.
5xxServer error. Retry possible β€” but do not re-sign blindly (you'll pay twice). Reuse the same X-PAYMENT header.

Security notes

item.text is generated content (LLM-authored). Treat it as untrusted user-generated content when rendering : escape HTML, strip markdown if your consumer doesn't support it, and never pipe it into shells, templates or eval() without sanitizing.

The server applies minimal cleanup (preamble stripping, invisible-character removal, length cap) but does not guarantee HTML-safety. Apply your own escaping at render time.

Pricing is announced in GET / response β€” always rely on it as the source of truth, not on hardcoded values, since the operator may adjust prices.