Documentation

UploadResource

Access via client.uploads - Low-level upload operations

Note

For most use cases, use the high-level client.upload() method instead.

upload_one()

Upload a single file with automatic AI description

async def upload_one(
file: Union[str, Path, bytes],
*,
filename: Optional[str] = None,
wait_for_descriptions: bool = True,
raise_on_failure: bool = True,
description_timeout: Optional[float] = None,
storage_target: Union[StorageTarget, str] = StorageTarget.DEFAULT,
) -> UploadResult

upload()

Upload one or more files with automatic descriptions (same as client.upload)

async def upload(...) -> BatchUploadResults

upload_batch()

Upload multiple files in parallel with optimized batch workflow (up to 10,000 files)

async def upload_batch(
files: Union[str, Path, list[Union[str, Path, bytes]]],
*,
filenames: Optional[list[str]] = None,
recursive: bool = True,
include_hidden: bool = False,
wait_for_descriptions: bool = True,
raise_on_failure: bool = True,
description_timeout: Optional[float] = None,
on_progress: Optional[Callable[[UploadProgressEvent], None]] = None,
on_file_complete: Optional[Callable[[FileCompleteEvent], None]] = None,
on_description_progress: Optional[Callable[[DescriptionProgressEvent], None]] = None,
on_description_failed: Optional[Callable[[DescriptionFailedEvent], None]] = None,
intent: str = "describe",
verification_level: str = "standard",
storage_target: str = "default",
) -> BatchUploadResults

check_quota()

Check upload quota before uploading

async def check_quota(file_count: int = 1) -> QuotaInfo

request_presigned_url()

Get presigned URL for direct S3 upload

async def request_presigned_url(
filename: str,
content_type: str,
size_bytes: int,
*,
purpose: str = "image_analysis",
idempotency_key: Optional[str] = None,
storage_target: str = "default",
) -> PresignedUrlInfo

confirm_upload()

Confirm upload after S3 PUT

async def confirm_upload(
object_key: str,
size_bytes: int,
*,
checksum: Optional[str] = None,
) -> ConfirmResult

wait_for_description()

Poll until description completes

async def wait_for_description(
image_id: str,
*,
timeout: Optional[float] = None,
poll_interval: Optional[float] = None,
) -> DescriptionStatus

batch_prepare()

Prepare batch upload (get presigned URLs for multiple files)

async def batch_prepare(
files: list[FileInfo],
*,
intent: str = "describe",
verification_level: str = "standard",
additional_params: Optional[dict[str, Any]] = None,
) -> BatchPrepareResult

batch_confirm()

Confirm batch upload completion

async def batch_confirm(
batch_id: str,
confirmations: list[UploadConfirmation],
*,
auto_process: bool = True,
) -> BatchConfirmResult

get_batch_status()

Check the status of a batch upload operation

async def get_batch_status(batch_id: str) -> UploadBatchStatusResult