Upload image
upload_imageUpload images to PixelVault using a local file path, public URL, or base64 data to receive a CDN URL. The URL supports on-the-fly transforms for resizing, cropping, format conversion, and AI background removal.
Instructions
Upload an image to PixelVault and get an instant CDN URL. Prefer path — a LOCAL file path the server reads off disk and streams — so large files aren't base64-encoded into the model context. Alternatively pass source_url (a public https URL the API imports) or data (base64 bytes). Optional folder, filename, visibility (private → signed URL, needs a secret key), expires_in (auto-expiring image), sign_expires_in. Max 5 MB; JPG/PNG/GIF/WebP/AVIF/SVG. The returned CDN URL supports on-the-fly transforms via query params — e.g. ?w=400&fit=cover (resize/crop), ?fmt=webp (format), ?segment=foreground (AI background removal → transparent PNG), and effects like ?blur=30&saturation=0&rotate=90. Or call transform_image to build a valid transform URL for you. See https://pixelvault.dev/docs#transforms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Base64-encoded image bytes (data URLs accepted). Prefer `path` for local files. Provide exactly one of path, source_url, or data. | |
| path | No | Absolute or relative path to a LOCAL image file. The server reads the file off disk and streams the bytes — nothing is base64-encoded into the model context, so large files work. Provide exactly one of path, source_url, or data. | |
| folder | No | Optional folder/path prefix for the image. | |
| filename | No | Optional filename override, e.g. photo.png. | |
| expires_in | No | Optional time-to-live in seconds (60–2,592,000, i.e. 1 min to 30 days). The image is auto-deleted after this. Omit for a permanent image. | |
| source_url | No | Public https URL of an image; the PixelVault API fetches and imports it. Provide exactly one of path, source_url, or data. | |
| visibility | No | `private` returns a signed URL only link-holders can open. Defaults to public. | |
| sign_expires_in | No | For visibility=private: signed-URL lifetime in seconds (default 3600). |