While Retab is built around evals, the most basic workflow is extracting structured data from a document. The easiest way to access our APIs is through our python SDK.

The platform has a playground you can explore and use to get sample code.

Find your API Key in the dashboard settings.

Using the Retab SDK

1

Install the SDK

pip install retab
2

Generate a Schema

from pathlib import Path
from retab import Retab

from retab import Retab
client = Retab()

response = client.schemas.generate(
    documents=["Invoice.pdf"],
    model="gpt-4.1",      # or any model your plan supports
    temperature=0.0,          # keep the generation deterministic
    modality="native",        # "native" = let the API decide best modality
)
3

Extract Data

from pathlib import Path
from retab import Retab

from retab import Retab
client = Retab()

response = client.documents.extract(
    json_schema = "Invoice_schema.json",
    document = "Invoice.pdf",
    model="gpt-4.1-nano",
    temperature=0
)

print(response)

Congratulations! You’ve extracted structured data from a document with Retab. Now you can start building evals, deploy processors, automate workflows and more.