Deployments are project-based configurations for document extraction that can be called via the API route https://api.retab.com/v1/deployments/{project_id}/{iteration_id}/extract. Deployments organize extraction configurations by project and iteration, allowing you to version your extraction logic and reuse proven configurations across multiple documents and automation workflows. Please check the API Reference for more details.

Deployment


MethodPurpose
extractProcesses documents using a project deployment and returns structured JSON.

Extract

Processes one or more documents using an existing deployment configuration and returns the extracted structured data. This is the primary method for executing document extraction using project-based configurations.
Returns
RetabParsedChatCompletion
The extracted data as a JSON object matching the deployment’s schema.
from retab import Retab, MIMEData

client = Retab()

# Process a single document
with open("invoice.pdf", "rb") as f:
    mime = MIMEData.from_bytes(f.read(), filename="invoice.pdf")

completion = client.deployments.extract(
    project_id="proj_01G34H8J2K",
    iteration_id="iter_01G34H8J2L",  # or "base-configuration" for default settings
    document=mime,
    temperature=0.1,  # Optional override
    seed=42,  # Optional for reproducibility
    store=True  # Whether to store results
)

Parameters

project_id
string
required
ID of the project containing the deployment configuration.
iteration_id
string
required
ID of the specific iteration to use, or "base-configuration" to use the project’s default settings.
document
Path | str | bytes | IOBase | MIMEData | PIL.Image.Image | HttpUrl
Single document to process (mutually exclusive with documents).
documents
List[Path | str | bytes | IOBase | MIMEData | PIL.Image.Image | HttpUrl]
List of documents to process (mutually exclusive with document).
temperature
float
Optional temperature override for this specific request. Overrides the deployment’s default temperature.
seed
int
Optional seed for reproducible results across multiple runs.
store
bool
default:"True"
Whether to store the extraction results for later retrieval and analysis.

Notes

  • Project vs Iteration: Projects contain multiple iterations, each with their own configuration. Use "base-configuration" as the iteration_id to use the project’s default settings.
  • Single vs Multiple Documents: Use either document (singular) for processing one file or documents (plural) for batch processing. These parameters are mutually exclusive.
  • Configuration Priority: Form parameters like temperature override the deployment’s default configuration for that specific request.
  • Supported File Types: All major document formats including PDF, images (PNG, JPG, etc.), HTML, Word documents, and more.