1 App credit allow you to make 1 operation, like processing an image via our API. So, for example, if you have a complex request where you want to:
SnapiX, accordingly its API, is based on the High performance Node.js image processing library Sharp. The output formats are limited to PNG, JPEG, WEBP and AVIF. The compression level for the different formats is predefined by the application and cannot be changed. Currently via the API we support all resize images.
Unlike the Web interface we do not support generating (convert to) .ico files via the API. This is because the this operation is really rare used. We may support it in the future in case there is enough demand.
You must provide an active API key, have sufficient App credits to perform the operation, and enough storage space to upload the image.
API_KEY="sk_snapix_apiKey-a1b2c3-placeholder"
* Copy some of your API Keys and it will be available here.
API keys use a granular permissions model. Each key holds an array of permissions that control which endpoints it can access. The default when creating a key is ["images-read", "galleries-read"] (read-only access).
You can configure permissions when creating a key on the API Keys page, and update them at any time.
Images permissions:
| Permission | Description |
|---|---|
images-read |
List and retrieve images |
images-create |
Upload new images |
images-update |
Update image metadata |
images-delete |
Delete images |
images-generate |
Generate images with AI |
images-convert-fly |
Convert images on the fly |
Galleries permissions:
| Permission | Description |
|---|---|
galleries-read |
List and retrieve galleries and ungrouped images |
galleries-create |
Create new galleries |
galleries-update |
Update gallery name or visibility |
galleries-delete |
Delete a gallery (keeps images) |
galleries-delete-with-images |
Delete a gallery and all its images |
Examples:
["images-read", "galleries-read"]["images-create"]Any request that requires a permission not present in the key returns 403 Forbidden.
Uploads an image (provided as form data file/URL field) to the object storage, performs initial processing based on provided options, and returns a JSON response. The image could be provided as binary data or as a URL.
The response includes details about the uploaded image, any generated variants, the base URL for accessing these variants, and their corresponding object keys (filenames). The actual URL of an image variant is ${urlBase}/${objectKey} and it can be extracted from the JSON response.
Upload the image and convert it to the default output format AVIF, keep the original aspect ratio and resolution. Optionally in the examples is used the command jq to pretty format the JSON response.
curl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/png" \
-F "name=test-1.png" \
-F "description=Test image description" \
-F "image=@./test-1.png" | jq
image field to upload the image as a binary file.contentType field, otherwise the process may fail in unpredictable ways. If you do not specify "contentType=" we will try to parse it with fallback to application/octet-stream.@ symbol tells curl to read the file from the given path (absolute or relative).contentType set is not mandatory, we will try to parse the content type from the file. But if we can't, the API will throw an error.name set is not mandatory, we will try to parse the name from the file. But if we can't, the API will throw an error. The max length is 256 characters. In the response the name is the property named originalName.description set is not mandatory. The max length is 4096 characters.You can provide an array of gallery Id(s) in the galleries field, thus the image will be added to the specified galleries.
curl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/png" \
-F "name=test-1.png" \
-F 'galleries=["7618c305...", "bedee85f..."]' \
-F "image=@./test-1.png" | jq
galleries field must be a valid JSON array of strings, which matches actual Ids of the galleries you want to add the image to.Get image from URL and convert it to the default output format AVIF, keep the original aspect ratio and resolution.
curl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "url=https://images.snapix.space/abc-123/def-456.png" | jq
url field to upload the image from a URL. All other fields are optional, but available for use.image field take precedence over the url field, you you must use only one of them.In this example we upload the image and convert it to multiple output resolutions. By passing an array of options objects to the resizeOptions field, we can specify multiple output resolutions. By passing an array of output formats to the formats field, we can specify multiple output formats.
curl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/webp" \
-F "image=@./test-1.webp" \
-F "name=test-1.webp" \
-F "description=Test image description" \
-F "ratio=1.777" \
-F 'formatOptions=[{"format": "webp"}, {"format": "avif"}]' \
-F 'resizeOptions=[{}, {"width": 720}, {"height": 580}]' | jq
This request will consume 6 App credits (2 for formatOptions * 3 for resizeOptions).
The ratio field must be a valid number. For example 16:9 ratio is 1.777, 4:3 ratio is 1.333. If not provided, the original one will be kept with the other operations (i.e. resize).
The resizeOptions field must be a valid JSON array. If an empty object is passed in the array, the image will be processed using the default options, retaining its original resolution, etc.
"padding": { "px": number, "py": number }: Add padding to the image.The formatOptions field must be a valid JSON array of objects like:
[
{
"format": "jpeg", // "jpeg" | "png" | "webp" | "avif",
"options": {
"background": "#FF0000", // Hex color
"quality": 70, // 80 is default, recommended range: 60-85
"mozjpeg": true, // Use mozjpeg encoder for JPEG images
"chromaSubsampling": "4:2:0", // Most efficient color sampling
"progressive": true, // Use progressive JPEG
"force": true // Force output format
// More options...
}
}
]
If you skip the formatOptions field or pass an empty array, the image will be processed using the default options, and will be output in the default output format for the API, which is webp.
The format property is required and, the valid output formats for our API are: ["png", "jpeg", "webp", "avif"]
The options object is optional. If you skip the options, the image will be processed using the default options.
Refer to the Sharp documentation for valid values per format:
png, jpeg, webp and avif
In addition to these properties, you can provide a background value as a hex color. This is useful when converting transparent images to a solid background (e.g., converting to jpeg). The default background color is #FFFFFF.
You can pass background also to the resizeOptions field, it will be used as background of the unfilled areas when when you resize with contain and other similar cases.
curl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/webp" \
-F "image=@./test-1.webp" \
-F "name=test-1.webp" \
-F "ratio=1.777" \
-F 'formatOptions=[{"format": "webp", "options": {"background": "#FF0"}}]' \
-F 'resizeOptions=[{"width": 720}, {"height": 580}]' | jq
Despite of the formatOptions provided the thumbnails (for the frontend) will be output with options like:
{
format: webp,
options: { quality: 30 }
}
${urlBase}/${objectKey}.{
"data": [
{
"id": "b27c40a1-1b80-4cd7-8a5a-43a7be53806c",
"urlBase": "https://www.snapix.space/2t7YzLFAGr...",
// Base URL for the uploaded images
"originalName": "test-2.webp",
"description": "Test image description",
"metadata": [
{
"size": 39477,
"idSuffix": 1024,
"imageInfo": {
"type": "avif",
"ratio": 1,
"width": 1024,
"height": 1024
},
"objectKey": "b27c40a1-1b80-4cd7-8a5a-43a7be53806c-1024x1024.avif",
// The image name in the user's account object storage
"contentType": "image/avif",
"lastModified": 1746103095199,
"fileExtension": "avif",
"optimizationPercent": 83
},
{
"size": 3348,
"idSuffix": "thumb_small",
...
// App required resolution, the users are not charged for this,
// but can use it for free
},
{
"size": 12032,
"idSuffix": "thumb_big",
...
// App required resolution, the users are not charged for this,
// but can use it for free
},
{
"size": 237234,
"idSuffix": "original",
"objectKey": null,
...
// System information for the original image,
// NOTE: We do not store the original image!
}
],
"size": 39477,
// The size in bytes that user's account storage will be charged
"createdAt": "2025-05-01T12:38:14.070Z",
"updatedAt": "2025-05-01T12:38:15.526Z"
"galleries": [
// If the image was uploaded to one or more galleries, otherwise empty []
{
"galleryId": "bedee85f-efcb-40ed-b571-180750fa3e98",
"imageId": "935cc219-5ea6-44cd-b2b6-9fcaad1174e2"
},
...
]
}
...
// More objects if you've requested more resizeOptions
],
"simpleData": [
{
"id": "b27c40a1-1b80-4cd7-8a5a-43a7be53806c",
"originalName": "test-2.webp",
"variants": {
"avif": "https:https://www.snapix.space/2t7YzLFAGr.../b27...6c-1024x1024.avif",
// "jpeg", "png", "webp" -- If they are requested by the formatOptions
},
"info": {
"width": 1024,
"height": 1024,
"ratio": 1
}
},
...
// More objects if you've requested more resizeOptions
],
"accountStatistics": {
"storageUsed": 39477, // Current used user's storage in bytes
"totalStorage": 188743680, // Total user's storage in bytes
"creditsUsed": 1, // Credits used for this request
"remainingCredits": 49, // Remaining credits of the account
"remainingCreditsPaidPlans": 0 // Remaining credits from paid plans
}
}
Here is extended jq command to extract the URLs of the uploaded image variants.
JQ_FILTER='.images[] | .urlBase as $baseUrl | .metadata[] | select(.objectKey != null) | "\($baseUrl)/\(.objectKey)"'
curl -X POST... | jq -r "$JQ_FILTER"
Second approach to extract the URLs, by using extract_urls function.
extract_urls() { jq -r '.images[] | .urlBase as $baseUrl | .metadata[] | select(.objectKey != null) | "\($baseUrl)/\(.objectKey)"' }
curl -X POST... | extract_urls
This API is designed for paginated retrieval of user images, per bucket. You are not charged for this operation. The user's API call rate limits are applied.
The default query parameters are:
page=1 - page number,limit=50 - maximum number of images per page, the max. allowable value is 200,sort=asc - asc (ascending - newer to older) or desc (descending - older to newer),bucketKey=snapix_default_bucket - for more details check the Custom Buckets section below.curl -X GET "https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" | jq
curl -X GET "https://www.snapix.space/api/v1/images?bucketKey=snapix_default_bucket&page=1&limit=10&sort=asc" \
-H "Authorization: Bearer ${API_KEY}" | jq
{
"data": [
{
"id": "b27c40a1-1b80-4cd7-8a5a-43a7be53806c",
"urlBase": "https://www.snapix.space/2t7YzLFAGr...",
// Base URL for the uploaded images
"originalName": "test-2.webp",
"description": "Test image description",
"metadata": [
{
"size": 39477,
"idSuffix": 1024,
"imageInfo": {
"type": "avif",
"ratio": 1,
"width": 1024,
"height": 1024
},
"objectKey": "b27c40a1-1b80-4cd7-8a5a-43a7be53806c-1024.avif",
// The image name in the user's account object storage
"contentType": "image/avif",
"lastModified": 1746103095199,
"fileExtension": "avif",
"optimizationPercent": 83
},
{
"size": 3348,
"idSuffix": "thumb_small",
...
// App required resolution, the users are not charged for this,
// but can use it for free
},
{
"size": 12032,
"idSuffix": "thumb_big",
...
// App required resolution, the users are not charged for this,
// but can use it for free
},
{
"size": 237234,
"idSuffix": "original",
"objectKey": null,
...
// System information for the original image,
// NOTE: We do not store the original image!
}
],
"size": 39477,
// The size in bytes that user's account storage will be charged
"createdAt": "2025-05-01T12:38:14.070Z",
"updatedAt": "2025-05-01T12:38:15.526Z"
}
...
],
"simpleData":
[
{
"id": "b27c40a1-1b80-4cd7-8a5a-43a7be53806c",
"originalName": "test-2.webp",
"variants": {
"avif": "https:https://www.snapix.space/2t7YzLFAGr.../b27...6c-1024x1024.avif",
},
"info": {
"width": 1024,
"height": 1024,
"ratio": 1
}
},
...
],
"accountStatistics": {
"storageUsed": 509477, // Current used user's storage in bytes
"totalStorage": 188743680, // Total user's storage in bytes
"creditsUsed": 0, // Credits used for this request
"remainingCredits": 109, // Remaining credits of the account
"remainingCreditsPaidPlans": 0 // Remaining credits from paid plans
}
"pagination": {
"page": 1,
"limit": 2,
"total": 3,
"totalPages": 2,
"hasNext": true,
"hasPrevious": false,
"nextPage": 2,
"previousPage": null
}
}
This API is designed for retrieving a single image - by Id. You are not charged for this operation. The user's API call rate limits are applied.
curl -X GET "https://www.snapix.space/api/v1/images/${ID}" \
-H "Authorization: Bearer ${API_KEY}" | jq
{
"data": {
"id": "8602d021-30bb-4deb-ae9f-21e981463a94",
"urlBase": "https://www.snapix.space/2t7YzLFAGr...",
"bucketKey": "snapix_default_bucket",
"originalName": "Image-55",
"description": "Test image description",
"metadata": [
{
"idSuffix": "thumb_small",
...
},
{
"idSuffix": "thumb_big",
...
},
{
"idSuffix": "original",
...
},
{
"size": 61514,
"idSuffix": "1024x576",
"imageInfo": {
"type": "webp",
"ratio": 1.78,
"width": 1024,
"height": 576
},
"objectKey": "8602d021-3...a94-1024x576.webp",
"contentType": "image/webp",
"lastModified": 1757438708663,
"fileExtension": "webp",
"optimizationPercent": 85
}
],
"size": 61514,
"createdAt": "2025-09-09T17:25:08.565Z",
"updatedAt": "2025-09-09T17:25:08.894Z",
"galleries": [
{
"galleryId": "7618c305-37b9-4a06-b986-9c62b285875c",
"imageId": "8602d021-30bb-4deb-ae9f-21e981463a94"
},
{
"galleryId": "bedee85f-efcb-40ed-b571-180750fa3e98",
"imageId": "8602d021-30bb-4deb-ae9f-21e981463a94"
}
]
},
"simpleData": {
"id": "8602d021-30bb-4deb-ae9f-21e981463a94",
"originalName": "Image-55",
"variants": {
"webp": "https://www.snapix.space/2t.../860...x576.webp"
},
"info": {
"width": 1024,
"height": 576,
"ratio": 1.78
}
}
}
This API is designed for updating a single image - by Id. You are charged for this operation only if it requires image processing - i.e. when you update only the name or the description you will not be charged. The user's API call rate limits are applied.
Actually we expose the same function for PUT /api/v1/images/${ID} and PATCH /api/v1/images/${ID} requests, so the both can be used interchangeably and they behaves in the PATCH request way.
curl -X PATCH \
"https://www.snapix.space/api/v1/images/${ID}" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/webp" \
-F "image=@./test-117.webp" \
-F "name=New name" \
-F "description=This is an updated description" \
-F "ratio=1.777" \
-F 'galleries=["bedee85f..."]' \
-F "storageKeyHandling=unique" \
-F 'formatOptions=[{"format": "webp"}, {"format": "avif"}]' \
-F 'resizeOptions={"width": 720}' | jq
This request will consume 2 App credits (for the formatOptions array).
The options are identical to the Upload and convert image to multiple output formats and resolutions example.
resizeOptions as an object instead of an array.You must provide at least one of the following fields: image (or url), name, description, or galleries; otherwise, there will be no data to process.
storageKeyHandling determines how object keys are managed. Options:
replace (default) - reuse the existing key. You don’t need to explicitly provide this value;unique - append a random suffix to generate a new key (ensures immediate CDN updates but requires your app to handle the new name).If you want to just resize an existing image you can provide it via the url field.
curl -X PATCH \
"https://www.snapix.space/api/v1/images/${ID}" \
-H "Authorization: Bearer ${API_KEY}" \
-F "url=https://images.snapix.space/2t7../img..-1080.webp" \
-F 'resizeOptions={"width": 720}' | jq
If you provide the galleries field, the image will be added to the specified galleries and removed from any galleries not included in the list. If you omit the galleries field, the image’s gallery associations will remain unchanged. To remove the image from all galleries, pass an empty array: galleries = []:
curl -X PATCH \
"https://www.snapix.space/api/v1/images/${ID}" \
-H "Authorization: Bearer ${API_KEY}" \
-F "galleries=[]" | jq
{
"data": {
"id": "f948f86a-c79d-4649-bf09-5cd6d55526b9",
"urlBase": "https://www.snapix.space/2t7YzLFAGr...",
"bucketKey": "snapix_default_bucket",
"originalName": "New name",
"description": "Updated description",
"metadata": [
{
"size": 876,
"idSuffix": "thumb_small",
"imageInfo": {
"type": "webp",
"ratio": 1.76,
"width": 120,
"height": 68
},
"objectKey": "f4...9a-blank-thumb_small.webp",
"contentType": "image/webp",
"lastModified": 1758546579928,
"fileExtension": "webp",
"optimizationPercent": 99
},
{
"size": 4116,
"idSuffix": "thumb_big",
"imageInfo": {
"type": "webp",
"ratio": 1.78,
"width": 320,
"height": 180
},
"objectKey": "f4...9a-pheasant-thumb_big.webp",
"contentType": "image/webp",
"lastModified": 1758546579936,
"fileExtension": "webp",
"optimizationPercent": 94
},
{
"size": 26622,
"idSuffix": "720x405",
"imageInfo": {
"type": "webp",
"ratio": 1.78,
"width": 720,
"height": 405
},
"objectKey": "f4...9a-teal-720x405.webp",
"contentType": "image/webp",
"lastModified": 1758546579962,
"fileExtension": "webp",
"optimizationPercent": 60
},
{
"size": 20152,
"idSuffix": "720x405",
"imageInfo": {
"type": "avif",
"ratio": 1.78,
"width": 720,
"height": 405
},
"objectKey": "f4...9a-silver-720x405.avif",
"contentType": "image/avif",
"lastModified": 1758546580884,
"fileExtension": "avif",
"optimizationPercent": 70
},
{
"size": 66452,
"idSuffix": "original",
"imageInfo": {
"type": "jpg",
"ratio": 1.9,
"width": 1200,
"height": 630
},
"objectKey": null,
"contentType": "image/webp",
"lastModified": 1758546579246,
"fileExtension": "jpg",
"optimizationPercent": 0
}
],
"size": 46774,
"createdAt": "2025-09-03T11:48:37.660Z",
"updatedAt": "2025-09-22T13:09:41.485Z",
"galleries": [
{
"galleryId": "bedee85f-efcb-40ed-b571-180750fa3e98",
"imageId": "f4...9a"
}
]
},
"simpleData": {
"id": "f4...9a",
"originalName": "New name",
"variants": {
"webp": "https://www.snapix.space/2t7YzLFAGr.../f4...9a-teal-720x405.webp",
"avif": "https://www.snapix.space/2t7YzLFAGr.../f4...9a-silver-720x405.avif"
},
"info": {
"width": 720,
"height": 405,
"ratio": 1.78
}
},
"accountStatistics": {
"storageUsed": 165384,
"totalStorage": 5242880,
"creditsUsed": 2,
"remainingCredits": 340,
"remainingCreditsPaidPlans": 60
}
}
This API is designed for deleting a single image - by Id.
curl -X DELETE "https://www.snapix.space/api/v1/images/${ID}" \
-H "Authorization: Bearer ${API_KEY}" | jq
null
By default, all images are uploaded to the default bucket of {{ applicationName }}. You can see its details in the Buckets page.
Registered users can create and manage custom buckets from the Buckets page.
primary bucket.primary bucket is automatically used for uploads through the web interface.In addition to the API key, the user must provide an active Bucket Key.
BUCKET_KEY="snapix_default_bucket"
* Copy some of your Bucket Keys and it will be available here.
To specify which bucket to use, you can use the bucketKey field in the API calls. If bucketKey is not specified in the API calls, as shown in the examples above, the primary bucket will be used by default.
curl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/png" \
-F "name=test-1.png" \
-F "image=@./test-1.png" \
-F "bucketKey=${BUCKET_KEY}" | jq
The response is the same as in the previous example. The only difference is that if you are using a custom bucket, the used space is not counted.
prefix notescurl -X POST \
"https://www.snapix.space/api/v1/images" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/png" \
-F "name=test-1.png" \
-F "image=@./test-1.png" \
-F "bucketKey=${BUCKET_KEY}" \
-F "prefix=example-prefix/" | jq
Changing the prefix on fly or changing the prefix within the bucket's configuration is not recommended!
This may lead to unexpected results. For example when you try to remove an image it will be removed from our database but will not be removed from the object storage. And you may need to remove it manually.
So we recommended when you want to change the prefix of a custom bucket, to create a new bucket with the new prefix.
Processes an image (provided as binary data or URL) directly based on the specified options (convert, resize, etc.). This operation happens on the fly; the image is not stored on the object storage. The converted image variant is returned as a stream.
You must provide an active API key and have sufficient App credits to perform the operation.
API_KEY="sk_snapix_apiKey-a1b2c3-placeholder"
* Copy some of your API Keys and it will be available here.
curl -X POST \
"https://www.snapix.space/api/v1/convert" \
-H "Authorization: Bearer ${API_KEY}" \
-F "image=@./test-1.webp" \
--output "test-1_converted.webp"
--output the response will be a stream of data and curl will not save it to a file.format via the formatOptions field, the default format of webp will be used as the output format.curl -X POST \
"https://www.snapix.space/api/v1/convert" \
-H "Authorization: Bearer ${API_KEY}" \
-F "url=https://images.snapix.space/abc-123/def-456.png" \
--output "test-2_converted.webp"
curl -X POST \
"https://www.snapix.space/api/v1/convert" \
-H "Authorization: Bearer ${API_KEY}" \
-F "contentType=image/webp" \
-F "image=@./test-1.webp" \
-F "name=test-1.webp" \
-F "ratio=1.78" \
-F 'formatOptions={"format": "avif", "options": {"background": "#FF0"}}' \
-F 'resizeOptions={"width": 1024}' \
--output "test-1_converted.avif"
ratio, formatOptions and resizeOptions fields are optional, reference the explanations above for more details, the difference is that here we pass the options as a JSON object instead of an array.ratio, formatOptions and resizeOptions fields are optional, reference the explanations above for more details, the difference is that here we pass the options as a JSON object instead of an array.We use Image Generation with Gemini (also known as Nano Banana) to generate images. The current model in use is gemini-3-pro-image-preview.
aiConfig field.This API is primarily designed to generate blog post cover images based on the provided prompt text and optional image template. While the template is not required, we strongly recommend providing one for the best results.
If you need to enforce a specific aspect ratio, you must supply an image template via either the url or image field. Only one template image is supported. For more details, see:
url field is provided, the API first fetches the image template.The result is a set of optimized, ready-to-use images.
Each request consumes 40 App credits for image generation, plus one or more credits for image processing depending on the chosen output format options.
API_KEY="sk_snapix_apiKey-a1b2c3-placeholder"
* Copy some of your API Keys and it will be available here.
image field.curl -X POST \
"https://www.snapix.space/api/v1/generate" \
-H "Authorization: Bearer ${API_KEY}" \
-F "prompt=An astronaut riding a horse" \
-F "image=@./test-1.webp" \
-F 'aiConfig={"topP": 0.95, "temperature": 1}' \
-F "contentType=image/webp" \
-F "name=Upload-via-binary" \
-F "description=Test image description - upload via binary" \
-F "ratio=1.9" \
-F 'formatOptions=[{"format": "webp"}, {"format": "avif"}]' \
-F 'resizeOptions=[{"width": 1200}, {"width": 240}]' | jq
Consumes 40 credits for generation and 4 credits for processing.
The prompt field is required.
The aiConfig field is optional, for more details see GenerateContentConfig.
The other fields are documented in the Upload API.
url field.curl -X POST \
"https://www.snapix.space/api/v1/generate" \
-H "Authorization: Bearer ${API_KEY}" \
-F "prompt=An astronaut riding a horse" \
-F "url=https://images.snapix.space/abc-123/def-456.png"
-F 'aiConfig={"topP": 0.95, "temperature": 1}' \
-F "name=upload-via-url" \
-F "description=Test image description - upload via URL" \
-F 'formatOptions=[{"format": "webp"}]' \
-F 'resizeOptions=[{"width": 1200, "height": 630}]' | jq
aiConfig field-F 'aiConfig={
"topP": 0.95,
"temperature": 0.9,
"systemInstruction":
"Preserve the character as shown in the input image (same appearance,
clothing, face, body, body parts, and body to head aspect ratio).
Change only the scene: background, lighting, surroundings.
Make sure the character remains recognizably the same.",
}'
Output for two resolutions and 2 output formats each:
{
"data": [
{
"id": "95c9e3e1-9c7c-426a-9005-6229b084a183",
"urlBase": "https://www.snapix.space/2t7YzLFAGr...",
"bucketKey": "snapix_default_bucket",
"originalName": "Upload-via-binary 2:[240x126]",
"description": "Test image description - upload via binary",
"metadata": [
{
"size": 896,
"idSuffix": "thumb_small",
"imageInfo": {
"type": "webp",
"ratio": 1.9,
"width": 120,
"height": 63
},
"objectKey": "95c9e3e1-9c7c-426a-9005-6229b084a183-thumb_small.webp",
"contentType": "image/webp",
"lastModified": 1759583800560,
"fileExtension": "webp",
"optimizationPercent": 100
},
{
"size": 4008,
"idSuffix": "thumb_big",
"imageInfo": {
"type": "webp",
"ratio": 1.9,
"width": 320,
"height": 168
},
"objectKey": "95c9e3e1-9c7c-426a-9005-6229b084a183-thumb_big.webp",
"contentType": "image/webp",
"lastModified": 1759583800554,
"fileExtension": "webp",
"optimizationPercent": 100
},
{
"size": 4368,
"idSuffix": "240x126",
"imageInfo": {
"type": "webp",
"ratio": 1.9,
"width": 240,
"height": 126
},
"objectKey": "95c9e3e1-9c7c-426a-9005-6229b084a183-240x126.webp",
"contentType": "image/webp",
"lastModified": 1759583800547,
"fileExtension": "webp",
"optimizationPercent": 100
},
{
"size": 3951,
"idSuffix": "240x126",
"imageInfo": {
"type": "avif",
"ratio": 1.9,
"width": 240,
"height": 126
},
"objectKey": "95c9e3e1-9c7c-426a-9005-6229b084a183-240x126.avif",
"contentType": "image/avif",
"lastModified": 1759583800641,
"fileExtension": "avif",
"optimizationPercent": 100
},
{
"size": 1716290,
"idSuffix": "original",
"imageInfo": {
"type": "png",
"ratio": 1.91,
"width": 1408,
"height": 736
},
"objectKey": null,
"contentType": "image/webp",
"lastModified": 1759583800314,
"fileExtension": "png",
"optimizationPercent": 0
}
],
"size": 8319,
"createdAt": "2025-10-04T13:16:40.433Z",
"updatedAt": "2025-10-04T13:16:40.965Z",
"galleries": []
},
{
"id": "26fad869-aeb2-4649-9c4a-839cf8a6cbe2",
"urlBase": "https://www.snapix.space/2t7YzLFAGr...",
"bucketKey": "snapix_default_bucket",
"originalName": "Upload-via-binary 1:[1200x632]",
"description": "Test image description - upload via binary",
"metadata": [
{
"size": 896,
"idSuffix": "thumb_small",
"imageInfo": {
"type": "webp",
"ratio": 1.9,
"width": 120,
"height": 63
},
"objectKey": "26fad869-aeb2-4649-9c4a-839cf8a6cbe2-thumb_small.webp",
"contentType": "image/webp",
"lastModified": 1759583800471,
"fileExtension": "webp",
"optimizationPercent": 100
},
{
"size": 4008,
"idSuffix": "thumb_big",
"imageInfo": {
"type": "webp",
"ratio": 1.9,
"width": 320,
"height": 168
},
"objectKey": "26fad869-aeb2-4649-9c4a-839cf8a6cbe2-thumb_big.webp",
"contentType": "image/webp",
"lastModified": 1759583800493,
"fileExtension": "webp",
"optimizationPercent": 100
},
{
"size": 42792,
"idSuffix": "1200x632",
"imageInfo": {
"type": "webp",
"ratio": 1.9,
"width": 1200,
"height": 632
},
"objectKey": "26fad869-aeb2-4649-9c4a-839cf8a6cbe2-1200x632.webp",
"contentType": "image/webp",
"lastModified": 1759583800534,
"fileExtension": "webp",
"optimizationPercent": 98
},
{
"size": 28453,
"idSuffix": "1200x632",
"imageInfo": {
"type": "avif",
"ratio": 1.9,
"width": 1200,
"height": 632
},
"objectKey": "26fad869-aeb2-4649-9c4a-839cf8a6cbe2-1200x632.avif",
"contentType": "image/avif",
"lastModified": 1759583801939,
"fileExtension": "avif",
"optimizationPercent": 98
},
{
"size": 1716290,
"idSuffix": "original",
"imageInfo": {
"type": "png",
"ratio": 1.91,
"width": 1408,
"height": 736
},
"objectKey": null,
"contentType": "image/webp",
"lastModified": 1759583800314,
"fileExtension": "png",
"optimizationPercent": 0
}
],
"size": 71245,
"createdAt": "2025-10-04T13:16:40.342Z",
"updatedAt": "2025-10-04T13:16:42.964Z",
"galleries": []
}
],
"simpleData": [
{
"id": "95c9e3e1-9c7c-426a-9005-6229b084a183",
"originalName": "Upload-via-binary 2:[240x126]",
"variants": {
"webp": "https://snapix-dev-serve.metalevel.tech/2t7YzLFAGr9H7wAHzrHilBzs4yh/95c9e3e1-9c7c-426a-9005-6229b084a183-240x126.webp",
"avif": "https://snapix-dev-serve.metalevel.tech/2t7YzLFAGr9H7wAHzrHilBzs4yh/95c9e3e1-9c7c-426a-9005-6229b084a183-240x126.avif"
},
"info": {
"width": 240,
"height": 126,
"ratio": 1.9
}
},
{
"id": "26fad869-aeb2-4649-9c4a-839cf8a6cbe2",
"originalName": "Upload-via-binary 1:[1200x632]",
"variants": {
"webp": "https://snapix-dev-serve.metalevel.tech/2t7YzLFAGr9H7wAHzrHilBzs4yh/26fad869-aeb2-4649-9c4a-839cf8a6cbe2-1200x632.webp",
"avif": "https://snapix-dev-serve.metalevel.tech/2t7YzLFAGr9H7wAHzrHilBzs4yh/26fad869-aeb2-4649-9c4a-839cf8a6cbe2-1200x632.avif"
},
"info": {
"width": 1200,
"height": 632,
"ratio": 1.9
}
}
],
"accountStatistics": {
"storageUsed": "user-bucket",
"totalStorage": "user-bucket",
"creditsUsed": 44,
"remainingCredits": 853,
"remainingCreditsPaidPlans": 520
},
"imageGenerateResponse": {
"metadata": {
"responseId": "Nh7haKSiH42zxN8PzMe_GA",
"modelVersion": "gemini-3-pro-image-preview",
"usageMetadata": {
"promptTokenCount": 1296,
"candidatesTokenCount": 1290,
"totalTokenCount": 2586,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 6
},
{
"modality": "IMAGE",
"tokenCount": 1290
}
],
"candidatesTokensDetails": [
{
"modality": "IMAGE",
"tokenCount": 1290
}
]
}
},
"text": ""
}
}
Galleries allow you to group and organize your images. All Gallery Management API endpoints require an active API key. None of these operations consume App credits; the user's API call rate limits are applied.
API_KEY="sk_snapix_apiKey-a1b2c3-placeholder"
* Copy some of your API Keys and it will be available here.
Returns all galleries belonging to the authenticated user.
curl -X GET "https://www.snapix.space/api/v1/galleries" \
-H "Authorization: Bearer ${API_KEY}" | jq
{
"galleries": [
{
"id": "7618c305-...",
"name": "My Gallery",
"isPublic": false,
"bucketKey": "default",
"accountId": "a1b2c3d4-...",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-03-15T12:00:00.000Z"
}
// More gallery objects...
]
}
Creates a new gallery. Images can optionally be attached at creation time.
curl -X POST "https://www.snapix.space/api/v1/galleries" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "My New Gallery",
"isPublic": false,
"bucketKey": "snapix_default_bucket",
"imageIds": ["f948f86a-...", "a1b2c3d4-..."]
}' | jq
name (required) - gallery name, max 256 characters.isPublic (optional) - whether the gallery is publicly accessible. Defaults to false.bucketKey (optional) - the bucket to associate the gallery with. Defaults to the primary bucket. For more details see the Custom Buckets section.imageIds (optional) - an array of existing image IDs to add to the gallery at creation time.{
"gallery": {
"id": "7618c305-...",
"name": "My New Gallery",
"isPublic": false,
"bucketKey": "default",
"accountId": "a1b2c3d4-...",
"createdAt": "2026-04-04T10:00:00.000Z",
"updatedAt": null,
"images": [
{
"galleryId": "7618c305-...",
"imageId": "f948f86a-...",
"image": { /* image object */ }
}
// More image objects...
]
}
}
Returns a single gallery by ID, including the full list of associated images.
curl -X GET "https://www.snapix.space/api/v1/galleries/${ID}" \
-H "Authorization: Bearer ${API_KEY}" | jq
{
"gallery": {
"id": "7618c305-...",
"name": "My Gallery",
"isPublic": false,
"bucketKey": "default",
"accountId": "a1b2c3d4-...",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-03-15T12:00:00.000Z",
"images": [
{
"galleryId": "7618c305-...",
"imageId": "f948f86a-...",
"image": { /* image object */ }
}
// More image objects...
]
}
}
Returns all images belonging to the authenticated user that are not assigned to any gallery.
curl -X GET "https://www.snapix.space/api/v1/galleries/ungrouped?bucketKey=my-bucket" \
-H "Authorization: Bearer ${API_KEY}" | jq
| Parameter | Type | Required | Description |
|---|---|---|---|
bucketKey |
string | No | Filter images by storage bucket. Defaults to the primary bucket when not provided. |
{
"gallery": {
"id": "ungrouped",
"name": "Ungrouped",
"isPublic": false,
"bucketKey": "default",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": null,
"accountId": "acc-...",
"images": [
{
"galleryId": "ungrouped",
"imageId": "f948f86a-...",
"image": {
"id": "f948f86a-...",
"urlBase": "https://cdn.example.com",
"originalName": "my-photo.png",
"description": null,
"metadata": [ /* variant objects */ ],
"size": 204800,
"bucketKey": "default",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": null,
"galleries": []
}
}
// More image entries...
]
}
}
Updates the name and/or isPublic fields of an existing gallery. At least one field must be provided.
Both PATCH /api/v1/galleries/${ID} and PUT /api/v1/galleries/${ID} behave identically - only the fields provided in the request body are updated.
curl -X PATCH "https://www.snapix.space/api/v1/galleries/${ID}" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"name": "Updated Name", "isPublic": true}' | jq
name or isPublic; otherwise the request will be rejected.{
"id": "7618c305-...",
"name": "Updated Name",
"isPublic": true,
"bucketKey": "default",
"accountId": "a1b2c3d4-...",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-04-04T11:00:00.000Z"
}
Deletes a gallery by ID. Optionally, all images associated with the gallery can be permanently removed from storage at the same time.
# Delete the gallery only (images are kept)
curl -X DELETE "https://www.snapix.space/api/v1/galleries/${ID}" \
-H "Authorization: Bearer ${API_KEY}"
# Delete the gallery and permanently remove all its images from storage
curl -X DELETE "https://www.snapix.space/api/v1/galleries/${ID}?deleteImages=true" \
-H "Authorization: Bearer ${API_KEY}"
deleteImages query parameter (optional, default false):
false - deletes only the gallery record; all images remain in storage and in your account.true - deletes the gallery and permanently removes all its images from storage. The gallery's bucketKey is used to locate the images in the correct bucket.null