First you need to create a new user in the Public Cloud interface. Use the ObjectStore operator role. Keep the user and the password in a safe place.
You need python-openstackclient on your computer / server to generate the credentials
apt -y install python-pip3 pip3 install python-openstackclient
You need to get the openrc.sh authentification file from the Horizon Public Cloud console (login with the user / password you create before and go on Project > API Access > OpenStack RC file v3)
Then you can type (you will be prompted with the password of current user)
source openrc.sh openstack ec2 credentials create
You will see a table with the specific credentials for the S3 API
S3_HOST = https://storage.<region>.cloud.ovh.net (<region> could be rbx gra sbg bhs …)