upload_media
Upload a local file or copy a remote URL to Pixio, returning a permanent public media URL for use with AI model media parameters.
Instructions
Upload a local file or mirror a remote URL to Pixio, returning a permanent public media URL.
Use this before generate whenever a model parameter needs media
(image_url, video_url, audio_url, ...): generate accepts
http(s) URLs only and rejects local filesystem paths. The returned
url (hosted on pixiomedia.nyc3.digitaloceanspaces.com) is permanent
and publicly readable, and is exactly what generate's media params
(e.g. image_url) expect — pass it through verbatim.
Args:
source: An http(s) URL (mirrored server-side into Pixio storage) or a
local file path (~ is expanded; uploaded as multipart).
Directories are rejected.
Returns:
{"url": str, "source_kind": "local_file" | "remote_url", "file_name": str, "size_bytes": int | None} — size_bytes is
None for remote URLs (the file never transits this machine).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||