---
site_search: "GET /ask?q={query} (read-only search over extend.ai and docs.extend.ai; returns links and quoted passages, not generated answers)"
title: "Migrate from Google Cloud Document AI to Extend"
description: "A developer guide to moving from Google Cloud Document AI to Extend: how processors, process_document, and output map, before-and-after Python code, and a side-by-side migration plan."
canonical: https://www.extend.ai/migrate/google-document-ai
---

# Migrate from Google Cloud Document AI to Extend

> Search this site and the docs: [`/ask?q=…`](/ask?q=webhook+retries) returns matching pages from extend.ai and docs.extend.ai, with quoted passages.

Migrate · Google Cloud Document AI to Extend

Replace separate Document AI processors with one API for parse, extract, classify, and split.

[Get an API key](https://dashboard.extend.ai/) · [Extend vs. Google Cloud Document AI](https://www.extend.ai/compare/extend-vs-google-document-ai.md)

[View as Markdown](https://www.extend.ai/migrate/google-document-ai.md)

## Five steps

1. Get an API key
2. Swap one call
3. Run both side by side
4. Scale with async
5. Cut over

- **Calls to swap:** process_document per processor
- **SDK:** pip install extend-ai or npm install extend-ai
- **API key variable:** EXTEND_API_KEY
- **Review:** Built-in human review and Review Agent

On this page:

- Concept map
- Steps
- Agent prompt
- SDK, CLI, and MCP
- FAQ

## Concept map

| Google Cloud Document AI | Extend | What to know |
| --- | --- | --- |
| `OCR and layout processors` | `client.parse(file=...)` | Markdown chunks and typed blocks from one call, with engines for accuracy, cost, or per-page routing. |
| `Extraction processors` | `client.extract(config={'schema': ...})` | Define fields in a JSON Schema in your code instead of configuring a processor per document type. |
| `Classifier and splitter processors` | `client.classify and client.split` | Describe each document type in the request; every split returns its own file ID. |
| `Processor name (projects/.../processors/...)` | `Inline config or a saved processor ID` | Pass config per call, or save a versioned extractor, classifier, or splitter and reference it by ID. |
| `document.text and text anchors` | `output.chunks and output.value` | Markdown and JSON instead of offsets into one text string. |
| `Application Default Credentials` | `EXTEND_API_KEY` | One API key per workspace. |

## 01 Get an API key

Sign up, then export your key as EXTEND_API_KEY. You start with 10,000 free credits.

## 02 Swap one call

Add Extend next to your current call, behind a flag.

Map each processor to one Extend call, busiest first.

### Process a document

Get Markdown chunks instead of text anchors.

Remove · Google Cloud Document AI (Python):

```python
from google.api_core.client_options import ClientOptions
from google.cloud import documentai

opts = ClientOptions(api_endpoint=f"{location}-documentai.googleapis.com")
client = documentai.DocumentProcessorServiceClient(client_options=opts)
name = client.processor_path(project_id, location, processor_id)

with open("invoice.pdf", "rb") as f:
    raw_document = documentai.RawDocument(
        content=f.read(), mime_type="application/pdf"
    )

result = client.process_document(
    request=documentai.ProcessRequest(name=name, raw_document=raw_document)
)
print(result.document.text)
```

Add · Extend (Python):

```python
from extend_ai import Extend

client = Extend()  # reads EXTEND_API_KEY

response = client.parse(
    file={"url": "https://example.com/invoice.pdf"}
)

for chunk in response.output.chunks:
    print(chunk.content)  # Markdown for the chunk
    for block in chunk.blocks:
        print(block.type, block.content)
```

### Extract fields with a schema

Define fields in a JSON Schema instead of a processor.

Add · Extend (Python):

```python
from extend_ai import Extend

client = Extend()

result = client.extract(
    file={"url": "https://example.com/invoice.pdf"},
    config={
        "schema": {
            "type": "object",
            "properties": {
                "invoice_number": {"type": ["string", "null"]},
                "total": {"type": ["number", "null"]},
            },
        },
        "advancedOptions": {"citationsEnabled": True},
    },
)

print(result.output.value)     # shaped like your schema
print(result.output.metadata)  # per-field confidence and citations
```

### Split and classify mixed files

Describe each document type in the request.

Add · Extend (Python):

```python
from extend_ai import Extend

client = Extend()

result = client.split(
    file={"url": "https://example.com/packet.pdf"},
    config={
        "splitClassifications": [
            {"id": "invoice", "type": "invoice",
             "description": "An invoice requesting payment."},
            {"id": "other", "type": "other",
             "description": "Any other document."},
        ],
    },
)

for split in result.output.splits:
    print(split.type, split.start_page, split.end_page)
    # split.file_id is a standalone file for Extract
```

## 03 Run both side by side

Compare both on 50 to 100 of your documents, and save them as an evaluation set.

- [Evaluation sets](https://docs.extend.ai/evaluation/overview)
- [Async processing](https://docs.extend.ai/general/async-processing)
- [Batch processing](https://docs.extend.ai/general/batch-processing)

## 04 Scale with async

Use async runs with webhooks, or batches of up to 1,000 files.

## 05 Cut over

Switch traffic once results pass, and rerun the set after changes.

### What you gain

- One API instead of separate processors.
- Built-in human review (Document AI's ended in 2025).
- Evaluation sets, Composer, and CI/CD.
- Cloud, BYOC, hybrid, or self-hosted.

### When to keep both

- You want Google-managed processors inside Google Cloud and already plan to build and operate the surrounding system.

## Agent prompt

Paste into Claude Code, Cursor, or Codex to run the migration.

Prompt:

```text
Migrate this codebase from Google Cloud Document AI to Extend. Read the guide at https://www.extend.ai/migrate/google-document-ai.md, install the extend-ai SDK, and replace each Google Cloud Document AI call using its concept map and code samples. Keep the Google Cloud Document AI path behind a flag until both paths have run on the same documents, and read the API key from EXTEND_API_KEY.
```

## SDK, CLI, and MCP

Pick how you want to work.

### SDKs

Python, TypeScript, Java, and Go.

```bash
pip install extend-ai
npm install extend-ai
```

- [SDK guide](https://www.extend.ai/agents/sdk.md)
- [SDK docs](https://docs.extend.ai/sdks)

### CLI

Run any processor from your terminal.

```bash
curl -fsSL https://extend.ai/install.sh | sh
extend setup
extend parse invoice.pdf > invoice.md
```

- [CLI guide](https://www.extend.ai/agents/cli.md)
- [CLI docs](https://docs.extend.ai/cli)

### MCP server

Let your coding agent call Extend.

```bash
claude mcp add --transport http extend https://mcp.extend.ai/mcp
```

- [MCP guide](https://www.extend.ai/agents/mcp.md)
- [MCP docs](https://docs.extend.ai/mcp)

### Agent quickstart

Give your agent current Extend docs.

```bash
npx skills add extend-hq/extend-agent-plugin --skill extend-api
```

- [Agent quickstart](https://docs.extend.ai/agent-quickstart)

## FAQ

### Google Cloud Document AI is down. What should I do?

Check Google Cloud Document AI's status page first. To keep documents moving during an outage, send the same files to Extend: sign up at dashboard.extend.ai, export EXTEND_API_KEY, and call client.parse or client.extract with the same file URL. New accounts get 10,000 free credits with no contract or sales call, and Extend publishes its own status at status.extend.ai.

### Can I use Extend as a fallback for Google Cloud Document AI?

Yes. Keep Google Cloud Document AI as your primary path and route a request to Extend when it fails, times out, or returns low-confidence output. Document AI returns a Document object with text anchors; Extend returns Markdown chunks and schema-shaped JSON, so a fallback maps your processor outputs to one Extend call per document type. Score both paths on the same Extend evaluation set so you know the fallback meets your bar before you need it.

### Google Cloud Document AI is slow or timing out on large documents. What are my options?

Use Extend's async run endpoints: create_and_poll while you test, or webhooks in production, instead of holding a connection open. Synchronous calls time out after five minutes, and batch requests accept up to 1,000 files each. For mixed batches, the parse_auto engine sends simple pages through the faster Light engine and only complex pages through Performance.

### Google Cloud Document AI is returning wrong or incomplete results. Is there a more accurate alternative?

No public same-run benchmark compares Extend and Google Cloud Document AI. Extend Performance Parse scored 95.7% field-level document Q&A accuracy on RealDoc-Bench, an open benchmark of real-world regulated documents, so run both on your own documents and compare. With citations enabled, every extracted value points to its page and region, so you can see exactly where a wrong value came from.

### Is there a benchmark comparing Extend and Document AI?

No public same-run benchmark compares the two products. Run both on the same set of your own documents and score the results before deciding.

### Google Cloud Document AI is getting expensive. How does Extend pricing work?

Extend publishes per-page pricing on a credit system: Parse costs $5 per 1,000 pages on Light and $20 per 1,000 pages on Performance on pay-as-you-go, at $0.01 per credit after 10,000 free credits, with no contract, monthly minimum, or platform fee. The parse_auto engine bills each page by its complexity, so clean pages stay cheap.

### Does Extend keep my documents if I switch from Google Cloud Document AI?

Not if you don't want it to. Zero data retention can be enabled on every plan, including pay-as-you-go, and AI subprocessors operate under contractual zero-retention and no-training terms. Extend supports SOC 2 Type II, HIPAA with BAAs, GDPR, and EU processing.

### Can I run Extend in my own cloud?

Yes. Extend runs as managed cloud in US or EU regions, as BYOC inside your own cloud account and VPC, or as a hybrid deployment.

### When should I consider migrating from Google Cloud Document AI to Extend?

Consider Extend when accuracy on complex documents, traceable output, or production review starts to limit your pipeline. Extend combines parse, extract, classify, split, workflows, evaluation, and human review in one platform, where Document AI gives you separate processors to orchestrate and its legacy Human-in-the-Loop service ended in 2025. Extend is self-serve, so you can test it on your own documents the same day with 10,000 free credits.

### Can a coding agent migrate my Google Cloud Document AI integration for me?

Yes. Connect the Extend MCP server to Claude Code, Cursor, Codex, or VS Code, or install the extend-api context file with npx skills add extend-hq/extend-agent-plugin --skill extend-api, then ask the agent to replace each call using the concept map on this page.

### How do Document AI processors map to Extend?

OCR and layout processors map to Extend Parse, extraction processors map to Extend Extract with a JSON Schema, and classifier and splitter processors map to Extend Classify and Split. Instead of a processor name, pass the configuration in the request or reference a saved, versioned Extend processor by ID.

### Does Extend include human review?

Yes. A human review step pauses a workflow so operators can inspect and correct output against the source document, and Review Agent flags likely errors. Google's legacy Human-in-the-Loop service for Document AI ended in 2025.

## Related

- [Extend vs. Google Cloud Document AI](https://www.extend.ai/compare/extend-vs-google-document-ai.md)
- [Extend docs](https://docs.extend.ai/)

## Other guides

- [Migrate from Reducto to Extend](https://www.extend.ai/migrate/reducto.md)
- [Migrate from LlamaParse to Extend](https://www.extend.ai/migrate/llamaparse.md)
- [Migrate from AWS Textract to Extend](https://www.extend.ai/migrate/aws-textract.md)
- [Migrate from Unstructured to Extend](https://www.extend.ai/migrate/unstructured.md)
