Blog

AI implementation

When an AI Model Reads the Same Document Differently on Azure

A practical investigation into missing digits, image detail and the API change that restored GPT-6 Luna’s document reading in our tests.

Digitrans · · 7 min

An accountant and a software engineer check a fictional financial document together in an office.

Two colleagues check a fictional financial document.

AI-generated editorial illustration.

In this article

A document reader can look reliable throughout development and still struggle after a move to a new hosting arrangement. That is what happened when we prepared a product that needed European processing for sensitive financial documents. We had built and tested the reading workflow using GPT-6 Luna through the direct OpenAI API. It handled the dense tables in our development documents well.

For deployment, we switched to Azure OpenAI in Microsoft Foundry. The model name was familiar. The result was not. Account references, balances and statement headings were being read incorrectly often enough to disrupt the accounting workflow. Some mistakes generated extra review questions. Others could have produced plausible but incorrect figures.

We investigated the image path before replacing the model. In our tests, changing the API used to submit each page restored the reading quality we had seen during development. The Azure deployment, page image and image-detail setting stayed the same.

Start with the page, then follow the request

Our reader turns each document page into a JPEG and asks the model to extract its contents. A later stage uses that reading to check balances, account references and continuity. If a digit disappears early on, subsequent checks can flag an account as unknown. If a heading is mistaken for another statement type, a series of apparently unrelated balance questions can follow.

That made the failure difficult to judge from the final output alone. We went back to the individual page images and compared what each API returned against a manually checked answer key.

The comparison used five financial-document pages with 51 selected fields. We sent each page three times per route, giving 153 field checks for each route. Azure used the West Europe deployment gpt-6-luna-2026-09-22. The reader rendered pages at zoom 3, producing 1,786 × 2,525 pixel JPEGs. Each route received identical image bytes with high image detail and medium reasoning effort.

The result that changed our approach

Our five-page comparison
Route for GPT-6 LunaInput tokens per pageChecked fields found
Azure Responses API1,065148 / 153
Azure Chat Completions API2,858153 / 153
Direct OpenAI Responses API3,059150 / 153

The Azure Chat Completions calls used the same Azure model deployment and the same page images as the Azure Responses calls. The successful result came from changing the API used to send the images. We did not change the renderer, resolution or high detail setting.

These figures describe a small, targeted test, not a benchmark of all financial documents. A field passed when its expected characters appeared in the reading, ignoring spaces, punctuation and accents. A value in the wrong column could still pass, and the score alone does not establish that a decimal separator was correctly placed. Check the original page when the position or exact formatting of a value matters.

The downstream effect was more visible over a long statement. On one 32-page document, our reader asked a larger recovery model to reread pages 10 to 11 times with Azure Responses. The corresponding figures were 6 to 7 with Azure Chat Completions and 5 with direct OpenAI. These counts come from our reader and should not be treated as expected rates for every document.

Why resizing was not the answer for us

We tested more than ten variants. On Azure Responses with high detail, pages reduced to 768 pixels wide, fitted to 2,048 pixels or enlarged to 2,381 × 3,367 pixels all produced the same 1,065 reported input tokens per page. That pattern suggests a common scaling step, though the token count does not expose Azure’s internal processing or prove the resolution delivered to the model.

Changing Responses detail to original or auto improved the result to 150 of 153 fields, but used 5,394 input tokens per page. Sending two page halves in separate requests found all 153 fields, at the cost of two calls per page. Image format, grayscale and contrast changes did not give us the same result as Chat Completions with a whole page.

A higher token count does not guarantee a better reading. It is a useful diagnostic signal when the same bytes and instructions produce a large, repeatable difference between routes. The useful outcome is whether the extracted values, their context and their positions are correct.

A public report with a different outcome

We found a Microsoft Q&A report from October 2026 describing repeated digits disappearing from a synthetic scanned invoice. Its author reported the problem on Azure resources in West Europe and Spain Central. The same references were read correctly through the direct OpenAI API in three attempts. Another developer commented that they had switched providers.

That report also says Chat Completions did not solve the author’s case. Splitting the page into two images did. The published Responses test used a 1,654 × 2,339 pixel PNG with low reasoning effort, while ours used a larger JPEG and medium. The full Chat Completions request is not published, so we cannot tell which differences explain the different outcomes.

OpenAI’s API changelog records a 25 September 2026 image-encoding fix affecting GPT-6 Luna and Sol. We have no confirmation that this fix explains the Azure behaviour in either investigation. The practical conclusion is to test the exact deployment and request used by your own application.

How to try the change

For our page-reading step, we send the original page JPEG to the Azure /openai/v1/chat/completions endpoint. The image is included in the user message as an image_url, with detail explicitly set to high. The example below shows the image block. Replace the three dots with the original JPEG encoded in Base64.

{
  "type": "image_url",
  "image_url": {
    "url": "data:image/jpeg;base64,...",
    "detail": "high"
  }
}

Our text interactions, tool calls and structured outputs continue to use Responses. This change is specific to page reading. Microsoft’s vision documentation describes the image detail setting and the request format.

Before changing a production workflow, prepare a small test set with an answer key. Synthetic documents can cover repeated digits, decimal separators, negative amounts, small print and tables with similar adjacent columns. Include pages your team finds difficult, and check both the value and where it appears on the original. Send the same images and instructions to each candidate route, repeat the calls and record the deployment, model version, detail setting, token usage and results.

Then test the complete workflow. Check which errors become review questions, which require a retry and whether an incorrect value can pass unnoticed. Human review and reconciliation remain relevant even when every field in a small test set passes.

Keep the processing requirement in view

The reason for the move was an important part of the decision. For sensitive business information, choose the Azure deployment type according to the actual processing-location requirements and contractual arrangements. A resource located in West Europe does not by itself establish the processing location of every deployment type. Microsoft distinguishes Global, Data Zone and geography-based processing. Its EU Data Zone can include countries outside the EU. See Microsoft’s deployment guidance.

Our result let us keep Luna on the existing Azure deployment for page reading. It also gave us a practical rule for future changes. Whenever a model, provider, API or deployment version changes, rerun representative document tests before relying on the output. The same model name is a starting point for that comparison. The pages themselves provide the evidence.

Related product

DigiRAG

Build agents in plain language, search your knowledge and handle mail, tasks and document outputs in one dedicated platform.

Explore AI consulting and implementation ↗Open product page