Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Container List Response

From Leeroopedia
Knowledge Sources
Domains API_Types, Python
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete type for container list response objects provided by the openai-python SDK.

Description

The ContainerListResponse Pydantic model represents a single container object returned when listing containers. It has the same shape as ContainerCreateResponse and ContainerRetrieveResponse: required fields id, created_at, name, object, and status, plus optional expires_after (nested ExpiresAfter with anchor and minutes), last_active_at, memory_limit, and network_policy (nested NetworkPolicy with type and allowed_domains).

Usage

Import this type when iterating over results from client.containers.list() to type-hint individual container items.

Code Reference

Source Location

Signature

class ExpiresAfter(BaseModel):
    anchor: Optional[Literal["last_active_at"]] = None
    minutes: Optional[int] = None

class NetworkPolicy(BaseModel):
    type: Literal["allowlist", "disabled"]
    allowed_domains: Optional[List[str]] = None

class ContainerListResponse(BaseModel):
    id: str
    created_at: int
    name: str
    object: str
    status: str
    expires_after: Optional[ExpiresAfter] = None
    last_active_at: Optional[int] = None
    memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]] = None
    network_policy: Optional[NetworkPolicy] = None

Import

from openai.types import ContainerListResponse

I/O Contract

Fields

Name Type Required Description
id str Yes Unique identifier for the container
created_at int Yes Unix timestamp (seconds) when the container was created
name str Yes Name of the container
object str Yes The object type
status str Yes Status of the container (e.g., active, deleted)
expires_after Optional[ExpiresAfter] No Expiration policy with anchor and minutes
last_active_at Optional[int] No Unix timestamp when the container was last active
memory_limit Optional[Literal["1g", "4g", "16g", "64g"]] No Configured memory limit
network_policy Optional[NetworkPolicy] No Network access policy (type and allowed domains)

Usage Examples

from openai import OpenAI

client = OpenAI()

for container in client.containers.list(limit=20):
    print(f"{container.id}: {container.name}")
    print(f"  Status: {container.status}")
    print(f"  Memory: {container.memory_limit}")
    if container.expires_after:
        print(f"  Expires: {container.expires_after.minutes}m after {container.expires_after.anchor}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment