Skip to main content
GET
/
v1
/
partitions
/
{partition_id}
from retab import Retab

client = Retab()

partition = client.partitions.get("part_01G34H8J2K")
for chunk in partition.output:
    print(chunk.key, chunk.pages)
{
  "id": "part_01G34H8J2K",
  "file": {
    "id": "file_6dd6eb00688ad8d1",
    "filename": "invoice_batch.pdf",
    "mime_type": "application/pdf"
  },
  "model": "retab-small",
  "key": "invoice_number",
  "instructions": "Return one chunk per invoice number and keep all pages for the same invoice together.",
  "n_consensus": 3,
  "allow_overlap": true,
  "output": [
    {"key": "INV-001", "pages": [1, 2]},
    {"key": "INV-002", "pages": [3, 4]}
  ],
  "consensus": {
    "likelihoods": [
      {"key": 0.99, "pages": [0.99, 0.98]},
      {"key": 0.96, "pages": [0.95, 0.95]}
    ],
    "choices": [
      [
        {"key": "INV-001", "pages": [1, 2]},
        {"key": "INV-002", "pages": [3, 4]}
      ]
    ]
  },
  "usage": {
    "credits": 3.0
  },
  "created_at": "2024-03-15T10:30:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.retab.com/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve a single persisted partition by ID.
from retab import Retab

client = Retab()

partition = client.partitions.get("part_01G34H8J2K")
for chunk in partition.output:
    print(chunk.key, chunk.pages)
{
  "id": "part_01G34H8J2K",
  "file": {
    "id": "file_6dd6eb00688ad8d1",
    "filename": "invoice_batch.pdf",
    "mime_type": "application/pdf"
  },
  "model": "retab-small",
  "key": "invoice_number",
  "instructions": "Return one chunk per invoice number and keep all pages for the same invoice together.",
  "n_consensus": 3,
  "allow_overlap": true,
  "output": [
    {"key": "INV-001", "pages": [1, 2]},
    {"key": "INV-002", "pages": [3, 4]}
  ],
  "consensus": {
    "likelihoods": [
      {"key": 0.99, "pages": [0.99, 0.98]},
      {"key": 0.96, "pages": [0.95, 0.95]}
    ],
    "choices": [
      [
        {"key": "INV-001", "pages": [1, 2]},
        {"key": "INV-002", "pages": [3, 4]}
      ]
    ]
  },
  "usage": {
    "credits": 3.0
  },
  "created_at": "2024-03-15T10:30:00Z"
}

Authorizations

Api-Key
string
header
required

Path Parameters

partition_id
string
required

Response

Successful Response

id
string
required

Unique identifier of the partition

file
FileRef · object
required

Information about the partitioned file

model
string
required

Model used for the partition operation

key
string
required

Partition key used for the run

instructions
string
default:""

Instructions supplied with the partition request

n_consensus
integer
default:1

Number of consensus votes used

allow_overlap
boolean
default:true

Whether pages were allowed to appear in more than one partition chunk

output
PartitionChunk · object[]

The list of partition chunks with their assigned pages

consensus
PartitionConsensus · object

Consensus metadata for multi-vote partition runs

usage
RetabUsage · object

Usage information for the partition operation

created_at
string<date-time> | null