Upload A File To Hedra
hedra_upload_fileUpload an image, video, or audio file to Hedra to get a temporary presigned URL for use as media input in AI generation jobs. Accepts local file paths, HTTPS URLs, or base64-encoded data.
Instructions
Upload a file (image, video, or audio) to Hedra and get back a short-lived presigned URL to use as a media input in hedra_submit_job (e.g. a start_image, a reference image, a voice-cloning audio sample).
Free — works even with $0.00 in the API wallet; funding is only enforced at job submission. The returned url expires 1 hour after upload; if it lapses before you submit, upload again.
Provide EXACTLY ONE source:
file_path: a path readable on the machine running this MCP server.
source_url: an https URL Hedra should fetch and re-upload (a plain external URL is NOT accepted directly by model inputs — it must go through this upload step first).
base64_data + filename: raw bytes inline, for clients that can't provide a local path or URL.
Returns: JSON {url, content_type, expires_at}. Pass this straight into a model's input as {"source":"url","url":} for the appropriate field (per hedra_get_model_input_schema).
Examples:
Use when: about to run an image-to-video model and need to upload the start frame first
Use when: cloning a voice from an audio sample the person uploaded
Don't use when: reusing a previous Hedra generation's output as input — pass {"source":"asset","asset_id":...} directly to hedra_submit_job instead, no re-upload needed
Error Handling:
"Error: file not found at " if file_path doesn't exist on the server's filesystem.
"Error [MODERATION_FAILED]..." can occur later at submit time if the uploaded content is refused, not at upload time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Filename to use, required when base64_data is provided; optional otherwise. | |
| file_path | No | Path to a file readable on the MCP server's filesystem. | |
| source_url | No | An https URL to fetch and re-upload to Hedra. | |
| base64_data | No | Raw file bytes, base64-encoded. Requires filename. |