Request
Your API key in the format: Bearer imperial_live_xxxxxxxxxxxxx
Query Parameters
Page number for pagination
Number of items per page (max: 100)
Filter by status: active, trash, or all
Filter by folder. For active status, leaving this empty shows Root by default.
Search across your whole library (filename/original filename, plus tag exact match)
Date filter start (YYYY-MM-DD, UTC)
Date filter end (YYYY-MM-DD, UTC)
MIME prefix filter (e.g. image/, video/, application/) or other
Minimum file size in bytes
Maximum file size in bytes
Filter favorites (true or false)
Include tags (comma-separated). Must include all tags.
Exclude tags (comma-separated)
Back-compat: tag=foo is still supported and behaves like tags=foo.
Response
Array of media objects (images and videos)
Pagination information Show pagination properties
Example Requests
curl -X GET "https://api.imperial.gay/images?page=1&limit=20" \
-H "Authorization: Bearer imperial_live_xxxxxxxxxxxxx"
Example Response
{
"images" : [
{
"_id" : "67d8f9a1b2c3d4e5f6789012" ,
"url" : "https://origin.imperial.gay/uploads/user-id/67d8f9a1b2c3d4e5f6789012-cat.jpg" ,
"thumbnailUrl" : null ,
"mimeType" : "image/jpeg" ,
"prompt" : "cat.jpg" ,
"modelName" : "240.1KB" ,
"size" : {
"width" : 0 ,
"height" : 0
},
"createdAt" : "2026-01-07T12:34:56.789Z" ,
"type" : "upload"
},
{
"_id" : "67d8f9a1b2c3d4e5f6789013" ,
"url" : "https://origin.imperial.gay/uploads/user-id/67d8f9a1b2c3d4e5f6789013-video.mp4" ,
"thumbnailUrl" : "https://origin.imperial.gay/uploads/user-id/thumbs/67d8f9a1b2c3d4e5f6789013-thumb.jpg" ,
"mimeType" : "video/mp4" ,
"prompt" : "video.mp4" ,
"modelName" : "5.0MB" ,
"size" : {
"width" : 0 ,
"height" : 0
},
"createdAt" : "2026-01-07T12:35:00.123Z" ,
"type" : "upload"
}
],
"pagination" : {
"page" : 1 ,
"limit" : 20 ,
"total" : 245 ,
"totalPages" : 13
}
}
Unique identifier for the media
Direct CDN URL to the media file
Thumbnail URL (for videos only, null for images)
MIME type (e.g., image/jpeg, video/mp4)
File size displayed in human-readable format
ISO 8601 timestamp of upload
Always "upload" for user uploads
The API returns up to 50 items per page by default. Use the page and limit parameters to navigate through your media:
# Get page 2 with 100 items per page
curl -X GET "https://api.imperial.gay/images?page=2&limit=100" \
-H "Authorization: Bearer imperial_live_xxxxxxxxxxxxx"
Filtering
Currently, the API returns all media sorted by upload date (newest first). Additional filtering options will be added in future updates.
Error Responses
Unauthorized
{
"error" : "Unauthorized" ,
"statusCode" : 401
}
Invalid Parameters
{
"error" : "Invalid page or limit parameter" ,
"statusCode" : 400
}
Use this endpoint to build custom galleries or dashboards for your media library.