POST /api/cdn · Header: X-Api-Key · JSON or multipart/form-data
src or file required. Uploaded files don't support TTL refresh — no source to re-fetch after expiry.{ "url": "/cdn/encrypted_hash" }w width · h height · q quality 1–100 · mode fit | crop → converts to WebPcodec libx265 | libx264 | libvpx-vp9 · crf 18–40 · preset ultrafast–slow · resolution 1280:-2 · audio_bitrate 96k → converts to MP4codec libmp3lame | aac | libopus · bitrate 64k–320k → converts to MP3202 with status, error and original src200 — file served from cache202 — processing: { "status": "pending|processing|failed", "error": "...", "src": "..." }400 — bad request (missing type, src, bad format)403 — bad API key or invalid encrypted URL404 — record not foundcurl -X POST https://wdcache.ru/api/cdn \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"image","src":"https://example.com/photo.jpg","params":{"w":800,"q":80}}'
curl -X POST https://wdcache.ru/api/cdn \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"video","src":"https://example.com/clip.mp4","params":{"crf":32,"resolution":"1280:-2"}}'
curl -X POST https://wdcache.ru/api/cdn \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"audio","src":"https://example.com/track.wav","params":{"bitrate":"128k"}}'
curl -X POST https://wdcache.ru/api/cdn \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"file","src":"https://example.com/doc.pdf","params":{}}'
curl -X POST https://wdcache.ru/api/cdn \
-H "X-Api-Key: YOUR_KEY" \
-F "file=@photo.jpg" \
-F "type=image" \
-F 'params={"w":800,"q":80}' \
-F "project=my-project"