Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api-reference.scale.com/llms.txt

Use this file to discover all available pages before exploring further.

File Upload

** File Upload Size:** There is a size limit of 80 MB per file. Need more? Get in touch.
Body Params
object
file
file
required
The local file to be uploaded.
display_name
string
A human readable name for the file.
project_name
string
Which project this file will be associated with. This is only used for the “Scale Rapid” data labeling tool. In order to upload the same file to multiple projects, call the File Upload API multiple times with the same id and different project_name values.
reference_id
string
A unique identifier for your file used for upload idempotency. Uploading two files with the same_reference_id will result in a 409 (Conflict) error.
metadata
object
A JSON object used to store additional data associated with the file.
import requests
from requests.auth import HTTPBasicAuth
import json


url = "https://api.scale.com/v1/files/upload"

auth = HTTPBasicAuth('{{api_key}}', '')

headers = {
    "Accept": "application/json",
}

with open("kitten.png", "rb") as f:
    response = requests.request(
        "POST",
        url,
        data={
            "project_name": "kitten_labeling",
            "metadata": json.dumps({"id": "kitten0"}),
        },
        files={"file": f},
        headers=headers,
        auth=auth,
    )
    print(response.text)

File Import

Body Params
object
file_url
file
required
The file url to be uploaded.
import requests
url = "https://api.scale.com/v1/files/import"
payload = { "file_url": "http://www.example.com/file.png" }
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "<YOUR_API_KEY>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)

Get Assets

Body Params
object
project
string
required
Project filter
metadata
string
Metadata filter
cursor
string
Cursor for pagination