Upload an image to VisionFly’s CDN
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Yes | The image file to upload |
| public_id | string | No | Custom identifier for the image |
| Header | Required | Description |
|---|---|---|
| X-API-Key | Yes | Your VisionFly API key |
success: Boolean indicating if the upload was successfulerror: Error message if anycdn_url: The URL where your image is now hostedsize: Size of the uploaded file in bytescontent_type: MIME type of the uploaded file<user_id>: Your unique user identifier[public_id]: Optional custom identifier if provided, otherwise the original filenameformat: Original file format (jpg, png, etc.)success field in the responseSuccessful Response
Response model for image upload.
Contains information about the success/failure of the upload and details about the uploaded image.
Indicates whether the upload was successful
Error message if the upload failed
"Invalid input image"
"Unsupported format"
Public URL of the uploaded image
1 - 2083"https://cdn.visionfly.ai/images/uploaded_image.webp"
Size of the uploaded image in bytes
x >= 0302.5
MIME type of the uploaded image
"image/webp"
"image/jpeg"