---
title: "Retrieve an agent environment template"
method: GET
path: "/agents/environments/templates/{environment_template_id}"
tags: ["Agents"]
---

# Retrieve an agent environment template

`GET /agents/environments/templates/{environment_template_id}`

## Request

- Base URL: `https://api.openai.com/v1`
- URL: `https://api.openai.com/v1/agents/environments/templates/{environment_template_id}`
- Auth: HTTP bearer

Retrieves reusable environment configuration without returning confidential values. See [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

## Path parameters

- `environment_template_id` string, required

## Response `200`

The requested environment template.

- EnvironmentTemplateResource: Reusable configuration that provisions a fresh OpenAI-hosted environment for each session.
  - `id` string, required: The ID of the reusable environment template.
  - `name` string, nullable, required: An optional human-readable display name for the template.
  - `object` 'agent.environment.template', required: The object type. Always `agent.environment.template`.
  - `created_at` integer, required: The Unix timestamp, in seconds, when the template was created.
  - `updated_at` integer, required: The Unix timestamp, in seconds, when the template was last updated.
  - `packages` EnvironmentPackagesResource, required: Packages installed in an OpenAI-hosted environment.
    - `python` string[], required: Python packages installed in the environment.
    - `system` string[], required: System packages installed in the environment.
    - `npm` string[], required: npm packages installed globally in the environment.
  - `network` NetworkPolicyResource, required: Network access for an OpenAI-hosted environment.
    - `access` 'enabled' | 'disabled' | 'restricted', required: The network access mode for an OpenAI-hosted environment.
    - `allowed_domains` string[], required: Domains the environment may access when network access is restricted.
  - `desktop` DesktopResource, required: The effective desktop configuration for an OpenAI-hosted environment.
    - `enabled` boolean, required: Whether the environment provisions a desktop and browser proxy.
  - `capability_directories` string[], required: Directories that expose capabilities to the agent.
  - `skills` HostedTemplateSkillResource[], required: Safe skill metadata, preserving unresolved version selectors.
    - union: Safe metadata for a skill configured by an environment template.
      - object: A skill resolved afresh from the Skills API whenever a session starts.
        - `type` 'skill_reference', required: The type of the object. Always `skill_reference`.
        - `skill_id` string, required: The referenced skill ID.
        - `version` string, nullable, required: The requested version selector, including `latest`.
      - object: Safe metadata for an inline skill archive.
        - `type` 'inline', required: The type of the object. Always `inline`.
        - `name` string, required: The skill name declared in `SKILL.md`.
        - `description` string, required: The skill description declared in `SKILL.md`.
  - `plugins` HostedPluginResource[], required: Safe plugin metadata, excluding inline archive contents.
    - `type` 'inline', required: The type of the object. Always `inline`.
    - `name` string, required: The installed plugin name.
    - `description` string, required: The installed plugin description.
  - `files` HostedTemplateFileResource[], required: Safe file metadata, excluding contents and session-scoped file IDs.
    - union: Safe metadata for a file configured by an environment template.
      - object: A project-scoped Files API reference resolved separately for each session.
        - `type` 'file_id', required: The type of the object. Always `file_id`.
        - `file_id` string, required: The ID of the uploaded file.
        - `path` string, required: The file's absolute path inside the environment.
      - object: Metadata for confidential inline file contents.
        - `type` 'inline', required: The type of the object. Always `inline`.
        - `path` string, required: The file's absolute path inside the environment.
        - `size_bytes` integer, required: The decoded size of the inline file in bytes.

## Other responses

- `400`: The request was invalid.
- `401`: Authentication or project context was missing.
- `403`: The API key lacks the required management permission.
- `404`: The requested environment definition was not found.
- `500`: An internal error occurred.
- `503`: The service is temporarily unavailable.

## Changes

- **2026-10-05** `7f654af7f94f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omnistack-sh/apis/openai-api/changes/agents/environments/templates/:environment_template_id/get.md)

---

[API](https://skmtc.dev/omnistack-sh/apis/openai-api.md) - [All operations](https://skmtc.dev/omnistack-sh/apis/openai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omnistack-sh/apis/openai-api/revisions/0a26f104d35f?raw)
