Skip to main content
ViscribeAI is an open-source Python and TypeScript SDK for structured image extraction. It exposes one public image method: extract. Pass an image, an output schema, and an optional instruction. Viscribe sends an OpenAI-compatible vision request and returns parsed data that matches your schema.

Quickstart

Install the SDK and make your first extraction request.

Extract

Shape image workflows with schemas and instructions.

Python

from pydantic import BaseModel, Field
from viscribe.images import extract


class Receipt(BaseModel):
    merchant_name: str | None = Field(description="Store or business name")
    total_amount: float | None = Field(description="Final total on the receipt")
    date: str | None = Field(description="Receipt date if visible")
    line_items: list[str] = Field(description="Visible purchased items")


result = extract(
    image_path="examples/receipt.png",
    output_schema=Receipt,
    instruction="Extract the receipt fields visible in the image.",
)

print(result.data.model_dump())

TypeScript

import { images } from "viscribe";

const result = await images.extract({
  imagePath: "examples/receipt.png",
  outputSchema: [
    { name: "merchant_name", type: "text", description: "Store or business name" },
    { name: "total_amount", type: "number", description: "Final total on the receipt" },
    { name: "date", type: "text", description: "Receipt date if visible" },
    { name: "line_items", type: "array_text", description: "Visible purchased items" },
  ],
  instruction: "Extract the receipt fields visible in the image.",
});

console.log(result.data);