Google Cloud Document AI Pricing Guide & Pre-Upload Cost Optimization: Avoiding the Per-Page OCR Billing Trap

Evaluating Google Cloud Document AI pricing for high-volume invoice, claims, or medical PDF ingestion? While basic Document AI Enterprise OCR starts at fractions of a cent per page, specialized Form Parsers, Invoice Parsers, and Custom Extractors bill $0.03 to $0.10+ per page—meaning blank separator sheets, duplicate scans, and T&C boilerplate pages silently multiply your monthly GCP bill by 3x–5x. Below is how a GCP Professional Cloud Architect and AI Application Engineer cuts Document AI API spend by 60%+ using lightweight pre-upload PDF page filtering in Python before invoking Cloud Document AI.

⚡ Book a 1-Day Engineering Sprint ($100 USD via Credit/Debit Card Checkout or Rp 1,000,000 via QRIS & Indonesian Bank Virtual Account): Submit your architecture or implementation scope at /en-us/1-day-service/ (instant 1-day feasibility check, Instant WhatsApp Verification or Email & Password Sign-In, and 1-business-day delivery), or hire Aldian Fazrihady for multi-week engagements on Upwork (Top-Rated, 5.0★).

1. Google Cloud Document AI API Pricing Breakdown by Processor Tier

Document AI Processor Type Typical Per-Page Cost Structure Hidden Billing Pitfall in Production
Document OCR Processor ~$1.50 per 1,000 pages ($0.0015 / page) Scanning 40-page contracts when only pages 1–2 contain metadata
Form Parser / Layout Parser ~$10–$30 per 1,000 pages ($0.01–$0.03 / page) Every blank scan backside or cover page is billed at the full parser rate
Invoice / Expense / Custom Extractor ~$30–$100 per 1,000 pages ($0.03–$0.10 / page) Appended vendor terms & conditions (10+ pages per PDF) 10x your invoice cost

2. Pre-Upload Page Triage in Python (pypdf + Blank/Boilerplate Slicing)

Before sending a multi-page PDF to documentai_v1.DocumentProcessorServiceClient, slice out blank scan pages, terms-and-conditions appendices, and exact SHA-256 duplicate attachments on Cloud Run:

import hashlib
import io
from pypdf import PdfReader, PdfWriter
from google.cloud import documentai_v1 as documentai

BOILERPLATE_MARKERS = ("general terms and conditions", "standard purchase order terms")

def extract_billable_pages(pdf_bytes: bytes, max_pages: int = 15) -> bytes:
    reader = PdfReader(io.BytesIO(pdf_bytes))
    writer = PdfWriter()
    kept = 0

    for page in reader.pages:
        if kept >= max_pages:
            break
        raw_text = (page.extract_text() or "").strip().lower()
        # Keep scanned image pages (empty text layer) if page has XObject images, skip pure blank pages
        has_images = "/XObject" in (page.get("/Resources") or {})
        if not raw_text and not has_images:
            continue
        if len(raw_text) > 400 and any(m in raw_text for m in BOILERPLATE_MARKERS):
            continue
        writer.add_page(page)
        kept += 1

    out = io.BytesIO()
    writer.write(out)
    return out.getvalue()

def process_filtered_invoice(project_id: str, location: str, processor_id: str, pdf_bytes: bytes):
    slim_pdf = extract_billable_pages(pdf_bytes)
    if not slim_pdf:
        return None
    doc_hash = hashlib.sha256(slim_pdf).hexdigest()
    client = documentai.DocumentProcessorServiceClient()
    name = client.processor_path(project_id, location, processor_id)
    req = documentai.ProcessRequest(
        name=name,
        raw_document=documentai.RawDocument(content=slim_pdf, mime_type="application/pdf"),
    )
    return doc_hash, client.process_document(request=req).document

3. Hybrid Routing: Document AI OCR + Gemini 2.5 Flash Structured Output

For heterogeneous vendor layouts where Custom Extractor per-page fees exceed budget, routing $0.0015/page Document OCR output (or native PDF text layers) into Vertex AI Gemini 2.5 Flash with strict Pydantic JSON Schema validation often reduces per-document extraction cost by 75–85% while handling unseen vendor templates zero-shot. Read more in the AI Application Engineer Pillar Guide and GCP Professional Cloud Architect Guide.

4. Frequently Asked Questions — Google Document AI Pricing

Does Google Cloud Document AI charge per document or per page?

Google Cloud Document AI charges strictly per page processed, regardless of whether a page contains a dense invoice table, boilerplate legal terms, or an accidental blank duplex scan.

How can we reduce Document AI costs without losing extraction accuracy?

Combine SHA-256 document deduplication, pre-upload blank and boilerplate page stripping with pypdf, Document AI ProcessOptions.IndividualPageSelector, and hybrid routing to Gemini Flash for text-native PDFs.


About the Author — Hire Aldian Fazrihady (Cloud Engineer, GCP Professional Cloud Architect, GCP Professional Data Engineer, Backend, AI & Full Stack Engineer)

Aldian Fazrihady is a Top-Rated Senior Cloud Engineer, GCP Professional Cloud Architect (Google Cloud Certified), GCP Professional Data Engineer (Google Cloud Certified), Backend Engineer (Python, Django, FastAPI, Go, PostgreSQL), AI Application Engineer (LLMs, RAG, MCP, Google ADK, LangGraph), and Full Stack Engineer (React, Next.js, TypeScript) with 15+ years of production software engineering experience.

Hire Aldian Fazrihady on Upwork | Book 1-Day Programming Service ($100 USD / Rp 1.000.000) | View Live AI Portfolio | Send a Direct Message

Related Engineering Articles

Engineering Role Pillar Guides & Category Hubs