# OpenSCAD Print Validation

> OpenSCAD Print Validation is a paid API for AI agents from api.williamrobinson.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-12).

Validates an OpenSCAD design for FDM 3D printability by compiling it, checking mesh integrity, slicing it, and returning detailed check results with artifacts.

## Facts

- Endpoint: POST https://api.williamrobinson.dev/v1/print/validate?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openscad-print-validation-b2ec00f5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gBWWxIUnB60rucTggc2J5

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 openscad-print-validation-b2ec00f5 -d '<json body>'
```

Example prompt: Can you validate this OpenSCAD source code for FDM PLA printing on a 220×220×250mm bed and tell me if the mesh is watertight, fits the build volume, and slices cleanly? Here's the code: `cube([60,40,20]);`

## When to prefer this

Choose this endpoint when you have raw OpenSCAD source code and need an end-to-end printability verdict — covering compilation, mesh integrity, bed-fit, and slicing — before committing to physical printing. It is uniquely suited to parametric OpenSCAD workflows where you want to inject parameter overrides and confirm the resulting geometry is valid. Prefer it over generic STL validators when you need the full pipeline from source to G-code confirmed, or when you need PrusaSlicer-backed slice verification rather than mesh checks alone.

## Known failure modes

- OpenSCAD compilation error if source contains syntax errors or external imports (CAD_COMPILE check fails)
- Non-manifold or non-watertight mesh returns MESH_WATERTIGHT failed status
- Model exceeds requested maxSizeMm or printer bed dimensions (REQUESTED_MAX_SIZE or PRINTER_BED check fails)
- Slicer produces no extrusion toolpath for degenerate geometry (EXTRUSION_TOOLPATH check fails)
- Payment not attached returns HTTP 402 with payment-required header
- Source exceeds 16 KiB limit returns validation error
- Parameter override names conflict with reserved names or non-scalar expressions

## How this service works

Web Evidence ($0.01/call), OpenSCAD Print Validation ($0.05/call), Spreadsheet Modification & Audit ($0.05/call), Packing & Shipping Engineer ($0.05/call), Game-Asset Technical Artist ($0.10/call), PCB Fabrication Engineer ($0.25/call), Software Failure Reduction Lab ($0.50/call), Laboratory-Protocol Compiler ($0.15/call), Video Finishing & Localization ($0.50/call), Print Prototype Engineer ($0.15/call), Garment-Pattern Engineer ($0.10/call), Product-Label Artwork Compiler ($0.15/call) and Notarized Website Capture ($10.00/call), settled in USDC on Base mainnet over HTTP 402. No API keys, no accounts.

Price: $0.01 (10000 atomic USDC per call), settled over HTTP 402 (x402, scheme "exact", EIP-3009).

How to pay: an unpaid POST answers 402 with a base64 `payment-required` header describing an exact transfer of 10000 atomic USDC on eip155:8453 (asset 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913) to 0x26026370fe8b2bb17af9092a17691c76519366da. Sign the EIP-3009 authorization, attach it in the `payment-signature` header, and retry the identical request. Invalid requests are never charged.

- Settlement: eip155:8453 / 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 / 0x26026370fe8b2bb17af9092a17691c76519366da

## Output

Returns a JSON object with overall pass/fail status, per-check results (compilation, mesh watertightness, triangle count, volume, size-against-bed, slicer G-code validity, preview render), model bounds and volume in mm, tool versions used, any warnings, and signed artifact URLs for the compiled STL, G-code, and preview PNG.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "source": {
   "type": "string",
   "maxLength": 16384,
   "minLength": 1,
   "description": "Self-contained OpenSCAD, interpreted in millimetres; maximum 16 KiB UTF-8 before and after overrides. External imports are prohibited."
  },
  "profile": {
   "enum": [
    "fdm-pla-0.4",
    "fdm-petg-0.4"
   ],
   "type": "string",
   "default": "fdm-pla-0.4"
  },
  "maxSizeMm": {
   "type": "array",
   "items": {
    "type": "number",
    "maximum": 1000,
    "exclusiveMinimum": 0
   },
   "default": [
    220,
    220,
    250
   ],
   "maxItems": 3,
   "minItems": 3
  },
  "parameters": {
   "type": "object",
   "default": {},
   "description": "Overrides must name unique top-level scalar literal assignments, not derived expressions or reserved names.",
   "maxProperties": 64,
   "propertyNames": {
    "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
   },
   "additionalProperties": {
    "anyOf": [
     {
      "type": "string",
      "maxLength": 512,
      "description": "Maximum 512 UTF-8 bytes."
     },
     {
      "type": "number",
      "maximum": 1000000,
      "minimum": -1000000
     },
     {
      "type": "boolean"
     }
    ]
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": {
   "boundsMm": {
    "max": [
     60,
     40,
     20
    ],
    "min": [
     0,
     0,
     0
    ],
    "size": [
     60,
     40,
     20
    ]
   },
   "volumeMm3": 14670.08559709728,
   "watertight": true,
   "triangleCount": 1024
  },
  "tools": {
   "slicer": "PrusaSlicer-2.5.0+UNKNOWN based on Slic3r (with GUI support)",
   "openscad": "OpenSCAD version 2021.01"
  },
  "checks": [
   {
    "code": "SOURCE_SELF_CONTAINED",
    "detail": "No external file-reading OpenSCAD constructs were found",
    "status": "passed"
   },
   {
    "code": "PARAMETERS_APPLIED",
    "detail": "2 named source parameters were patched",
    "status": "passed"
   },
   {
    "code": "CAD_COMPILE",
    "detail": "OpenSCAD rendered a binary STL",
    "status": "passed"
   },
   {
    "code": "MESH_VALIDITY",
    "detail": "Binary STL has finite vertices and a closed manifold surface",
    "status": "passed"
   },
   {
    "code": "MESH_TRIANGLES",
    "detail": "1024 triangles inspected",
    "status": "passed"
   },
   {
    "code": "MESH_FINITE_VERTICES",
    "detail": "All STL vertex coordinates are finite",
    "status": "passed"
   },
   {
    "code": "MESH_WATERTIGHT",
    "detail": "Every undirected triangle edge appears exactly twice",
    "status": "passed"
   },
   {
    "code": "MESH_ENCLOSED_VOLUME",
    "detail": "14670.086 mm³ enclosed volume",
    "status": "passed"
   },
   {
    "code": "REQUESTED_MAX_SIZE",
    "detail": "60.000 × 40.000 × 20.000 mm against requested 220 × 220 × 250 mm",
    "status": "passed"
   },
   {
    "code": "PRINTER_BED",
    "detail": "60.000 × 40.000 × 20.000 mm against 220 × 220 × 250 mm printer bed",
    "status": "passed"
   },
   {
    "code": "SLICER",
    "detail": "PrusaSlicer produced bounded G-code with the fixed profile",
    "status": "passed"
   },
   {
    "code": "EXTRUSION_TOOLPATH",
    "detail": "G-code contains at least one extrusion move",
    "status": "passed"
   },
   {
    "code": "PREVIEW",
    "detail": "Headless OpenSCAD rendered preview.png",
    "status": "passed"
   }
  ],
  "status": "passed",
  "profile": "fdm-pla-0.4",
  "warnings": [],
  "artifacts": [
   {
    "href": "https://print.api.williamrobinson.dev/v1/print/artifacts/0123456789abcdef0123456789abcdef0123456789abcdef/model.scad",
    "name": "model.scad",
    "sha256": "3176712575449a647e09f74ed99074c084688ffc82e9f53a6cfff368d3bfd0c2",
    "mediaType": "text/plain; charset=utf-8",
    "si
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openscad-print-validation-b2ec00f5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.williamrobinson.dev](https://www.zero.xyz/host/api.williamrobinson.dev/llms.txt)
