For AI agents
Patchwork, run by your agent
Your agent signs up, installs the snippet, writes variants (or asks Patchwork to), launches tests and ships winners. Patchwork serves the variants, counts the conversions and stores the data. You get an email to claim the workspace whenever you want to look at the dashboard.
MCP
Add the server to your agent. Call signup first, then reconnect with the key it returns as Authorization: Bearer pw_live_….
{
"mcpServers": {
"patchwork": {
"type": "http",
"url": "https://patchwork.run/mcp"
}
}
}REST
The same operations over HTTP. Full schema at /openapi.json, and a plain-text summary for models at /llms.txt.
curl -X POST https://patchwork.run/api/v1/signup \
-H 'content-type: application/json' \
-d '{"email":"you@acme.com","website":"acme.com"}'Paying
One plan, $100 per 30 days, with a 14-day free trial. Agents can pay with the Machine Payments Protocol (card or stablecoin), with stripe pay from the Stripe CLI, or hand a person a Stripe Checkout link. GET /api/v1/billing lists the options that are on.
Endpoints
POST /api/v1/signupno key
Create a workspace for a website. Returns an API key (shown once) and the snippet. The owner is emailed a claim link.
GET /api/v1/me
Workspace, role, billing state, limits and usage.
POST /api/v1/claim
Email the owner a fresh link to claim the workspace in the dashboard.
GET /api/v1/sites
List sites, each with its snippet and install state.
POST /api/v1/sites
Add a site.
GET /api/v1/sites/{site_id}
Get a site.
POST /api/v1/sites/{site_id}/install-check
Fetch the site and report whether the snippet is installed correctly, with fixes.
GET /api/v1/sites/{site_id}/experiments
List a site's experiments.
POST /api/v1/sites/{site_id}/experiments
Start a draft experiment on one section of a page, chosen by CSS selector (must match exactly one element).
GET /api/v1/experiments/{experiment_id}
Status, variants, goal and the original section HTML.
POST /api/v1/experiments/{experiment_id}/variants
Add up to 5 variants you wrote: HTML that replaces the section, plus optional CSS. Sanitized, then approved.
POST /api/v1/experiments/{experiment_id}/generate
Have Patchwork's AI write variants (about a minute). They arrive as pending_review.
POST /api/v1/experiments/{experiment_id}/variants/{variant_id}/approve
Approve a variant for testing.
POST /api/v1/experiments/{experiment_id}/variants/{variant_id}/reject
Reject a variant.
PUT /api/v1/experiments/{experiment_id}/goal
Set the conversion goal.
POST /api/v1/experiments/{experiment_id}/launch
Start serving variants. Needs an approved variant, a goal and an active trial or payment.
POST /api/v1/experiments/{experiment_id}/pause
Stop serving variants.
POST /api/v1/experiments/{experiment_id}/resume
Serve variants again.
POST /api/v1/experiments/{experiment_id}/conclude
End the test.
POST /api/v1/experiments/{experiment_id}/ship
Serve one variant to everyone.
GET /api/v1/experiments/{experiment_id}/results
Visitors, conversions and win probabilities per variant, with a recommendation.
GET /api/v1/keys
List active API keys (owners).
POST /api/v1/keys
Create an API key; returned once (owners).
DELETE /api/v1/keys/{key_id}
Revoke a key (owners).
GET /api/v1/billing
Trial or paid status and every way to pay that is switched on.
POST /api/v1/billing/checkout
A Stripe Checkout link for a person to subscribe with a card.
POST /api/v1/billing/stripe-pay
Redeem a `stripe pay @handle 100 usd` transfer. $100 buys 30 days, pro rata.
POST /api/v1/workspaces/{workspace_id}/payno key
Machine Payments Protocol: answers 402 with a challenge; pay it with an MPP client to buy 30 days for $100. No API key.