One of the following:
class EnvironmentParamNone: …

Runs the agent without an execution environment.

type: Literal["none"]

The type of the object. Always none.

class EnvironmentParamOpenAIHosted: …

An existing OpenAI-hosted environment or new inline/template-based hosted configuration.

type: Literal["openai_hosted"]

The type of the object. Always openai_hosted.

capability_directories: Optional[List[str]]

Directories that contain capabilities exposed to the agent. Defaults to an empty list.

minItems0
maxItems16384
container_size: Optional[Literal["small", "medium", "large"]]

The hosted container size. Omission selects the medium tier.

One of the following:
"small"
"medium"
"large"
desktop: Optional[EnvironmentParamOpenAIHostedDesktop]

Desktop provisioning. Omission or null inherits the template setting, or defaults to disabled.

enabled: bool

Whether to provision the desktop and its browser proxy.

env: Optional[Dict[str, str]]

Environment variables made available to the agent.

environment_id: Optional[str]

An existing prewarmed environment. Cannot be combined with a template or inline configuration.

minLength9
maxLength256
environment_template_id: Optional[str]

A reusable hosted template applied before inline session configuration. Omitted fields inherit the template; network overrides cannot broaden its policy.

minLength0
maxLength64
files: Optional[List[HostedEnvironmentFileParam]]

Files available before the agent starts. Defaults to an empty list.

minItems0
maxItems50
One of the following:
class HostedEnvironmentFileParamFileID: …

A file previously uploaded through the OpenAI Files API.

file_id: str

The ID of the uploaded file.

minLength1
maxLength256
path: str

The absolute destination path inside /workspace.

minLength1
maxLength4096
type: Literal["file_id"]

The type of the object. Always file_id.

class HostedEnvironmentFileParamInline: …

A file supplied directly as standard-base64 data.

data: str

The standard-base64-encoded file contents.

minLength0
maxLength6990508
path: str

The absolute destination path inside /workspace.

minLength1
maxLength4096
type: Literal["inline"]

The type of the object. Always inline.

network: Optional[EnvironmentParamOpenAIHostedNetwork]

Network access policy for the environment. If omitted, the API version determines whether network access is enabled or disabled.

access: Literal["enabled", "disabled", "restricted"]

The environment’s network access mode.

One of the following:
"enabled"

Allows unrestricted network access.

"disabled"

Disables network access.

"restricted"

Applies the configured domain restrictions.

allowed_domains: Optional[List[str]]

Domains the environment may access when network access is restricted.

minItems0
maxItems16384
blocked_domains: Optional[List[str]]

Domains blocked for both executor and browser when access is restricted. A nonempty list requires access: restricted and cannot be combined with nonempty allowed_domains. Wildcard domains are not supported.

minItems0
maxItems100
packages: Optional[EnvironmentParamOpenAIHostedPackages]

Packages to install in the environment. Defaults to empty package lists.

npm: Optional[List[str]]

npm packages to install globally. Defaults to an empty list.

minItems0
maxItems16384
python: Optional[List[str]]

Python packages to install. Defaults to an empty list.

minItems0
maxItems16384
system: Optional[List[str]]

System packages to install. Defaults to an empty list.

minItems0
maxItems16384
plugins: Optional[List[HostedPluginParam]]

Plugins provided as inline ZIP archives. Defaults to an empty list.

minItems0
maxItems32
description: str

The plugin description declared in .codex-plugin/plugin.json.

minLength0
maxLength1048576
name: str

The plugin name declared in .codex-plugin/plugin.json.

minLength1
maxLength64

Provides ZIP bytes encoded with standard base64.

data: str

Standard-base64 encoded ZIP archive bytes.

minLength1
maxLength70254592
media_type: Literal["application/zip"]

The archive media type, always application/zip.

type: Literal["base64"]

The type of the object. Always base64.

type: Literal["inline"]

The type of the object. Always inline.

setup_commands: Optional[List[SetupCommandParam]]

Ordered, confidential setup commands. Command bodies are never returned.

minItems0
maxItems16
command: str

The shell command to execute.

minLength0
maxLength65536
cwd: Optional[str]

The absolute working directory. Defaults to /workspace.

minLength0
maxLength4096
skills: Optional[List[HostedSkillParam]]

Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty list.

minItems0
maxItems200
One of the following:
class HostedSkillParamSkillReference: …

References a skill uploaded through the Skills API.

skill_id: str

The ID of the skill created through /v1/skills.

minLength1
maxLength64
type: Literal["skill_reference"]

The type of the object. Always skill_reference.

version: Optional[str]

The skill version, a positive integer or latest; omission selects the default.

minLength0
maxLength1048576
class HostedSkillParamInline: …

Supplies a skill ZIP directly in the session request.

description: str

The skill description declared in SKILL.md.

minLength0
maxLength1048576
name: str

The skill name declared in SKILL.md.

minLength1
maxLength64

Provides ZIP bytes encoded with standard base64.

data: str

Standard-base64 encoded ZIP archive bytes.

minLength1
maxLength70254592
media_type: Literal["application/zip"]

The archive media type, always application/zip.

type: Literal["base64"]

The type of the object. Always base64.

type: Literal["inline"]

The type of the object. Always inline.

class EnvironmentParamSelfHosted: …

An application-hosted environment configured inline.

type: Literal["self_hosted"]

The type of the object. Always self_hosted.

workspace_directory: str

Absolute project directory inside the self-hosted environment.

minLength0
maxLength1048576
capability_directories: Optional[List[str]]

Directories that contain capabilities exposed to the agent. Defaults to an empty list.

minItems0
maxItems16384