Skip to content

Public Access

Files in public vaults are accessible without authentication. This is useful for hosting public assets, open datasets, or shareable content.

Tusky provides three unauthenticated endpoints for public access:

EndpointDescription
GET /api/public/files/:fileIdDownload a file by ID
GET /api/public/blobs/:blobIdDownload by Walrus blob ID
GET /api/public/vaults/:userId/:vaultSlugList files in a public vault
// Using the SDK — no API key needed for public methods
const tusky = new TuskyClient({ apiKey: '' });
// Build a URL (synchronous, no API call)
const fileUrl = tusky.public.getFileUrl('file-uuid');
// → "https://api.opentusk.ai/api/public/files/file-uuid"
// Download directly
const response = await fetch(fileUrl);
const data = await response.arrayBuffer();

Once a file is synced to Walrus, you can access it by its content-addressed blob ID. This works even if the file is cold (evicted from hot cache):

const blobUrl = tusky.public.getBlobUrl('walrus-blob-id');
const response = await fetch(blobUrl);

Browse all files in a public vault using the owner’s user ID and vault slug:

const result = await tusky.public.listVaultFiles('user-uuid', 'my-public-vault');
console.log(result.vault.name);
console.log(result.files.length);

Only files in public vaults are accessible via these endpoints. Files in private vaults always require authentication and return encrypted content that can only be decrypted client-side.

Vault visibility is set at creation and cannot be changed.

  • Static assets: Host images, PDFs, or documents with direct URLs
  • Open data: Share datasets publicly via vault listings
  • Decentralized links: Use Walrus blob IDs for content-addressed, permanent URLs