One of the following:
EnvironmentParamNone { type }

Runs the agent without an execution environment.

type: "none"

The type of the object. Always none.

EnvironmentParamOpenAIHosted { type, capability_directories, container_size, 10 more }

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

type: "openai_hosted"

The type of the object. Always openai_hosted.

capability_directories?: Array<string> | null

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

minItems0
maxItems16384
container_size?: "small" | "medium" | "large"

The hosted container size. Omission selects the medium tier.

One of the following:
"small"
"medium"
"large"
desktop?: Desktop | null

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

enabled: boolean

Whether to provision the desktop and its browser proxy.

env?: Record<string, string> | null

Environment variables made available to the agent.

environment_id?: string

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

minLength9
maxLength256
environment_template_id?: string

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

minLength0
maxLength64
files?: Array<HostedEnvironmentFileParam> | null

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

minItems0
maxItems50
One of the following:
HostedEnvironmentFileParamFileID { file_id, path, type }

A file previously uploaded through the OpenAI Files API.

file_id: string

The ID of the uploaded file.

minLength1
maxLength256
path: string

The absolute destination path inside /workspace.

minLength1
maxLength4096
type: "file_id"

The type of the object. Always file_id.

HostedEnvironmentFileParamInline { data, path, type }

A file supplied directly as standard-base64 data.

data: string

The standard-base64-encoded file contents.

minLength0
maxLength6990508
path: string

The absolute destination path inside /workspace.

minLength1
maxLength4096
type: "inline"

The type of the object. Always inline.

network?: Network | null

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

access: "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?: Array<string> | null

Domains the environment may access when network access is restricted.

minItems0
maxItems16384
blocked_domains?: Array<string> | null

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?: Packages | null

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

npm?: Array<string> | null

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

minItems0
maxItems16384
python?: Array<string> | null

Python packages to install. Defaults to an empty list.

minItems0
maxItems16384
system?: Array<string> | null

System packages to install. Defaults to an empty list.

minItems0
maxItems16384
plugins?: Array<HostedPluginParam { description, name, source, type } > | null

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

minItems0
maxItems32
description: string

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

minLength0
maxLength1048576
name: string

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

minLength1
maxLength64
source: InlineCapabilitySourceParam { data, media_type, type }

Provides ZIP bytes encoded with standard base64.

type: "inline"

The type of the object. Always inline.

setup_commands?: Array<SetupCommandParam { command, cwd } > | null

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

minItems0
maxItems16
command: string

The shell command to execute.

minLength0
maxLength65536
cwd?: string | null

The absolute working directory. Defaults to /workspace.

minLength0
maxLength4096
skills?: Array<HostedSkillParam> | null

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

minItems0
maxItems200
One of the following:
HostedSkillParamSkillReference { skill_id, type, version }

References a skill uploaded through the Skills API.

skill_id: string

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

minLength1
maxLength64
type: "skill_reference"

The type of the object. Always skill_reference.

version?: string | null

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

minLength0
maxLength1048576
HostedSkillParamInline { description, name, source, type }

Supplies a skill ZIP directly in the session request.

description: string

The skill description declared in SKILL.md.

minLength0
maxLength1048576
name: string

The skill name declared in SKILL.md.

minLength1
maxLength64
source: InlineCapabilitySourceParam { data, media_type, type }

Provides ZIP bytes encoded with standard base64.

type: "inline"

The type of the object. Always inline.

EnvironmentParamSelfHosted { type, workspace_directory, capability_directories }

An application-hosted environment configured inline.

type: "self_hosted"

The type of the object. Always self_hosted.

workspace_directory: string

Absolute project directory inside the self-hosted environment.

minLength0
maxLength1048576
capability_directories?: Array<string> | null

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

minItems0
maxItems16384