Skip to main content
Unsiloed provides specialized document AI APIs for parsing, extraction, classification, and splitting.

Installation

pnpm add @doclo/providers-unsiloed

Available Providers

The Unsiloed package provides 5 specialized providers:
ProviderTypeDescription
unsiloedParseProviderOCRSemantic document parsing
unsiloedExtractProviderVLMSchema-based data extraction
unsiloedTablesProviderVLMTable extraction
unsiloedClassifyProviderVLMDocument classification
unsiloedSplitProviderVLMDocument splitting

Parse Provider

Convert documents to structured text:
import { unsiloedParseProvider } from '@doclo/providers-unsiloed';
import { createFlow, parse } from '@doclo/flows';

const provider = unsiloedParseProvider({
  apiKey: process.env.UNSILOED_API_KEY!
});

const flow = createFlow()
  .step('parse', parse({ provider }))
  .build();

Extract Provider

Extract structured data from documents:
import { unsiloedExtractProvider } from '@doclo/providers-unsiloed';
import { createFlow, extract } from '@doclo/flows';

const provider = unsiloedExtractProvider({
  apiKey: process.env.UNSILOED_API_KEY!
});

const flow = createFlow()
  .step('extract', extract({
    provider,
    schema: invoiceSchema
  }))
  .build();

Tables Provider

Extract tables from documents:
import { unsiloedTablesProvider } from '@doclo/providers-unsiloed';
import { createFlow, extract } from '@doclo/flows';

const provider = unsiloedTablesProvider({
  apiKey: process.env.UNSILOED_API_KEY!
});

const flow = createFlow()
  .step('extract-tables', extract({
    provider,
    schema: tableSchema
  }))
  .build();

Classify Provider

Classify documents into categories:
import { unsiloedClassifyProvider } from '@doclo/providers-unsiloed';
import { createFlow, categorize } from '@doclo/flows';

const provider = unsiloedClassifyProvider({
  apiKey: process.env.UNSILOED_API_KEY!
});

const flow = createFlow()
  .step('categorize', categorize({
    provider,
    categories: ['invoice', 'receipt', 'contract']
  }))
  .build();

Split Provider

Split multi-document PDFs:
import { unsiloedSplitProvider } from '@doclo/providers-unsiloed';
import { createFlow, split } from '@doclo/flows';

const provider = unsiloedSplitProvider({
  apiKey: process.env.UNSILOED_API_KEY!
});

const flow = createFlow()
  .step('split', split({
    provider,
    schemas: { invoice: invoiceSchema }
  }))
  .build();

Factory Function

Create any Unsiloed provider with the factory function:
import { createUnsiloedProvider } from '@doclo/providers-unsiloed';

const parseProvider = createUnsiloedProvider({
  type: 'parse',
  apiKey: process.env.UNSILOED_API_KEY!
});

const extractProvider = createUnsiloedProvider({
  type: 'extract',
  apiKey: process.env.UNSILOED_API_KEY!
});

Pricing

Unsiloed uses per-page pricing:
import { USD_PER_PAGE, calculateUsage } from '@doclo/providers-unsiloed';

// Calculate cost for a 10-page document
const usage = calculateUsage(10);
console.log(`Cost: $${(USD_PER_PAGE * 10).toFixed(2)}`);

Supported File Types

import {
  SUPPORTED_MIME_TYPES,
  isMimeTypeSupported
} from '@doclo/providers-unsiloed';

// Check if a file type is supported
if (isMimeTypeSupported('application/pdf')) {
  // Process the PDF
}

Environment Variables

UNSILOED_API_KEY=your_api_key_here

Next Steps