{"command":{"effect":"write","timeoutSeconds":120,"inputSchema":{"type":"object","description":"Creates reusable environment configuration without returning confidential setup commands or environment values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).","properties":{"body":{"$ref":"#/definitions/CreateEnvironmentTemplateParams"}},"required":[],"additionalProperties":false,"definitions":{"CreateEnvironmentTemplateParams":{"type":"object","properties":{"packages":{"anyOf":[{"$ref":"#/definitions/EnvironmentPackagesParam"},{"type":"null"}],"description":"Packages to install in the environment. Defaults to empty package lists."},"setup_commands":{"type":["array","null"],"items":{"$ref":"#/definitions/SetupCommandParam"},"minItems":0,"maxItems":16,"description":"Ordered, confidential setup commands. Command bodies are never returned."},"network":{"anyOf":[{"$ref":"#/definitions/NetworkPolicyParam"},{"type":"null"}],"description":"Network access policy for the environment. If omitted, the API version determines whether network access is enabled or disabled."},"desktop":{"anyOf":[{"$ref":"#/definitions/DesktopParam"},{"type":"null"}],"description":"Desktop provisioning. Omission or null inherits the template setting, or defaults to disabled."},"env":{"type":["object","null"],"additionalProperties":{"type":"string","minLength":0,"maxLength":1048576},"propertyNames":{"type":"string","minLength":1,"maxLength":256},"minProperties":0,"maxProperties":1024,"description":"Environment variables made available to the agent."},"capability_directories":{"type":["array","null"],"items":{"type":"string","minLength":0,"maxLength":1048576},"minItems":0,"maxItems":16384,"description":"Directories that contain capabilities exposed to the agent. Defaults to an empty list."},"skills":{"type":["array","null"],"items":{"$ref":"#/definitions/HostedSkillParam"},"minItems":0,"maxItems":200,"description":"Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty list."},"plugins":{"type":["array","null"],"items":{"$ref":"#/definitions/HostedPluginParam"},"minItems":0,"maxItems":32,"description":"Plugins provided as inline ZIP archives. Defaults to an empty list."},"files":{"type":["array","null"],"items":{"$ref":"#/definitions/HostedEnvironmentFileParam"},"minItems":0,"maxItems":50,"description":"Files available before the agent starts. Defaults to an empty list."},"name":{"type":["string","null"],"minLength":1,"maxLength":256,"description":"An optional human-readable display name for the template."}},"additionalProperties":false,"description":"Parameters for creating a reusable, project-scoped OpenAI-hosted environment template."},"EnvironmentPackagesParam":{"type":"object","properties":{"python":{"type":["array","null"],"items":{"type":"string","minLength":0,"maxLength":1048576},"minItems":0,"maxItems":16384,"description":"Python packages to install. Defaults to an empty list."},"system":{"type":["array","null"],"items":{"type":"string","minLength":0,"maxLength":1048576},"minItems":0,"maxItems":16384,"description":"System packages to install. Defaults to an empty list."},"npm":{"type":["array","null"],"items":{"type":"string","minLength":0,"maxLength":1048576},"minItems":0,"maxItems":16384,"description":"npm packages to install globally. Defaults to an empty list."}},"additionalProperties":false,"description":"Packages to install in an OpenAI-hosted environment."},"SetupCommandParam":{"type":"object","properties":{"command":{"type":"string","minLength":0,"maxLength":65536,"description":"The shell command to execute."},"cwd":{"type":["string","null"],"minLength":0,"maxLength":4096,"description":"The absolute working directory. Defaults to `/workspace`."}},"required":["command"],"additionalProperties":false,"description":"A confidential setup command executed before the hosted agent starts."},"NetworkPolicyParam":{"type":"object","properties":{"access":{"$ref":"#/definitions/NetworkAccessParam"},"allowed_domains":{"type":["array","null"],"items":{"type":"string","minLength":0,"maxLength":1048576},"minItems":0,"maxItems":16384,"description":"Domains the environment may access when network access is restricted."},"blocked_domains":{"type":["array","null"],"items":{"type":"string","minLength":0,"maxLength":1048576},"minItems":0,"maxItems":100,"description":"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."}},"required":["access"],"additionalProperties":false,"description":"Network access for an OpenAI-hosted environment."},"DesktopParam":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether to provision the desktop and its browser proxy."}},"required":["enabled"],"additionalProperties":false,"description":"Desktop configuration for an OpenAI-hosted environment."},"HostedSkillParam":{"oneOf":[{"$ref":"#/definitions/HostedSkillParamSkillReference"},{"$ref":"#/definitions/HostedSkillParamInline"}],"description":"A skill installed in an OpenAI-hosted environment."},"HostedPluginParam":{"oneOf":[{"$ref":"#/definitions/HostedPluginParamInline"}],"description":"A plugin installed in an OpenAI-hosted environment."},"HostedEnvironmentFileParam":{"oneOf":[{"$ref":"#/definitions/HostedEnvironmentFileParamFileId"},{"$ref":"#/definitions/HostedEnvironmentFileParamInline"}],"description":"A file materialized in an OpenAI-hosted execution environment."},"NetworkAccessParam":{"type":"string","enum":["enabled","disabled","restricted"],"description":"The network access mode for an OpenAI-hosted environment."},"HostedSkillParamSkillReference":{"type":"object","properties":{"type":{"type":"string","enum":["skill_reference"],"default":"skill_reference","description":"The type of the object. Always `skill_reference`."},"skill_id":{"type":"string","minLength":1,"maxLength":64,"description":"The ID of the skill created through `/v1/skills`."},"version":{"type":["string","null"],"minLength":0,"maxLength":1048576,"description":"The skill version, a positive integer or `latest`; omission selects the default."}},"required":["type","skill_id"],"additionalProperties":false,"description":"References a skill uploaded through the Skills API."},"HostedSkillParamInline":{"type":"object","properties":{"type":{"type":"string","enum":["inline"],"default":"inline","description":"The type of the object. Always `inline`."},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The skill name declared in `SKILL.md`."},"description":{"type":"string","minLength":0,"maxLength":1048576,"description":"The skill description declared in `SKILL.md`."},"source":{"$ref":"#/definitions/InlineCapabilitySourceParam"}},"required":["type","name","description","source"],"additionalProperties":false,"description":"Supplies a skill ZIP directly in the session request."},"HostedPluginParamInline":{"type":"object","properties":{"type":{"type":"string","enum":["inline"],"default":"inline","description":"The type of the object. Always `inline`."},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The plugin name declared in `.codex-plugin/plugin.json`."},"description":{"type":"string","minLength":0,"maxLength":1048576,"description":"The plugin description declared in `.codex-plugin/plugin.json`."},"source":{"$ref":"#/definitions/InlineCapabilitySourceParam"}},"required":["type","name","description","source"],"additionalProperties":false,"description":"Supplies a plugin ZIP directly in the session request."},"HostedEnvironmentFileParamFileId":{"type":"object","properties":{"type":{"type":"string","enum":["file_id"],"default":"file_id","description":"The type of the object. Always `file_id`."},"file_id":{"type":"string","minLength":1,"maxLength":256,"description":"The ID of the uploaded file."},"path":{"type":"string","minLength":1,"maxLength":4096,"description":"The absolute destination path inside `/workspace`."}},"required":["type","file_id","path"],"additionalProperties":false,"description":"A file previously uploaded through the OpenAI Files API."},"HostedEnvironmentFileParamInline":{"type":"object","properties":{"type":{"type":"string","enum":["inline"],"default":"inline","description":"The type of the object. Always `inline`."},"data":{"type":"string","minLength":0,"maxLength":6990508,"description":"The standard-base64-encoded file contents."},"path":{"type":"string","minLength":1,"maxLength":4096,"description":"The absolute destination path inside `/workspace`."}},"required":["type","data","path"],"additionalProperties":false,"description":"A file supplied directly as standard-base64 data."},"InlineCapabilitySourceParam":{"oneOf":[{"$ref":"#/definitions/InlineCapabilitySourceParamBase64"}],"description":"The encoded ZIP archive for an inline skill or plugin."},"InlineCapabilitySourceParamBase64":{"type":"object","properties":{"type":{"type":"string","enum":["base64"],"default":"base64","description":"The type of the object. Always `base64`."},"media_type":{"type":"string","enum":["application/zip"],"default":"application/zip","description":"The archive media type, always `application/zip`."},"data":{"type":"string","minLength":1,"maxLength":70254592,"description":"Standard-base64 encoded ZIP archive bytes."}},"required":["type","media_type","data"],"additionalProperties":false,"description":"Provides ZIP bytes encoded with standard base64."}}},"name":"Create an agent environment template","id":"openai.createagentenvironmenttemplate","example":{},"maxRequests":1,"summary":false}}