File Management

Upload a file

Upload a file (image or video) to be used as input for predictions. The uploaded file will be stored temporarily and can be referenced in prediction requests by its URL.

Uploaded files are available for 30 minutes after upload and are automatically deleted after expiration. Use the returned URL in your prediction input fields that accept file URLs.

Rate limit: 10000 requests per minute

Example with curl:

curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/your/file.jpg"

Note: Use -F (form) with @ prefix to upload a file from your local filesystem.

post/v1/files

Request

  • Base URL: https://api.pruna.ai
  • URL: https://api.pruna.ai/v1/files
  • Auth: API key in header apikey

Response

File uploaded successfully

idstring required

Unique identifier for the uploaded file

namestring required

Original filename

content_typestring required

MIME type of the uploaded file

sizeinteger required

File size in bytes

etagstring

Entity tag for cache validation

created_atstring date-time required

Timestamp when the file was uploaded

expires_atstring date-time required

Timestamp when the file will expire and be deleted

Example response

{
  "id": "fqadqq42xq",
  "name": "test.jpg",
  "content_type": "image/jpeg",
  "size": 185093,
  "etag": "\"14e9a51deaac6bee2dd8b5c52d7d0b5f\"",
  "checksums": {
    "sha256": "aa10d5d09bcee5cb5d854bd81899308b0cf0c0c50e29d4f00c2c06e51f0e2fe6"
  },
  "metadata": {
    "content_length": 185093,
    "width": 1344,
    "height": 768
  },
  "created_at": "2025-01-08T18:51:26.729Z",
  "expires_at": "2025-01-09T18:51:26.729Z",
  "urls": {
    "get": "https://api.pruna.ai/v1/files/fqadqq42xq"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.