Share via

Error 500 using Azure OpenAI Responses API

Michelle Miller 10 Reputation points
2025-07-21T16:04:57.2266667+00:00

Hello,

I am testing using the Reponses API via python and keep getting "InternalServerError: Error code: 500 - {'error': {'message': '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=2213926 if the error persists. Please include the request ID 1cbeb774-0aee-4ef5-b890-0d9b5e6b3660 in your message.', 'type': 'server_error', 'param': None, 'code': 'server_error'}}"

Sometimes the same code will run with no issue, but more often than not I get this error.

Below is a minimum reproducible example. Please let me know if more info is needed. The error is almost always referring to response2, though sometimes response1 also gets the error. I have confirmed that I am well below any rate limits as well.

Thank you

# Initialize Azure OpenAI client
client = AzureOpenAI(
    api_version='2025-03-01-preview',
    azure_endpoint=endpoint,
    azure_ad_token_provider=token_provider,
)

#First response
response1 = client.responses.create(
        model='mymodel_gpt-4o',
        instructions = 'This is a system level prompt',
        input= [{"role":"user", "content":"This is my initial question"}],
        top_p=0.1,
    )

#Second response, using the context of the first response
response2 = client.responses.create(
        model='mymodel_gpt-4o',
        previous_response_id=response1.id,
        input = [{"role": "user", "content": 'This is my next question'}],
        top_p=0.1,
        )
Azure OpenAI in Foundry Models

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.