title | description |
---|---|
Salad Simple Storage |
This is a simple HTTP service to allow SaladCloud customers to temporarily upload assets for use in other SaladCloud services. Examples include uploading images for stable diffusion training or inference, audio clips for transcription, etc. |
- Maximum file size is 100MB
- Files will be automatically deleted after 30 days
Requests to the S4 service must include either:
- A
Salad-Api-Key
header with a valid SaladCloud API key. - An
Authorization
header with a valid SaladCloud JWT (issued by the Instance Metadata Service) as a bearer token.
Uploads a file to the specified organization.
Request Parameters:
organization_name
(string): The name of the organization.filename
(string): The name of the file to upload. This can be a path, and the file will be stored in a directory structure based on the path. e.g.path/to/my/file.tar.gz
will be stored aspath/to/my/file.tar.gz
.
Example Request:
curl -X PUT \
'https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz' \
--header 'Salad-Api-Key: YOURAPIKEY' \
--form 'mimeType="application/tar+gzip"' \
--form 'file=@/path/to/my/file.tar.gz'
Example Response:
{
"url": "https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz"
}
Example Request, Creating Signed URL
When uploading a file, you can optionally request to sign the url, which will allow you to use the returned url to fetch
the file without needing to include the Salad-Api-Key
header.
curl -X PUT \
'https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz' \
--header 'Salad-Api-Key: YOURAPIKEY' \
--form 'mimeType="application/tar+gzip"' \
--form 'file=@/path/to/my/file.tar.gz' \
--form 'sign=true' \
--signatureExp '86400'
Example Response, Signed URL
{
"url": "https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz?token=8eb6de1b-b313-4169-8411-39860ebc73ab"
}
Downloads a file from the specified organization.
Request Parameters:
organization_name
(string): The name of the organization.filename
(string): The name of the file to download.
Example Request:
curl -X GET \
'https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz' \
--header 'Salad-Api-Key: YOURAPIKEY' \
--output file.tar.gz
Deletes a file from the specified organization.
Request Parameters:
organization_name
(string): The name of the organization.filename
(string): The name of the file to delete.
Example Request:
curl -X DELETE \
'https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz' \
--header 'Salad-Api-Key: YOURAPIKEY'
Lists all files within the specified organization.
Request Parameters:
organization_name
(string): The name of the organization.
Example Request:
curl -X GET \
'https://storage-api.salad.com/organizations/salad-benchmarking/files' \
--header 'Salad-Api-Key: YOURAPIKEY'
Example Response:
{
"files": [
{
"url": "https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz",
"size": 1024,
"mimeType": "application/tar+gzip",
"uploaded": "2021-09-01T12:00:00Z",
"etag": "1234567890"
}
]
}
Creates a signed URL for a file in the specified organization.
Request Parameters:
organization_name
(string): The name of the organization.filename
(string): The name of the file to create a signed URL for.
Example Request:
curl -X POST \
'https://storage-api.salad.com/organizations/salad-benchmarking/file_tokens/path/to/my/file.tar.gz' \
--header 'Salad-Api-Key: YOURAPIKEY' \
--data '{"method": "GET", "expires": 86400}'
Example Response:
{
"url": "https://storage-api.salad.com/organizations/salad-benchmarking/files/path/to/my/file.tar.gz?token=974360ea-63f7-4db3-9692-72ca5dbae615"
}