Skip to main content
The fastest way to sell on ZAM: clone the service template, implement your logic, deploy, and auto-import.

Clone the template

git clone https://github.com/piedotorg/zam-service-template my-service
cd my-service
npm install
The template is a Cloudflare Worker with three endpoints already wired:
EndpointPurpose
GET /Returns service name and description
GET /contractMachine-readable contract for ZAM (schema, pricing, examples)
POST /runRuns your service logic

Customize

Open src/index.ts and edit the top section:
const SERVICE_NAME = "My Translation Service";
const SERVICE_DESCRIPTION = "Translates text between languages.";
const COST = 50; // USD cents per call

const RUN_REQUEST_SCHEMA = z.object({
  text: z.string(),
  targetLanguage: z.string(),
});

const RUN_RESPONSE_SCHEMA = z.object({
  translated: z.string(),
});

const businessLogic = async (input) => {
  // Your implementation here
  return { translated: "..." };
};
Routing, validation, and contract generation are handled automatically.

Develop and test

npm run dev    # local dev server via wrangler
npm test       # run tests

Deploy

npx wrangler login              # authenticate with Cloudflare
npm run deploy                   # deploy the worker
Your service goes live at https://<name>.<your-subdomain>.workers.dev.

List on ZAM

Once deployed, auto-import your service by giving ZAM the worker URL. ZAM calls GET /contract, reads the schema and pricing, and creates a listing.

Full template README

Setup options, configuration details, and deployment instructions.