VisionFly.ai API Documentation
Everything you need to deliver optimized images globally. Choose between our CDN for hosted images or Image API for on-the-fly transformations.
CDN API Overview
The VisionFly CDN is the recommended way to deliver images. Upload your images once, and serve them globally with on-the-fly transformations using simple URL parameters. No API key required for serving - just use the CDN URL.
Quick Start
1. Get your API key
Sign up at visionfly.ai/signup and generate your API key from the dashboard
2. Upload an image
POST your image to our upload endpoint with your API key
# Upload an image to VisionFly CDN curl -X POST "https://api.visionfly.ai/cdn/upload" \ -H "X-API-Key: YOUR_API_KEY" \ -F "file=@/path/to/image.jpg" \ -F "project=my-website" # Response: # { # "imageId": "img_abc123xyz", # "url": "https://img.visionfly.ai/img_abc123xyz", # "size": 245000, # "contentType": "image/jpeg" # }3. Serve with transformations
Use the returned URL with query parameters for on-the-fly optimization
# Serve an optimized image with transformations # No API key required - images are public via CDN # Basic usage - original image https://img.visionfly.ai/img_abc123xyz # Resize to 800px width, auto height https://img.visionfly.ai/img_abc123xyz?w=800 # Resize and convert to WebP with 85% quality https://img.visionfly.ai/img_abc123xyz?w=800&h=600&f=webp&q=85 # Apply blur and brightness adjustments https://img.visionfly.ai/img_abc123xyz?blur=10&bri=20
CDN API Reference
Base URL
https://api.visionfly.ai/cdn
CDN Delivery URL
https://img.visionfly.ai/{imageId}No API key required for serving images - they are publicly accessible via CDN
/uploadUpload an image to VisionFly CDN. Returns a unique image ID and CDN URL.
Request
Content-Type: multipart/form-data
fileImage file (JPEG, PNG, WebP, GIF, AVIF, SVG)
projectProject name to organize images (creates project if doesn't exist)
/imagesList all images in your CDN library with pagination support.
projectFilter by project slug
limitNumber of images (1-100, default: 50)
cursorPagination cursor (last imageId from previous response)
/imagesDelete one or more images from CDN.
imageIdsArray of image IDs to delete (max 50)
/usageGet storage, bandwidth, and project usage statistics.
Projects Management
Organize your images into projects for better management.
/projectsList all projects
/projectsCreate a new project
/projectsUpdate project name/description
/projectsDelete a project
URL Transformation Parameters
Add these parameters to any CDN URL to transform images on-the-fly. Example: https://img.visionfly.ai/img_abc?w=800&f=webp&q=85
wWidth in pixels (1-4200)
hHeight in pixels (1-4200)
fOutput format: JPEG, PNG, WEBP, GIF, AVIF, AUTO (default: AUTO)
qQuality (1-100, default: 80)
fitResize mode: FILL, CONTAIN, CROP (default: CONTAIN)
blurGaussian blur (0-100)
sharpSharpen strength (0-100)
briBrightness (-100 to 100)
conContrast (-100 to 100)
satSaturation (-100 to 100)
optSmart optimization (true/false)
Code Examples
# Upload an image to VisionFly CDN
curl -X POST "https://api.visionfly.ai/cdn/upload" \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@/path/to/image.jpg" \
-F "project=my-website"
# Response:
# {
# "imageId": "img_abc123xyz",
# "url": "https://img.visionfly.ai/img_abc123xyz",
# "size": 245000,
# "contentType": "image/jpeg"
# }