Cloudflare R2
Cloudflare R2 is an S3-compatible object storage service with no egress fees.
Prerequisites
- A Cloudflare account with R2 enabled
- An R2 bucket created
- An R2 API token with Object Read & Write permissions on the bucket
Getting R2 credentials
In the Cloudflare dashboard:
- Go to R2 → Manage R2 API Tokens
- Create a token with Object Read & Write on your bucket
- Note the Access Key ID and Secret Access Key
- Your endpoint URL is:
https://<ACCOUNT_ID>.r2.cloudflarestorage.com
Connecting R2
curl -X PATCH https://filenest.drgodly.com/v1/projects/{id}/storage \
-H "Authorization: Bearer fn_live_..." \
-H "Content-Type: application/json" \
-d '{
"provider": "r2",
"storage_mode": "byob",
"bucket_name": "my-r2-bucket",
"endpoint_url": "https://abc123.r2.cloudflarestorage.com",
"access_key_id": "...",
"secret_access_key": "..."
}'Encryption
R2 encrypts all data at rest by default. SSE is always enabled and cannot be disabled. The sse_enabled field is always true for R2 projects.
Verify connectivity
curl -X POST https://filenest.drgodly.com/v1/projects/{id}/storage/verify \
-H "Authorization: Bearer fn_live_..."