The S3-compatible API is currently in beta. If you’d like to provide feedback, please join our Discord
Datacenter availability
The S3-compatible API is currently available for network volumes hosted in a limited number of datacenters. Each datacenter has an endpoint URL that you’ll use when calling the S3-compatible API, using the formathttps://s3api-[DATACENTER].runpod.io/.
Create a network volume in one of the following datacenters to use the S3-compatible API:
| Datacenter | Endpoint URL |
|---|---|
EUR-IS-1 | https://s3api-eur-is-1.runpod.io/ |
EU-RO-1 | https://s3api-eu-ro-1.runpod.io/ |
Setup and authentication
1
Create a network volume
Before you can use the S3-compatible API, you must create a network volume in a supported datacenter. For detailed instructions, see Network volumes -> Create a network volume.
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).
- In the Runpod console, navigate to the Settings page.
- Expand the S3 API Keys section and select Create an S3 API key.
- Give your key a name and select Create.
- Make a note of 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.
- 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 access key (e.g.,
user_***...) from the previous step. - AWS Secret Access Key: Enter your secret (e.g.,
rps_***...) from the previous step. - 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 access key (e.g.,
~/.aws/credentials).Using the S3-compatible API
You can use the S3-compatible API to interact with your Runpod network volumes using standard S3 tools: Core AWS CLI operations such asls, cp, mv, rm, and sync function as expected.
s3 CLI examples
When usingaws s3 commands, you must pass in the endpoint URL for your network volume using the --endpoint-url 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
Usels to list objects in a network volume directory:
Transfer files
Usecp to copy a file to a network volume:
cp to copy a file from a network volume to a local directory:
rm to remove a file from a network volume:
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 the 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). 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_***...).
Supported S3 actions
The S3-compatible API supports the following operations. For detailed information on each, refer to the AWS S3 API documentation.| Operation | Description |
|---|---|
CopyObject | Copy objects between locations. |
DeleteObject | Remove objects. |
GetObject | Download objects. |
HeadBucket | Verify bucket exists and you have permissions. |
HeadObject | Retrieve object metadata. |
ListBuckets | List available buckets. |
ListObjects | List objects in a bucket. |
PutObject | Upload objects. |
CreateMultipartUpload | Start a multipart upload for large files. |
UploadPart | Upload a part of a multipart upload. |
CompleteMultipartUpload | Finish a multipart upload. |
AbortMultipartUpload | Cancel a multipart upload. |
ListMultipartUploads | View in-progress multipart uploads. |
Limitations
- 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. This behavior is similar to applying a size quota in S3. - Maximum file size: 4TB (the maximum size of a network volume).
- Multipart uploads:
- Parts from multipart uploads are stored on disk until either
CompleteMultipartUploadorAbortMultipartUploadis called. - The S3-compatible API enforces the 5GB maximum single file part upload size, but not the 5TB maximum file size.
- The 5MB minimum part size for multipart uploads is not enforced.
- Parts from multipart uploads are stored on disk until either
- 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.
- Unsupported S3 features:
- Object versioning.
- Object encryption.
- Object tagging.
- Object ACLs.
- Object locking.
- Website redirects.
- Storage classes besides
STANDARD(all network volume objects use theSTANDARDstorage class).