Use Runpod’s S3-compatible API to access and manage your network volumes.
Runpod provides an S3-protocol compatible API for direct access to your network volumes. This allows you to manage files on your network volumes without launching a Pod, reducing cost and operational friction.
Using the S3-compatible API does not affect pricing. Network volumes are billed hourly at $0.07/GB/month for the first 1TB, and $0.05/GB/month for additional storage.
The S3-compatible API is available for network volumes in select datacenters. Each datacenter has a unique endpoint URL that you’ll use when calling the API:
Datacenter | Endpoint URL |
---|---|
EUR-IS-1 | https://s3api-eur-is-1.runpod.io/ |
EU-RO-1 | https://s3api-eu-ro-1.runpod.io/ |
EU-CZ-1 | https://s3api-eu-cz-1.runpod.io/ |
US-KS-2 | https://s3api-us-ks-2.runpod.io/ |
Create your network volume in a supported datacenter to use the S3-compatible API.
Create a network volume
First, create a network volume in a supported datacenter. See Network volumes -> Create a network volume for detailed instructions.
Create an S3 API key
Next, you’ll need to generate a new key called an “S3 API key” (this is separate from your Runpod API key).
user_***...
) and secret (e.g., rps_***...
) to use in the next step.For security, Runpod will show your API key secret only once, so you may wish to save it elsewhere (e.g., in your password manager, or in a GitHub secret). Treat your API key secret like a password and don’t share it with anyone.
Configure AWS CLI
To use the S3-compatible API with your Runpod network volumes, you must configure your AWS CLI with the Runpod S3 API key you created.
aws configure
in your terminal.Shared Secret for user_2f21CfO73Mm2Uq2lEGFiEF24IPw 1749176107073
. user_2f21CfO73Mm2Uq2lEGFiEF24IPw
is the user ID (yours will be different).json
.This will configure the AWS CLI to use your Runpod S3 API key by storing these details in your AWS credentials file (typically at ~/.aws/credentials
).
You can use the S3-compatible API to interact with your Runpod network volumes using standard S3 tools:
Core AWS CLI operations such as ls
, cp
, mv
, rm
, and sync
function as expected.
When using aws s3
commands, you must pass in the endpoint URL for your network volume using the --endpoint-url
flag and the datacenter ID using the --region
flag.
The --region
flag is case-sensitive. For instance, --region EU-RO-1
is a valid input, whereas --region eu-ro-1
will be rejected.
Unlike traditional S3 key-value stores, object names in the Runpod S3-compatible API correspond to actual file paths on your network volume. Object names containing special characters (e.g., #
) may need to be URL-encoded to ensure proper processing.
Use ls
to list objects in a network volume directory:
Unlike standard S3 buckets, ls
and ListObjects
operations will list empty directories.
ls
operations may take a long time when used on a directory containing many files (over 10,000) or large amounts of data (over 10GB), or when used recursively on a network volume containing either.
Use cp
to copy a file to a network volume:
Use cp
to copy a file from a network volume to a local directory:
Use rm
to remove a file from a network volume:
If you encounter a 502 “bad gateway” error during file transfer, try increasing AWS_MAX_ATTEMPTS
to 10 or more:
This command syncs a local directory (source) to a network volume directory (destination):
You can also use aws s3api
commands (instead of aws s3
) to interact with the S3-compatible API.
For example, here’s how you could use aws s3api get-object
to download an object from a network volume:
Replace [LOCAL_FILE]
with the desired path and name of the file after download—for example: ~/local-dir/my-file.txt
.
For a list of available s3api
commands, see the AWS s3api reference.
You can also use the Boto3 library to interact with the S3-compatible API, using it to transfer files to and from a Runpod network volume.
The script below demonstrates how to upload a file to a Runpod network volume using the Boto3 library. It takes command-line arguments for the network volume ID (as an S3 bucket), the datacenter-specific S3 endpoint URL, the local file path, the desired object (file path on the network volume), and the AWS Region (which corresponds to the Runpod datacenter ID).
Your Runpod S3 API key credentials must be set as environment variables using the values from the Setup and authentication step:
AWS_ACCESS_KEY_ID
: Should be set to your Runpod S3 API key access key (e.g., user_***...
).AWS_SECRET_ACCESS_KEY
: Should be set to your Runpod S3 API key’s secret (e.g., rps_***...
).When uploading files with Boto3, you must specify the complete file path (including the filename) for both source and destination files.
For example, for the put_objects
method above, you must specify these arguments:
file_path
: The local source file (e.g., local_directory/file.txt
).object_name
: The remote destination file to be created on the network volume (e.g., remote_directory/file.txt
).With that in mind, here’s an example of how to run the script above using command-line arguments:
The tables below show which S3 API operations and AWS CLI commands are currently supported. Use the tables below to understand what functionality is available and plan your development workflows accordingly.
For detailed information on these operations, refer to the AWS S3 API documentation.
If a function is not listed below, that means it’s not currently implemented. We are continuously expanding the S3-compatible API based on customer needs and usage patterns.
Operation | Supported | CLI Command | Notes |
---|---|---|---|
CopyObject | ✅ | aws s3 cp , aws s3api copy-object | Copy objects between locations |
DeleteObject | ✅ | aws s3 rm , aws s3api delete-object | Remove individual objects |
GetObject | ✅ | aws s3 cp , aws s3api get-object | Download objects |
HeadBucket | ✅ | aws s3 ls , aws s3api head-bucket | Verify bucket exists and permissions |
HeadObject | ✅ | aws s3api head-object | Retrieve object metadata |
ListBuckets | ✅ | aws s3 ls , aws s3api list-buckets | List available network volumes |
ListObjects | ✅ | aws s3 ls , aws s3api list-objects | List objects in a bucket (includes empty directories) |
ListObjectsV2 | ✅ | aws s3 ls , aws s3api list-objects-v2 | Enhanced version of ListObjects |
PutObject | ✅ | aws s3 cp , aws s3api put-object | Upload objects (<500MB) |
DeleteObjects | ❌ | aws s3api delete-objects | Planned |
RestoreObject | ❌ | aws s3api restore-object | Not supported |
Files larger than 500MB must be uploaded using multipart uploads. The AWS CLI performs multipart uploads automatically.
Operation | Supported | CLI Command | Notes |
---|---|---|---|
CreateMultipartUpload | ✅ | aws s3api create-multipart-upload | Start multipart upload for large files |
UploadPart | ✅ | aws s3api upload-part | Upload individual parts |
CompleteMultipartUpload | ✅ | aws s3api complete-multipart-upload | Finish multipart upload |
AbortMultipartUpload | ✅ | aws s3api abort-multipart-upload | Cancel multipart upload |
ListMultipartUploads | ✅ | aws s3api list-multipart-uploads | View in-progress uploads |
ListParts | ✅ | aws s3api list-parts | List parts of a multipart upload |
Operation | Supported | CLI Command | Notes |
---|---|---|---|
CreateBucket | ❌ | aws s3api create-bucket | Use the Runpod console to create network volumes |
DeleteBucket | ❌ | aws s3api delete-bucket | Use the Runpod console to delete network volumes |
GetBucketLocation | ❌ | aws s3api get-bucket-location | Datacenter info available in the Runpod console |
GetBucketVersioning | ❌ | aws s3api get-bucket-versioning | Versioning is not supported |
PutBucketVersioning | ❌ | aws s3api put-bucket-versioning | Versioning is not supported |
Operation | Supported | CLI Command | Notes |
---|---|---|---|
GetBucketAcl | ❌ | N/A | ACLs are not supported |
PutBucketAcl | ❌ | N/A | ACLs are not supported |
GetObjectAcl | ❌ | N/A | ACLs are not supported |
PutObjectAcl | ❌ | N/A | ACLs are not supported |
GetBucketPolicy | ❌ | N/A | Bucket policies are not supported |
PutBucketPolicy | ❌ | N/A | Bucket policies are not supported |
Operation | Supported | CLI Command | Notes |
---|---|---|---|
GetObjectTagging | ❌ | N/A | Object tagging is not supported |
PutObjectTagging | ❌ | N/A | Object tagging is not supported |
DeleteObjectTagging | ❌ | N/A | Object tagging is not supported |
Operation | Supported | CLI Command | Notes |
---|---|---|---|
GetBucketEncryption | ❌ | N/A | Encryption is not supported |
PutBucketEncryption | ❌ | N/A | Encryption is not supported |
GetObjectLockConfiguration | ❌ | N/A | Object locking is not supported |
PutObjectLockConfiguration | ❌ | N/A | Object locking is not supported |
ListObjects
operations may take a long time when used on a directory containing many files (over 10,000) or large amounts of data (over 10GB), or when used recursively on a network volume containing either.
When running aws s3 ls
or ListObjects
on a directory with many files or large amounts of data (typically >10,000 files or >10 GB of data) for the first time, it may run very slowly, or you may encounter the following error:
This occurs because Runpod must compute and cache the MD5 checksum (i.e., ETag) for files created without the S3-compatible API. This computation can take several minutes for large directories or files, as the ListObjects
request must wait until the checksum is ready.
Workarounds:
CopyObject
and UploadPart
actions do not check for available free space beforehand and may fail if the volume runs out of space.#
) may need to be URL encoded to ensure proper processing..s3compat_uploads/
folder. This folder and its contents are automatically cleaned up when you call CompleteMultipartUpload
or AbortMultipartUpload
.When uploading large files (12GB+), you may encounter timeout errors during the CompleteMultipartUpload
operation. To resolve this, increase the timeout settings in your AWS tools:
For aws s3
and aws s3api
, use the --cli-read-timeout
parameter:
Or, configure timeout in ~/.aws/config
:
For comprehensive documentation on AWS S3 commands and libraries, refer to: