The Vipsac API allows you to transcode standard images into highly optimized, native AVIF binaries.
The API uses API keys for authentication. Pass your secret key in the HTTP header of all requests.
X-API-Keysk_live_ (e.g., X-API-Key: sk_live_...).Converts standard image formats (JPEG, PNG, WebP) into compressed, web-optimized AVIF files.
POSThttps://api.vipsac.dev/v1/transcode/imagemultipart/form-data| Field Name | Type | Required | Description |
|---|---|---|---|
image |
Binary File | Yes | The raw image file to be transcoded. Supports JPEG, PNG, and WebP. |
const formData = new FormData();
formData.append('image', imageFileBuffer);
const response = await fetch('https://api.vipsac.dev/v1/transcode/image', {
method: 'POST',
headers: {
'X-API-Key': 'your_sk_live_key_here'
},
body: formData
});
if (response.ok) {
const avifBuffer = await response.arrayBuffer();
// Serve or upload to S3/R2
}
import requests
files = {'image': open('photo.jpg', 'rb')}
headers = {'X-API-Key': 'your_sk_live_key_here'}
response = requests.post('https://api.vipsac.dev/v1/transcode/image', headers=headers, files=files)
if response.status_code == 200:
with open('optimized.avif', 'wb') as f:
f.write(response.content)
To ensure platform stability and prevent abuse, the following guardrails are strictly enforced:
Payload sizes are evaluated at the edge. Any payload exceeding the absolute maximum of 30MB is dropped immediately.
| Subscription Tier | Maximum File Size |
|---|---|
| Starter | 10 MB |
| Growth | 20 MB |
| Pro | 30 MB |
To protect the processing cores against malicious decompression bombs (e.g., heavily compressed files that expand to massive resolutions), the engine enforces a strict dimensional ceiling.
Any image with a width or height exceeding 5000 pixels will be instantly rejected with a 400 Bad Request before being allocated to memory.
| Status Code | Type | Description |
|---|---|---|
| 200 OK | image/avif |
Returns the raw AVIF binary bytes directly in the response body. |
| Status Code | Type | Description |
|---|---|---|
| 400 Bad Request | Standard Error | The image file/dimensions are corrupted, or the file size exceeds your tier's limit. |
| 401 Unauthorized | Standard Error | The X-API-Key header is missing, invalid, or expired. |
| 402 Payment Required | Standard Error | The subscription attached to the API key has expired. |
| 429 Too Many Requests | Standard Error | Rate limit exceeded. The sustained limit of 5 req/sec has been tripped. |
| Status Code | Type | Description |
|---|---|---|
| 503 Service Unavailable | Standard Error | Temporary server overload, or the concurrency queue is full. Retrying after a short delay is recommended. |