# OCR (Optical Character Recognition)

URL: https://interfaze.ai/docs/vision/ocr

Extract text and bounds with confidence scores from dense images and large documents including handwritten text, printed documents, screenshots, and other visual content.

- Over 100+ languages with mixed language support. View all [supported languages](https://interfaze.ai/docs/supported-languages)
- Charts, tables, graphs, mathematical equations, latex, code blocks, and more
- Multi-page documents and large PDFs
- High density images and low quality images

## Extraction of an image

**Interfaze SDK · typescript**

```typescript
import { responseFormat } from "interfaze";
import { z } from "zod";

const IDSchema = z.object({
	first_name: z.string().describe("First name on the ID"),
	last_name: z.string().describe("Last name on the ID"),
	dob: z.string().describe("Date of birth on the ID"),
	driver_licence_number: z.string().describe("Driver licence number on the ID"),
});

const response = await interfaze.chat.completions.create({
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract the details from this ID" },
				{
					type: "image_url",
					image_url: {
						url: "https://r2public.jigsawstack.com/interfaze/examples/id.jpg",
					},
				},
			],
		},
	],
	response_format: responseFormat(z.toJSONSchema(IDSchema), "id_schema"),
});

console.log(JSON.parse(response.choices[0]?.message.content ?? "{}"));

console.log("OCR Results:", response.precontext?.[0]?.result);
```

**Vercel AI SDK · typescript**

```typescript
import { generateObject } from "ai";
import { z } from "zod";

const IDSchema = z.object({
	first_name: z.string().describe("First name on the ID"),
	last_name: z.string().describe("Last name on the ID"),
	dob: z.string().describe("Date of birth on the ID"),
	driver_licence_number: z.string().describe("Driver licence number on the ID"),
});

const { object, providerMetadata } = await generateObject({
	model: interfaze("interfaze-beta"),
	schema: IDSchema,
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract the details from this ID" },
				{
					type: "image",
					mediaType: "image/jpeg",
					image: "https://r2public.jigsawstack.com/interfaze/examples/id.jpg",
				},
			],
		},
	],
});

console.log(object);
console.log("OCR Results:", providerMetadata?.interfaze?.precontext?.[0]?.result);
```

**LangChain SDK · typescript**

```typescript
import { z } from "zod";

const IDSchema = z.object({
	first_name: z.string().describe("First name on the ID"),
	last_name: z.string().describe("Last name on the ID"),
	dob: z.string().describe("Date of birth on the ID"),
	driver_licence_number: z.string().describe("Driver licence number on the ID"),
});

const structuredModel = interfaze.withStructuredOutput(IDSchema, { includeRaw: true });

const response = await structuredModel.invoke([
	{
		role: "user",
		content: [
			{ type: "text", text: "Extract the details from this ID" },
			{
				type: "image_url",
				image_url: {
					url: "https://r2public.jigsawstack.com/interfaze/examples/id.jpg",
				},
			},
		],
	},
]);

console.log(response.parsed);

console.log("OCR Results:", response.raw.response_metadata.precontext?.[0]?.result);
```

**Interfaze SDK · python**

```python
from pydantic import BaseModel, Field

class IDSchema(BaseModel):
    first_name: str = Field(..., description="First name on the ID")
    last_name: str = Field(..., description="Last name on the ID")
    dob: str = Field(..., description="Date of birth on the ID")
    driver_licence_number: str = Field(..., description="Driver licence number on the ID")

response = interfaze.chat.completions.parse(
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Extract the details from this ID"},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://r2public.jigsawstack.com/interfaze/examples/id.jpg"
                    },
                },
            ],
        }
    ],
    response_format=IDSchema,
)

print(response.choices[0].message.parsed)

print("OCR Results:", response.precontext[0].result if response.precontext else None)
```

**LangChain SDK · python**

```python
from langchain_core.messages import HumanMessage
from pydantic import BaseModel, Field

class IDSchema(BaseModel):
    first_name: str = Field(..., description="First name on the ID")
    last_name: str = Field(..., description="Last name on the ID")
    dob: str = Field(..., description="Date of birth on the ID")
    driver_licence_number: str = Field(..., description="Driver licence number on the ID")

structured_llm = interfaze.with_structured_output(IDSchema, include_raw=True)

response = structured_llm.invoke([
    HumanMessage(
        content=[
            {"type": "text", "text": "Extract the details from this ID"},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://r2public.jigsawstack.com/interfaze/examples/id.jpg"
                },
            },
        ]
    )
])

print(response["parsed"])

print("OCR Results:", response["raw"].response_metadata.get("precontext"))
```

**Bounding boxes mapped to the image**

![ID bounding boxes mapped](https://r2public.jigsawstack.com/interfaze/examples/id_output.png)

**JSON output**

`object` contains the extracted information defined in the schema. `precontext` contains the raw metadata such as bounding boxes and confidence scores.

```json
{
  "object": {
    "first_name": "IVÁN",
    "last_name": "MUÑOZ ESTRADA",
    "dob": "09/12/1987",
    "driver_licence_number": "Y4067081"
  },
  "response": {
    "id": "interfaze-1774997933544",
    "modelId": "interfaze-beta",
    "body": {
      "id": "interfaze-1774997933544",
      "object": "chat.completion",
      "created": 1774997933,
      "model": "interfaze-beta",
      "usage": {
        "prompt_tokens": 16771,
        "completion_tokens": 2530,
        "total_tokens": 19301
      },
      "precontext": [
        {
          "name": "ocr",
          "result": {
            "extracted_text": "California\nUSA\nDRIVER LICENSE\nDL Y4067081\nCLASS C\nEXP 09/12/2027\nEND NONE\nEN MUÑOZ ESTRADA\nFN IVÁN ICHET\n14223 BELGATE ST\nBALDWIN PARK CA 91706\nDOB 09/12/1987\nRSTRNONE 09121987\nIvan M.\nSEX M HAIR BLK EYES BLK\nHGT 5-02\" WGT 185lb ISS\nDD 08/13/202160648/AAFD/27 07/25/2022",
            "sections": [
              {
                "text": "California\nUSA\nDRIVER LICENSE\nDL Y4067081\nCLASS C\nEXP 09/12/2027\nEND NONE\nEN MUÑOZ ESTRADA\nFN IVÁN ICHET\n14223 BELGATE ST\nBALDWIN PARK CA 91706\nDOB 09/12/1987\nRSTRNONE 09121987\nIvan M.\nSEX M HAIR BLK EYES BLK\nHGT 5-02\" WGT 185lb ISS\nDD 08/13/202160648/AAFD/27 07/25/2022",
                "lines": [
                  {
                    "text": "California",
                    "bounds": {
                      "top_left": {
                        "x": 63,
                        "y": 89
                      },
                      "top_right": {
                        "x": 268,
                        "y": 89
                      },
                      "bottom_right": {
                        "x": 268,
                        "y": 129
                      },
                      "bottom_left": {
                        "x": 63,
                        "y": 129
                      },
                      "width": 205,
                      "height": 40
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "California",
                        "bounds": {
                          "top_left": {
                            "x": 64,
                            "y": 90
                          },
                          "top_right": {
                            "x": 267,
                            "y": 89
                          },
                          "bottom_right": {
                            "x": 267,
                            "y": 130
                          },
                          "bottom_left": {
                            "x": 63,
                            "y": 130
                          },
                          "width": 203.5,
                          "height": 40.5
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "USA",
                    "bounds": {
                      "top_left": {
                        "x": 270,
                        "y": 100
                      },
                      "top_right": {
                        "x": 296,
                        "y": 99
                      },
                      "bottom_right": {
                        "x": 296,
                        "y": 114
                      },
                      "bottom_left": {
                        "x": 269,
                        "y": 115
                      },
                      "width": 26.5,
                      "height": 15
                    },
                    "average_confidence": 0.96,
                    "words": [
                      {
                        "text": "USA",
                        "bounds": {
                          "top_left": {
                            "x": 269,
                            "y": 100
                          },
                          "top_right": {
                            "x": 294,
                            "y": 99
                          },
                          "bottom_right": {
                            "x": 295,
                            "y": 114
                          },
                          "bottom_left": {
                            "x": 269,
                            "y": 115
                          },
                          "width": 25.5,
                          "height": 15
                        },
                        "confidence": 0.96
                      }
                    ]
                  },
                  {
                    "text": "DRIVER LICENSE",
                    "bounds": {
                      "top_left": {
                        "x": 334,
                        "y": 91
                      },
                      "top_right": {
                        "x": 497,
                        "y": 91
                      },
                      "bottom_right": {
                        "x": 497,
                        "y": 113
                      },
                      "bottom_left": {
                        "x": 334,
                        "y": 114
                      },
                      "width": 163,
                      "height": 22.5
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "DRIVER",
                        "bounds": {
                          "top_left": {
                            "x": 335,
                            "y": 91
                          },
                          "top_right": {
                            "x": 405,
                            "y": 92
                          },
                          "bottom_right": {
                            "x": 405,
                            "y": 114
                          },
                          "bottom_left": {
                            "x": 335,
                            "y": 115
                          },
                          "width": 70,
                          "height": 23
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "LICENSE",
                        "bounds": {
                          "top_left": {
                            "x": 412,
                            "y": 92
                          },
                          "top_right": {
                            "x": 494,
                            "y": 91
                          },
                          "bottom_right": {
                            "x": 494,
                            "y": 113
                          },
                          "bottom_left": {
                            "x": 412,
                            "y": 114
                          },
                          "width": 82,
                          "height": 22
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "DL Y4067081",
                    "bounds": {
                      "top_left": {
                        "x": 247,
                        "y": 153
                      },
                      "top_right": {
                        "x": 394,
                        "y": 153
                      },
                      "bottom_right": {
                        "x": 394,
                        "y": 178
                      },
                      "bottom_left": {
                        "x": 247,
                        "y": 179
                      },
                      "width": 147,
                      "height": 25.5
                    },
                    "average_confidence": 0.93,
                    "words": [
                      {
                        "text": "DL",
                        "bounds": {
                          "top_left": {
                            "x": 247,
                            "y": 154
                          },
                          "top_right": {
                            "x": 267,
                            "y": 154
                          },
                          "bottom_right": {
                            "x": 267,
                            "y": 179
                          },
                          "bottom_left": {
                            "x": 247,
                            "y": 179
                          },
                          "width": 20,
                          "height": 25
                        },
                        "confidence": 0.92
                      },
                      {
                        "text": "Y4067081",
                        "bounds": {
                          "top_left": {
                            "x": 272,
                            "y": 154
                          },
                          "top_right": {
                            "x": 393,
                            "y": 154
                          },
                          "bottom_right": {
                            "x": 393,
                            "y": 179
                          },
                          "bottom_left": {
                            "x": 272,
                            "y": 179
                          },
                          "width": 121,
                          "height": 25
                        },
                        "confidence": 0.95
                      }
                    ]
                  },
                  {
                    "text": "CLASS C",
                    "bounds": {
                      "top_left": {
                        "x": 453,
                        "y": 153
                      },
                      "top_right": {
                        "x": 521,
                        "y": 153
                      },
                      "bottom_right": {
                        "x": 521,
                        "y": 168
                      },
                      "bottom_left": {
                        "x": 453,
                        "y": 169
                      },
                      "width": 68,
                      "height": 15.5
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "CLASS",
                        "bounds": {
                          "top_left": {
                            "x": 454,
                            "y": 153
                          },
                          "top_right": {
                            "x": 503,
                            "y": 153
                          },
                          "bottom_right": {
                            "x": 503,
                            "y": 169
                          },
                          "bottom_left": {
                            "x": 455,
                            "y": 169
                          },
                          "width": 48.5,
                          "height": 16
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "C",
                        "bounds": {
                          "top_left": {
                            "x": 510,
                            "y": 154
                          },
                          "top_right": {
                            "x": 518,
                            "y": 154
                          },
                          "bottom_right": {
                            "x": 518,
                            "y": 168
                          },
                          "bottom_left": {
                            "x": 510,
                            "y": 169
                          },
                          "width": 8,
                          "height": 14.5
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "EXP 09/12/2027",
                    "bounds": {
                      "top_left": {
                        "x": 244,
                        "y": 184
                      },
                      "top_right": {
                        "x": 397,
                        "y": 184
                      },
                      "bottom_right": {
                        "x": 397,
                        "y": 207
                      },
                      "bottom_left": {
                        "x": 244,
                        "y": 208
                      },
                      "width": 153,
                      "height": 23.5
                    },
                    "average_confidence": 0.96,
                    "words": [
                      {
                        "text": "EXP",
                        "bounds": {
                          "top_left": {
                            "x": 249,
                            "y": 185
                          },
                          "top_right": {
                            "x": 278,
                            "y": 185
                          },
                          "bottom_right": {
                            "x": 277,
                            "y": 209
                          },
                          "bottom_left": {
                            "x": 248,
                            "y": 208
                          },
                          "width": 29,
                          "height": 23.5
                        },
                        "confidence": 0.97
                      },
                      {
                        "text": "09/12/2027",
                        "bounds": {
                          "top_left": {
                            "x": 283,
                            "y": 185
                          },
                          "top_right": {
                            "x": 397,
                            "y": 184
                          },
                          "bottom_right": {
                            "x": 397,
                            "y": 208
                          },
                          "bottom_left": {
                            "x": 282,
                            "y": 209
                          },
                          "width": 114.5,
                          "height": 24
                        },
                        "confidence": 0.94
                      }
                    ]
                  },
                  {
                    "text": "END NONE",
                    "bounds": {
                      "top_left": {
                        "x": 454,
                        "y": 191
                      },
                      "top_right": {
                        "x": 536,
                        "y": 191
                      },
                      "bottom_right": {
                        "x": 536,
                        "y": 206
                      },
                      "bottom_left": {
                        "x": 454,
                        "y": 206
                      },
                      "width": 82,
                      "height": 15
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "END",
                        "bounds": {
                          "top_left": {
                            "x": 456,
                            "y": 192
                          },
                          "top_right": {
                            "x": 484,
                            "y": 192
                          },
                          "bottom_right": {
                            "x": 484,
                            "y": 206
                          },
                          "bottom_left": {
                            "x": 456,
                            "y": 206
                          },
                          "width": 28,
                          "height": 14
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "NONE",
                        "bounds": {
                          "top_left": {
                            "x": 493,
                            "y": 192
                          },
                          "top_right": {
                            "x": 533,
                            "y": 192
                          },
                          "bottom_right": {
                            "x": 533,
                            "y": 207
                          },
                          "bottom_left": {
                            "x": 492,
                            "y": 207
                          },
                          "width": 40.5,
                          "height": 15
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "EN MUÑOZ ESTRADA",
                    "bounds": {
                      "top_left": {
                        "x": 248,
                        "y": 213
                      },
                      "top_right": {
                        "x": 449,
                        "y": 211
                      },
                      "bottom_right": {
                        "x": 449,
                        "y": 232
                      },
                      "bottom_left": {
                        "x": 248,
                        "y": 234
                      },
                      "width": 201,
                      "height": 21
                    },
                    "average_confidence": 0.73,
                    "words": [
                      {
                        "text": "EN",
                        "bounds": {
                          "top_left": {
                            "x": 249,
                            "y": 214
                          },
                          "top_right": {
                            "x": 269,
                            "y": 213
                          },
                          "bottom_right": {
                            "x": 269,
                            "y": 234
                          },
                          "bottom_left": {
                            "x": 249,
                            "y": 234
                          },
                          "width": 20,
                          "height": 20.5
                        },
                        "confidence": 0.31
                      },
                      {
                        "text": "MUÑOZ",
                        "bounds": {
                          "top_left": {
                            "x": 274,
                            "y": 213
                          },
                          "top_right": {
                            "x": 347,
                            "y": 212
                          },
                          "bottom_right": {
                            "x": 347,
                            "y": 234
                          },
                          "bottom_left": {
                            "x": 274,
                            "y": 234
                          },
                          "width": 73,
                          "height": 21.5
                        },
                        "confidence": 0.95
                      },
                      {
                        "text": "ESTRADA",
                        "bounds": {
                          "top_left": {
                            "x": 353,
                            "y": 212
                          },
                          "top_right": {
                            "x": 444,
                            "y": 212
                          },
                          "bottom_right": {
                            "x": 444,
                            "y": 233
                          },
                          "bottom_left": {
                            "x": 353,
                            "y": 234
                          },
                          "width": 91,
                          "height": 21.5
                        },
                        "confidence": 0.92
                      }
                    ]
                  },
                  {
                    "text": "FN IVÁN ICHET",
                    "bounds": {
                      "top_left": {
                        "x": 250,
                        "y": 233
                      },
                      "top_right": {
                        "x": 389,
                        "y": 233
                      },
                      "bottom_right": {
                        "x": 389,
                        "y": 253
                      },
                      "bottom_left": {
                        "x": 250,
                        "y": 254
                      },
                      "width": 139,
                      "height": 20.5
                    },
                    "average_confidence": 0.85,
                    "words": [
                      {
                        "text": "FN",
                        "bounds": {
                          "top_left": {
                            "x": 250,
                            "y": 234
                          },
                          "top_right": {
                            "x": 270,
                            "y": 234
                          },
                          "bottom_right": {
                            "x": 270,
                            "y": 254
                          },
                          "bottom_left": {
                            "x": 250,
                            "y": 255
                          },
                          "width": 20,
                          "height": 20.5
                        },
                        "confidence": 0.86
                      },
                      {
                        "text": "IVÁN",
                        "bounds": {
                          "top_left": {
                            "x": 274,
                            "y": 234
                          },
                          "top_right": {
                            "x": 318,
                            "y": 234
                          },
                          "bottom_right": {
                            "x": 317,
                            "y": 254
                          },
                          "bottom_left": {
                            "x": 274,
                            "y": 254
                          },
                          "width": 43.5,
                          "height": 20
                        },
                        "confidence": 0.7
                      },
                      {
                        "text": "ICHET",
                        "bounds": {
                          "top_left": {
                            "x": 327,
                            "y": 234
                          },
                          "top_right": {
                            "x": 387,
                            "y": 233
                          },
                          "bottom_right": {
                            "x": 386,
                            "y": 254
                          },
                          "bottom_left": {
                            "x": 327,
                            "y": 254
                          },
                          "width": 59.5,
                          "height": 20.5
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "14223 BELGATE ST",
                    "bounds": {
                      "top_left": {
                        "x": 250,
                        "y": 255
                      },
                      "top_right": {
                        "x": 393,
                        "y": 253
                      },
                      "bottom_right": {
                        "x": 393,
                        "y": 271
                      },
                      "bottom_left": {
                        "x": 251,
                        "y": 272
                      },
                      "width": 142.5,
                      "height": 17.5
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "14223",
                        "bounds": {
                          "top_left": {
                            "x": 252,
                            "y": 256
                          },
                          "top_right": {
                            "x": 293,
                            "y": 256
                          },
                          "bottom_right": {
                            "x": 293,
                            "y": 272
                          },
                          "bottom_left": {
                            "x": 252,
                            "y": 272
                          },
                          "width": 41,
                          "height": 16
                        },
                        "confidence": 1
                      },
                      {
                        "text": "BELGATE",
                        "bounds": {
                          "top_left": {
                            "x": 296,
                            "y": 256
                          },
                          "top_right": {
                            "x": 366,
                            "y": 255
                          },
                          "bottom_right": {
                            "x": 366,
                            "y": 271
                          },
                          "bottom_left": {
                            "x": 297,
                            "y": 272
                          },
                          "width": 69.5,
                          "height": 16
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "ST",
                        "bounds": {
                          "top_left": {
                            "x": 373,
                            "y": 254
                          },
                          "top_right": {
                            "x": 391,
                            "y": 254
                          },
                          "bottom_right": {
                            "x": 391,
                            "y": 271
                          },
                          "bottom_left": {
                            "x": 372,
                            "y": 271
                          },
                          "width": 18.5,
                          "height": 17
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "BALDWIN PARK CA 91706",
                    "bounds": {
                      "top_left": {
                        "x": 250,
                        "y": 270
                      },
                      "top_right": {
                        "x": 440,
                        "y": 269
                      },
                      "bottom_right": {
                        "x": 440,
                        "y": 286
                      },
                      "bottom_left": {
                        "x": 250,
                        "y": 287
                      },
                      "width": 190,
                      "height": 17
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "BALDWIN",
                        "bounds": {
                          "top_left": {
                            "x": 251,
                            "y": 271
                          },
                          "top_right": {
                            "x": 320,
                            "y": 270
                          },
                          "bottom_right": {
                            "x": 319,
                            "y": 287
                          },
                          "bottom_left": {
                            "x": 251,
                            "y": 287
                          },
                          "width": 68.5,
                          "height": 16.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "PARK",
                        "bounds": {
                          "top_left": {
                            "x": 327,
                            "y": 270
                          },
                          "top_right": {
                            "x": 365,
                            "y": 270
                          },
                          "bottom_right": {
                            "x": 365,
                            "y": 287
                          },
                          "bottom_left": {
                            "x": 326,
                            "y": 287
                          },
                          "width": 38.5,
                          "height": 17
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "CA",
                        "bounds": {
                          "top_left": {
                            "x": 372,
                            "y": 270
                          },
                          "top_right": {
                            "x": 392,
                            "y": 270
                          },
                          "bottom_right": {
                            "x": 392,
                            "y": 287
                          },
                          "bottom_left": {
                            "x": 372,
                            "y": 287
                          },
                          "width": 20,
                          "height": 17
                        },
                        "confidence": 1
                      },
                      {
                        "text": "91706",
                        "bounds": {
                          "top_left": {
                            "x": 397,
                            "y": 270
                          },
                          "top_right": {
                            "x": 439,
                            "y": 269
                          },
                          "bottom_right": {
                            "x": 438,
                            "y": 287
                          },
                          "bottom_left": {
                            "x": 396,
                            "y": 287
                          },
                          "width": 42,
                          "height": 17.5
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "DOB 09/12/1987",
                    "bounds": {
                      "top_left": {
                        "x": 251,
                        "y": 291
                      },
                      "top_right": {
                        "x": 404,
                        "y": 289
                      },
                      "bottom_right": {
                        "x": 404,
                        "y": 311
                      },
                      "bottom_left": {
                        "x": 251,
                        "y": 313
                      },
                      "width": 153,
                      "height": 22
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "DOB",
                        "bounds": {
                          "top_left": {
                            "x": 252,
                            "y": 293
                          },
                          "top_right": {
                            "x": 285,
                            "y": 292
                          },
                          "bottom_right": {
                            "x": 285,
                            "y": 312
                          },
                          "bottom_left": {
                            "x": 252,
                            "y": 313
                          },
                          "width": 33,
                          "height": 20
                        },
                        "confidence": 1
                      },
                      {
                        "text": "09/12/1987",
                        "bounds": {
                          "top_left": {
                            "x": 291,
                            "y": 291
                          },
                          "top_right": {
                            "x": 404,
                            "y": 290
                          },
                          "bottom_right": {
                            "x": 404,
                            "y": 312
                          },
                          "bottom_left": {
                            "x": 291,
                            "y": 312
                          },
                          "width": 113,
                          "height": 21.5
                        },
                        "confidence": 0.99
                      }
                    ]
                  },
                  {
                    "text": "RSTRNONE 09121987",
                    "bounds": {
                      "top_left": {
                        "x": 251,
                        "y": 314
                      },
                      "top_right": {
                        "x": 343,
                        "y": 314
                      },
                      "bottom_right": {
                        "x": 343,
                        "y": 330
                      },
                      "bottom_left": {
                        "x": 251,
                        "y": 331
                      },
                      "width": 92,
                      "height": 16.5
                    },
                    "average_confidence": 0.96,
                    "words": [
                      {
                        "text": "RSTRNONE",
                        "bounds": {
                          "top_left": {
                            "x": 252,
                            "y": 315
                          },
                          "top_right": {
                            "x": 341,
                            "y": 314
                          },
                          "bottom_right": {
                            "x": 341,
                            "y": 331
                          },
                          "bottom_left": {
                            "x": 251,
                            "y": 331
                          },
                          "width": 89.5,
                          "height": 16.5
                        },
                        "confidence": 0.96
                      }
                    ]
                  },
                  {
                    "text": "Ivan M.",
                    "bounds": {
                      "top_left": {
                        "x": 76,
                        "y": 374
                      },
                      "top_right": {
                        "x": 239,
                        "y": 376
                      },
                      "bottom_right": {
                        "x": 239,
                        "y": 420
                      },
                      "bottom_left": {
                        "x": 75,
                        "y": 419
                      },
                      "width": 163.5,
                      "height": 44.5
                    },
                    "average_confidence": 0.9,
                    "words": [
                      {
                        "text": "Ivan",
                        "bounds": {
                          "top_left": {
                            "x": 85,
                            "y": 375
                          },
                          "top_right": {
                            "x": 172,
                            "y": 376
                          },
                          "bottom_right": {
                            "x": 171,
                            "y": 419
                          },
                          "bottom_left": {
                            "x": 83,
                            "y": 420
                          },
                          "width": 87.5,
                          "height": 44
                        },
                        "confidence": 0.94
                      },
                      {
                        "text": "M.",
                        "bounds": {
                          "top_left": {
                            "x": 199,
                            "y": 377
                          },
                          "top_right": {
                            "x": 237,
                            "y": 379
                          },
                          "bottom_right": {
                            "x": 237,
                            "y": 420
                          },
                          "bottom_left": {
                            "x": 198,
                            "y": 420
                          },
                          "width": 38.5,
                          "height": 42
                        },
                        "confidence": 0.87
                      }
                    ]
                  },
                  {
                    "text": "SEX M HAIR BLK EYES BLK",
                    "bounds": {
                      "top_left": {
                        "x": 315,
                        "y": 369
                      },
                      "top_right": {
                        "x": 370,
                        "y": 369
                      },
                      "bottom_right": {
                        "x": 370,
                        "y": 384
                      },
                      "bottom_left": {
                        "x": 315,
                        "y": 384
                      },
                      "width": 55,
                      "height": 15
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "SEX",
                        "bounds": {
                          "top_left": {
                            "x": 317,
                            "y": 370
                          },
                          "top_right": {
                            "x": 345,
                            "y": 370
                          },
                          "bottom_right": {
                            "x": 345,
                            "y": 385
                          },
                          "bottom_left": {
                            "x": 317,
                            "y": 385
                          },
                          "width": 28,
                          "height": 15
                        },
                        "confidence": 0.98
                      },
                      {
                        "text": "M",
                        "bounds": {
                          "top_left": {
                            "x": 356,
                            "y": 370
                          },
                          "top_right": {
                            "x": 364,
                            "y": 370
                          },
                          "bottom_right": {
                            "x": 364,
                            "y": 385
                          },
                          "bottom_left": {
                            "x": 356,
                            "y": 385
                          },
                          "width": 8,
                          "height": 15
                        },
                        "confidence": 1
                      }
                    ]
                  },
                  {
                    "text": "HGT 5-02\" WGT 185lb ISS",
                    "bounds": {
                      "top_left": {
                        "x": 316,
                        "y": 387
                      },
                      "top_right": {
                        "x": 400,
                        "y": 387
                      },
                      "bottom_right": {
                        "x": 400,
                        "y": 401
                      },
                      "bottom_left": {
                        "x": 316,
                        "y": 402
                      },
                      "width": 84,
                      "height": 14.5
                    },
                    "average_confidence": 0.82,
                    "words": [
                      {
                        "text": "HGT",
                        "bounds": {
                          "top_left": {
                            "x": 317,
                            "y": 388
                          },
                          "top_right": {
                            "x": 347,
                            "y": 387
                          },
                          "bottom_right": {
                            "x": 346,
                            "y": 402
                          },
                          "bottom_left": {
                            "x": 317,
                            "y": 402
                          },
                          "width": 29.5,
                          "height": 14.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "5-02\"",
                        "bounds": {
                          "top_left": {
                            "x": 359,
                            "y": 387
                          },
                          "top_right": {
                            "x": 399,
                            "y": 387
                          },
                          "bottom_right": {
                            "x": 399,
                            "y": 402
                          },
                          "bottom_left": {
                            "x": 359,
                            "y": 401
                          },
                          "width": 40,
                          "height": 14.5
                        },
                        "confidence": 0.65
                      }
                    ]
                  },
                  {
                    "text": "DD 08/13/202160648/AAFD/27 07/25/2022",
                    "bounds": {
                      "top_left": {
                        "x": 316,
                        "y": 408
                      },
                      "top_right": {
                        "x": 499,
                        "y": 406
                      },
                      "bottom_right": {
                        "x": 499,
                        "y": 421
                      },
                      "bottom_left": {
                        "x": 316,
                        "y": 423
                      },
                      "width": 183,
                      "height": 15
                    },
                    "average_confidence": 0.95,
                    "words": [
                      {
                        "text": "DD",
                        "bounds": {
                          "top_left": {
                            "x": 318,
                            "y": 408
                          },
                          "top_right": {
                            "x": 335,
                            "y": 408
                          },
                          "bottom_right": {
                            "x": 336,
                            "y": 423
                          },
                          "bottom_left": {
                            "x": 318,
                            "y": 423
                          },
                          "width": 17.5,
                          "height": 15
                        },
                        "confidence": 0.96
                      },
                      {
                        "text": "08/13/202160648/AAFD/27",
                        "bounds": {
                          "top_left": {
                            "x": 342,
                            "y": 408
                          },
                          "top_right": {
                            "x": 499,
                            "y": 407
                          },
                          "bottom_right": {
                            "x": 499,
                            "y": 420
                          },
                          "bottom_left": {
                            "x": 343,
                            "y": 423
                          },
                          "width": 156.5,
                          "height": 14
                        },
                        "confidence": 0.94
                      }
                    ]
                  }
                ]
              }
            ],
            "width": 698,
            "height": 525
          }
        }
      ]
    }
  },
  "finishReason": "stop",
  "usage": {
    "inputTokens": 16771,
    "outputTokens": 2530,
    "totalTokens": 19301
  }
}
```

## PDF document extraction

Document: https://arxiv.org/pdf/2602.04101

**Interfaze SDK · typescript**

```typescript
import { responseFormat } from "interfaze";
import { z } from "zod";

const ResearchPaperSchema = z.object({
	title: z.string().describe("Title of the document"),
	summary: z.string().describe("Summary of the document"),
	formulas: z
		.array(
			z.object({
				formula: z.string().describe("Formula in the document"),
				bounds: z.object({
					top_left_x: z.number(),
					top_left_y: z.number(),
					bottom_right_x: z.number(),
					bottom_right_y: z.number(),
				}),
			})
		)
		.describe("Formulas in the document"),
});

const response = await interfaze.chat.completions.create({
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract the text and information from the document based on the schema." },
				{
					type: "file",
					file: {
						filename: "research-paper.pdf",
						file_data: "https://arxiv.org/pdf/2602.04101",
					},
				},
			],
		},
	],
	response_format: responseFormat(z.toJSONSchema(ResearchPaperSchema), "research_paper_schema"),
});

console.log(JSON.parse(response.choices[0]?.message.content ?? "{}"));

console.log("OCR Results:", response.precontext?.[0]?.result);
```

**Vercel AI SDK · typescript**

```typescript
import { generateObject } from "ai";
import { z } from "zod";

const ResearchPaperSchema = z.object({
	title: z.string().describe("Title of the document"),
	summary: z.string().describe("Summary of the document"),
	formulas: z
		.array(
			z.object({
				formula: z.string().describe("Formula in the document"),
				bounds: z.object({
					top_left_x: z.number(),
					top_left_y: z.number(),
					bottom_right_x: z.number(),
					bottom_right_y: z.number(),
				}),
			})
		)
		.describe("Formulas in the document"),
});

const { object, providerMetadata } = await generateObject({
	model: interfaze("interfaze-beta"),
	schema: ResearchPaperSchema,
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract the text and information from the document based on the schema." },
				{
					type: "file",
					data: "https://arxiv.org/pdf/2602.04101",
					mediaType: "application/pdf",
				},
			],
		},
	],
});

console.log(object);
console.log("OCR Results:", providerMetadata?.interfaze?.precontext?.[0]?.result);
```

**LangChain SDK · typescript**

```typescript
import { z } from "zod";

const ResearchPaperSchema = z.object({
	title: z.string().describe("Title of the document"),
	summary: z.string().describe("Summary of the document"),
	formulas: z
		.array(
			z.object({
				formula: z.string().describe("Formula in the document"),
				bounds: z.object({
					top_left_x: z.number(),
					top_left_y: z.number(),
					bottom_right_x: z.number(),
					bottom_right_y: z.number(),
				}),
			})
		)
		.describe("Formulas in the document"),
});

const structuredModel = interfaze.withStructuredOutput(ResearchPaperSchema, { includeRaw: true });

const response = await structuredModel.invoke([
	{
		role: "user",
		content: [
			{ type: "text", text: "Extract the text and information from the document based on the schema." },
			{
				type: "file",
				file: {
					filename: "research-paper.pdf",
					file_data: "https://arxiv.org/pdf/2602.04101",
				},
			},
		],
	},
]);

console.log(response.parsed);

console.log("OCR Results:", response.raw.response_metadata.precontext?.[0]?.result);
```

**Interfaze SDK · python**

```python
from pydantic import BaseModel, Field
from typing import List

class FormulaBounds(BaseModel):
    top_left_x: float
    top_left_y: float
    bottom_right_x: float
    bottom_right_y: float

class FormulaItem(BaseModel):
    formula: str = Field(..., description="Formula in the document")
    bounds: FormulaBounds

class ResearchPaperSchema(BaseModel):
    title: str = Field(..., description="Title of the document")
    summary: str = Field(..., description="Summary of the document")
    formulas: List[FormulaItem] = Field(..., description="Formulas in the document")

response = interfaze.chat.completions.parse(
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Extract the text and information from the document based on the schema."},
                {
                    "type": "file",
                    "file": {
                        "filename": "research-paper.pdf",
                        "file_data": "https://arxiv.org/pdf/2602.04101",
                    },
                },
            ],
        }
    ],
    response_format=ResearchPaperSchema,
)

print(response.choices[0].message.parsed)

print("OCR Results:", response.precontext[0].result if response.precontext else None)
```

**LangChain SDK · python**

```python
from langchain_core.messages import HumanMessage
from pydantic import BaseModel, Field
from typing import List

class FormulaBounds(BaseModel):
    top_left_x: float
    top_left_y: float
    bottom_right_x: float
    bottom_right_y: float

class FormulaItem(BaseModel):
    formula: str = Field(..., description="Formula in the document")
    bounds: FormulaBounds

class ResearchPaperSchema(BaseModel):
    title: str = Field(..., description="Title of the document")
    summary: str = Field(..., description="Summary of the document")
    formulas: List[FormulaItem] = Field(..., description="Formulas in the document")

structured_llm = interfaze.with_structured_output(ResearchPaperSchema, include_raw=True)

response = structured_llm.invoke([
    HumanMessage(
        content=[
            {"type": "text", "text": "Extract the text and information from the document based on the schema."},
            {
                "type": "file",
                "file": {
                    "filename": "research-paper.pdf",
                    "file_data": "https://arxiv.org/pdf/2602.04101",
                },
            },
        ]
    )
])

print(response["parsed"])

print("OCR Results:", response["raw"].response_metadata.get("precontext"))
```

**JSON output**

```json
{
  "object": {
    "title": "Interfaze: The Future of AI is built on Task-Specific Small Models",
    "summary": "The paper introduces Interfaze, a system designed for modern LLM applications that focuses on building and acting over context rather than relying solely on monolithic models. Interfaze combines a heterogeneous stack of DNNs and small language models (SLMs) for perception and classification across various modalities (object detection, OCR, speech-to-text, text, and image classification). It includes a context-construction layer to crawl, index, and parse external sources (web pages, code, PDFs, diagrams) into a compact structured state, and an action layer with a thin controller. This controller selects which tools to run, compiles distilled context, and feeds it to a configured LLM for the final response.\n\nInterfaze-Beta, the concrete instantiation, achieves competitive or state-of-the-art results on challenging benchmarks by offloading the bulk of computation to smaller, task-specific models and tools. The system demonstrates strong performance across knowledge, reasoning, code, and multimodal tasks, with results like 83.6% on MMLU-Pro, 91.4% on MMLU, 81.3% on GPQA-Diamond, 57.8% on LiveCodeBench v5, 90.0% on AIME-2025, 77.3% on MMMU (val), 91.5% on AI2D, 90.9% on ChartQA, and 90.8% on Common Voice v16. The paper highlights that gains primarily come from the small-model and tool stack and context compilation, rather than relying on a single large general-purpose model. Limitations identified include delays and over-building of context, which are targets for future work.",
    "formulas": [
      {
        "formula": "Χ(τ,ω) = Σα[η] [n – τ] e-jwn,",
        "bounds": {
          "top_left_x": 204,
          "top_left_y": 1304,
          "bottom_right_x": 500,
          "bottom_right_y": 1332
        }
      },
      {
        "formula": "2f,r = log ((M|X(τ,·)|²) f + є)",
        "bounds": {
          "top_left_x": 215,
          "top_left_y": 1445,
          "bottom_right_x": 490,
          "bottom_right_y": 1472
        }
      },
      {
        "formula": "P¢(Yt | Y<t,h1:T) = softmax(Wot + b)",
        "bounds": {
          "top_left_x": 698,
          "top_left_y": 727,
          "bottom_right_x": 1040,
          "bottom_right_y": 753
        }
      },
      {
        "formula": "Φυ: RH×W×3 → RD×K",
        "bounds": {
          "top_left_x": 248,
          "top_left_y": 663,
          "bottom_right_x": 455,
          "bottom_right_y": 688
        }
      },
      {
        "formula": "Ot : P → RD",
        "bounds": {
          "top_left_x": 296,
          "top_left_y": 738,
          "bottom_right_x": 407,
          "bottom_right_y": 761
        }
      },
      {
        "formula": "Sk = σ ´φυ(x)φt(p) T k = 1,...,K,",
        "bounds": {
          "top_left_x": 179,
          "top_left_y": 851,
          "bottom_right_x": 300,
          "bottom_right_y": 870
        }
      },
      {
        "formula": "B(p,x) = {bi = (Xmin, Ymin, Xmax, Ymax)}(i) No.",
        "bounds": {
          "top_left_x": 156,
          "top_left_y": 1066,
          "bottom_right_x": 554,
          "bottom_right_y": 1099
        }
      },
      {
        "formula": "m₁ = S(x, bi) ∈ {0, 1}H×W",
        "bounds": {
          "top_left_x": 231,
          "top_left_y": 1314,
          "bottom_right_x": 473,
          "bottom_right_y": 1338
        }
      }
    ]
  },
  "finishReason": "stop",
  "usage": {
    "inputTokens": 1284611,
    "outputTokens": 129082,
    "totalTokens": 1413693
  }
}
```

The output is truncated for this example.

## Handwriting text extraction

![Handwriting text](https://r2public.jigsawstack.com/interfaze/examples/handwriting.jpeg)

**Interfaze SDK · typescript**

```typescript
import { responseFormat } from "interfaze";
import { z } from "zod";

const HandwritingSchema = z.object({
	text: z.string().describe("all text in the image"),
});

const response = await interfaze.chat.completions.create({
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract text from the image based on the schema and correct the text if it is not correct based on the image." },
				{
					type: "image_url",
					image_url: {
						url: "https://r2public.jigsawstack.com/interfaze/examples/handwriting.jpeg",
					},
				},
			],
		},
	],
	response_format: responseFormat(z.toJSONSchema(HandwritingSchema), "handwriting_schema"),
});

console.log(JSON.parse(response.choices[0]?.message.content ?? "{}"));

console.log("OCR Results:", response.precontext?.[0]?.result);
```

**Vercel AI SDK · typescript**

```typescript
import { generateObject } from "ai";
import { z } from "zod";

const HandwritingSchema = z.object({
	text: z.string().describe("all text in the image"),
});

const { object, providerMetadata } = await generateObject({
	model: interfaze("interfaze-beta"),
	schema: HandwritingSchema,
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract text from the image based on the schema and correct the text if it is not correct based on the image." },
				{
					type: "image",
					mediaType: "image/jpeg",
					image: "https://r2public.jigsawstack.com/interfaze/examples/handwriting.jpeg",
				},
			],
		},
	],
});

console.log(object);
console.log("OCR Results:", providerMetadata?.interfaze?.precontext?.[0]?.result);
```

**LangChain SDK · typescript**

```typescript
import { z } from "zod";

const HandwritingSchema = z.object({
	text: z.string().describe("all text in the image"),
});

const structuredModel = interfaze.withStructuredOutput(HandwritingSchema, { includeRaw: true });

const response = await structuredModel.invoke([
	{
		role: "user",
		content: [
			{ type: "text", text: "Extract text from the image based on the schema and correct the text if it is not correct based on the image." },
			{
				type: "image_url",
				image_url: {
					url: "https://r2public.jigsawstack.com/interfaze/examples/handwriting.jpeg",
				},
			},
		],
	},
]);

console.log(response.parsed);

console.log("OCR Results:", response.raw.response_metadata.precontext?.[0]?.result);
```

**Interfaze SDK · python**

```python
from pydantic import BaseModel, Field

class HandwritingSchema(BaseModel):
    text: str = Field(..., description="all text in the image")

response = interfaze.chat.completions.parse(
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Extract text from the image based on the schema and correct the text if it is not correct based on the image."},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://r2public.jigsawstack.com/interfaze/examples/handwriting.jpeg"
                    },
                },
            ],
        }
    ],
    response_format=HandwritingSchema,
)

print(response.choices[0].message.parsed)

print("OCR Results:", response.precontext[0].result if response.precontext else None)
```

**LangChain SDK · python**

```python
from langchain_core.messages import HumanMessage
from pydantic import BaseModel, Field

class HandwritingSchema(BaseModel):
    text: str = Field(..., description="all text in the image")

structured_llm = interfaze.with_structured_output(HandwritingSchema, include_raw=True)

response = structured_llm.invoke([
    HumanMessage(
        content=[
            {"type": "text", "text": "Extract text from the image based on the schema and correct the text if it is not correct based on the image."},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://r2public.jigsawstack.com/interfaze/examples/handwriting.jpeg"
                },
            },
        ]
    )
])

print(response["parsed"])

print("OCR Results:", response["raw"].response_metadata.get("precontext"))
```

**JSON output**

```json
{
  "object": {
    "text": "The lovely song night may song Luna shines Welcome and farewell my heart was beating the rosebuds on the moor the violet beautiful The artist's evening song our love new life To Belinda Holds Lili waist so long farewell Now I leave this little hut where my beloved live Walking now with veiled steps through the bowers Luna shines throughout birch and oak zephyr per path And the birch trees bowing low shed incense on the track How beautiful the coolness of this lovely summer night! How the soul fills with happiness in this true place of quiet! I can scarcely grasp the bliss, yet Heaven, I would shun A thousand nights like this if my darling granted one."
  },
  "response": {
    "id": "interfaze-1776795798946",
    "modelId": "interfaze-beta",
    "body": {
      "id": "interfaze-1776795798946",
      "object": "chat.completion",
      "created": 1776795798,
      "model": "interfaze-beta",
      "usage": {
        "prompt_tokens": 27869,
        "completion_tokens": 36362,
        "total_tokens": 64231
      },
      "precontext": [
        {
          "name": "ocr",
          "result": {
            "extracted_text": "The lovely Song night may song linen shined\nWelcome and faint wei my heart was beating\nthe reseach on the moon the violet beautifull\nThe artist's evening song our love new life\nTo bringa hould this meant so dave yourself\nNow I have this little hut where My Theread live\nWalking near the wildel fields through the bowers\nluna shines throughot birch and oak zephyr perfume\nAnd the birch trees leaning how shed incense on the brok\nHow beautiful the coolness of this lovely summer-night!\nHow the et fills with happiness in this full place of gaol!\nI can scarcely graspe the bliss, yet Heaven, I would shun\nA thousand nights like this if my darling granted ene.",
            "sections": [
              {
                "text": "The lovely Song night may song linen shined\nWelcome and faint wei my heart was beating\nthe reseach on the moon the violet beautifull\nThe artist's evening song our love new life\nTo bringa hould this meant so dave yourself\nNow I have this little hut where My Theread live\nWalking near the wildel fields through the bowers\nluna shines throughot birch and oak zephyr perfume\nAnd the birch trees leaning how shed incense on the brok\nHow beautiful the coolness of this lovely summer-night!\nHow the et fills with happiness in this full place of gaol!\nI can scarcely graspe the bliss, yet Heaven, I would shun\nA thousand nights like this if my darling granted ene.",
                "lines": [
                  {
                    "text": "The lovely Song night may song linen shined",
                    "bounds": {
                      "top_left": {
                        "x": 27,
                        "y": 22
                      },
                      "top_right": {
                        "x": 422,
                        "y": 21
                      },
                      "bottom_right": {
                        "x": 423,
                        "y": 47
                      },
                      "bottom_left": {
                        "x": 27,
                        "y": 51
                      },
                      "width": 395.5,
                      "height": 27.5
                    },
                    "average_confidence": 0.78,
                    "words": [
                      {
                        "text": "The",
                        "bounds": {
                          "top_left": {
                            "x": 29,
                            "y": 23
                          },
                          "top_right": {
                            "x": 58,
                            "y": 23
                          },
                          "bottom_right": {
                            "x": 57,
                            "y": 52
                          },
                          "bottom_left": {
                            "x": 28,
                            "y": 52
                          },
                          "width": 29,
                          "height": 29
                        },
                        "confidence": 0.93
                      },
                      {
                        "text": "lovely",
                        "bounds": {
                          "top_left": {
                            "x": 73,
                            "y": 23
                          },
                          "top_right": {
                            "x": 126,
                            "y": 23
                          },
                          "bottom_right": {
                            "x": 126,
                            "y": 50
                          },
                          "bottom_left": {
                            "x": 73,
                            "y": 51
                          },
                          "width": 53,
                          "height": 27.5
                        },
                        "confidence": 0.89
                      },
                      {
                        "text": "Song",
                        "bounds": {
                          "top_left": {
                            "x": 142,
                            "y": 22
                          },
                          "top_right": {
                            "x": 185,
                            "y": 22
                          },
                          "bottom_right": {
                            "x": 184,
                            "y": 49
                          },
                          "bottom_left": {
                            "x": 142,
                            "y": 50
                          },
                          "width": 42.5,
                          "height": 27.5
                        },
                        "confidence": 0.88
                      },
                      {
                        "text": "night",
                        "bounds": {
                          "top_left": {
                            "x": 194,
                            "y": 22
                          },
                          "top_right": {
                            "x": 243,
                            "y": 22
                          },
                          "bottom_right": {
                            "x": 242,
                            "y": 48
                          },
                          "bottom_left": {
                            "x": 193,
                            "y": 48
                          },
                          "width": 49,
                          "height": 26
                        },
                        "confidence": 0.92
                      },
                      {
                        "text": "may",
                        "bounds": {
                          "top_left": {
                            "x": 252,
                            "y": 22
                          },
                          "top_right": {
                            "x": 288,
                            "y": 22
                          },
                          "bottom_right": {
                            "x": 287,
                            "y": 47
                          },
                          "bottom_left": {
                            "x": 251,
                            "y": 47
                          },
                          "width": 36,
                          "height": 25
                        },
                        "confidence": 0.86
                      },
                      {
                        "text": "song",
                        "bounds": {
                          "top_left": {
                            "x": 297,
                            "y": 22
                          },
                          "top_right": {
                            "x": 333,
                            "y": 22
                          },
                          "bottom_right": {
                            "x": 332,
                            "y": 46
                          },
                          "bottom_left": {
                            "x": 296,
                            "y": 47
                          },
                          "width": 36,
                          "height": 24.5
                        },
                        "confidence": 0.6
                      },
                      {
                        "text": "linen",
                        "bounds": {
                          "top_left": {
                            "x": 342,
                            "y": 22
                          },
                          "top_right": {
                            "x": 371,
                            "y": 22
                          },
                          "bottom_right": {
                            "x": 370,
                            "y": 46
                          },
                          "bottom_left": {
                            "x": 341,
                            "y": 46
                          },
                          "width": 29,
                          "height": 24
                        },
                        "confidence": 0.55
                      },
                      {
                        "text": "shined",
                        "bounds": {
                          "top_left": {
                            "x": 376,
                            "y": 22
                          },
                          "top_right": {
                            "x": 420,
                            "y": 21
                          },
                          "bottom_right": {
                            "x": 419,
                            "y": 45
                          },
                          "bottom_left": {
                            "x": 375,
                            "y": 46
                          },
                          "width": 44,
                          "height": 24
                        },
                        "confidence": 0.6
                      }
                    ]
                  }
                ]
              }
            ],
            "width": 459,
            "height": 360
          }
        }
      ]
    }
  },
  "finishReason": "stop",
  "usage": {
    "inputTokens": 27869,
    "outputTokens": 36362,
    "totalTokens": 64231
  }
}
```

## Multilingual text extraction

![Multilingual text](https://r2public.jigsawstack.com/interfaze/examples/multilingual.jpeg)

**Interfaze SDK · typescript**

```typescript
import { responseFormat } from "interfaze";
import { z } from "zod";

const MultilingualSchema = z.object({
	text: z
		.string()
		.describe("all text in the image without any translations. Return in native language of the image"),
	english_text: z.string(),
	other_language_text: z.string(),
	languages_detected: z.array(z.string()).describe("iso languages detected in the image"),
});

const response = await interfaze.chat.completions.create({
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract text from the image based on the schema." },
				{
					type: "image_url",
					image_url: {
						url: "https://r2public.jigsawstack.com/interfaze/examples/multilingual.jpeg",
					},
				},
			],
		},
	],
	response_format: responseFormat(z.toJSONSchema(MultilingualSchema), "multilingual_schema"),
});

console.log(JSON.parse(response.choices[0]?.message.content ?? "{}"));

console.log("OCR Results:", response.precontext?.[0]?.result);
```

**Vercel AI SDK · typescript**

```typescript
import { generateObject } from "ai";
import { z } from "zod";

const MultilingualSchema = z.object({
	text: z
		.string()
		.describe("all text in the image without any translations. Return in native language of the image"),
	english_text: z.string(),
	other_language_text: z.string(),
	languages_detected: z.array(z.string()).describe("iso languages detected in the image"),
});

const { object, providerMetadata } = await generateObject({
	model: interfaze("interfaze-beta"),
	schema: MultilingualSchema,
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract text from the image based on the schema." },
				{
					type: "image",
					mediaType: "image/jpeg",
					image: "https://r2public.jigsawstack.com/interfaze/examples/multilingual.jpeg",
				},
			],
		},
	],
});

console.log(object);
console.log("OCR Results:", providerMetadata?.interfaze?.precontext?.[0]?.result);
```

**LangChain SDK · typescript**

```typescript
import { z } from "zod";

const MultilingualSchema = z.object({
	text: z
		.string()
		.describe("all text in the image without any translations. Return in native language of the image"),
	english_text: z.string(),
	other_language_text: z.string(),
	languages_detected: z.array(z.string()).describe("iso languages detected in the image"),
});

const structuredModel = interfaze.withStructuredOutput(MultilingualSchema, { includeRaw: true });

const response = await structuredModel.invoke([
	{
		role: "user",
		content: [
			{ type: "text", text: "Extract text from the image based on the schema." },
			{
				type: "image_url",
				image_url: {
					url: "https://r2public.jigsawstack.com/interfaze/examples/multilingual.jpeg",
				},
			},
		],
	},
]);

console.log(response.parsed);

console.log("OCR Results:", response.raw.response_metadata.precontext?.[0]?.result);
```

**Interfaze SDK · python**

```python
from pydantic import BaseModel, Field
from typing import List

class MultilingualSchema(BaseModel):
    text: str = Field(..., description="all text in the image without any translations. Return in native language of the image")
    english_text: str
    other_language_text: str
    languages_detected: List[str] = Field(..., description="iso languages detected in the image")

response = interfaze.chat.completions.parse(
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Extract text from the image based on the schema."},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://r2public.jigsawstack.com/interfaze/examples/multilingual.jpeg"
                    },
                },
            ],
        }
    ],
    response_format=MultilingualSchema,
)

print(response.choices[0].message.parsed)

print("OCR Results:", response.precontext[0].result if response.precontext else None)
```

**LangChain SDK · python**

```python
from langchain_core.messages import HumanMessage
from pydantic import BaseModel, Field
from typing import List

class MultilingualSchema(BaseModel):
    text: str = Field(..., description="all text in the image without any translations. Return in native language of the image")
    english_text: str
    other_language_text: str
    languages_detected: List[str] = Field(..., description="iso languages detected in the image")

structured_llm = interfaze.with_structured_output(MultilingualSchema, include_raw=True)

response = structured_llm.invoke([
    HumanMessage(
        content=[
            {"type": "text", "text": "Extract text from the image based on the schema."},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://r2public.jigsawstack.com/interfaze/examples/multilingual.jpeg"
                },
            },
        ]
    )
])

print(response["parsed"])

print("OCR Results:", response["raw"].response_metadata.get("precontext"))
```

**JSON output**

```json
{
  "object": {
    "text": "he → అతడు (athadu)she → ఆమె (aame)boy → అబ్బాయి (abbayi)girl → అమ్మాయి (ammayi)house → ఇలు (illu)water → నీరు (neeru)food → తిండి (tindi)",
    "english_text": "he she boy girl house water food",
    "other_language_text": "అతడు (athadu) ఆమె (aame) అబ్బాయి (abbayi) అమ్మాయి (ammayi) ఇలు (illu) నీరు (neeru) తిండి (tindi)",
    "languages_detected": ["en", "te"]
  },
  "response": {
    "id": "interfaze-1776798684994",
    "modelId": "interfaze-beta",
    "body": {
      "id": "interfaze-1776798684994",
      "object": "chat.completion",
      "model": "interfaze-beta",
      "usage": {
        "prompt_tokens": 11716,
        "completion_tokens": 14633,
        "total_tokens": 26349
      },
      "precontext": [
        {
          "name": "ocr",
          "result": {
            "extracted_text": "he → అతడు (athadu)\nshe → ఆమె (aame)\nboy → అబ్బాయి (abbayi)\ngirl → అమ్మాయి (ammayi)\nhouse → ఇలు (illu)\nwater → నీరు (neeru)\nfood → తిండి (tindi)",
            "sections": [
              {
                "text": "he → అతడు (athadu)\nshe → ఆమె (aame)\nboy → అబ్బాయి (abbayi)\ngirl → అమ్మాయి (ammayi)\nhouse → ఇలు (illu)\nwater → నీరు (neeru)\nfood → తిండి (tindi)",
                "lines": [
                  {
                    "text": "he → అతడు (athadu)",
                    "bounds": {
                      "top_left": {
                        "x": 231,
                        "y": 125
                      },
                      "top_right": {
                        "x": 516,
                        "y": 125
                      },
                      "bottom_right": {
                        "x": 516,
                        "y": 157
                      },
                      "bottom_left": {
                        "x": 231,
                        "y": 155
                      },
                      "width": 285,
                      "height": 31
                    },
                    "average_confidence": 0.95,
                    "words": [
                      {
                        "text": "he",
                        "bounds": {
                          "top_left": {
                            "x": 231,
                            "y": 125
                          },
                          "top_right": {
                            "x": 262,
                            "y": 126
                          },
                          "bottom_right": {
                            "x": 262,
                            "y": 155
                          },
                          "bottom_left": {
                            "x": 231,
                            "y": 155
                          },
                          "width": 31,
                          "height": 29.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "→",
                        "bounds": {
                          "top_left": {
                            "x": 275,
                            "y": 126
                          },
                          "top_right": {
                            "x": 302,
                            "y": 126
                          },
                          "bottom_right": {
                            "x": 302,
                            "y": 156
                          },
                          "bottom_left": {
                            "x": 275,
                            "y": 156
                          },
                          "width": 27,
                          "height": 30
                        },
                        "confidence": 0.96
                      },
                      {
                        "text": "అతడు",
                        "bounds": {
                          "top_left": {
                            "x": 338,
                            "y": 126
                          },
                          "top_right": {
                            "x": 374,
                            "y": 126
                          },
                          "bottom_right": {
                            "x": 374,
                            "y": 157
                          },
                          "bottom_left": {
                            "x": 337,
                            "y": 157
                          },
                          "width": 36.5,
                          "height": 31
                        },
                        "confidence": 0.88
                      },
                      {
                        "text": "(athadu)",
                        "bounds": {
                          "top_left": {
                            "x": 414,
                            "y": 126
                          },
                          "top_right": {
                            "x": 516,
                            "y": 126
                          },
                          "bottom_right": {
                            "x": 515,
                            "y": 157
                          },
                          "bottom_left": {
                            "x": 413,
                            "y": 157
                          },
                          "width": 102,
                          "height": 31
                        },
                        "confidence": 0.96
                      }
                    ]
                  },
                  {
                    "text": "she → ఆమె (aame)",
                    "bounds": {
                      "top_left": {
                        "x": 215,
                        "y": 179
                      },
                      "top_right": {
                        "x": 471,
                        "y": 181
                      },
                      "bottom_right": {
                        "x": 470,
                        "y": 213
                      },
                      "bottom_left": {
                        "x": 214,
                        "y": 210
                      },
                      "width": 256,
                      "height": 31.5
                    },
                    "average_confidence": 0.95,
                    "words": [
                      {
                        "text": "she",
                        "bounds": {
                          "top_left": {
                            "x": 217,
                            "y": 179
                          },
                          "top_right": {
                            "x": 267,
                            "y": 180
                          },
                          "bottom_right": {
                            "x": 266,
                            "y": 211
                          },
                          "bottom_left": {
                            "x": 216,
                            "y": 210
                          },
                          "width": 50,
                          "height": 31
                        },
                        "confidence": 1
                      },
                      {
                        "text": "→",
                        "bounds": {
                          "top_left": {
                            "x": 282,
                            "y": 180
                          },
                          "top_right": {
                            "x": 312,
                            "y": 180
                          },
                          "bottom_right": {
                            "x": 312,
                            "y": 213
                          },
                          "bottom_left": {
                            "x": 282,
                            "y": 212
                          },
                          "width": 30,
                          "height": 32.5
                        },
                        "confidence": 0.96
                      },
                      {
                        "text": "ఆమె",
                        "bounds": {
                          "top_left": {
                            "x": 336,
                            "y": 180
                          },
                          "top_right": {
                            "x": 382,
                            "y": 181
                          },
                          "bottom_right": {
                            "x": 382,
                            "y": 213
                          },
                          "bottom_left": {
                            "x": 335,
                            "y": 213
                          },
                          "width": 46.5,
                          "height": 32.5
                        },
                        "confidence": 0.88
                      },
                      {
                        "text": "(aame)",
                        "bounds": {
                          "top_left": {
                            "x": 389,
                            "y": 181
                          },
                          "top_right": {
                            "x": 471,
                            "y": 182
                          },
                          "bottom_right": {
                            "x": 471,
                            "y": 212
                          },
                          "bottom_left": {
                            "x": 389,
                            "y": 213
                          },
                          "width": 82,
                          "height": 31
                        },
                        "confidence": 0.96
                      }
                    ]
                  },
                  {
                    "text": "boy → అబ్బాయి (abbayi)",
                    "bounds": {
                      "top_left": {
                        "x": 215,
                        "y": 234
                      },
                      "top_right": {
                        "x": 525,
                        "y": 235
                      },
                      "bottom_right": {
                        "x": 525,
                        "y": 272
                      },
                      "bottom_left": {
                        "x": 215,
                        "y": 271
                      },
                      "width": 310,
                      "height": 37
                    },
                    "average_confidence": 0.95,
                    "words": [
                      {
                        "text": "boy",
                        "bounds": {
                          "top_left": {
                            "x": 218,
                            "y": 234
                          },
                          "top_right": {
                            "x": 266,
                            "y": 235
                          },
                          "bottom_right": {
                            "x": 265,
                            "y": 270
                          },
                          "bottom_left": {
                            "x": 217,
                            "y": 268
                          },
                          "width": 48,
                          "height": 34.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "→",
                        "bounds": {
                          "top_left": {
                            "x": 273,
                            "y": 235
                          },
                          "top_right": {
                            "x": 311,
                            "y": 236
                          },
                          "bottom_right": {
                            "x": 310,
                            "y": 272
                          },
                          "bottom_left": {
                            "x": 272,
                            "y": 270
                          },
                          "width": 38,
                          "height": 35.5
                        },
                        "confidence": 0.96
                      },
                      {
                        "text": "అబ్బాయి",
                        "bounds": {
                          "top_left": {
                            "x": 347,
                            "y": 236
                          },
                          "top_right": {
                            "x": 367,
                            "y": 236
                          },
                          "bottom_right": {
                            "x": 366,
                            "y": 272
                          },
                          "bottom_left": {
                            "x": 346,
                            "y": 272
                          },
                          "width": 20,
                          "height": 36
                        },
                        "confidence": 0.88
                      },
                      {
                        "text": "(abbayi)",
                        "bounds": {
                          "top_left": {
                            "x": 379,
                            "y": 236
                          },
                          "top_right": {
                            "x": 413,
                            "y": 236
                          },
                          "bottom_right": {
                            "x": 412,
                            "y": 272
                          },
                          "bottom_left": {
                            "x": 379,
                            "y": 272
                          },
                          "width": 33.5,
                          "height": 36
                        },
                        "confidence": 0.96
                      }
                    ]
                  }
                ]
              }
            ],
            "width": 728,
            "height": 546
          }
        }
      ]
    }
  }
}
```

## OCR + Object detection

Run OCR and [Object detection](https://interfaze.ai/docs/vision/object-detection) on the same image in one request.

![Dense text with figures](https://r2public.jigsawstack.com/interfaze/examples/dense_text_ocr_figures_output.png)

**Interfaze SDK · typescript**

```typescript
import { responseFormat } from "interfaze";
import { z } from "zod";

const OCRObjectDetectionSchema = z.object({
	text: z.string().describe("all text in the image"),
	graphic_objects: z
		.array(
			z.object({
				description: z.string(),
				top_left_x: z.number(),
				top_left_y: z.number(),
				bottom_right_x: z.number(),
				bottom_right_y: z.number(),
			})
		)
		.describe("graphics objects found in the image"),
});

const response = await interfaze.chat.completions.create({
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract the text and graphics from the image based on the schema." },
				{
					type: "image_url",
					image_url: {
						url: "https://r2public.jigsawstack.com/interfaze/examples/dense_text_ocr_figures.png",
					},
				},
			],
		},
	],
	response_format: responseFormat(z.toJSONSchema(OCRObjectDetectionSchema), "ocr_object_detection_schema"),
});

console.log(JSON.parse(response.choices[0]?.message.content ?? "{}"));

console.log("OCR Results:", response.precontext?.[0]?.result);
```

**Vercel AI SDK · typescript**

```typescript
import { generateObject } from "ai";
import { z } from "zod";

const OCRObjectDetectionSchema = z.object({
	text: z.string().describe("all text in the image"),
	graphic_objects: z
		.array(
			z.object({
				description: z.string(),
				top_left_x: z.number(),
				top_left_y: z.number(),
				bottom_right_x: z.number(),
				bottom_right_y: z.number(),
			})
		)
		.describe("graphics objects found in the image"),
});

const { object, providerMetadata } = await generateObject({
	model: interfaze("interfaze-beta"),
	schema: OCRObjectDetectionSchema,
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract the text and graphics from the image based on the schema." },
				{
					type: "image",
					mediaType: "image/png",
					image: "https://r2public.jigsawstack.com/interfaze/examples/dense_text_ocr_figures.png",
				},
			],
		},
	],
});

console.log(object);
console.log("OCR Results:", providerMetadata?.interfaze?.precontext?.[0]?.result);
```

**LangChain SDK · typescript**

```typescript
import { z } from "zod";

const OCRObjectDetectionSchema = z.object({
	text: z.string().describe("all text in the image"),
	graphic_objects: z
		.array(
			z.object({
				description: z.string(),
				top_left_x: z.number(),
				top_left_y: z.number(),
				bottom_right_x: z.number(),
				bottom_right_y: z.number(),
			})
		)
		.describe("graphics objects found in the image"),
});

const structuredModel = interfaze.withStructuredOutput(OCRObjectDetectionSchema, { includeRaw: true });

const response = await structuredModel.invoke([
	{
		role: "user",
		content: [
			{ type: "text", text: "Extract the text and graphics from the image based on the schema." },
			{
				type: "image_url",
				image_url: {
					url: "https://r2public.jigsawstack.com/interfaze/examples/dense_text_ocr_figures.png",
				},
			},
		],
	},
]);

console.log(response.parsed);

console.log("OCR Results:", response.raw.response_metadata.precontext?.[0]?.result);
```

**Interfaze SDK · python**

```python
from pydantic import BaseModel, Field
from typing import List

class GraphicObject(BaseModel):
    description: str
    top_left_x: float
    top_left_y: float
    bottom_right_x: float
    bottom_right_y: float

class OCRObjectDetectionSchema(BaseModel):
    text: str = Field(..., description="all text in the image")
    graphic_objects: List[GraphicObject] = Field(..., description="graphics objects found in the image")

response = interfaze.chat.completions.parse(
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Extract the text and graphics from the image based on the schema."},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://r2public.jigsawstack.com/interfaze/examples/dense_text_ocr_figures.png"
                    },
                },
            ],
        }
    ],
    response_format=OCRObjectDetectionSchema,
)

print(response.choices[0].message.parsed)

print("OCR Results:", response.precontext[0].result if response.precontext else None)
```

**LangChain SDK · python**

```python
from langchain_core.messages import HumanMessage
from pydantic import BaseModel, Field
from typing import List

class GraphicObject(BaseModel):
    description: str
    top_left_x: float
    top_left_y: float
    bottom_right_x: float
    bottom_right_y: float

class OCRObjectDetectionSchema(BaseModel):
    text: str = Field(..., description="all text in the image")
    graphic_objects: List[GraphicObject] = Field(..., description="graphics objects found in the image")

structured_llm = interfaze.with_structured_output(OCRObjectDetectionSchema, include_raw=True)

response = structured_llm.invoke([
    HumanMessage(
        content=[
            {"type": "text", "text": "Extract the text and graphics from the image based on the schema."},
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://r2public.jigsawstack.com/interfaze/examples/dense_text_ocr_figures.png"
                },
            },
        ]
    )
])

print(response["parsed"])

print("OCR Results:", response["raw"].response_metadata.get("precontext"))
```

**JSON output**

```json
{
  "object": {
    "text": "cane stopped on the corner and yelled he wrote science fiction-and observant. acter named Dick Manly. He was so out, \"What is that?\" \"I remember my mother coming home ratchet. The ego!\" Zero's swagger is a de- \"It's some oxtail,\"Lagomarsini called. and going, 'Hey, so-and-so is out there,'\" scendant of Dick's. \"Zero really has per- \"I'll be back,\" the woman said. Rubin-Vega said, referring to actors. Her mission to say the things he says because \"You better be back!\" Quié said. mother collected autographs for young he knows that somebody in there gets The woman was done bantering: \"I Daphne. \"I had a 'Humpty Dumpty' him,\" she said. \"And that's the permis- better get my cornbread.\" book with signatures from Ben Gaz- sion that I give myself, as a brown Both chefs replied, \"Yes, ma'am.\" woman-to speak those words and, like, -Zach Helfand dio-\"and Donald Sutherland and Jane bite into them.\" His language doesn't zara\"-a member of the Actors Stu- THE BOARDS the courtyard,\" she said. teachers used to talk like that!\" she said, Fonda, because they shot 'Klute' across faze her. \"I grew up in New York. My STOMPING GROUND \"Honestly, I remember walking out laughing. \"They were, like, 'Do you think of this place-there was a yearning,\" she you're better than me?'\" went on, looking up and down the street. The New Group's new home is at the \"That's why I had to come back.\" She Theatre at St. Clement's-a church recalled that feeling: the fantasy of see- building, like those on her old block. ing a legendary actor, \"and the fact that \"Just coming off the run of 'Twelfth ong before Daphne Rubin-Vega be- these buildings look like churches.\" She Night,'\"-Shakespeare in the Park, last L came a Broadway star-in 1996, at Dramatists building (\"DEDICATED TO fact that theatre and democracy were age twenty-six, when she débuted the THE PLAYWRIGHT\"), a few doors down. born at the same time in Greek civiliza- role of Mimi in \"Rent\"-she felt at home \"There was something very spiritual about tion,\" she said. \"And that theatre was in the theatre district. For a time, as a it. I used to listen to 'The Me Nobody mandatory in order for people to be urged kid, \"I lived here, next to the Actors Stu- Knows' with Irene Cara, probably the to make up their own minds. I've always dio,\" she said recently, in front of a town first year I got here. I remember thinking, thought of the theatre as a sacred place.\" house on West Forty-fourth Street. She's Oh, my God. I recognized myself some- At the café, she'd taken her coat currently working two blocks away, star- off, revealing a butterfly brooch. \"This where.\" A savvy bohemian neighbor gave ring as Mr. Zero in the New Group's her a copy of Backstage, where she saw was my mom's,\" she said. Her mother revival of Elmer Rice's expressionist sat- an audition for \"children's theatre\"-\"The died when she was ten, not long after ire \"The Adding Machine.\" Rubin-Vega Princess and the Pea.\" \"So, after school, they left Hell's Kitchen. Rubin-Vega is five feet two and trim, with swooping I went to where this audition was-I was doesn't often talk about the autographed dark hair, and she wore a wool jacket a latchkey kid-by myself. The woman \"Humpty Dumpty\"book, she said, \"be- and pin-striped pants. Born in Panama, was, like, 'What are you doing here? How cause it's so long ago that I didn't even she emigrated with her mother, a nurse, old are you?' And I said, 'Nine years old.' know that this was what I wanted, you in the seventies. In New York, her mother And she said, 'Come back in another know? It was, like, my mom-because married a magazine editor and they nine years.' It was devastating.\" Rubin- I lost her-this sounds freaky, but I often moved into his apartment, on that build- Vega gazed toward the under-stairs en- think that, like, this is beyond my own ing's garden level. Her parents were cre- trance to her former apartment. \"I feel will. Like, I've been buoyed, the wind is ative-she played Chopin on the piano; like sitting on the stoop until I get kicked at my back.\" She looked at the time; out,\" she said. Eventually, she headed to it was almost six. \"Oh! Time to go Amy's Bread, on Ninth Avenue, for a and turn into a man.\" At the Theatre at café warmup before showtime. St. Clement's, she signed some auto- \"The Adding Machine,\" from 1923, is graphs and went inside. about Mr. Zero, a repressed number -Sarah Larson cruncher who gets replaced by an add- PARIS POSTCARD ing machine. He kills his boss (Michael FAIL! Cyril Creighton), impassively accepts prison and execution, and fails to find happiness even in the Elysian Fields; he's also a bigot who shuns its \"mixed\" and pleasure-seeking crowd. Rubin-Vega plays Zero with muted calm and quick- silver rage; he can look stunted, stunned, then lash out, floridly. \"I try to lose my- Thy not come up with a condom self in this character, at least physically,\" that fits the man, rather than she said. \"Particularly for Zero, I need to vice versa?\" a German entrepreneur leave that wiggle room of Daphne.\" She named Jan Vinzenz Krause once asked. hasn't played a man before. \"But, in my His solution, the spray-on condom, which Daphne Rubin-Vega teens, I had this comedy-sketchy char- involves coating a penis with liquid latex, 12 THE NEW YORKER, APRIL 27, 2026",
    "graphic_objects": [
      {
        "description": "A drawing located at the top left under the \"STOMPING GROUND\" heading, featuring a cityscape with a moon and a whimsical character.",
        "top_left_x": 84,
        "top_left_y": 484,
        "bottom_right_x": 394,
        "bottom_right_y": 630
      },
      {
        "description": "A detailed line drawing of Daphne Rubin-Vega in front of a building facade, matching the main profile story.",
        "top_left_x": 77,
        "top_left_y": 1367,
        "bottom_right_x": 517,
        "bottom_right_y": 1878
      },
      {
        "description": "A drawing located in the bottom right corner depicting a person interacting with a device or box, situated above the text about the spray-on condom.",
        "top_left_x": 985,
        "top_left_y": 1581,
        "bottom_right_x": 1264,
        "bottom_right_y": 1737
      }
    ]
  },
  "response": {
    "id": "interfaze-1777011979378",
    "modelId": "interfaze-beta",
    "body": {
      "id": "interfaze-1777011979378",
      "object": "chat.completion",
      "model": "interfaze-beta",
      "usage": {
        "prompt_tokens": 201034,
        "completion_tokens": 60409,
        "total_tokens": 261443
      },
      "precontext": [
        {
          "name": "ocr",
          "result": {
            "extracted_text": "cane stopped on the corner and yelled he wrote science fiction-and observant. acter named Dick Manly. He was so\nout, \"What is that?\" \"I remember my mother coming home ratchet. The ego!\" Zero's swagger is a de-\n\"It's some oxtail,\"Lagomarsini called. and going, 'Hey, so-and-so is out there,'\" scendant of Dick's. \"Zero really has per-\n\"I'll be back,\" the woman said. Rubin-Vega said, referring to actors. Her mission to say the things he says because\n\"You better be back!\" Quié said. mother collected autographs for young he knows that somebody in there gets\nThe woman was done bantering: \"I Daphne. \"I had a 'Humpty Dumpty' him,\" she said. \"And that's the permis-\nbetter get my cornbread.\" book with signatures from Ben Gaz- sion that I give myself, as a brown\nBoth chefs replied, \"Yes, ma'am.\" woman-to speak those words and, like,\n-Zach Helfand dio-\"and Donald Sutherland and Jane bite into them.\" His language doesn't\nzara\"-a member of the Actors Stu-\nTHE BOARDS the courtyard,\" she said. teachers used to talk like that!\" she said,\nFonda, because they shot 'Klute' across faze her. \"I grew up in New York. My\nSTOMPING GROUND \"Honestly, I remember walking out laughing. \"They were, like, 'Do you think\nof this place-there was a yearning,\" she you're better than me?'\"\nwent on, looking up and down the street. The New Group's new home is at the\n\"That's why I had to come back.\" She Theatre at St. Clement's-a church\nrecalled that feeling: the fantasy of see- building, like those on her old block.\ning a legendary actor, \"and the fact that \"Just coming off the run of 'Twelfth\nong before Daphne Rubin-Vega be-\nthese buildings look like churches.\" She Night,'\"-Shakespeare in the Park, last\nL\ncame a Broadway star-in 1996, at Dramatists building (\"DEDICATED TO fact that theatre and democracy were\ngestured toward the Gothic Revival New summer-\"it's hard not to absorb the\nage twenty-six, when she débuted the THE PLAYWRIGHT\"), a few doors down. born at the same time in Greek civiliza-\nrole of Mimi in \"Rent\"-she felt at home \"There was something very spiritual about tion,\" she said. \"And that theatre was\nin the theatre district. For a time, as a it. I used to listen to 'The Me Nobody mandatory in order for people to be urged\nkid, \"I lived here, next to the Actors Stu- Knows' with Irene Cara, probably the to make up their own minds. I've always\ndio,\" she said recently, in front of a town first year I got here. I remember thinking, thought of the theatre as a sacred place.\"\nhouse on West Forty-fourth Street. She's Oh, my God. I recognized myself some- At the café, she'd taken her coat\ncurrently working two blocks away, star- off, revealing a butterfly brooch. \"This\nwhere.\" A savvy bohemian neighbor gave\nring as Mr. Zero in the New Group's her a copy of Backstage, where she saw was my mom's,\" she said. Her mother\nrevival of Elmer Rice's expressionist sat- an audition for \"children's theatre\"-\"The died when she was ten, not long after\nire \"The Adding Machine.\" Rubin-Vega Princess and the Pea.\" \"So, after school, they left Hell's Kitchen. Rubin-Vega\nis five feet two and trim, with swooping I went to where this audition was-I was doesn't often talk about the autographed\ndark hair, and she wore a wool jacket a latchkey kid-by myself. The woman \"Humpty Dumpty\"book, she said, \"be-\nand pin-striped pants. Born in Panama, was, like, 'What are you doing here? How cause it's so long ago that I didn't even\nshe emigrated with her mother, a nurse, old are you?' And I said, 'Nine years old.' know that this was what I wanted, you\nin the seventies. In New York, her mother And she said, 'Come back in another know? It was, like, my mom-because\nmarried a magazine editor and they nine years.' It was devastating.\" Rubin- I lost her-this sounds freaky, but I often\nmoved into his apartment, on that build- Vega gazed toward the under-stairs en- think that, like, this is beyond my own\ning's garden level. Her parents were cre- trance to her former apartment. \"I feel will. Like, I've been buoyed, the wind is\native-she played Chopin on the piano; like sitting on the stoop until I get kicked at my back.\" She looked at the time;\nout,\" she said. Eventually, she headed to it was almost six. \"Oh! Time to go\nAmy's Bread, on Ninth Avenue, for a and turn into a man.\" At the Theatre at\ncafé warmup before showtime. St. Clement's, she signed some auto-\n\"The Adding Machine,\" from 1923, is graphs and went inside.\nabout Mr. Zero, a repressed number -Sarah Larson\ncruncher who gets replaced by an add-\ning machine. He kills his boss (Michael PARIS POSTCARD\nCyril Creighton), impassively accepts FAIL!\nprison and execution, and fails to find\nhappiness even in the Elysian Fields; he's\nalso a bigot who shuns its \"mixed\" and\npleasure-seeking crowd. Rubin-Vega\nplays Zero with muted calm and quick-\nsilver rage; he can look stunted, stunned,\nthen lash out, floridly. \"I try to lose my- Thy not come up with a condom\nself in this character, at least physically,\" that fits the man, rather than\n‘W\nshe said. \"Particularly for Zero, I need to vice versa?\" a German entrepreneur\nleave that wiggle room of Daphne.\" She named Jan Vinzenz Krause once asked.\nhasn't played a man before. \"But, in my His solution, the spray-on condom, which\nDaphne Rubin-Vega teens, I had this comedy-sketchy char- involves coating a penis with liquid latex,\n12 THE NEW YORKER, APRIL 27, 2026",
            "sections": [
              {
                "text": "cane stopped on the corner and yelled he wrote science fiction-and observant. acter named Dick Manly. He was so\nout, \"What is that?\" \"I remember my mother coming home ratchet. The ego!\" Zero's swagger is a de-\n\"It's some oxtail,\"Lagomarsini called. and going, 'Hey, so-and-so is out there,'\" scendant of Dick's. \"Zero really has per-\n\"I'll be back,\" the woman said. Rubin-Vega said, referring to actors. Her mission to say the things he says because\n\"You better be back!\" Quié said. mother collected autographs for young he knows that somebody in there gets\nThe woman was done bantering: \"I Daphne. \"I had a 'Humpty Dumpty' him,\" she said. \"And that's the permis-\nbetter get my cornbread.\" book with signatures from Ben Gaz- sion that I give myself, as a brown\nBoth chefs replied, \"Yes, ma'am.\" woman-to speak those words and, like,\n-Zach Helfand dio-\"and Donald Sutherland and Jane bite into them.\" His language doesn't\nzara\"-a member of the Actors Stu-\nTHE BOARDS the courtyard,\" she said. teachers used to talk like that!\" she said,\nFonda, because they shot 'Klute' across faze her. \"I grew up in New York. My\nSTOMPING GROUND \"Honestly, I remember walking out laughing. \"They were, like, 'Do you think\nof this place-there was a yearning,\" she you're better than me?'\"\nwent on, looking up and down the street. The New Group's new home is at the\n\"That's why I had to come back.\" She Theatre at St. Clement's-a church\nrecalled that feeling: the fantasy of see- building, like those on her old block.\ning a legendary actor, \"and the fact that \"Just coming off the run of 'Twelfth\nong before Daphne Rubin-Vega be-\nthese buildings look like churches.\" She Night,'\"-Shakespeare in the Park, last\nL\ncame a Broadway star-in 1996, at Dramatists building (\"DEDICATED TO fact that theatre and democracy were\ngestured toward the Gothic Revival New summer-\"it's hard not to absorb the\nage twenty-six, when she débuted the THE PLAYWRIGHT\"), a few doors down. born at the same time in Greek civiliza-\nrole of Mimi in \"Rent\"-she felt at home \"There was something very spiritual about tion,\" she said. \"And that theatre was\nin the theatre district. For a time, as a it. I used to listen to 'The Me Nobody mandatory in order for people to be urged\nkid, \"I lived here, next to the Actors Stu- Knows' with Irene Cara, probably the to make up their own minds. I've always\ndio,\" she said recently, in front of a town first year I got here. I remember thinking, thought of the theatre as a sacred place.\"\nhouse on West Forty-fourth Street. She's Oh, my God. I recognized myself some- At the café, she'd taken her coat\ncurrently working two blocks away, star- off, revealing a butterfly brooch. \"This\nwhere.\" A savvy bohemian neighbor gave\nring as Mr. Zero in the New Group's her a copy of Backstage, where she saw was my mom's,\" she said. Her mother\nrevival of Elmer Rice's expressionist sat- an audition for \"children's theatre\"-\"The died when she was ten, not long after\nire \"The Adding Machine.\" Rubin-Vega Princess and the Pea.\" \"So, after school, they left Hell's Kitchen. Rubin-Vega\nis five feet two and trim, with swooping I went to where this audition was-I was doesn't often talk about the autographed\ndark hair, and she wore a wool jacket a latchkey kid-by myself. The woman \"Humpty Dumpty\"book, she said, \"be-\nand pin-striped pants. Born in Panama, was, like, 'What are you doing here? How cause it's so long ago that I didn't even\nshe emigrated with her mother, a nurse, old are you?' And I said, 'Nine years old.' know that this was what I wanted, you\nin the seventies. In New York, her mother And she said, 'Come back in another know? It was, like, my mom-because\nmarried a magazine editor and they nine years.' It was devastating.\" Rubin- I lost her-this sounds freaky, but I often\nmoved into his apartment, on that build- Vega gazed toward the under-stairs en- think that, like, this is beyond my own\ning's garden level. Her parents were cre- trance to her former apartment. \"I feel will. Like, I've been buoyed, the wind is\native-she played Chopin on the piano; like sitting on the stoop until I get kicked at my back.\" She looked at the time;\nout,\" she said. Eventually, she headed to it was almost six. \"Oh! Time to go\nAmy's Bread, on Ninth Avenue, for a and turn into a man.\" At the Theatre at\ncafé warmup before showtime. St. Clement's, she signed some auto-\n\"The Adding Machine,\" from 1923, is graphs and went inside.\nabout Mr. Zero, a repressed number -Sarah Larson\ncruncher who gets replaced by an add-\ning machine. He kills his boss (Michael PARIS POSTCARD\nCyril Creighton), impassively accepts FAIL!\nprison and execution, and fails to find\nhappiness even in the Elysian Fields; he's\nalso a bigot who shuns its \"mixed\" and\npleasure-seeking crowd. Rubin-Vega\nplays Zero with muted calm and quick-\nsilver rage; he can look stunted, stunned,\nthen lash out, floridly. \"I try to lose my- Thy not come up with a condom\nself in this character, at least physically,\" that fits the man, rather than\n‘W\nshe said. \"Particularly for Zero, I need to vice versa?\" a German entrepreneur\nleave that wiggle room of Daphne.\" She named Jan Vinzenz Krause once asked.\nhasn't played a man before. \"But, in my His solution, the spray-on condom, which\nDaphne Rubin-Vega teens, I had this comedy-sketchy char- involves coating a penis with liquid latex,\n12 THE NEW YORKER, APRIL 27, 2026",
                "lines": [
                  {
                    "text": "cane stopped on the corner and yelled he wrote science fiction-and observant. acter named Dick Manly. He was so",
                    "bounds": {
                      "top_left": {
                        "x": 83,
                        "y": 80
                      },
                      "top_right": {
                        "x": 1406,
                        "y": 78
                      },
                      "bottom_right": {
                        "x": 1406,
                        "y": 111
                      },
                      "bottom_left": {
                        "x": 83,
                        "y": 110
                      },
                      "width": 1323,
                      "height": 30
                    },
                    "average_confidence": 0.99,
                    "words": [
                      {
                        "text": "cane",
                        "bounds": {
                          "top_left": {
                            "x": 86,
                            "y": 82
                          },
                          "top_right": {
                            "x": 137,
                            "y": 81
                          },
                          "bottom_right": {
                            "x": 137,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 86,
                            "y": 110
                          },
                          "width": 51,
                          "height": 28.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "stopped",
                        "bounds": {
                          "top_left": {
                            "x": 143,
                            "y": 81
                          },
                          "top_right": {
                            "x": 229,
                            "y": 81
                          },
                          "bottom_right": {
                            "x": 228,
                            "y": 111
                          },
                          "bottom_left": {
                            "x": 143,
                            "y": 110
                          },
                          "width": 85.5,
                          "height": 29.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "on",
                        "bounds": {
                          "top_left": {
                            "x": 235,
                            "y": 81
                          },
                          "top_right": {
                            "x": 264,
                            "y": 81
                          },
                          "bottom_right": {
                            "x": 264,
                            "y": 111
                          },
                          "bottom_left": {
                            "x": 235,
                            "y": 111
                          },
                          "width": 29,
                          "height": 30
                        },
                        "confidence": 1
                      },
                      {
                        "text": "the",
                        "bounds": {
                          "top_left": {
                            "x": 272,
                            "y": 81
                          },
                          "top_right": {
                            "x": 309,
                            "y": 80
                          },
                          "bottom_right": {
                            "x": 309,
                            "y": 111
                          },
                          "bottom_left": {
                            "x": 272,
                            "y": 111
                          },
                          "width": 37,
                          "height": 30.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "corner",
                        "bounds": {
                          "top_left": {
                            "x": 316,
                            "y": 80
                          },
                          "top_right": {
                            "x": 387,
                            "y": 80
                          },
                          "bottom_right": {
                            "x": 386,
                            "y": 111
                          },
                          "bottom_left": {
                            "x": 315,
                            "y": 111
                          },
                          "width": 71,
                          "height": 31
                        },
                        "confidence": 1
                      },
                      {
                        "text": "and",
                        "bounds": {
                          "top_left": {
                            "x": 392,
                            "y": 80
                          },
                          "top_right": {
                            "x": 434,
                            "y": 80
                          },
                          "bottom_right": {
                            "x": 433,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 392,
                            "y": 111
                          },
                          "width": 41.5,
                          "height": 30.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "yelled",
                        "bounds": {
                          "top_left": {
                            "x": 440,
                            "y": 80
                          },
                          "top_right": {
                            "x": 506,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 505,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 439,
                            "y": 110
                          },
                          "width": 66,
                          "height": 30.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "he",
                        "bounds": {
                          "top_left": {
                            "x": 534,
                            "y": 78
                          },
                          "top_right": {
                            "x": 558,
                            "y": 78
                          },
                          "bottom_right": {
                            "x": 557,
                            "y": 109
                          },
                          "bottom_left": {
                            "x": 533,
                            "y": 109
                          },
                          "width": 24,
                          "height": 31
                        },
                        "confidence": 1
                      },
                      {
                        "text": "wrote",
                        "bounds": {
                          "top_left": {
                            "x": 564,
                            "y": 78
                          },
                          "top_right": {
                            "x": 624,
                            "y": 78
                          },
                          "bottom_right": {
                            "x": 622,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 563,
                            "y": 109
                          },
                          "width": 59.5,
                          "height": 31.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "science",
                        "bounds": {
                          "top_left": {
                            "x": 630,
                            "y": 78
                          },
                          "top_right": {
                            "x": 703,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 702,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 628,
                            "y": 110
                          },
                          "width": 73.5,
                          "height": 31.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "fiction-and",
                        "bounds": {
                          "top_left": {
                            "x": 709,
                            "y": 79
                          },
                          "top_right": {
                            "x": 841,
                            "y": 80
                          },
                          "bottom_right": {
                            "x": 840,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 708,
                            "y": 110
                          },
                          "width": 132,
                          "height": 30.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "observant.",
                        "bounds": {
                          "top_left": {
                            "x": 847,
                            "y": 80
                          },
                          "top_right": {
                            "x": 961,
                            "y": 81
                          },
                          "bottom_right": {
                            "x": 959,
                            "y": 109
                          },
                          "bottom_left": {
                            "x": 846,
                            "y": 110
                          },
                          "width": 113.5,
                          "height": 29
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "acter",
                        "bounds": {
                          "top_left": {
                            "x": 984,
                            "y": 81
                          },
                          "top_right": {
                            "x": 1040,
                            "y": 81
                          },
                          "bottom_right": {
                            "x": 1039,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 984,
                            "y": 110
                          },
                          "width": 55.5,
                          "height": 29
                        },
                        "confidence": 1
                      },
                      {
                        "text": "named",
                        "bounds": {
                          "top_left": {
                            "x": 1046,
                            "y": 81
                          },
                          "top_right": {
                            "x": 1125,
                            "y": 80
                          },
                          "bottom_right": {
                            "x": 1124,
                            "y": 109
                          },
                          "bottom_left": {
                            "x": 1045,
                            "y": 109
                          },
                          "width": 79,
                          "height": 28.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "Dick",
                        "bounds": {
                          "top_left": {
                            "x": 1131,
                            "y": 80
                          },
                          "top_right": {
                            "x": 1188,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 1188,
                            "y": 109
                          },
                          "bottom_left": {
                            "x": 1131,
                            "y": 109
                          },
                          "width": 57,
                          "height": 29.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "Manly.",
                        "bounds": {
                          "top_left": {
                            "x": 1197,
                            "y": 79
                          },
                          "top_right": {
                            "x": 1277,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 1276,
                            "y": 110
                          },
                          "bottom_left": {
                            "x": 1196,
                            "y": 109
                          },
                          "width": 80,
                          "height": 30.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "He",
                        "bounds": {
                          "top_left": {
                            "x": 1283,
                            "y": 79
                          },
                          "top_right": {
                            "x": 1322,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 1321,
                            "y": 111
                          },
                          "bottom_left": {
                            "x": 1282,
                            "y": 110
                          },
                          "width": 39,
                          "height": 31.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "was",
                        "bounds": {
                          "top_left": {
                            "x": 1328,
                            "y": 79
                          },
                          "top_right": {
                            "x": 1372,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 1371,
                            "y": 111
                          },
                          "bottom_left": {
                            "x": 1327,
                            "y": 111
                          },
                          "width": 44,
                          "height": 32
                        },
                        "confidence": 1
                      },
                      {
                        "text": "so",
                        "bounds": {
                          "top_left": {
                            "x": 1378,
                            "y": 79
                          },
                          "top_right": {
                            "x": 1403,
                            "y": 79
                          },
                          "bottom_right": {
                            "x": 1402,
                            "y": 112
                          },
                          "bottom_left": {
                            "x": 1377,
                            "y": 112
                          },
                          "width": 25,
                          "height": 33
                        },
                        "confidence": 1
                      }
                    ]
                  },
                  {
                    "text": "out, \"What is that?\" \"I remember my mother coming home ratchet. The ego!\" Zero's swagger is a de-",
                    "bounds": {
                      "top_left": {
                        "x": 83,
                        "y": 111
                      },
                      "top_right": {
                        "x": 1406,
                        "y": 111
                      },
                      "bottom_right": {
                        "x": 1406,
                        "y": 142
                      },
                      "bottom_left": {
                        "x": 83,
                        "y": 140
                      },
                      "width": 1323,
                      "height": 28
                    },
                    "average_confidence": 0.98,
                    "words": [
                      {
                        "text": "out,",
                        "bounds": {
                          "top_left": {
                            "x": 85,
                            "y": 112
                          },
                          "top_right": {
                            "x": 122,
                            "y": 112
                          },
                          "bottom_right": {
                            "x": 124,
                            "y": 140
                          },
                          "bottom_left": {
                            "x": 86,
                            "y": 140
                          },
                          "width": 37.5,
                          "height": 28
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "\"What",
                        "bounds": {
                          "top_left": {
                            "x": 128,
                            "y": 112
                          },
                          "top_right": {
                            "x": 206,
                            "y": 110
                          },
                          "bottom_right": {
                            "x": 207,
                            "y": 139
                          },
                          "bottom_left": {
                            "x": 129,
                            "y": 140
                          },
                          "width": 78,
                          "height": 28.5
                        },
                        "confidence": 0.94
                      },
                      {
                        "text": "is",
                        "bounds": {
                          "top_left": {
                            "x": 211,
                            "y": 110
                          },
                          "top_right": {
                            "x": 230,
                            "y": 110
                          },
                          "bottom_right": {
                            "x": 231,
                            "y": 139
                          },
                          "bottom_left": {
                            "x": 212,
                            "y": 139
                          },
                          "width": 19,
                          "height": 29
                        },
                        "confidence": 1
                      },
                      {
                        "text": "that?\"",
                        "bounds": {
                          "top_left": {
                            "x": 235,
                            "y": 110
                          },
                          "top_right": {
                            "x": 300,
                            "y": 110
                          },
                          "bottom_right": {
                            "x": 301,
                            "y": 137
                          },
                          "bottom_left": {
                            "x": 237,
                            "y": 139
                          },
                          "width": 64.5,
                          "height": 28
                        },
                        "confidence": 0.91
                      },
                      {
                        "text": "\"I",
                        "bounds": {
                          "top_left": {
                            "x": 537,
                            "y": 110
                          },
                          "top_right": {
                            "x": 555,
                            "y": 110
                          },
                          "bottom_right": {
                            "x": 554,
                            "y": 142
                          },
                          "bottom_left": {
                            "x": 536,
                            "y": 142
                          },
                          "width": 18,
                          "height": 32
                        },
                        "confidence": 0.88
                      },
                      {
                        "text": "remember",
                        "bounds": {
                          "top_left": {
                            "x": 561,
                            "y": 111
                          },
                          "top_right": {
                            "x": 672,
                            "y": 112
                          },
                          "bottom_right": {
                            "x": 670,
                            "y": 142
                          },
                          "bottom_left": {
                            "x": 560,
                            "y": 142
                          },
                          "width": 110.5,
                          "height": 30.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "my",
                        "bounds": {
                          "top_left": {
                            "x": 678,
                            "y": 112
                          },
                          "top_right": {
                            "x": 712,
                            "y": 112
                          },
                          "bottom_right": {
                            "x": 710,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 676,
                            "y": 142
                          },
                          "width": 34,
                          "height": 30.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "mother",
                        "bounds": {
                          "top_left": {
                            "x": 718,
                            "y": 112
                          },
                          "top_right": {
                            "x": 798,
                            "y": 112
                          },
                          "bottom_right": {
                            "x": 796,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 716,
                            "y": 143
                          },
                          "width": 80,
                          "height": 31
                        },
                        "confidence": 1
                      },
                      {
                        "text": "coming",
                        "bounds": {
                          "top_left": {
                            "x": 804,
                            "y": 112
                          },
                          "top_right": {
                            "x": 885,
                            "y": 112
                          },
                          "bottom_right": {
                            "x": 883,
                            "y": 142
                          },
                          "bottom_left": {
                            "x": 802,
                            "y": 143
                          },
                          "width": 81,
                          "height": 30.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "home",
                        "bounds": {
                          "top_left": {
                            "x": 891,
                            "y": 112
                          },
                          "top_right": {
                            "x": 957,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 955,
                            "y": 142
                          },
                          "bottom_left": {
                            "x": 889,
                            "y": 142
                          },
                          "width": 66,
                          "height": 30.5
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "ratchet.",
                        "bounds": {
                          "top_left": {
                            "x": 982,
                            "y": 112
                          },
                          "top_right": {
                            "x": 1062,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1063,
                            "y": 142
                          },
                          "bottom_left": {
                            "x": 984,
                            "y": 141
                          },
                          "width": 79.5,
                          "height": 30
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "The",
                        "bounds": {
                          "top_left": {
                            "x": 1068,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1107,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1107,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 1069,
                            "y": 142
                          },
                          "width": 38.5,
                          "height": 31.5
                        },
                        "confidence": 1
                      },
                      {
                        "text": "ego!\"",
                        "bounds": {
                          "top_left": {
                            "x": 1113,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1166,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1166,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 1113,
                            "y": 143
                          },
                          "width": 53,
                          "height": 32
                        },
                        "confidence": 0.94
                      },
                      {
                        "text": "Zero's",
                        "bounds": {
                          "top_left": {
                            "x": 1173,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1234,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1233,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 1172,
                            "y": 143
                          },
                          "width": 61,
                          "height": 32
                        },
                        "confidence": 0.99
                      },
                      {
                        "text": "swagger",
                        "bounds": {
                          "top_left": {
                            "x": 1240,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1322,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1320,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 1239,
                            "y": 143
                          },
                          "width": 81.5,
                          "height": 32
                        },
                        "confidence": 1
                      },
                      {
                        "text": "is",
                        "bounds": {
                          "top_left": {
                            "x": 1328,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1344,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1343,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 1326,
                            "y": 143
                          },
                          "width": 16.5,
                          "height": 32
                        },
                        "confidence": 1
                      },
                      {
                        "text": "a",
                        "bounds": {
                          "top_left": {
                            "x": 1351,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1361,
                            "y": 111
                          },
                          "bottom_right": {
                            "x": 1359,
                            "y": 143
                          },
                          "bottom_left": {
                            "x": 1349,
                            "y": 143
                          },
                          "width": 10,
                          "height": 32
                        },
                        "confidence": 1
                      },
                      {
                        "text": "de-",
                        "bounds": {
                          "top_left": {
                            "x": 1367,
                            "y": 111
                          },
                          "top_right": {
                            "x": 1406,
                            "y": 112
                          },
                          "bottom_right": {
                            "x": 1403,
                            "y": 142
                          },
                          "bottom_left": {
                            "x": 1365,
                            "y": 143
                          },
                          "width": 38.5,
                          "height": 31
                        },
                        "confidence": 1
                      }
                    ]
                  }
                ]
              }
            ],
            "width": 1488,
            "height": 2020
          }
        },
        {
          "name": "object_detection",
          "result": {
            "detected_objects": [
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 650
                  },
                  "top_right": {
                    "x": 517,
                    "y": 650
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 1317
                  },
                  "bottom_right": {
                    "x": 517,
                    "y": 1317
                  },
                  "width": 433,
                  "height": 667
                },
                "label": "paragraph_0"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 532,
                    "y": 74
                  },
                  "top_right": {
                    "x": 955,
                    "y": 74
                  },
                  "bottom_left": {
                    "x": 532,
                    "y": 424
                  },
                  "bottom_right": {
                    "x": 955,
                    "y": 424
                  },
                  "width": 423,
                  "height": 350
                },
                "label": "paragraph_1"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 977,
                    "y": 74
                  },
                  "top_right": {
                    "x": 1401,
                    "y": 74
                  },
                  "bottom_left": {
                    "x": 977,
                    "y": 484
                  },
                  "bottom_right": {
                    "x": 1401,
                    "y": 484
                  },
                  "width": 424,
                  "height": 410
                },
                "label": "paragraph_2"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 532,
                    "y": 430
                  },
                  "top_right": {
                    "x": 955,
                    "y": 430
                  },
                  "bottom_left": {
                    "x": 532,
                    "y": 1401
                  },
                  "bottom_right": {
                    "x": 955,
                    "y": 1401
                  },
                  "width": 423,
                  "height": 971
                },
                "label": "paragraph_3"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 977,
                    "y": 490
                  },
                  "top_right": {
                    "x": 1401,
                    "y": 490
                  },
                  "bottom_left": {
                    "x": 977,
                    "y": 1438
                  },
                  "bottom_right": {
                    "x": 1401,
                    "y": 1438
                  },
                  "width": 424,
                  "height": 948
                },
                "label": "paragraph_4"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 532,
                    "y": 1414
                  },
                  "top_right": {
                    "x": 955,
                    "y": 1414
                  },
                  "bottom_left": {
                    "x": 532,
                    "y": 1939
                  },
                  "bottom_right": {
                    "x": 955,
                    "y": 1939
                  },
                  "width": 423,
                  "height": 525
                },
                "label": "paragraph_5"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 977,
                    "y": 1757
                  },
                  "top_right": {
                    "x": 1401,
                    "y": 1757
                  },
                  "bottom_left": {
                    "x": 977,
                    "y": 1949
                  },
                  "bottom_right": {
                    "x": 1401,
                    "y": 1949
                  },
                  "width": 424,
                  "height": 192
                },
                "label": "paragraph_6"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 393
                  },
                  "top_right": {
                    "x": 263,
                    "y": 393
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 424
                  },
                  "bottom_right": {
                    "x": 263,
                    "y": 424
                  },
                  "width": 179,
                  "height": 31
                },
                "label": "heading_0"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 428
                  },
                  "top_right": {
                    "x": 346,
                    "y": 428
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 454
                  },
                  "bottom_right": {
                    "x": 346,
                    "y": 454
                  },
                  "width": 262,
                  "height": 26
                },
                "label": "heading_1"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 985,
                    "y": 1504
                  },
                  "top_right": {
                    "x": 1212,
                    "y": 1504
                  },
                  "bottom_left": {
                    "x": 985,
                    "y": 1535
                  },
                  "bottom_right": {
                    "x": 1212,
                    "y": 1535
                  },
                  "width": 227,
                  "height": 31
                },
                "label": "heading_2"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 985,
                    "y": 1535
                  },
                  "top_right": {
                    "x": 1086,
                    "y": 1535
                  },
                  "bottom_left": {
                    "x": 985,
                    "y": 1561
                  },
                  "bottom_right": {
                    "x": 1086,
                    "y": 1561
                  },
                  "width": 101,
                  "height": 26
                },
                "label": "heading_3"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 92,
                    "y": 1916
                  },
                  "top_right": {
                    "x": 319,
                    "y": 1916
                  },
                  "bottom_left": {
                    "x": 92,
                    "y": 1949
                  },
                  "bottom_right": {
                    "x": 319,
                    "y": 1949
                  },
                  "width": 227,
                  "height": 33
                },
                "label": "caption"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 484
                  },
                  "top_right": {
                    "x": 394,
                    "y": 484
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 630
                  },
                  "bottom_right": {
                    "x": 394,
                    "y": 630
                  },
                  "width": 310,
                  "height": 146
                },
                "label": "drawing_0"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 77,
                    "y": 1367
                  },
                  "top_right": {
                    "x": 517,
                    "y": 1367
                  },
                  "bottom_left": {
                    "x": 77,
                    "y": 1878
                  },
                  "bottom_right": {
                    "x": 517,
                    "y": 1878
                  },
                  "width": 440,
                  "height": 511
                },
                "label": "drawing_1"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 985,
                    "y": 1581
                  },
                  "top_right": {
                    "x": 1264,
                    "y": 1581
                  },
                  "bottom_left": {
                    "x": 985,
                    "y": 1737
                  },
                  "bottom_right": {
                    "x": 1264,
                    "y": 1737
                  },
                  "width": 279,
                  "height": 156
                },
                "label": "drawing_2"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 393
                  },
                  "top_right": {
                    "x": 263,
                    "y": 393
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 424
                  },
                  "bottom_right": {
                    "x": 263,
                    "y": 424
                  },
                  "width": 179,
                  "height": 31
                },
                "label": "text box_0"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 985,
                    "y": 1504
                  },
                  "top_right": {
                    "x": 1212,
                    "y": 1504
                  },
                  "bottom_left": {
                    "x": 985,
                    "y": 1535
                  },
                  "bottom_right": {
                    "x": 1212,
                    "y": 1535
                  },
                  "width": 227,
                  "height": 31
                },
                "label": "text box_1"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 1971
                  },
                  "top_right": {
                    "x": 104,
                    "y": 1971
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 1993
                  },
                  "bottom_right": {
                    "x": 104,
                    "y": 1993
                  },
                  "width": 20,
                  "height": 22
                },
                "label": "page number_0"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 193,
                    "y": 1971
                  },
                  "top_right": {
                    "x": 498,
                    "y": 1971
                  },
                  "bottom_left": {
                    "x": 193,
                    "y": 1993
                  },
                  "bottom_right": {
                    "x": 498,
                    "y": 1993
                  },
                  "width": 305,
                  "height": 22
                },
                "label": "page number_1"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 84,
                    "y": 393
                  },
                  "top_right": {
                    "x": 263,
                    "y": 393
                  },
                  "bottom_left": {
                    "x": 84,
                    "y": 424
                  },
                  "bottom_right": {
                    "x": 263,
                    "y": 424
                  },
                  "width": 179,
                  "height": 31
                },
                "label": "line_0"
              },
              {
                "bounds": {
                  "top_left": {
                    "x": 985,
                    "y": 1504
                  },
                  "top_right": {
                    "x": 1212,
                    "y": 1504
                  },
                  "bottom_left": {
                    "x": 985,
                    "y": 1535
                  },
                  "bottom_right": {
                    "x": 1212,
                    "y": 1535
                  },
                  "width": 227,
                  "height": 31
                },
                "label": "line_1"
              }
            ]
          }
        }
      ]
    }
  },
  "finishReason": "stop",
  "usage": {
    "inputTokens": 201034,
    "outputTokens": 60409,
    "totalTokens": 261443
  }
}
```

## Run OCR task with raw output

Running OCR as a tasks with `<task>ocr</task>` in the system message make it cheaper and faster with a fixed structured output that's pre-defined.

Learn more about [running a task](https://interfaze.ai/docs/run-tasks).

**Interfaze SDK · typescript**

```typescript
const result = await interfaze.tasks.ocr("https://r2public.jigsawstack.com/interfaze/examples/id.jpg");

console.log(result);
```

**Vercel AI SDK · typescript**

```typescript
import { generateObject } from "ai";

const { object } = await generateObject({
	model: interfaze("interfaze-beta"),
	output: "no-schema",
	system: "<task>ocr</task>",
	messages: [
		{
			role: "user",
			content: [
				{ type: "text", text: "Extract all text from this ID" },
				{
					type: "image",
					mediaType: "image/jpeg",
					image: "https://r2public.jigsawstack.com/interfaze/examples/id.jpg",
				},
			],
		},
	],
});

console.log(object);
```

**LangChain SDK · typescript**

```typescript
import { HumanMessage, SystemMessage } from "@langchain/core/messages";

const response = await interfaze.invoke([
	new SystemMessage("<task>ocr</task>"),
	new HumanMessage({
		content: [
			{ type: "text", text: "Extract all text from this ID" },
			{
				type: "image_url",
				image_url: {
					url: "https://r2public.jigsawstack.com/interfaze/examples/id.jpg",
				},
			},
		],
	}),
]);

const { result } = JSON.parse(response.content as string);
console.log(result);
```

**Interfaze SDK · python**

```python
result = interfaze.tasks.ocr("https://r2public.jigsawstack.com/interfaze/examples/id.jpg")

print(result)
```

**LangChain SDK · python**

```python
import json
from langchain_core.messages import SystemMessage, HumanMessage

response = interfaze.invoke([
    SystemMessage(content="<task>ocr</task>"),
    HumanMessage(content=[
        {"type": "text", "text": "Extract all text from this ID"},
        {
            "type": "image_url",
            "image_url": {
                "url": "https://r2public.jigsawstack.com/interfaze/examples/id.jpg"
            },
        },
    ]),
])

print(json.loads(response.content).get("result"))
```

**JSON output**

```json
{
  "object": {
    "name": "ocr",
    "result": {
      "extracted_text": "California\nUSA\nDRIVER LICENSE\nDL Y4067081\nCLASS C\nEXP 09/12/2027\nEND NONE\nEN MUÑOZ ESTRADA\nFN IVÁN ICHET\n14223 BELGATE ST\nBALDWIN PARK CA 91706\nDOB 09/12/1987\nRSTRNONE 09121987\nIvan M.\nSEX M HAIR BLK EYES BLK\nHGT 5-02\" WGT 185lb ISS\nDD 08/13/202160648/AAFD/27 07/25/2022",
      "sections": [
        {
          "text": "California\nUSA\nDRIVER LICENSE\nDL Y4067081\nCLASS C\nEXP 09/12/2027\nEND NONE\nEN MUÑOZ ESTRADA\nFN IVÁN ICHET\n14223 BELGATE ST\nBALDWIN PARK CA 91706\nDOB 09/12/1987\nRSTRNONE 09121987\nIvan M.\nSEX M HAIR BLK EYES BLK\nHGT 5-02\" WGT 185lb ISS\nDD 08/13/202160648/AAFD/27 07/25/2022",
          "lines": [
            {
              "text": "California",
              "bounds": {
                "top_left": {
                  "x": 63,
                  "y": 89
                },
                "top_right": {
                  "x": 268,
                  "y": 89
                },
                "bottom_right": {
                  "x": 268,
                  "y": 129
                },
                "bottom_left": {
                  "x": 63,
                  "y": 129
                },
                "width": 205,
                "height": 40
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "California",
                  "bounds": {
                    "top_left": {
                      "x": 64,
                      "y": 90
                    },
                    "top_right": {
                      "x": 267,
                      "y": 89
                    },
                    "bottom_right": {
                      "x": 267,
                      "y": 130
                    },
                    "bottom_left": {
                      "x": 63,
                      "y": 130
                    },
                    "width": 203.5,
                    "height": 40.5
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "USA",
              "bounds": {
                "top_left": {
                  "x": 270,
                  "y": 100
                },
                "top_right": {
                  "x": 296,
                  "y": 99
                },
                "bottom_right": {
                  "x": 296,
                  "y": 114
                },
                "bottom_left": {
                  "x": 269,
                  "y": 115
                },
                "width": 26.5,
                "height": 15
              },
              "average_confidence": 0.96,
              "words": [
                {
                  "text": "USA",
                  "bounds": {
                    "top_left": {
                      "x": 269,
                      "y": 100
                    },
                    "top_right": {
                      "x": 294,
                      "y": 99
                    },
                    "bottom_right": {
                      "x": 295,
                      "y": 114
                    },
                    "bottom_left": {
                      "x": 269,
                      "y": 115
                    },
                    "width": 25.5,
                    "height": 15
                  },
                  "confidence": 0.96
                }
              ]
            },
            {
              "text": "DRIVER LICENSE",
              "bounds": {
                "top_left": {
                  "x": 334,
                  "y": 91
                },
                "top_right": {
                  "x": 497,
                  "y": 91
                },
                "bottom_right": {
                  "x": 497,
                  "y": 113
                },
                "bottom_left": {
                  "x": 334,
                  "y": 114
                },
                "width": 163,
                "height": 22.5
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "DRIVER",
                  "bounds": {
                    "top_left": {
                      "x": 335,
                      "y": 91
                    },
                    "top_right": {
                      "x": 405,
                      "y": 92
                    },
                    "bottom_right": {
                      "x": 405,
                      "y": 114
                    },
                    "bottom_left": {
                      "x": 335,
                      "y": 115
                    },
                    "width": 70,
                    "height": 23
                  },
                  "confidence": 0.99
                },
                {
                  "text": "LICENSE",
                  "bounds": {
                    "top_left": {
                      "x": 412,
                      "y": 92
                    },
                    "top_right": {
                      "x": 494,
                      "y": 91
                    },
                    "bottom_right": {
                      "x": 494,
                      "y": 113
                    },
                    "bottom_left": {
                      "x": 412,
                      "y": 114
                    },
                    "width": 82,
                    "height": 22
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "DL Y4067081",
              "bounds": {
                "top_left": {
                  "x": 247,
                  "y": 153
                },
                "top_right": {
                  "x": 394,
                  "y": 153
                },
                "bottom_right": {
                  "x": 394,
                  "y": 178
                },
                "bottom_left": {
                  "x": 247,
                  "y": 179
                },
                "width": 147,
                "height": 25.5
              },
              "average_confidence": 0.93,
              "words": [
                {
                  "text": "DL",
                  "bounds": {
                    "top_left": {
                      "x": 247,
                      "y": 154
                    },
                    "top_right": {
                      "x": 267,
                      "y": 154
                    },
                    "bottom_right": {
                      "x": 267,
                      "y": 179
                    },
                    "bottom_left": {
                      "x": 247,
                      "y": 179
                    },
                    "width": 20,
                    "height": 25
                  },
                  "confidence": 0.92
                },
                {
                  "text": "Y4067081",
                  "bounds": {
                    "top_left": {
                      "x": 272,
                      "y": 154
                    },
                    "top_right": {
                      "x": 393,
                      "y": 154
                    },
                    "bottom_right": {
                      "x": 393,
                      "y": 179
                    },
                    "bottom_left": {
                      "x": 272,
                      "y": 179
                    },
                    "width": 121,
                    "height": 25
                  },
                  "confidence": 0.95
                }
              ]
            },
            {
              "text": "CLASS C",
              "bounds": {
                "top_left": {
                  "x": 453,
                  "y": 153
                },
                "top_right": {
                  "x": 521,
                  "y": 153
                },
                "bottom_right": {
                  "x": 521,
                  "y": 168
                },
                "bottom_left": {
                  "x": 453,
                  "y": 169
                },
                "width": 68,
                "height": 15.5
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "CLASS",
                  "bounds": {
                    "top_left": {
                      "x": 454,
                      "y": 153
                    },
                    "top_right": {
                      "x": 503,
                      "y": 153
                    },
                    "bottom_right": {
                      "x": 503,
                      "y": 169
                    },
                    "bottom_left": {
                      "x": 455,
                      "y": 169
                    },
                    "width": 48.5,
                    "height": 16
                  },
                  "confidence": 0.99
                },
                {
                  "text": "C",
                  "bounds": {
                    "top_left": {
                      "x": 510,
                      "y": 154
                    },
                    "top_right": {
                      "x": 518,
                      "y": 154
                    },
                    "bottom_right": {
                      "x": 518,
                      "y": 168
                    },
                    "bottom_left": {
                      "x": 510,
                      "y": 169
                    },
                    "width": 8,
                    "height": 14.5
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "EXP 09/12/2027",
              "bounds": {
                "top_left": {
                  "x": 244,
                  "y": 184
                },
                "top_right": {
                  "x": 397,
                  "y": 184
                },
                "bottom_right": {
                  "x": 397,
                  "y": 207
                },
                "bottom_left": {
                  "x": 244,
                  "y": 208
                },
                "width": 153,
                "height": 23.5
              },
              "average_confidence": 0.96,
              "words": [
                {
                  "text": "EXP",
                  "bounds": {
                    "top_left": {
                      "x": 249,
                      "y": 185
                    },
                    "top_right": {
                      "x": 278,
                      "y": 185
                    },
                    "bottom_right": {
                      "x": 277,
                      "y": 209
                    },
                    "bottom_left": {
                      "x": 248,
                      "y": 208
                    },
                    "width": 29,
                    "height": 23.5
                  },
                  "confidence": 0.97
                },
                {
                  "text": "09/12/2027",
                  "bounds": {
                    "top_left": {
                      "x": 283,
                      "y": 185
                    },
                    "top_right": {
                      "x": 397,
                      "y": 184
                    },
                    "bottom_right": {
                      "x": 397,
                      "y": 208
                    },
                    "bottom_left": {
                      "x": 282,
                      "y": 209
                    },
                    "width": 114.5,
                    "height": 24
                  },
                  "confidence": 0.94
                }
              ]
            },
            {
              "text": "END NONE",
              "bounds": {
                "top_left": {
                  "x": 454,
                  "y": 191
                },
                "top_right": {
                  "x": 536,
                  "y": 191
                },
                "bottom_right": {
                  "x": 536,
                  "y": 206
                },
                "bottom_left": {
                  "x": 454,
                  "y": 206
                },
                "width": 82,
                "height": 15
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "END",
                  "bounds": {
                    "top_left": {
                      "x": 456,
                      "y": 192
                    },
                    "top_right": {
                      "x": 484,
                      "y": 192
                    },
                    "bottom_right": {
                      "x": 484,
                      "y": 206
                    },
                    "bottom_left": {
                      "x": 456,
                      "y": 206
                    },
                    "width": 28,
                    "height": 14
                  },
                  "confidence": 0.99
                },
                {
                  "text": "NONE",
                  "bounds": {
                    "top_left": {
                      "x": 493,
                      "y": 192
                    },
                    "top_right": {
                      "x": 533,
                      "y": 192
                    },
                    "bottom_right": {
                      "x": 533,
                      "y": 207
                    },
                    "bottom_left": {
                      "x": 492,
                      "y": 207
                    },
                    "width": 40.5,
                    "height": 15
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "EN MUÑOZ ESTRADA",
              "bounds": {
                "top_left": {
                  "x": 248,
                  "y": 213
                },
                "top_right": {
                  "x": 449,
                  "y": 211
                },
                "bottom_right": {
                  "x": 449,
                  "y": 232
                },
                "bottom_left": {
                  "x": 248,
                  "y": 234
                },
                "width": 201,
                "height": 21
              },
              "average_confidence": 0.73,
              "words": [
                {
                  "text": "EN",
                  "bounds": {
                    "top_left": {
                      "x": 249,
                      "y": 214
                    },
                    "top_right": {
                      "x": 269,
                      "y": 213
                    },
                    "bottom_right": {
                      "x": 269,
                      "y": 234
                    },
                    "bottom_left": {
                      "x": 249,
                      "y": 234
                    },
                    "width": 20,
                    "height": 20.5
                  },
                  "confidence": 0.31
                },
                {
                  "text": "MUÑOZ",
                  "bounds": {
                    "top_left": {
                      "x": 274,
                      "y": 213
                    },
                    "top_right": {
                      "x": 347,
                      "y": 212
                    },
                    "bottom_right": {
                      "x": 347,
                      "y": 234
                    },
                    "bottom_left": {
                      "x": 274,
                      "y": 234
                    },
                    "width": 73,
                    "height": 21.5
                  },
                  "confidence": 0.95
                },
                {
                  "text": "ESTRADA",
                  "bounds": {
                    "top_left": {
                      "x": 353,
                      "y": 212
                    },
                    "top_right": {
                      "x": 444,
                      "y": 212
                    },
                    "bottom_right": {
                      "x": 444,
                      "y": 233
                    },
                    "bottom_left": {
                      "x": 353,
                      "y": 234
                    },
                    "width": 91,
                    "height": 21.5
                  },
                  "confidence": 0.92
                }
              ]
            },
            {
              "text": "FN IVÁN ICHET",
              "bounds": {
                "top_left": {
                  "x": 250,
                  "y": 233
                },
                "top_right": {
                  "x": 389,
                  "y": 233
                },
                "bottom_right": {
                  "x": 389,
                  "y": 253
                },
                "bottom_left": {
                  "x": 250,
                  "y": 254
                },
                "width": 139,
                "height": 20.5
              },
              "average_confidence": 0.85,
              "words": [
                {
                  "text": "FN",
                  "bounds": {
                    "top_left": {
                      "x": 250,
                      "y": 234
                    },
                    "top_right": {
                      "x": 270,
                      "y": 234
                    },
                    "bottom_right": {
                      "x": 270,
                      "y": 254
                    },
                    "bottom_left": {
                      "x": 250,
                      "y": 255
                    },
                    "width": 20,
                    "height": 20.5
                  },
                  "confidence": 0.86
                },
                {
                  "text": "IVÁN",
                  "bounds": {
                    "top_left": {
                      "x": 274,
                      "y": 234
                    },
                    "top_right": {
                      "x": 318,
                      "y": 234
                    },
                    "bottom_right": {
                      "x": 317,
                      "y": 254
                    },
                    "bottom_left": {
                      "x": 274,
                      "y": 254
                    },
                    "width": 43.5,
                    "height": 20
                  },
                  "confidence": 0.7
                },
                {
                  "text": "ICHET",
                  "bounds": {
                    "top_left": {
                      "x": 327,
                      "y": 234
                    },
                    "top_right": {
                      "x": 387,
                      "y": 233
                    },
                    "bottom_right": {
                      "x": 386,
                      "y": 254
                    },
                    "bottom_left": {
                      "x": 327,
                      "y": 254
                    },
                    "width": 59.5,
                    "height": 20.5
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "14223 BELGATE ST",
              "bounds": {
                "top_left": {
                  "x": 250,
                  "y": 255
                },
                "top_right": {
                  "x": 393,
                  "y": 253
                },
                "bottom_right": {
                  "x": 393,
                  "y": 271
                },
                "bottom_left": {
                  "x": 251,
                  "y": 272
                },
                "width": 142.5,
                "height": 17.5
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "14223",
                  "bounds": {
                    "top_left": {
                      "x": 252,
                      "y": 256
                    },
                    "top_right": {
                      "x": 293,
                      "y": 256
                    },
                    "bottom_right": {
                      "x": 293,
                      "y": 272
                    },
                    "bottom_left": {
                      "x": 252,
                      "y": 272
                    },
                    "width": 41,
                    "height": 16
                  },
                  "confidence": 1
                },
                {
                  "text": "BELGATE",
                  "bounds": {
                    "top_left": {
                      "x": 296,
                      "y": 256
                    },
                    "top_right": {
                      "x": 366,
                      "y": 255
                    },
                    "bottom_right": {
                      "x": 366,
                      "y": 271
                    },
                    "bottom_left": {
                      "x": 297,
                      "y": 272
                    },
                    "width": 69.5,
                    "height": 16
                  },
                  "confidence": 0.99
                },
                {
                  "text": "ST",
                  "bounds": {
                    "top_left": {
                      "x": 373,
                      "y": 254
                    },
                    "top_right": {
                      "x": 391,
                      "y": 254
                    },
                    "bottom_right": {
                      "x": 391,
                      "y": 271
                    },
                    "bottom_left": {
                      "x": 372,
                      "y": 271
                    },
                    "width": 18.5,
                    "height": 17
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "BALDWIN PARK CA 91706",
              "bounds": {
                "top_left": {
                  "x": 250,
                  "y": 270
                },
                "top_right": {
                  "x": 440,
                  "y": 269
                },
                "bottom_right": {
                  "x": 440,
                  "y": 286
                },
                "bottom_left": {
                  "x": 250,
                  "y": 287
                },
                "width": 190,
                "height": 17
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "BALDWIN",
                  "bounds": {
                    "top_left": {
                      "x": 251,
                      "y": 271
                    },
                    "top_right": {
                      "x": 320,
                      "y": 270
                    },
                    "bottom_right": {
                      "x": 319,
                      "y": 287
                    },
                    "bottom_left": {
                      "x": 251,
                      "y": 287
                    },
                    "width": 68.5,
                    "height": 16.5
                  },
                  "confidence": 0.99
                },
                {
                  "text": "PARK",
                  "bounds": {
                    "top_left": {
                      "x": 327,
                      "y": 270
                    },
                    "top_right": {
                      "x": 365,
                      "y": 270
                    },
                    "bottom_right": {
                      "x": 365,
                      "y": 287
                    },
                    "bottom_left": {
                      "x": 326,
                      "y": 287
                    },
                    "width": 38.5,
                    "height": 17
                  },
                  "confidence": 0.99
                },
                {
                  "text": "CA",
                  "bounds": {
                    "top_left": {
                      "x": 372,
                      "y": 270
                    },
                    "top_right": {
                      "x": 392,
                      "y": 270
                    },
                    "bottom_right": {
                      "x": 392,
                      "y": 287
                    },
                    "bottom_left": {
                      "x": 372,
                      "y": 287
                    },
                    "width": 20,
                    "height": 17
                  },
                  "confidence": 1
                },
                {
                  "text": "91706",
                  "bounds": {
                    "top_left": {
                      "x": 397,
                      "y": 270
                    },
                    "top_right": {
                      "x": 439,
                      "y": 269
                    },
                    "bottom_right": {
                      "x": 438,
                      "y": 287
                    },
                    "bottom_left": {
                      "x": 396,
                      "y": 287
                    },
                    "width": 42,
                    "height": 17.5
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "DOB 09/12/1987",
              "bounds": {
                "top_left": {
                  "x": 251,
                  "y": 291
                },
                "top_right": {
                  "x": 404,
                  "y": 289
                },
                "bottom_right": {
                  "x": 404,
                  "y": 311
                },
                "bottom_left": {
                  "x": 251,
                  "y": 313
                },
                "width": 153,
                "height": 22
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "DOB",
                  "bounds": {
                    "top_left": {
                      "x": 252,
                      "y": 293
                    },
                    "top_right": {
                      "x": 285,
                      "y": 292
                    },
                    "bottom_right": {
                      "x": 285,
                      "y": 312
                    },
                    "bottom_left": {
                      "x": 252,
                      "y": 313
                    },
                    "width": 33,
                    "height": 20
                  },
                  "confidence": 1
                },
                {
                  "text": "09/12/1987",
                  "bounds": {
                    "top_left": {
                      "x": 291,
                      "y": 291
                    },
                    "top_right": {
                      "x": 404,
                      "y": 290
                    },
                    "bottom_right": {
                      "x": 404,
                      "y": 312
                    },
                    "bottom_left": {
                      "x": 291,
                      "y": 312
                    },
                    "width": 113,
                    "height": 21.5
                  },
                  "confidence": 0.99
                }
              ]
            },
            {
              "text": "RSTRNONE 09121987",
              "bounds": {
                "top_left": {
                  "x": 251,
                  "y": 314
                },
                "top_right": {
                  "x": 343,
                  "y": 314
                },
                "bottom_right": {
                  "x": 343,
                  "y": 330
                },
                "bottom_left": {
                  "x": 251,
                  "y": 331
                },
                "width": 92,
                "height": 16.5
              },
              "average_confidence": 0.96,
              "words": [
                {
                  "text": "RSTRNONE",
                  "bounds": {
                    "top_left": {
                      "x": 252,
                      "y": 315
                    },
                    "top_right": {
                      "x": 341,
                      "y": 314
                    },
                    "bottom_right": {
                      "x": 341,
                      "y": 331
                    },
                    "bottom_left": {
                      "x": 251,
                      "y": 331
                    },
                    "width": 89.5,
                    "height": 16.5
                  },
                  "confidence": 0.96
                }
              ]
            },
            {
              "text": "Ivan M.",
              "bounds": {
                "top_left": {
                  "x": 76,
                  "y": 374
                },
                "top_right": {
                  "x": 239,
                  "y": 376
                },
                "bottom_right": {
                  "x": 239,
                  "y": 420
                },
                "bottom_left": {
                  "x": 75,
                  "y": 419
                },
                "width": 163.5,
                "height": 44.5
              },
              "average_confidence": 0.9,
              "words": [
                {
                  "text": "Ivan",
                  "bounds": {
                    "top_left": {
                      "x": 85,
                      "y": 375
                    },
                    "top_right": {
                      "x": 172,
                      "y": 376
                    },
                    "bottom_right": {
                      "x": 171,
                      "y": 419
                    },
                    "bottom_left": {
                      "x": 83,
                      "y": 420
                    },
                    "width": 87.5,
                    "height": 44
                  },
                  "confidence": 0.94
                },
                {
                  "text": "M.",
                  "bounds": {
                    "top_left": {
                      "x": 199,
                      "y": 377
                    },
                    "top_right": {
                      "x": 237,
                      "y": 379
                    },
                    "bottom_right": {
                      "x": 237,
                      "y": 420
                    },
                    "bottom_left": {
                      "x": 198,
                      "y": 420
                    },
                    "width": 38.5,
                    "height": 42
                  },
                  "confidence": 0.87
                }
              ]
            },
            {
              "text": "SEX M HAIR BLK EYES BLK",
              "bounds": {
                "top_left": {
                  "x": 315,
                  "y": 369
                },
                "top_right": {
                  "x": 370,
                  "y": 369
                },
                "bottom_right": {
                  "x": 370,
                  "y": 384
                },
                "bottom_left": {
                  "x": 315,
                  "y": 384
                },
                "width": 55,
                "height": 15
              },
              "average_confidence": 0.99,
              "words": [
                {
                  "text": "SEX",
                  "bounds": {
                    "top_left": {
                      "x": 317,
                      "y": 370
                    },
                    "top_right": {
                      "x": 345,
                      "y": 370
                    },
                    "bottom_right": {
                      "x": 345,
                      "y": 385
                    },
                    "bottom_left": {
                      "x": 317,
                      "y": 385
                    },
                    "width": 28,
                    "height": 15
                  },
                  "confidence": 0.98
                },
                {
                  "text": "M",
                  "bounds": {
                    "top_left": {
                      "x": 356,
                      "y": 370
                    },
                    "top_right": {
                      "x": 364,
                      "y": 370
                    },
                    "bottom_right": {
                      "x": 364,
                      "y": 385
                    },
                    "bottom_left": {
                      "x": 356,
                      "y": 385
                    },
                    "width": 8,
                    "height": 15
                  },
                  "confidence": 1
                }
              ]
            },
            {
              "text": "HGT 5-02\" WGT 185lb ISS",
              "bounds": {
                "top_left": {
                  "x": 316,
                  "y": 387
                },
                "top_right": {
                  "x": 400,
                  "y": 387
                },
                "bottom_right": {
                  "x": 400,
                  "y": 401
                },
                "bottom_left": {
                  "x": 316,
                  "y": 402
                },
                "width": 84,
                "height": 14.5
              },
              "average_confidence": 0.82,
              "words": [
                {
                  "text": "HGT",
                  "bounds": {
                    "top_left": {
                      "x": 317,
                      "y": 388
                    },
                    "top_right": {
                      "x": 347,
                      "y": 387
                    },
                    "bottom_right": {
                      "x": 346,
                      "y": 402
                    },
                    "bottom_left": {
                      "x": 317,
                      "y": 402
                    },
                    "width": 29.5,
                    "height": 14.5
                  },
                  "confidence": 0.99
                },
                {
                  "text": "5-02\"",
                  "bounds": {
                    "top_left": {
                      "x": 359,
                      "y": 387
                    },
                    "top_right": {
                      "x": 399,
                      "y": 387
                    },
                    "bottom_right": {
                      "x": 399,
                      "y": 402
                    },
                    "bottom_left": {
                      "x": 359,
                      "y": 401
                    },
                    "width": 40,
                    "height": 14.5
                  },
                  "confidence": 0.65
                }
              ]
            },
            {
              "text": "DD 08/13/202160648/AAFD/27 07/25/2022",
              "bounds": {
                "top_left": {
                  "x": 316,
                  "y": 408
                },
                "top_right": {
                  "x": 499,
                  "y": 406
                },
                "bottom_right": {
                  "x": 499,
                  "y": 421
                },
                "bottom_left": {
                  "x": 316,
                  "y": 423
                },
                "width": 183,
                "height": 15
              },
              "average_confidence": 0.95,
              "words": [
                {
                  "text": "DD",
                  "bounds": {
                    "top_left": {
                      "x": 318,
                      "y": 408
                    },
                    "top_right": {
                      "x": 335,
                      "y": 408
                    },
                    "bottom_right": {
                      "x": 336,
                      "y": 423
                    },
                    "bottom_left": {
                      "x": 318,
                      "y": 423
                    },
                    "width": 17.5,
                    "height": 15
                  },
                  "confidence": 0.96
                },
                {
                  "text": "08/13/202160648/AAFD/27",
                  "bounds": {
                    "top_left": {
                      "x": 342,
                      "y": 408
                    },
                    "top_right": {
                      "x": 499,
                      "y": 407
                    },
                    "bottom_right": {
                      "x": 499,
                      "y": 420
                    },
                    "bottom_left": {
                      "x": 343,
                      "y": 423
                    },
                    "width": 156.5,
                    "height": 14
                  },
                  "confidence": 0.94
                }
              ]
            }
          ]
        }
      ],
      "width": 698,
      "height": 525
    }
  },
  "finishReason": "stop",
  "usage": {
    "inputTokens": 5351,
    "outputTokens": 2404,
    "totalTokens": 7755
  },
  "response": {
    "id": "interfaze-1774999479678",
    "modelId": "interfaze-beta",
    "body": {
      "id": "interfaze-1774999479678",
      "object": "chat.completion",
      "model": "interfaze-beta",
      "usage": {
        "prompt_tokens": 5351,
        "completion_tokens": 2404,
        "total_tokens": 7755
      }
    }
  }
}
```
