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
- You give ZAM a base URL (e.g.,
https://your-api.com).
- ZAM fetches
https://your-api.com/contract.
- ZAM validates the response against the service contract schema.
- 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.curl -X POST https://api.zeroclick.am/v1/providers \
-H "Content-Type: application/json" \
-H "x-zam-api-key: zam_your_key_here" \
-d '{
"title": "Weather Forecast",
"description": "Returns a 5-day forecast for any city.",
"category": "data",
"tags": ["weather", "forecast"],
"runContract": {
"method": "POST",
"endpointPath": "https://your-api.com/forecast",
"inputSchema": {
"type": "object",
"properties": {
"city": {"type": "string"}
},
"required": ["city"]
}
}
}'
You can also preview the contract first without saving:curl -X POST https://api.zeroclick.am/v1/listings/from-service/preview \
-H "Content-Type: application/json" \
-H "x-zam-api-key: zam_your_key_here" \
-d '{"serviceUrl": "https://your-api.com"}'
- Go to Dashboard > My Zams > Create New Zam.
- Select the Import from Service tab.
- Enter your service URL and click Preview.
- Review the auto-detected fields.
- Click Submit.
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 type | Cause |
|---|
network | ZAM cannot reach the URL |
non_ok_status | The /contract endpoint returned a non-2xx status |
invalid_json | The response is not valid JSON |
invalid_contract | The JSON does not match the service contract schema |