Skip to content
Open

r2 apis #30653

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/content/docs/r2/api/index.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
title: API
description: Access R2 storage through the S3-compatible API or the Workers API.
description: Access R2 storage through the S3-compatible API, Workers API, or Cloudflare REST API.
pcx_content_type: navigation
sidebar:
order: 6
group:
hideIndex: true
products:
- r2
---

import { DirectoryListing } from "~/components"

<DirectoryListing />
R2 provides three API surfaces for interacting with your data:

- **[Workers API](/r2/api/workers/workers-api-reference/):** An in-Worker API accessed by binding an R2 bucket to a [Worker](/workers/). Use the Workers API to read, write, and list objects from within a Worker.
- **[S3-compatible API](/r2/api/s3/api/):** An S3-compatible HTTP API available at `https://<ACCOUNT_ID>.r2.cloudflarestorage.com`. Use existing S3 SDKs and tools to interact with R2.
- **[Cloudflare REST API](/api/resources/r2/):** The `api.cloudflare.com` REST API used by the Cloudflare Dashboard and Wrangler CLI. Supports bucket management and object operations. [Rate limits apply](/r2/platform/limits/#cloudflare-rest-api). Use the S3-compatible API or Workers API for high-throughput workloads.
6 changes: 6 additions & 0 deletions src/content/docs/r2/platform/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ Managed public bucket access through an `r2.dev` subdomain is not intended for p
- Bandwidth (throughput) may also be throttled when using the `r2.dev` endpoint.

For production use cases, connect a [custom domain](/r2/buckets/public-buckets/#custom-domains) to your bucket. Custom domains allow you to serve content from a domain you control (for example, `assets.example.com`), configure fine-grained caching, set up redirect and rewrite rules, mutate content via [Cloudflare Workers](/workers/), and get detailed URL-level analytics for content served from your R2 bucket.

## Cloudflare REST API

The [Cloudflare REST API](/api/resources/r2/) is rate limited to 1,200 requests per five minutes across all R2 REST API operations on your account.

For high-throughput object operations, use the [S3-compatible API](/r2/api/s3/api/) or [Workers API](/r2/api/workers/workers-api-reference/) instead. The Cloudflare REST API is best suited for lower-volume management and configuration operations.
Loading