Providers

Amazon S3

api.storage.connect({ type: "object", provider: "s3", endpoint })

A bucket of your own on S3. The same five actions as R2, signed the same way — the region is the one thing that differs.

type: objectSigV4region matters
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

Connecting

const bucket = await api.storage.connect({
  label: "Archive",
  type: "object",
  provider: "s3",
  endpoint: {
    credentials: {
      bucketName: "my-archive",
      region: "eu-west-3",
      accessKeyId: "…",
      secretAccessKey: "…",
    },
  },
});
bucket = api.storage.connect(
    label="Archive",
    type="object",
    provider="s3",
    endpoint={
        "credentials": {
            "bucketName": "my-archive",
            "region": "eu-west-3",
            "accessKeyId": "…",
            "secretAccessKey": "…",
        },
    },
)
credentials.bucketNamestringrequired

The bucket.

credentials.regionstringus-east-1

Where it lives. Part of the address and of the signature.

credentials.accessKeyIdstringrequired

The access key.

credentials.secretAccessKeystringrequired

Its secret.

A wrong region looks like a permission problem

The region is signed into every request, so a bucket in eu-west-3 reached as us-east-1 is refused — and the refusal talks about the signature, not about the region. Set it explicitly whenever the bucket is not in the default one.

The five actions

CallDoes
{ action: "list", prefix, limit, recursive, continuationToken }Lists keys and folders under a prefix.
{ action: "overview" }Top-level folders, with counts, bytes and a sample.
{ action: "object", key }Reads one object — text or base64.
{ action: "upload", key, contentBase64 | content, contentType }Writes one object.
{ action: "delete", key }Removes one object.

Everything on the R2 page about folders, paging, binary content and key encoding applies identically here — the two share one implementation, and the shapes that come back are the same.

What the key needs to be allowed

ActionNeeds
list · overviewlisting the bucket
objectreading an object
uploadwriting an object
deletedeleting an object

A key allowed to read but not to list makes object work while list is refused — which reads as « the bucket is empty » if you only ever call list. Grant listing, or work from keys you already hold.

Errors keep the provider's message

A refusal comes back as Échec du listage S3/R2 (HTTP 403) followed by the provider's own explanation, pulled out of its XML. That message is the fastest route to the cause: a missing permission, a wrong region, an expired key.

It is registered, not tested

connect() stores the credentials and returns. Nothing is verified until the first run() — see connect().