What ModelRiver writes
R2 speaks the S3 API, so ModelRiver writes the same files as on Amazon S3: one gzip-compressed NDJSON object per batch (one event per line):
1<prefix>/<yyyy>/<mm>/<dd>/<first-event-id>_<last-event-id>.ndjson.gzThe date is the first event's date in UTC. A retried batch is written to the same key, so the bucket never holds the same event twice. Send test writes <prefix>/_modelriver_test.json.
Objects are private: ModelRiver sets no ACL and no public cache headers. Keep the bucket's public access (r2.dev subdomain and custom domains) off.
1. Create a bucket and an API token
In the Cloudflare dashboard, open R2 Object Storage and create a bucket that only holds audit logs, for example acme-audit-logs. Choose the EU jurisdiction if the logs must stay in the EU.
Then create an API token for ModelRiver under R2 Object Storage → Manage API tokens → Create API token:
| Setting | Value |
|---|---|
| Permissions | Object Read & Write |
| Specify bucket(s) | Apply to specific buckets only, and pick the audit log bucket |
| TTL | Optional. When the token expires, the export pauses until you enter a new one. |
Cloudflare shows an Access Key ID and a Secret Access Key once. Copy both; ModelRiver needs them, not the token value.
R2 tokens can't be limited to writing or to a prefix the way an AWS IAM policy can: Object Read & Write also allows reading, listing and deleting in that bucket. That's why the bucket should hold nothing but audit logs, and why your SIEM should get its own read-only token rather than ModelRiver's.
2. Find your account ID
The account ID is a 32-character hex string. It's shown in the Cloudflare dashboard under R2 Object Storage → Account details, and it's the first part of the bucket's S3 API URL (https://<ACCOUNT_ID>.r2.cloudflarestorage.com/<bucket>). You can paste that whole URL into the form; ModelRiver keeps only the account ID.
3. Configure the export
In Organization settings → Audit log export, choose Cloudflare R2 and fill in:
| Field | Value |
|---|---|
| Account ID | The ID from step 2. |
| Jurisdiction | Default, or European Union (EU) for a bucket created in the EU jurisdiction. |
| Bucket | acme-audit-logs |
| Key prefix | modelriver/audit (optional) |
| Access key ID, Secret access key | The token's Access Key ID and Secret Access Key. |
ModelRiver builds the endpoint from these (https://<ACCOUNT_ID>.r2.cloudflarestorage.com, or .eu.r2.cloudflarestorage.com for the EU), uses region auto and path-style URLs (<endpoint>/<bucket>/<key>). Under the hood it's an S3 destination, so an S3-compatible client sees the same requests.
The access key is encrypted at rest and never shown again. The page shows only its last four characters. You can change the bucket, account or jurisdiction later without entering it again.
Choose Send test, then check that modelriver/audit/_modelriver_test.json appeared in the bucket. If R2 refuses, the error names R2's code and highlights the field to fix.
Reading the files
Any S3 client works with R2's endpoint and region auto. With the AWS CLI and a read-only R2 token (untested):
aws s3 cp s3://acme-audit-logs/modelriver/audit/2026/11/25/ . --recursive \ --endpoint-url https://<ACCOUNT_ID>.r2.cloudflarestorage.com --region autozcat *.ndjson.gz | jq -c 'select(.high_risk)'SIEM inputs that read S3-compatible storage can read the bucket the same way, with their own read-only token. R2 charges no egress fees, so reading the files back costs only R2's per-request operations.