Download File

Download a previously uploaded file from AI providers using its file ID

returns IUploadedFile

Retrieve a file that was previously uploaded to an AI provider. Supports OpenAI and Google, returning a normalized IUploadedFile object with metadata and access details.


Basic Usage (Download by File ID)

using UnityEngine;
using Glitch9.AIDevKit;

// File ID returned from a previous UploadFileTask
string fileId = "file-abc123";

IUploadedFile file = await Api.OpenAI.DownloadFile(fileId)
    .ExecuteAsync();

Debug.Log($"Downloaded: {file.Id} ({file.FileName}, {file.SizeBytes} bytes)");

Google Download

string gcsFileId = "gcs-xyz456";

IUploadedFile gcsFile = await Api.Google.DownloadFile(gcsFileId)
    .ExecuteAsync();

Debug.Log($"Downloaded from GCS: {gcsFile.Uri}");

Last updated