# cdn.withzero.xyz Static Site & File CDN Upload

> cdn.withzero.xyz Static Site & File CDN Upload is a free API for AI agents from cdn.withzero.xyz, callable via MPP, free · handshake required, status healthy (last checked 2026-09-15, last successful call 2026-09-16).

Uploads a base64-encoded zip (static site) or individual file to a public CDN, serving it instantly at a wallet-scoped URL

## Facts

- Endpoint: POST https://cdn.withzero.xyz/api/v1/uploads
- Price: free · handshake required
- Payment: MPP
- Status: healthy
- Last checked: 2026-09-15
- Last successful call: 2026-09-16
- Success rate: 94% of calls made through Zero
- Rating: 5.0 / 5 from 42 reviews
- Activations on Zero: 2825
- Provider: cdn.withzero.xyz
- Website: https://cdn.withzero.xyz
- Canonical page: https://www.zero.xyz/c/cdn-withzero-xyz-static-site-file-cdn-upload-a0d9f22f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9D_skXut99eNMD3iTGhoA

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 cdn-withzero-xyz-static-site-file-cdn-upload-a0d9f22f -d '<json body>'
```

Example prompt: Upload my base64-encoded zip as a static site (kind:site) to the CDN with the slug 'my-portfolio', cache it for 3600 seconds, and give me the public URL where it will be served.

## When to prefer this

Use this endpoint when you need to instantly publish a static website or individual file asset to a public CDN URL without any infrastructure setup. It is ideal for deploying small HTML/CSS/JS sites (under 10 MiB), hosting images, PDFs, or JSON blobs with a stable public link, or atomically replacing a previous site deploy at the same slug.

## Known failure modes

- Data exceeds 10 MiB after base64 decode — server rejects upload
- Invalid base64 encoding in data field — parse error
- Missing required 'data' field — 400 validation error
- Slug too long (over 512 chars) — validation error
- ext field missing for kind:file with no slug — validation error
- cacheTtlSeconds below minimum of 60 or zero — clamped or rejected

## How this service works

Host a static website on a fast public CDN — upload a zip of your site (kind:site) and it is served instantly at /<walletId>/<slug>/. Also doubles as a one-off file host (kind:file) for individual assets like images, PDFs, or JSON.

## Output

Returns a walletId, the resolved cacheTtlSeconds, and an array of uploaded file objects each containing the public CDN URL, the path within the wallet namespace, and the decoded file size in bytes. For a site upload, one entry per file in the zip is returned.

## Example request

```json
{
 "ext": "png",
 "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
 "kind": "file",
 "slug": "test-image.png",
 "cacheTtlSeconds": 3600
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "data"
 ],
 "properties": {
  "ext": {
   "type": "string",
   "maxLength": 8,
   "minLength": 1,
   "description": "Required only for kind:file with no slug; ignored otherwise."
  },
  "data": {
   "type": "string",
   "minLength": 1,
   "description": "Base64-encoded bytes. For kind:site, a zip of your static website (HTML/CSS/JS). For kind:file, the raw file bytes. Max 10 MiB after decode (same cap for kind:site decompressed total)."
  },
  "kind": {
   "enum": [
    "file",
    "site"
   ],
   "type": "string",
   "description": "\"site\" hosts a static website: data is a zip atomically deployed to your wallet folder under the slug prefix and served at /<walletId>/<slug>/ — replaces any previous deploy at that prefix. \"file\" (default) uploads a single asset under your wallet folder."
  },
  "slug": {
   "type": "string",
   "maxLength": 512,
   "minLength": 1,
   "description": "Custom path within your wallet folder. kind:site — the folder prefix the site is deployed under (e.g. \"my-site\" → served at /<walletId>/my-site/). kind:file — full filename including extension (e.g. \"logo.png\"). Re-uploads to the same slug overwrite; site re-deploys delete orphans from the previous deploy."
  },
  "cacheTtlSeconds": {
   "type": "integer",
   "maximum": 9007199254740991,
   "description": "Edge cache lifetime (Cache-Control max-age) in seconds, applied to every object in this upload. Default 3600, clamped to [60, 86400]. Does not affect how long files are stored.",
   "exclusiveMinimum": 0
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "walletId",
  "cacheTtlSeconds",
  "files"
 ],
 "properties": {
  "files": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "url",
     "path",
     "sizeBytes"
    ],
    "properties": {
     "url": {
      "type": "string",
      "description": "Public URL this file is served from."
     },
     "path": {
      "type": "string",
      "description": "Path within your wallet namespace (the part after <walletId>/)."
     },
     "sizeBytes": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": -9007199254740991,
      "description": "Decoded file size in bytes."
     }
    },
    "additionalProperties": false
   },
   "description": "One entry per uploaded file. kind:file — a single entry. kind:site — one entry per file in the zip; the hosted site's entry point is /<walletId>/<slug>/, which serves <slug>/index.html."
  },
  "walletId": {
   "type": "string",
   "description": "Random per-wallet base62 id used as the folder in the URL path (the <walletId> in /<walletId>/<slug>/)."
  },
  "cacheTtlSeconds": {
   "type": "integer",
   "maximum": 9007199254740991,
   "minimum": -9007199254740991,
   "description": "Resolved edge cache lifetime (Cache-Control max-age) applied to every uploaded object."
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cdn-withzero-xyz-static-site-file-cdn-upload-a0d9f22f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cdn.withzero.xyz](https://www.zero.xyz/host/cdn.withzero.xyz/llms.txt)
