import { SDK } from '@meetkai/mka1';
const mka1 = new SDK({
apiKey: '<mka1-api-key>',
headers: { 'X-On-Behalf-Of': '<end-user-id>' },
});
const schema = await mka1.llm.extract.createSchema({
name: 'Invoice extraction',
description: 'Extract invoice header fields from PDF invoices',
schema: {
type: 'object',
properties: {
invoice_number: { type: 'string' },
vendor_name: { type: 'string' },
total_amount: { type: 'number' },
date: { type: 'string', format: 'date' },
},
required: ['invoice_number', 'total_amount'],
},
metadata: {
document_type: 'invoice',
},
});
console.log(schema.id); // e.g. "schema_invoice_123"