> ## Documentation Index
> Fetch the complete documentation index at: https://docs.viscribe.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install ViscribeAI and extract structured data from your first image.

## Install

<CodeGroup>
  ```bash Python theme={null}
  pip install viscribe
  ```

  ```bash TypeScript theme={null}
  npm install viscribe
  ```
</CodeGroup>

## Configure a model

Viscribe uses OpenAI-compatible chat completions with vision support. Set
`OPENAI_API_KEY` in your environment or pass `api_key` / `apiKey` directly.

```bash theme={null}
export OPENAI_API_KEY=sk-...
export OPENAI_MODEL=gpt-5-mini
```

## Extract structured data

<CodeGroup>
  ```python Python theme={null}
  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.",
  model_config={
  "model": "gpt-5-mini",
  "temperature": 1,
  },
  )

  print(result.data.model_dump())

  ```

  ```ts TypeScript theme={null}
  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.",
    modelConfig: {
      model: "gpt-5-mini",
      temperature: 1,
    },
  });

  console.log(result.data);
  ```
</CodeGroup>

## Image inputs

Exactly one image source is required.

<CodeGroup>
  ```python Python theme={null}
  extract(image_path="examples/receipt.png", output_schema=Receipt)
  extract(image_url="https://example.com/receipt.png", output_schema=Receipt)
  extract(image_base64="iVBORw0KGgo...", output_schema=Receipt)
  ```

  ```ts TypeScript theme={null}
  await images.extract({
    imagePath: "examples/receipt.png",
    outputSchema: [{ name: "total_amount", type: "number" }],
  });
  await images.extract({
    imageUrl: "https://example.com/receipt.png",
    outputSchema: [{ name: "total_amount", type: "number" }],
  });
  await images.extract({
    imageBase64: "iVBORw0KGgo...",
    outputSchema: [{ name: "total_amount", type: "number" }],
  });
  ```
</CodeGroup>
