Photoroom's Image Editing API at https://image-api.photoroom.com/v2/edit removes backgrounds, adds shadows and new backgrounds, and resizes — driven by query parameters, including an imageUrl to fetch the source from. The basic Remove Background API is at https://sdk.photoroom.com/v1/segment (file upload).
Get a key in the Photoroom API dashboard (sandbox keys start with sandbox_) and send it as the x-api-key header. In the examples it's written {{PHOTOROOM_API_KEY}}.
Full reference: https://docs.photoroom.com/
Returns the edited image.
curl "https://image-api.photoroom.com/v2/edit?imageUrl=https%3A%2F%2Fwww.remove.bg%2Fexample.jpg&removeBackground=true" \
-H "x-api-key: {{PHOTOROOM_API_KEY}}"
curl https://image-api.photoroom.com/v1/account \
-H "x-api-key: {{PHOTOROOM_API_KEY}}"