SDK

Schemas

A schema is a JSON Schema describing the typed output you want from an extraction. lirovo.schemas exposes create, list, and get.

schemas.create(input)#

Registers a new schema and resolves to a Schema. Input is a CreateSchemaInput.

namerequired
string

Human-readable name for the schema.

description
string | null

Optional free-text description.

jsonSchemarequired
Record<string, unknown>

The JSON Schema document describing the output shape. Sent on the wire as json_schema.

ts
const schema = await lirovo.schemas.create({
  name: "product-mentions",
  description: "Products named in the video",
  jsonSchema: {
    type: "object",
    properties: { products: { type: "array", items: { type: "string" } } },
    required: ["products"],
  },
});
// => Schema { id, name, ... }

schemas.list(params?)#

Lists schemas and resolves to a SchemaList. Accepts optional limit and cursor for pagination.

ts
const page = await lirovo.schemas.list({ limit: 20 });
// => SchemaList { data, ... }

schemas.get(id)#

Fetches a single schema by id and resolves to a Schema.

ts
const schema = await lirovo.schemas.get("sch_a1b2");