API ReferenceMedia
Upload media from URL
Upload media directly from a URL (useful for AI-generated images).
Authorization
bearerAuth AuthorizationBearer <token>
API keys start with cue_sk_ prefix. Get your key from the Cue dashboard.
Example: cue_sk_abc123def456ghi789jkl012mno345pqr678stu901vwx234
In: header
Request Body
application/json
url*string
URL to download the image from
Format
urifilename*string
Filename to use for the uploaded asset
Length
1 <= length <= 255Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.oncue.so/v1/media/upload-from-url" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/generated-image.png", "filename": "ai-generated-image.png" }'{
"data": {
"id": "med_x9k4m2n7pqhj",
"userId": "usr_x9k4m2n7pqhj",
"r2Key": "media/usr_x9k4m2n7pqhj/med_x9k4m2n7pqhj/original",
"originalFilename": "ai-generated-image.png",
"mimeType": "image/png",
"sizeBytes": 512000,
"transcodingStatus": "ready",
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:00:00Z"
}
}{
"error": "Failed to fetch image from URL"
}{
"error": "Unauthorized"
}{
"error": "Failed to upload image"
}