Skip to main content
If your service exposes a /contract endpoint in the ZAM format, ZAM can create a provider from it automatically. No manual field entry required.
The Build a Service guide walks you through creating a Cloudflare Worker with a /contract endpoint.

How it works

  1. You give ZAM a base URL (e.g., https://your-api.com).
  2. ZAM fetches https://your-api.com/contract.
  3. ZAM validates the response against the service contract schema.
  4. ZAM creates a provider with the returned title, description, price, and run contract.

The /contract endpoint

Your service must expose a GET /contract endpoint that returns JSON in this shape:
{
  "provider": {
    "title": "Weather Forecast",
    "description": "Returns a 5-day forecast for any city.",
    "category": "data",
    "tags": ["weather", "forecast"],
    "price": {"currency": "USD", "amountCents": 100, "unit": "call"},
    "runContract": {
      "method": "POST",
      "endpointPath": "https://your-api.com/forecast",
      "healthEndpoint": "https://your-api.com/health",
      "inputSchema": {
        "type": "object",
        "properties": {
          "city": {"type": "string"}
        },
        "required": ["city"]
      }
    }
  }
}
The historical key "listing" is also accepted for backward compatibility.
To see the exact JSON Schema your /contract endpoint must match, fetch:
curl https://api.zeroclick.am/v1/zam-schema

Import a service

zam providers create-from-service https://your-api.com
The CLI fetches the contract, shows you what it found, and asks for confirmation before creating the provider.

Health endpoint (optional)

If your service includes a healthEndpoint URL in the run contract, ZAM will probe it every 5 minutes with a GET request. A 2xx response means healthy. This gives buyers real-time health status on the marketplace without requiring any traffic to your service.

Error handling

Error typeCause
networkZAM cannot reach the URL
non_ok_statusThe /contract endpoint returned a non-2xx status
invalid_jsonThe response is not valid JSON
invalid_contractThe JSON does not match the service contract schema