APIError with 95% of image requests for 2 days now

Summary

Starting yesterday (approx. 24 hours ago), we began experiencing a critical regression with Azure OpenAI Vision requests. Approximately 95% of requests containing base64 images are failing with a generic APIError (Status 500) immediately upon connection.

This represents a sudden change in behavior; previously, these exact payloads succeeded without issue.

Environment

  • Platform: Azure OpenAI (Hosted Data Zone Standard Europe)

  • Models: gpt-5.1, gpt-5, gpt-5-mini

  • SDK: Python langchain-openai / langchain-core

  • Method: astream_events, (Async Streaming), ainvoke

Configuration

We are initializing the client using azure_ad_token_provider for authentication:

Python

ChatOpenAI(
    model=model_deployment, # e.g. gpt-5
    base_url=f"https://{azure_openai_service}.openai.azure.com/openai/{api_version}/",
    api_key=get_bearer_token_provider(azure_credential, "https://cognitiveservices.azure.com/.default"),
    use_responses_api=True,
    output_version="responses/v1",
)

The Issue

When sending a request that includes an image using LangChain’s SystemMessage and HumanMessage classes, the stream terminates immediately with the following generic error. This error lacks standard JSON body details or error codes:

Plaintext

Error in streaming response: An error occurred while processing your request. 
You can retry your request, or contact us through an Azure support request at: 
https://go.microsoft.com/fwlink/?linkid=xxx if the error persists.

Observations

  1. High Failure Rate: Failure rate spiked to ~95% within the last 24 hours across all listed GPT-5 variants.

  2. Regression: Identical code and payloads that worked two days ago are now failing constantly.

  3. No Structural Error: We do not receive a 400 Bad Request or a ResponsibleAIPolicyViolation. The response behaves like a raw upstream 500 Server Error / Timeout.

Reproduction Snippet

We are using the standard LangChain message structure:

Python

from langchain_core.messages import SystemMessage, HumanMessage

# Standard setup using LangChain message classes
messages = [
    SystemMessage(content="You are a helpful assistant."),
    HumanMessage(content=[
        {"type": "text", "text": "Describe this image."},
        {
            "type": "image_url", 
            "image_url": {
                "url": "data:image/png;base64,..." # Valid Base64 String
            }
        }
    ])
]

# Triggers generic 500 APIError immediately on iteration
async for event in llm.astream_events(messages, version="v1"):
    pass

additonal information: normal chat requests work without any problems.

token load is not high for the failed requests, ~2k tokens inpurt. the images are quite small 113k bytes.

Also, as mentioned in the ticket, the same code worked perfectly fine until yesterday with the same images.

1 Like

OpenAI is not where you’d report problems with Azure AI services.

You get to pay Microsoft to tell them they are failing you.

You might try to re-deploy, perhaps to a different region. Then explore making the similar vision request by direct API call outside of LangChain or SDK to see if it is the particular request being sent. Ensure you are using a MIME type in the base64 data URL that is the same as the actual image file (while OpenAI will even let you just send “image/” with no type.)

hi thanks for support. I was posting the problem I have here, because the error is raised in the openai package. but thanks for pointing out about the mime types as well as the strategy on how to tackle this issue even more systematically.

We are experiencing the exact same issue. Switching to a different region or using the completions API instead of the responses API seems to fix it. Do you have any new information on it?