External Publication
Visit Post

Get container api giving 404 before it is deleted or expired

OpenAI Developer Community May 29, 2026
Source

Hi OpenAI Team,

I am using the response api with background true, tool shell with environment type container and container id.

I am creating a container before making the response api call with expiry after 20 minutes of last active at and passed the container id as reference as such

client.responses.create(
  parameters: {
    model: @model,
    background: true,
    tools: [
      {
        type: "shell",
        environment: {
          type: "container_reference",
          container_id: container_id
        }
      }
    ],
    input: [
      {
        role: “system”,
        content: instructions
      },
      {
         role: “user”,
         content: [
           {
              type: "input_text",
              text: user_prompt
            },
            {
               type: "input_file",
               file_id: file_id
            }
          ]
        }
     ],
     temperature: 0.0
   }

    )

Then I listen to openai response completion webhook. Once I receive the webhook request I try to fetch the container output. However, sometimes while trying to fetch the container output I get the 404 container not found error Container with id not found. I am confident I am fetching the container output within that 20 mins window (to be honest much earlier than 20 mins has elasped) but still I get container not found error. This makes my product feature very unreliable.

I think something is wrong with openai container resource cleanup logic but for us this is very problematic because it makes my service product feature unreliable and blindly starting the processing again would cost me a lot as it is going to be widely used feature so I cannot just retry without understanding the issue and cost associated with it.

Thanks!

Discussion in the ATmosphere

Loading comments...