Host a file
host_fileHosts a file: upload up to 10 MB as base64 with its content type and get back a public download URL that serves the bytes with that content type for 1 to 168 hours (default 24). Downloads are free, readable at once where uploaded and everywhere within about a minute. Executables are refused; HTML and SVG are served as attachments. A failed upload is not charged. Price: $0.01 per call in USDC (x402).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The file, base64 (standard or URL-safe alphabet). Up to 10485760 bytes decoded. | |
| filename | No | Suggested download name. Never used as the storage key. | |
| ttlHours | No | Hours the download URL keeps working, default 24. | |
| contentType | Yes | MIME type the file is served with, e.g. image/png or application/pdf. Executable types are refused; text/html and image/svg+xml are served as attachments. |