Need a public URL for an image

Hi, I have an app that is receiving an image from an API but the API does not return a public URL. I need a public URL for the next step of my app.

I can. display the image on my page I see that when I display my image it automatically is uploaded to the file manager.

When I view the image in the file manager I can click into it and get a public URL.

How can I dynamically retrieve this public URL and display it on my page.

Workflow : api returns image → make a public URL for the image → retrieve and display the public URL.

Hope someone can help, thanks