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,) -> UploadResultupload()
Upload one or more files with automatic descriptions (same as client.upload)
async def upload(...) -> BatchUploadResultsupload_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",) -> BatchUploadResultscheck_quota()
Check upload quota before uploading
async def check_quota(file_count: int = 1) -> QuotaInforequest_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",) -> PresignedUrlInfoconfirm_upload()
Confirm upload after S3 PUT
async def confirm_upload( object_key: str, size_bytes: int, *, checksum: Optional[str] = None,) -> ConfirmResultwait_for_description()
Poll until description completes
async def wait_for_description( image_id: str, *, timeout: Optional[float] = None, poll_interval: Optional[float] = None,) -> DescriptionStatusbatch_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,) -> BatchPrepareResultbatch_confirm()
Confirm batch upload completion
async def batch_confirm( batch_id: str, confirmations: list[UploadConfirmation], *, auto_process: bool = True,) -> BatchConfirmResultget_batch_status()
Check the status of a batch upload operation
async def get_batch_status(batch_id: str) -> UploadBatchStatusResult