Migrate · Google Cloud Document AI to Extend

Migrate from Google Cloud Document AI to Extend

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

View as Markdown

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

Concept map

OCR and layout processorsclient.parse(file=...)
Markdown chunks and typed blocks from one call, with engines for accuracy, cost, or per-page routing.
Extraction processorsclient.extract(config={'schema': ...})
Define fields in a JSON Schema in your code instead of configuring a processor per document type.
Classifier and splitter processorsclient.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 anchorsoutput.chunks and output.value
Markdown and JSON instead of offsets into one text string.
Application Default CredentialsEXTEND_API_KEY
One API key per workspace.
  1. Get an API key

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

  2. 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)
    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)
    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)
    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)
    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
  3. Run both side by side

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

  4. Scale with async

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

  5. 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

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.

pip install extend-ai
npm install extend-ai

CLI

Run any processor from your terminal.

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

MCP server

Let your coding agent call Extend.

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

Agent quickstart

Give your agent current Extend docs.

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

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.

cta-background

( fig.11 )

Turn your documents into high quality data