Datacenter availability
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:
Create your network volume in a supported datacenter to use the S3-compatible API.
Setup and authentication
1
Create a network volume
First, create a network volume in a supported datacenter. See Network volumes -> Create a network volume for detailed instructions.
2
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).
- Go to the Settings page in the Runpod console.
- Expand S3 API Keys and select Create an S3 API key.
- Name your key and select Create.
- Save the access key (e.g.,
user_***...) and secret (e.g.,rps_***...) to use in the next step.
3
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.
This command displays which credentials are currently active, the source of each credential (such as the config file or environment variables), and whether all required credentials are properly set.
- If you haven’t already, install the AWS CLI on your local machine.
- Run the command
aws configurein your terminal. - Provide the following when prompted:
- AWS Access Key ID: Enter your Runpod user ID. You can find this in the Secrets section of the Runpod console, in the description of your S3 API key. By default, the description will look similar to:
Shared Secret for user_2f21CfO73Mm2Uq2lEGFiEF24IPw 1749176107073.user_2f21CfO73Mm2Uq2lEGFiEF24IPwis the user ID (yours will be different). - AWS Secret Access Key: Enter your Runpod S3 API key’s secret access key.
- Default Region name: You can leave this blank.
- Default output format: You can leave this blank or set it to
json.
- AWS Access Key ID: Enter your Runpod user ID. You can find this in the Secrets section of the Runpod console, in the description of your S3 API key. By default, the description will look similar to:
~/.aws/credentials).Managing credentials
Managing credentials
Verifying your AWS configuration
If you’re experiencing authentication issues, use the following command to check your current AWS configuration:Environment variables override config files
AWS CLI uses the following priority order for credentials (highest to lowest):- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) - AWS credentials file (
~/.aws/credentials) - AWS config file (
~/.aws/config)
-
Check for existing environment variables:
-
If outdated environment variables are set, unset them:
-
Verify your configuration again:
Using the S3-compatible API
You can use the S3-compatible API to interact with your Runpod network volumes using standard S3 tools: Standard AWS CLI operations such asls, cp, mv, and rm work as expected for most file operations. The sync command works for basic use cases but may encounter issues with large numbers of files (10,000+) or complex directory structures.
Network volume path mapping
Network volume path mapping
Network volumes are mounted to Serverless workers at
/runpod-volume and to Pods at /workspace by default. The S3-compatible API maps file paths as follows:- Pod filesystem path:
/workspace/my-folder/file.txt - Serverless worker path:
/runpod-volume/my-folder/file.txt - S3 API path:
s3://NETWORK_VOLUME_ID/my-folder/file.txt
s3 CLI examples
When usingaws 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.
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.
List objects
List objects
Use Unlike standard S3 buckets,
ls to list objects in a network volume directory:ls and ListObjects operations will list empty directories.Transfer files
Transfer files
Use Use
cp to copy a file to a network volume:cp to copy a file from a network volume to a local directory:Remove files
Remove files
Use
rm to remove a file from a network volume:Sync directories
Sync directories
This command syncs a local directory (source) to a network volume directory (destination):
s3api CLI example
You can also useaws 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:
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.
Boto3 Python example
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).Boto3 script
Boto3 script
To run this script, 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_***...).
Example usage
Example usage
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).
Uploading very large files
You can upload large files to network volumes using S3 multipart upload operations (see the compatibility reference below). You can also download this helper script, which dramatically improves reliability when uploading very large files (10GB+) by handling timeouts and retries automatically. Click here to download the script on GitHub. Here’s an example of how to run the script using command line arguments:S3 API compatibility reference
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 user needs and usage patterns.
Core operations
Core operations
Multipart upload operations
Multipart upload operations
Files larger than 500MB must be uploaded using multipart uploads. The AWS CLI performs multipart uploads automatically.
Bucket management operations
Bucket management operations
Access control and permissions
Access control and permissions
Object metadata and tagging
Object metadata and tagging
Encryption and security
Encryption and security
Known issues and limitations
ListObjects runs slowly or fails with "same next token" error
ListObjects runs slowly or fails with "same next token" error
When running 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
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:ListObjects request must wait until the checksum is ready.Workarounds:- The operation will typically complete successfully if you wait for the process to finish.
- If the client aborts with a pagination error, retry the operation after a brief pause.
Storage and time synchronization
Storage and time synchronization
- Storage capacity: Network volumes have a fixed storage capacity, unlike the virtually unlimited storage of standard S3 buckets. The
CopyObjectandUploadPartactions do not check for available free space beforehand and may fail if the volume runs out of space. - Maximum file size: 4TB (the maximum size of a network volume).
- Object names: 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. - Time synchronization: Requests that are out of time sync by 1 hour will be rejected. This is more lenient than the 15-minute window specified by the AWS SigV4 authentication specification.
Multipart uploads
Multipart uploads
- The maximum size for a single part of a multipart upload is 500MB.
- The AWS S3 minimum part size of 5MB is not enforced.
- Multipart upload parts and metadata are stored in a hidden
.s3compat_uploads/folder. This folder and its contents are automatically cleaned up when you callCompleteMultipartUploadorAbortMultipartUpload.
aws s3 sync limitations
aws s3 sync limitations
The
aws s3 sync command has limited support in Runpod’s S3-compatible API. While it works for basic use cases (syncing small numbers of files and simple directory structures), you may encounter errors when syncing directories with very large numbers of files (over 10,000) or complex nested structures.Common issues include:- EOF errors with 200 OK responses.
- Duplicate ContinuationToken errors in ListObjectsV2.
- Intermittent AccessDenied errors.
cp commands for better reliability. Full sync support is in development.Timeout configuration for large files
Timeout configuration for large files
When uploading large files (10GB+), you may encounter timeout errors during the
CompleteMultipartUpload operation. To resolve this, we recommend using the multipart upload helper script.Or you can try increasing the timeout settings in your AWS tools:- AWS CLI
- Boto3
For Or, configure timeout in
aws s3 and aws s3api, use the --cli-read-timeout parameter:~/.aws/config: