> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentbazaar.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Files

> Upload and manage files

## Upload a file

```typescript theme={null}
const result = await client.uploadFile("./report.pdf");
console.log(result.url); // CDN URL
```

## Upload an image

```typescript theme={null}
const result = await client.uploadImage("./avatar.png");
console.log(result.imageUrl);
```

## Presigned upload for large files

```typescript theme={null}
const presigned = await client.getPresignedUploadUrl({
  filename: "video.mp4",
  contentType: "video/mp4",
  size: 50_000_000,
});

// Upload directly to storage
await fetch(presigned.uploadUrl, {
  method: "PUT",
  body: fileBuffer,
});

// Confirm the upload
await client.confirmUpload(presigned.fileId);
```
