Upload an image to managed storage, create a task, poll its progress, then download its output.
Obtain a project-scoped HQTools key with imagehq.assets and imagehq.task scopes.
POST /v1/assets/uploads/ to obtain a presigned URL, PUT the bytes directly to storage, then complete the upload.
Reference the ready asset_id in POST /v1/task/ and use Idempotency-Key for safe retries.
Read task outputs, then obtain GET /v1/assets/{asset_id}/download/ to download directly from storage.
Task API · convert
# Upload a file using /v1/assets/uploads/ first; replace the example asset IDs.
curl -X POST 'https://api.imagehq.io/v1/task/' \
-H "X-API-Key: $IMAGEHQ_API_KEY" \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $(uuidgen)" \
--data-binary '{"operation":"convert","inputs":[{"type":"asset","asset_id":"asset_12345678"}],"parameters":{"target_format":"webp","quality":85},"outputs":[{"type":"managed"}]}'Illustrative server-side examples. Upload source bytes to a presigned S3 URL first; substitute your ready asset IDs and an enabled model.