Installation

Basic Usage

import { Cortex } from '@cortex-ai/sdk';

const cortex = new Cortex({
  apiKey: 'YOUR_API_KEY',
});

const run = await cortex.apps.workflows.runs.create('YOUR_WORKFLOW_ID', {
  input: {
    fields_to_extract:
      'Get the invoice_number, total_amount, and customer_details',
    document: 'https://example.com/invoice.pdf',
  },
});

console.log(run.result); // {invoice_number: '123456', total_amount: '1000', customer_details: 'John Doe'}

Authentication

To authenticate, you need a Cortex API key, which you can obtain from the Cortex dashboard settings page.