# Zero-UI Spec Generator

> Zero-UI Spec Generator is a paid API for AI agents from zero-ui-service.andrew-228.workers.dev, paid per call via MPP, price unknown, status unknown (last checked 2026-10-28).

Generates a JSON UI spec composed from zeroclick-ui components based on a natural-language intent, suitable for live rendering.

## Facts

- Endpoint: POST https://zero-ui-service.andrew-228.workers.dev/v1/ui?utm_source=zero.xyz
- Price: price unknown
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Provider: zero-ui-service.andrew-228.workers.dev
- Website: https://zero-ui-service.andrew-228.workers.dev
- Canonical page: https://www.zero.xyz/c/zero-ui-service-andrew-228-workers-dev-zero-ui-spec-generator-d65cdda2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7twGHUk3y9JLsFqAmHWjw

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability zero-ui-service-andrew-228-workers-dev-zero-ui-spec-generator-d65cdda2 -d '<json body>'
```

Example prompt: Generate a zeroclick-ui JSON spec for an 'elicit-project-requirements' form — include fields for project name, description, deadline, and team size, and pass in context that this is for a software project scoping session.

## When to prefer this

Choose this endpoint when you need to programmatically generate a renderable UI component tree from a natural-language description using the zeroclick-ui component system. Ideal for AI agents that need to dynamically construct UI screens, forms, or wizards on the fly without hand-coding component structures. Best when the consuming system already supports zeroclick-ui rendering.

## Known failure modes

- Missing required 'intent' field returns a validation error
- Intent string of length 0 is rejected by minLength constraint
- Malformed context object may cause unexpected output or error
- Unrecognized component types in intent may result in generic fallback UI
- Service unavailable returns a non-200 response from the Cloudflare Worker

## How this service works

Returns a JSON spec composed from zeroclick-ui components, suitable for live rendering. Free service — no payment required.

## Output

A JSON object with a 'root' property describing the component tree (component name, props, children, text), plus optional 'notes', 'imports', and 'tokens.needs' arrays that indicate what UI tokens or imports are required for live rendering.

## Example request

```json
{
 "format": "json",
 "intent": "create-user-onboarding-flow",
 "context": {
  "appName": "Analytics Dashboard",
  "userRole": "analyst",
  "onboardingSteps": [
   "profile-setup",
   "data-source-connection",
   "dashboard-customization"
  ]
 },
 "history": []
}
```

## Request schema (JSON Schema)

```json
{
 "definitions": {
  "GenerateRequest": {
   "type": "object",
   "required": [
    "intent"
   ],
   "properties": {
    "format": {
     "enum": [
      "json"
     ],
     "type": "string",
     "default": "json"
    },
    "intent": {
     "type": "string",
     "minLength": 1,
     "description": "Short identifier for the requested UI shape, e.g. 'elicit-project-requirements' or a free-form natural-language request."
    },
    "context": {
     "type": "object",
     "description": "Arbitrary content/data the UI should incorporate (text, image URLs, prior selections, etc).",
     "additionalProperties": {}
    },
    "history": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "type"
      ],
      "properties": {
       "type": {
        "type": "string"
       },
       "payload": {
        "type": "object",
        "additionalProperties": {}
       }
      },
      "additionalProperties": false
     },
     "description": "Prior user actions in this session, oldest first."
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "definitions": {
  "UISpec": {
   "type": "object",
   "required": [
    "root"
   ],
   "properties": {
    "root": {
     "type": "object",
     "required": [
      "component"
     ],
     "properties": {
      "text": {
       "type": "string"
      },
      "props": {
       "type": "object",
       "additionalProperties": {}
      },
      "children": {
       "type": "array",
       "items": {
        "$ref": "#/definitions/UISpec/properties/root"
       }
      },
      "component": {
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "notes": {
     "type": "string"
    },
    "tokens": {
     "type": "object",
     "properties": {
      "needs": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "default": []
      }
     },
     "additionalProperties": false
    },
    "imports": {
     "type": "array",
     "items": {
      "type": "string"
     },
     "default": []
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/zero-ui-service-andrew-228-workers-dev-zero-ui-spec-generator-d65cdda2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from zero-ui-service.andrew-228.workers.dev](https://www.zero.xyz/host/zero-ui-service.andrew-228.workers.dev/llms.txt)
