> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to configure a storage class in Object Storage

A storage class is one of a bucket's characteristics. You set it when you [create a bucket](https://docs.nebius.com/object-storage/configure-storage-classes.md#for-a-new-bucket), [edit it](https://docs.nebius.com/object-storage/configure-storage-classes.md#for-an-existing-bucket), or [upload an object](https://docs.nebius.com/object-storage/configure-storage-classes.md#how-to-upload-an-object-to-a-storage-class) to this bucket.

Object Storage supports three classes: Enhanced Throughput, Intelligent, and Standard. They differ in price and performance.

For more information, see [Storage classes in Object Storage](https://docs.nebius.com/object-storage/storage-classes.md).

## Prerequisites

If you use the web console, you don't need to complete any prerequisites.

> [tab] CLI
>
> [Install and configure](https://docs.nebius.com/cli/install.md) the Nebius AI Cloud CLI.

> [tab] Go SDK
>
> [Install and initialize the Nebius SDK for Go](https://docs.nebius.com/sdk/go/install-auth.md).

> [tab] Python SDK
>
> [Install and initialize the Nebius SDK for Python](https://docs.nebius.com/sdk/python/install-auth.md).

> [tab] JavaScript SDK
>
> [Install and initialize the Nebius SDK for JavaScript](https://docs.nebius.com/sdk/javascript/install-auth.md).

## How to set a default storage class for a bucket

Each bucket has a default storage class. All new objects are uploaded into this class unless you [explicitly define the class](#how-to-upload-an-object-to-a-storage-class).

By default, new buckets use the Standard storage class. You can change the default storage class both when you create a bucket and for an existing bucket. The new default storage class does not affect objects that are already in storage in the bucket.

> [!NOTE]
>
> You can use the **Force storage class** (`--force-storage-class`) [bucket parameter](https://docs.nebius.com/object-storage/buckets/manage.md#bucket-parameters) to make the default storage class override the storage class that you explicitly select for any individual object uploaded to the bucket.

### For a new bucket

> [tab] Web console
>
> 1. In the sidebar, go to  **Storage** → **Object Storage**.
> 2. Click **Create resource** → **Bucket**.
> 3. Select the storage class in the bucket creation form.
> 4. Configure the other settings and create the bucket.

> [tab] Nebius AI Cloud CLI
>
> When you [create a bucket](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-create-buckets-nebius-ai-cloud-cli), add the `--default-storage-class` parameter to set the default storage class:
>
> ```bash theme={null}
> nebius storage bucket create \
>   --default-storage-class <STANDARD|ENHANCED_THROUGHPUT|INTELLIGENT> \
>   ...
> ```

> [tab] Go SDK
>
> Create a bucket with a default storage class:
>
> ```go theme={null}
> createService := sdk.Services().Storage().V1().Bucket()
> createOperation, err := createService.Create(
>     ctx,
>     &storage.CreateBucketRequest{
>         Metadata: &common.ResourceMetadata{
>             Name: "<bucket_name>",
>         },
>         Spec: &storage.BucketSpec{
>             DefaultStorageClass: storage.
>                 StorageClass_STANDARD,
>         },
>     },
> )
> if err != nil {
>     return err
> }
> if _, err = createOperation.Wait(ctx); err != nil {
>     return err
> }
> ```
>
> In the code, set the following parameters:
>
> * `Metadata.Name`: Bucket name.
> * `DefaultStorageClass`: Default storage class. The example sets `StorageClass_STANDARD`.

> [tab] Python SDK
>
> Create a bucket with a default storage class:
>
> ```python theme={null}
> create_service = BucketServiceClient(sdk)
> create_operation = await create_service.create(
>     CreateBucketRequest(
>         metadata=ResourceMetadata(name="<bucket_name>"),
>         spec=BucketSpec(
>             default_storage_class=StorageClass.STANDARD,
>         ),
>     ),
> )
> await create_operation.wait()
> ```
>
> In the code, set the following parameters:
>
> * `metadata.name`: Bucket name.
> * `default_storage_class`: Default storage class. The example sets `StorageClass.STANDARD`.

> [tab] JavaScript SDK
>
> Create a bucket with a default storage class:
>
> ```ts theme={null}
> const createService = new BucketService(sdk);
> const createOperation = await createService.create(
>   CreateBucketRequest.create({
>     metadata: ResourceMetadata.create({
>       name: "<bucket_name>",
>     }),
>     spec: BucketSpec.create({
>       defaultStorageClass: StorageClass.STANDARD,
>     }),
>   }),
> ).result;
> await createOperation.wait();
> ```
>
> In the code, set the following parameters:
>
> * `metadata.name`: Bucket name.
> * `defaultStorageClass`: Default storage class. The example sets `StorageClass.STANDARD`.

### For an existing bucket

> [tab] Web console
>
> 1. In the sidebar, go to  **Storage** → **Object Storage**.
> 2. Select the bucket you need and switch to the **Settings** tab.
> 3. Select the storage class and save the changes.

> [tab] Nebius AI Cloud CLI
>
> When you [modify a bucket](https://docs.nebius.com/object-storage/buckets/manage.md#how-to-modify-buckets-nebius-ai-cloud-cli), set the `--default-storage-class` parameter:
>
> ```bash theme={null}
> nebius storage bucket update \
>   --default-storage-class <STANDARD|ENHANCED_THROUGHPUT|INTELLIGENT> \
>   ...
> ```

> [tab] Go SDK
>
> Update the default storage class of an existing bucket:
>
> ```go theme={null}
> updateService := sdk.Services().Storage().V1().Bucket()
> updateBucket, err := updateService.GetByName(
>     ctx,
>     &storage.GetBucketByNameRequest{Name: "<bucket_name>"},
> )
> if err != nil {
>     return err
> }
> updateBucket.Spec.DefaultStorageClass = storage.
>     StorageClass_STANDARD
> updateOperation, err := updateService.Update(
>     ctx,
>     &storage.UpdateBucketRequest{
>         Metadata: updateBucket.Metadata,
>         Spec:     updateBucket.Spec,
>     },
> )
> if err != nil {
>     return err
> }
> if _, err = updateOperation.Wait(ctx); err != nil {
>     return err
> }
> ```
>
> In the code, set the following parameters:
>
> * `Name`: Bucket name.
> * `DefaultStorageClass`: Default storage class. The example sets `StorageClass_STANDARD`.

> [tab] Python SDK
>
> Update the default storage class of an existing bucket:
>
> ```python theme={null}
> update_service = BucketServiceClient(sdk)
> update_bucket = await update_service.get_by_name(
>     GetBucketByNameRequest(name="<bucket_name>"),
> )
> update_bucket.spec.default_storage_class = (
>     StorageClass.STANDARD
> )
> update_operation = await update_service.update(
>     UpdateBucketRequest(
>         metadata=update_bucket.metadata,
>         spec=update_bucket.spec,
>     ),
> )
> await update_operation.wait()
> ```
>
> In the code, set the following parameters:
>
> * `name`: Bucket name.
> * `default_storage_class`: Default storage class. The example sets `StorageClass.STANDARD`.

> [tab] JavaScript SDK
>
> Update the default storage class of an existing bucket:
>
> ```ts theme={null}
> const updateService = new BucketService(sdk);
> const updateBucket = await updateService.getByName(
>   GetBucketByNameRequest.create({ name: "<bucket_name>" }),
> ).result;
> updateBucket.spec.defaultStorageClass =
>   StorageClass.STANDARD;
> const updateOperation = await updateService.update(
>   UpdateBucketRequest.create({
>     metadata: updateBucket.metadata,
>     spec: updateBucket.spec,
>   }),
> ).result;
> await updateOperation.wait();
> ```
>
> In the code, set the following parameters:
>
> * `name`: Bucket name.
> * `defaultStorageClass`: Default storage class. The example sets `StorageClass.STANDARD`.

## How to upload an object to a storage class

If you need to store an object in a different storage class than the default one for the bucket, set the storage class during upload.

> [!WARNING]
>
> The [AWS CLI](https://docs.nebius.com/object-storage/interfaces/aws-cli.md) does not support uploading objects to a storage class that differs from the bucket's default. To do that, use [s5cmd](https://github.com/peak/s5cmd).

To [upload an object](https://docs.nebius.com/object-storage/objects/upload-download.md#uploading-a-single-file) to the desired storage class, set the `--storage-class` parameter in the upload command:

```bash s5cmd theme={null}
s5cmd cp \
   --storage-class <STANDARD|ENHANCED_THROUGHPUT|INTELLIGENT> \
   ...
   <local_path> s3://<bucket>/<path>
```

To change the storage class of an object after you upload it, make a `copy-object` request that moves the object between storage classes:

```bash s5cmd theme={null}
s5cmd cp \
   --storage-class <STANDARD|ENHANCED_THROUGHPUT|INTELLIGENT> \
   ...
   s3://<bucket>/<path> s3://<bucket>/<path>
```
