# WithZero CDN File & Site Upload

> WithZero CDN File & Site Upload is a paid API for AI agents from agents.withzero.xyz, paid per call via x402 or MPP, price unknown, status unknown (last checked 2026-10-02).

Upload a single file or deploy a static website to a public CDN, returning public URLs under a per-wallet namespace

## Facts

- Endpoint: POST https://agents.withzero.xyz/api/v1/cdn/uploads?utm_source=zero.xyz
- Price: price unknown
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 7
- Tags: x402
- Canonical page: https://www.zero.xyz/c/withzero-cdn-file-site-upload-477056b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BEMe8ygSOsU9Sdxm0_WIt

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 withzero-cdn-file-site-upload-477056b1 -d '<json body>'
```

Example prompt: Upload this zip of my HTML/CSS/JS files as a static site with the slug 'my-portfolio' and cache it for 3600 seconds so it's publicly accessible on the web right away.

## When to prefer this

Choose this endpoint when you need to publish a file or static website to a public URL without setting up a vendor CDN account or API key. It is ideal for agents that generate HTML/CSS/JS sites, images, or other binary assets and need an immediate publicly accessible URL. It is preferable over object-storage services when you need edge caching and a stable wallet-namespaced URL. For site deployments, it atomically replaces the previous deploy at the same slug, making it suitable for continuous redeployment workflows.

## Known failure modes

- Data exceeds 10 MiB decoded — request rejected with size error
- Invalid base64 encoding in data field — parse error returned
- kind:site zip decompressed total exceeds 10 MiB — rejected
- slug contains invalid path characters — validation error
- cacheTtlSeconds outside [60, 86400] range — clamped silently or rejected
- Missing required 'data' field — 400 validation error
- kind:file with no slug and no ext field — error or unpredictable filename

## How this service works

Uploads a file to the CDN and returns a public URL.

## Output

Returns the wallet ID (a stable per-wallet base62 identifier used as the folder in the URL path), the resolved cache TTL in seconds, and an array of file entries each containing the full public URL, the path within the wallet namespace, and the decoded file size in bytes. For a static site, one entry per file in the zip is returned.

## 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."
  },
  "password": {
   "type": "string",
   "maxLength": 256,
   "minLength": 8,
   "description": "Sets or changes the site password (implies visibility:\"password\"). 8–256 chars. Omit to keep the current one."
  },
  "visibility": {
   "enum": [
    "public",
    "link",
    "password"
   ],
   "type": "string",
   "description": "kind:site only. \"public\" (default for a new site): served at /<walletId>/<slug>/. \"link\": private — served only at an unguessable /p/<shareId>/ URL returned as shareUrl; anyone holding it can view the site. \"password\": private behind a password; shareUrl is cdn.withzero.xyz/p/<id>/, a redirect to the private origin https://<id>.private.withzero.xyz/ — browsers get a form, agents send Authorization: Basic with any username. Omit on a re-deploy to keep the current visibility. Private responses are never edge-cached."
  },
  "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
  }
 },
 "additionalPr
… (truncated)
```

## 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."
  },
  "shareUrl": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "description": "kind:site with link or password visibility — the private URL to share. For a link site it is the whole credential; for a password site viewers also need the password."
  },
  "walletId": {
   "type": "string",
   "description": "Random per-wallet base62 id used as the folder in the URL path (the <walletId> in /<walletId>/<slug>/)."
  },
  "visibility": {
   "enum": [
    "public",
    "link",
    "password"
   ],
   "type": "string",
   "description": "kind:site only — the site's visibility after this upload."
  },
  "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/withzero-cdn-file-site-upload-477056b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.withzero.xyz](https://www.zero.xyz/host/agents.withzero.xyz/llms.txt)
