Upload Files
Upload local files to Atlas Cloud for image-to-video, image editing, and other workflows
Overview
Many AI generation workflows require input files — for example, animating a static image into video, applying style transfer, or editing an existing image. The Upload Media endpoint lets you upload local files to Atlas Cloud and receive a temporary URL that you can pass to generation endpoints.
API Endpoint
POST https://api.atlascloud.ai/api/v1/model/uploadMediaAuthentication
Include your API key in the Authorization header:
Authorization: Bearer your-api-keyRequest
Send the file as a multipart/form-data request with the file in the file field.
Response
Returns a JSON object with a temporary URL for the uploaded file.
Code Examples
Python
import requests
response = requests.post(
"https://api.atlascloud.ai/api/v1/model/uploadMedia",
headers={"Authorization": "Bearer your-api-key"},
files={"file": open("photo.jpg", "rb")}
)
data = response.json()
file_url = data.get("url")
print(f"Uploaded file URL: {file_url}")Node.js
import fs from "fs";
const formData = new FormData();
formData.append("file", new Blob([fs.readFileSync("photo.jpg")]));
const response = await fetch(
"https://api.atlascloud.ai/api/v1/model/uploadMedia",
{
method: "POST",
headers: { Authorization: "Bearer your-api-key" },
body: formData,
}
);
const { url } = await response.json();
console.log(`Uploaded file URL: ${url}`);cURL
curl -X POST https://api.atlascloud.ai/api/v1/model/uploadMedia \
-H "Authorization: Bearer your-api-key" \
-F "[email protected]"Common Workflows
Image-to-Video
Upload a source image, then pass its URL to a video generation model:
import requests
# Step 1: Upload image
upload_resp = requests.post(
"https://api.atlascloud.ai/api/v1/model/uploadMedia",
headers={"Authorization": "Bearer your-api-key"},
files={"file": open("my_image.jpg", "rb")}
)
image_url = upload_resp.json().get("url")
# Step 2: Generate video from uploaded image
video_resp = requests.post(
"https://api.atlascloud.ai/api/v1/model/generateVideo",
headers={
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json"
},
json={
"model": "kling-v2.0",
"prompt": "The person slowly turns and smiles",
"image_url": image_url
}
)
prediction_id = video_resp.json().get("predictionId")
print(f"Video generation started: {prediction_id}")Image-to-Image (Style Transfer, Enhancement)
import requests
# Step 1: Upload source image
upload_resp = requests.post(
"https://api.atlascloud.ai/api/v1/model/uploadMedia",
headers={"Authorization": "Bearer your-api-key"},
files={"file": open("source.jpg", "rb")}
)
image_url = upload_resp.json().get("url")
# Step 2: Apply transformation
result = requests.post(
"https://api.atlascloud.ai/api/v1/model/generateImage",
headers={
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json"
},
json={
"model": "your-image-to-image-model",
"image_url": image_url,
"prompt": "Transform into oil painting style"
}
)Important Notes
- Temporary URLs: Uploaded files are for temporary use with Atlas Cloud generation tasks only. Files may be cleaned up periodically.
- Supported formats: Common image formats (JPEG, PNG, WebP) and video formats are supported. Check the specific model's documentation for format requirements.
- File size: There may be limits on upload file size depending on the model. Refer to the model's detail page for specific limitations.
- Use promptly: Use uploaded file URLs within the same session. Do not rely on them for long-term storage.
Next Steps
- Predictions — Track async generation task status and results
- Image Generation — Explore image generation models
- Video Generation — Explore video generation models
- API Reference — Full API specification