Implementation:Openai Openai python Container Auto Param
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for parameterizing an automatically created container provided by the openai-python SDK.
Description
ContainerAutoParam is a TypedDict that defines the parameter structure for requesting automatic container creation in the Responses API. It requires a type field fixed to "container_auto", and provides optional fields for file_ids (a list of uploaded file IDs to make available inside the container), memory_limit (one of "1g", "4g", "16g", or "64g"), network_policy (a union of ContainerNetworkPolicyDisabledParam or ContainerNetworkPolicyAllowlistParam), and skills (an iterable of SkillReferenceParam or InlineSkillParam objects).
Usage
Import this type when constructing a container configuration for a response request that needs code execution in a sandboxed environment. Use it to specify resource limits, network policies, and available files for the container.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/container_auto_param.py
Signature
NetworkPolicy: TypeAlias = Union[
ContainerNetworkPolicyDisabledParam,
ContainerNetworkPolicyAllowlistParam,
]
Skill: TypeAlias = Union[SkillReferenceParam, InlineSkillParam]
class ContainerAutoParam(TypedDict, total=False):
type: Required[Literal["container_auto"]]
file_ids: SequenceNotStr[str]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
network_policy: NetworkPolicy
skills: Iterable[Skill]
Import
from openai.types.responses import ContainerAutoParam
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| type | Literal["container_auto"] | Yes | Automatically creates a container for this request. |
| file_ids | SequenceNotStr[str] | No | An optional list of uploaded file IDs to make available to the code. |
| memory_limit | Optional[Literal["1g", "4g", "16g", "64g"]] | No | The memory limit for the container. |
| network_policy | NetworkPolicy | No | Network access policy for the container (disabled or allowlist). |
| skills | Iterable[Skill] | No | An optional list of skills referenced by id or inline data. |
Usage Examples
from openai.types.responses import ContainerAutoParam
container: ContainerAutoParam = {
"type": "container_auto",
"memory_limit": "4g",
"file_ids": ["file-abc123"],
}
response = client.responses.create(
model="gpt-4o",
input="Analyze the uploaded CSV file",
container=container,
)