---
title: "Vercel AI Gateway can extract fields from PDFs and images"
id: "story-133"
canonical_url: "https://emergent.fm/stories/133"
markdown_url: "https://emergent.fm/stories/133/article.md"
published_at: "2026-11-23T23:16:04.983Z"
modified_at: "2026-11-24T04:56:41.528Z"
source_at: "2026-11-23T05:00:00.000Z"
topic: "orchestration"
trust_label: "Confirmed by vendor"
publisher: "Emergent.FM"
---

# Vercel AI Gateway can extract fields from PDFs and images

> ScaleDown Extract-1 pulls text values or lists of text values from text, images, and PDFs.

## Key points

- Vercel added extraction models to AI Gateway, starting with ScaleDown Extract-1 to pull structured text values or lists from text, images, and PDFs.
- ScaleDown Extract-1 is listed at $0.05 per 1M input tokens on AI Gateway and is available only through the AI SDK using experimental_extract in ai@7.0.176 or later.
- The model returns confidence scores from 0 to 1 so teams can flag uncertain matches for review, while OpenAI-compatible and Anthropic-compatible endpoints are not supported.

Vercel has added extraction models to AI Gateway, starting with ScaleDown Extract-1, according to the release changelog. Extraction models locate specific details in provided content, such as an invoice number or contact names, and return them as separate fields that application code can consume directly. Vercel reports that teams can use the model to process invoices, contracts, and other records, and that extraction requests appear in AI Gateway logs and spend tracking.

## Confidence scores and offsets guide document review

In a document workflow, developers pass a PDF or image as a file part inside the state parameter and define target fields such as vendor, total, and line items, according to the changelog. Each key in fields produces a matching entry in result.answers, with value set to null when a field is not found. Extract-1 attaches confidence scores from 0 to 1 for matches, including individual list items, and for text input it can also return character offsets, which mark the start and end positions of a match in the source text.

## Pricing is $0.05 per million input tokens

According to the AI Gateway model directory, ScaleDown Extract-1 offers a 1M context window at an input price of $0.05 per 1M tokens, and usage is subject to ScaleDown's Terms and Privacy Policies. Vercel's extraction quickstart states that running an extraction job requires Node.js 22.18 or later, a team with available AI Gateway Credits, and an AI_GATEWAY_API_KEY environment variable exported in the shell.

## Only the AI SDK supports extraction requests

Vercel's extraction documentation states that extraction is not supported through the OpenAI-compatible or Anthropic-compatible endpoints, limiting access to the AI SDK. For scaledown/extract-1, supported field types are restricted to text and list with text items, while supported file inputs cover images and PDF files. When using an AI Gateway provider instance, developers specify the model through gateway.extractionModel('scaledown/extract-1').

## Try it

1. Export your API key in the shell with `export AI_GATEWAY_API_KEY="your_ai_gateway_api_key"`.
2. Install the latest AI SDK by running `pnpm add ai@latest`.
3. Create `index.mts` using `experimental_extract` with model `scaledown/extract-1` and your target `state` and `fields`.
4. Run `node index.mts` to execute the extraction and print `result.answers`.

## Sources

- [Ai gateway now supports extraction models](<https://vercel.com/changelog/ai-gateway-now-supports-extraction-models>) (vercel.com, release)
- [Extract 1](<https://vercel.com/ai-gateway/models/scaledown/extract-1>) (vercel.com, documentation)
- [Extraction](<https://vercel.com/docs/ai-gateway/modalities/extraction>) (vercel.com, documentation)
- [AI Gateway Extraction Quickstart](<https://vercel.com/docs/ai-gateway/getting-started/extraction>) (vercel.com, documentation)

Canonical page: <https://emergent.fm/stories/133>
