We used hcloud-uploader before
but the images get quite large (as they are the full disks) so a restore is quite slow.
What I got working recently is "dd-install" via rescue mode.
https://github.com/tcurdt/dd-install
Allows me to install alpine/debian/nixos/... with a custom partition setup.
But it feels like an workaround. A proper API would be so much appreciated!