Skip to main content
GET
/
serverless
/
files
/
file
/
{file}
Download file
curl --request GET \
  --url https://api.fal.ai/v1/serverless/files/file/{file} \
  --header 'Authorization: <api-key>'
import requests

url = "https://api.fal.ai/v1/serverless/files/file/{file}"

headers = {"Authorization": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<api-key>'}};

fetch('https://api.fal.ai/v1/serverless/files/file/{file}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "error": {
    "type": "authorization_error",
    "message": "Authentication required"
  }
}
{
"error": {
"type": "not_found",
"message": "Resource not found"
}
}
{
"error": {
"type": "rate_limited",
"message": "Rate limit exceeded"
}
}
{
"error": {
"type": "server_error",
"message": "An unexpected error occurred"
}
}

Authorizations

Authorization
string
header
required

API key must be prefixed with "Key ", e.g. Authorization: Key YOUR_API_KEY

Path Parameters

file
string
required

Path of the file to download

Example:

"datasets/images/cat.jpg"

Response

File stream