you created the wrong token type - you have a general API token. you need to create an R2 bucket token:
- go to the cloudflare dashboard → R2 object storage (left sidebar under
storage & databases). - on the right side of the R2 overview page, click
manage(API tokens). - click
create account API token. - fill in an appropriate token name and set Permissions to
object read & writethensave - this will output an
access key idand asecret access key. those are what you need to put into discourse’s S3 configuration
and yes you need to remove trailing slashes because discourse will likely reject them

