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 retab import Retab

client = Retab()

schema_response = client.schemas.generate(
    documents=["Invoice.pdf"],
    model="gpt-4o-mini",          # 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 retab import Retab

client = Retab()

extraction_response = client.documents.extract(
    json_schema = schema_response.json_schema,
    document = "Invoice.pdf",
    model="gpt-4o-mini",
    temperature=0
)

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