Azure OpenAI Code Interpreter - Containers API - Timeout

Akundy, Vyas 120 Reputation points
2025-11-11T19:51:32.9+00:00

Hi Team,

I am trying to implement the Code Interpreter that is enabled through tool calling in the new responses API and as part of that to be able to perform Q&A tasks on a file the OpenAI documentation shows that we need to create a container and upload files to the container. However I am trying to run the following code and it always shows a timeout and does not list the containers that I have created. Is there any alternative that you can suggest here or let me know how to make this work?

from openai import OpenAI

client = OpenAI(
    api_key="api key",
    base_url="https://azure-openai-resource.openai.azure.com/openai/v1",
)
client.containers.list()

Output: {'error': {'code': 'Timeout', 'message': 'The operation was timeout.'}}
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
{count} votes

Answer accepted by question author
  1. Sridhar M 3,160 Reputation points Microsoft External Staff Moderator
    2025-11-11T20:36:37.7166667+00:00

    Hi Akundy, Vyas

    Welcome to Microsoft Q&A and Thank you for reaching out.

    You’re seeing the Timeout Error because the Azure OpenAI Containers API isn’t fully exposed for direct management through the Python SDK. In Azure, the container feature is mainly an internal mechanism that supports the Code Interpreter tool (used within the Responses API) rather than a standalone service you can list or query directly.

    So, when you call client.containers.list(), the SDK is trying to reach an endpoint (GET /openai/v1/containers) that either doesn’t exist in Azure’s implementation or isn’t enabled in your region hence the timeout.

    In Azure OpenAI, you don’t actually need to manually create or list containers to use the Code Interpreter. Instead, Azure provides an “auto” mode where containers are automatically managed behind the scenes. You simply upload files with client.files.create() and then reference those file IDs in the Responses API request by specifying a container parameter with "type": "auto". This automatically creates a temporary container for your code execution task, which is valid for a limited time (usually around one hour with an idle timeout of 20 minutes).

    If you still want to confirm whether container management endpoints are available, you can check Azure’s REST API documentation or try calling GET https://<your-resource>.openai.azure.com/openai/v1/containers directly with tools like Postman but most users report this endpoint is either restricted or unsupported in Azure.

    In short, the timeout isn’t caused by your setup but by the fact that Azure OpenAI doesn’t yet support explicit container listing. The correct approach is to rely on automatic container creation via the Responses API using "container": {"type": "auto"} and file_ids.

    References

    I Hope this helps. Do let me know if you have any further queries.

    Thank you!

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.