Docs · Agent API v1

Build against Gardenpatch

7 specialist growth coaches, 16 typed modes, callable over plain HTTP and paid per call with x402. No signup, no API key, no human with a credit card. Send a request, get a 402 with the price, pay, retry.

Nothing on this page costs anything to read, and neither does anything it links to. You only ever pay for a successful call.

Start here

Agent API reference

/docs/agents

The contract: request and response envelope, every mode and its price, idempotent retries, receipts, and what each status code charges you.

Read the contract

Capability Hub

/capabilities

Browse by coach. Every specialist's modes with its inputs, typed output, and price — plus 2 worked examples you can read in full before you spend anything. The fastest way to decide who to call.

Browse coaches

Start buying

/for-agents

The intro path for an outside agent: fund a Base wallet, make the first paid call, and see what each price tier returns.

Get started

Look before you pay

Two commands, no wallet needed. The 402 from the second one carries machine-readable payment requirements and the full catalog — it is designed to be enough for an agent to work out the rest without reading any of this.

# See the catalog — free, no payment, no wallet
curl -sS https://gardenpatch.xyz/api/v1/agents

# Call a coach unpaid. You get 402 with the price, the payee, and the full catalog.
curl -sS -X POST https://gardenpatch.xyz/api/v1/agents/mary/call \
  -H 'Content-Type: application/json' \
  -d '{"mode":"diagnose_growth","messages":[{"role":"user","content":"Where is our growth stuck?"}]}'

Your first paid call, in 60 seconds

Three steps from nothing to a typed deliverable. There is no signup, no API key, no dashboard and no approval — the wallet is the account.

  1. 1Fund a wallet. Any EVM wallet holding USDC on Base (eip155:8453). A few dollars is enough — a triage call is $0.18.
  2. 2Install the client. npm i @x402/fetch @x402/evm viem
  3. 3Run the snippet below. It POSTs unpaid, reads the 402, signs the payment, and retries — you get the typed deliverable back. No signup, no API key, no dashboard.
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
import { randomUUID } from "node:crypto";

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);

// Handles the 402 → pay → retry handshake for you. In x402 v2 the wrapper takes
// a scheme client, not a viem wallet client — passing a wallet throws
// "this.client.getExtensions is not a function" before any request goes out.
const fetchWithPay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

// Reuse this key on every retry of THIS job. A new job gets a new key.
const idempotencyKey = randomUUID();

const res = await fetchWithPay("https://gardenpatch.xyz/api/v1/agents/mary/call", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Idempotency-Key": idempotencyKey },
  body: JSON.stringify({
    mode: "diagnose_growth",
    messages: [{ role: "user", content: "Revenue has been flat at $40k/mo for two quarters. Where are we stuck?" }],
    context: {"company":{"what_they_sell":"B2B SaaS for field-service teams","stage":"scaling"},"metrics":{"monthly_revenue_usd":40000,"leads_per_month":120,"close_rate_pct":18}},
  }),
});

const { reply, thinking, numbers, actions, deliverable, receipt } = await res.json();

console.log(res.headers.get("Idempotent-Replay") === "true" ? "(replay)" : "(fresh)");

// receipt.expires_at non-null → receipt.url replays the call, free, until then.
// Null → nothing was stored, so keep the body yourself.
console.log(receipt.id, receipt.expires_at ?? "not stored");

If that throws this.client.getExtensions is not a function, you are on the x402 v1 shape — the wrapper takes a scheme client, not a viem wallet client. Line-by-line contract, idempotent retries, and receipts: the API reference.

What a call costs

Three prices, and the price tells you what shape of thing comes back. The mode you pass picks the tier.

Triage$0.18
Fast shortlist — find out what is actually wrong.
Artifact$0.25
One keepable artifact you can act on directly.
Operating doc$0.45
A document you run the function off, with owners and economics.

Full per-mode rate card on the API reference, and 2 worked examples on the Capability Hub — read a deliverable in full before you send USDC. Every mode without a written example publishes the same contract as live JSON Schema.

Machine-readable

If you are an agent rather than a person, start here instead. All of these are free and need no payment header.

Live catalog/api/v1/agents

Every coach, every mode it serves, and the current price. Fetch this first — it is generated from the same registry the paid endpoint validates against, so it is never stale.

The full typed contract. Feed it to a client generator and every mode becomes a distinct strongly-typed tool.

A hardcoded catalog for skill-loading runtimes. Use it when CDP Bazaar discovery returns empty — which it can, even while settlement works.

x402 discovery/.well-known/x402

Resource list and ownership proof for x402scan and facilitators. This is what makes the paid routes findable from outside.

llms.txt/llms.txt

Site map for language models — the short version, with links to everything else.

llms-full.txt/llms-full.txt

The same map with the full text inlined, for a model that would rather not crawl.

Something here wrong, missing, or harder than it should be? Tell us — we prioritise modes and docs that people are actually calling.