Short answer: For a Node.js service storing AI-generated images, send the generated bytes directly to object storage with the put operation, a bucket, and a stable key; keep Node.js out of the media data path whenever the application does not need to transform it.
The decisive constraint is throughput. An image-generation response may be small enough for one request, while a media pipeline quickly turns proxying into an unnecessary bandwidth and memory bottleneck.
The design below treats the upload as a four-stage path: produce bytes, choose an immutable key, send the bytes, and record the result. That order protects the two invariants that matter in a media backend: a retry must not create a second logical asset, and the database must be able to explain which object was accepted.
What must the upload guarantee?
The API call is a PUT to /v1/storage/object/put/{bucket}/{key} .…