> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/lumina-ai-inc/chunkr/llms.txt
> Use this file to discover all available pages before exploring further.

# Output

> OutputResponse and related structures returned from document processing

## OutputResponse

The OutputResponse object contains the processed results of a document analysis task.

<ResponseField name="chunks" type="Chunk[]" required>
  Collection of document chunks, where each chunk contains one or more segments. See [Chunk](#chunk) below.
</ResponseField>

<ResponseField name="file_name" type="string">
  The name of the file.
</ResponseField>

<ResponseField name="page_count" type="integer">
  The number of pages in the file.
</ResponseField>

<ResponseField name="pdf_url" type="string">
  The presigned URL of the PDF file.
</ResponseField>

<ResponseField name="extracted_json" type="object" deprecated>
  **DEPRECATED**: The extracted JSON from the document.
</ResponseField>

## Chunk

A Chunk represents a logical grouping of segments from the document. Chunks are created based on the `target_length` configuration.

<ResponseField name="chunk_id" type="string" required>
  The unique identifier for the chunk.
</ResponseField>

<ResponseField name="chunk_length" type="integer" required>
  The total number of tokens in the chunk. Calculated by the configured `tokenizer`.
</ResponseField>

<ResponseField name="segments" type="Segment[]" required>
  Collection of document segments that form this chunk.

  When `target_chunk_length` > 0, contains the maximum number of segments that fit within that length (segments remain intact). Otherwise, contains exactly one segment.

  See [Segment](#segment) below.
</ResponseField>

<ResponseField name="embed" type="string">
  Suggested text to be embedded for the chunk. This text is generated by combining the embed content from each segment according to the configured embed sources (HTML, Markdown, LLM, or Content).

  Can be configured using `embed_sources` in the `SegmentProcessing` configuration.
</ResponseField>

## Segment

A Segment represents a logical element within a document page (e.g., title, paragraph, table, image).

<ResponseField name="segment_id" type="string" required>
  Unique identifier for the segment.
</ResponseField>

<ResponseField name="segment_type" type="SegmentType" required>
  The type of the segment. See [Segment Types](/api/models/segments#segment-types) for all possible values.
</ResponseField>

<ResponseField name="bbox" type="BoundingBox" required>
  Bounding box coordinates for the segment.

  <Expandable title="BoundingBox properties">
    <ResponseField name="left" type="number" required>
      The left coordinate of the bounding box.
    </ResponseField>

    <ResponseField name="top" type="number" required>
      The top coordinate of the bounding box.
    </ResponseField>

    <ResponseField name="width" type="number" required>
      The width of the bounding box.
    </ResponseField>

    <ResponseField name="height" type="number" required>
      The height of the bounding box.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="page_number" type="integer" required>
  Page number of the segment (1-indexed).
</ResponseField>

<ResponseField name="page_width" type="number" required>
  Width of the page containing the segment.
</ResponseField>

<ResponseField name="page_height" type="number" required>
  Height of the page containing the segment.
</ResponseField>

<ResponseField name="content" type="string" required>
  Content of the segment, will be either HTML or Markdown, depending on the format chosen in segment processing configuration.
</ResponseField>

<ResponseField name="html" type="string" required>
  HTML representation of the segment.
</ResponseField>

<ResponseField name="markdown" type="string" required>
  Markdown representation of the segment.
</ResponseField>

<ResponseField name="text" type="string" required>
  Text content of the segment. Calculated from the OCR results.
</ResponseField>

<ResponseField name="llm" type="string">
  LLM-generated representation of the segment. Only present if LLM processing is configured for this segment type.
</ResponseField>

<ResponseField name="image" type="string">
  Presigned URL to the cropped image of the segment. Only present if cropping is enabled for this segment type.
</ResponseField>

<ResponseField name="confidence" type="number">
  Confidence score of the layout analysis model for this segment (0.0 to 1.0).
</ResponseField>

<ResponseField name="ocr" type="OCRResult[]">
  OCR results for the segment.

  <Expandable title="OCRResult properties">
    <ResponseField name="text" type="string" required>
      The recognized text of the OCR result.
    </ResponseField>

    <ResponseField name="bbox" type="BoundingBox" required>
      Bounding box for this OCR result.
    </ResponseField>

    <ResponseField name="confidence" type="number">
      The confidence score of the recognized text (0.0 to 1.0).
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Response

```json theme={null}
{
  "chunks": [
    {
      "chunk_id": "550e8400-e29b-41d4-a716-446655440000",
      "chunk_length": 256,
      "segments": [
        {
          "segment_id": "660e8400-e29b-41d4-a716-446655440001",
          "segment_type": "Title",
          "bbox": {
            "left": 72.0,
            "top": 100.0,
            "width": 450.0,
            "height": 36.0
          },
          "page_number": 1,
          "page_width": 612.0,
          "page_height": 792.0,
          "content": "# Document Title",
          "html": "<h1>Document Title</h1>",
          "markdown": "# Document Title",
          "text": "Document Title",
          "confidence": 0.95
        }
      ],
      "embed": "# Document Title"
    }
  ],
  "file_name": "example.pdf",
  "page_count": 10,
  "pdf_url": "https://s3.amazonaws.com/..."
}
```
