S3-compatible API
Use Runpod’s S3-compatible API to access and manage your network volumes.
The S3-compatible API is currently in beta. If you’d like to provide feedback, please join our Discord
Runpod provides an S3-protocol compatible API that allows direct access to your network volumes. This feature enables you to manage files on your network volumes without needing to launch a Pod, reducing cost and operational friction.
Using the S3-compatible API to access your network volumes does not affect pricing. Network volumes are billed hourly at a rate of $0.07 per GB per month for the first 1TB, and $0.05 per GB per month for additional storage beyond that.
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 format https://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
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.
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 your access key ID and secret access key to use in the next step.
For security, Runpod will show your secret access key only once, so you may wish to save it elsewhere (e.g., in your password manager, or in a GitHub secret). Treat your secret access key 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.
- If you haven’t already, install the AWS CLI on your local machine.
- Run the command
aws configure
in 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_2f21CfO73Mm2Uq2lEGFiEF24IPw
is 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:
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
).
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 as ls
, cp
, mv
, rm
, and sync
function as expected.
s3 CLI examples
When using aws 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
Use ls
to list objects in a network volume directory:
Transfer files
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:
Sync directories
This command syncs a local directory (source) to a network volume directory (destination):
s3api CLI example
You can also use aws 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:
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.
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:
RUNPOD_USER_EMAIL
: Should be set to your Runpod account email.RUNPOD_S3_API_KEY
: Should be set to your Runpod S3 API key’s secret access key.
Example usage:
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. |
Large file handling is supported through multipart uploads, allowing you to transfer files larger than 5GB.
Limitations
- Multipart uploads:
- Parts from multipart uploads are stored on disk until either
CompleteMultipartUpload
orAbortMultipartUpload
is 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
- Storage capacity: Network volumes have a fixed storage capacity, unlike the virtually unlimited storage of standard S3 buckets. The
CopyObject
andUploadPart
actions 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. - 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.
Reference documentation
For comprehensive documentation on AWS S3 commands and libraries, refer to: