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

# Retrieve an agent environment

`GET /agents/environments/{environment_id}`

Retrieves an execution environment's connection status and safe installed metadata. See [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle).

## Path parameters

- `environment_id` string, required

## Response `200`

The requested environment.

- PublicEnvironmentResource — Safe metadata for a first-class execution environment.
  - `id` string, required — The ID of the environment.
  - `object` 'agent.environment', required — The object type. Always `agent.environment`.
  - `type` 'openai_hosted' | 'self_hosted', required — The kind of execution environment.
  - `status` 'pending' | 'connected' | 'disconnected' | 'expired' | 'failed', required — The public lifecycle status of an execution environment.
  - `files` HostedEnvironmentFileResource[], required — Files installed in the environment, without their contents.
    - union — Metadata for a file materialized in an OpenAI-hosted execution environment.
      - object — A file copied from the OpenAI Files API.
        - `type` 'file_id', required — The type of the object. Always `file_id`.
        - `id` string, required — The session-scoped ID of the file in the execution environment.
        - `file_id` string, required — The ID of the uploaded file.
        - `path` string, required — The file's absolute path inside the environment.
        - `size_bytes` integer, required — The decoded file size in bytes.
      - object — A file supplied inline when the session was created.
        - `type` 'inline', required — The type of the object. Always `inline`.
        - `id` string, required — The session-scoped ID of the file in the execution environment.
        - `path` string, required — The file's absolute path inside the environment.
        - `size_bytes` integer, required — The decoded file size in bytes.
  - `skills` HostedSkillResource[], required — Skills installed in the environment, without their archive contents.
    - union — A skill installed in an OpenAI-hosted environment.
      - object — A skill installed from the Skills API.
        - `type` 'skill_reference', required — The type of the object. Always `skill_reference`.
        - `skill_id` string, required — The referenced skill ID.
        - `version` string, required — The concrete skill version installed for this session.
        - `name` string, required — The installed skill name.
        - `description` string, required — The installed skill description.
      - object — A skill installed from an inline ZIP archive.
        - `type` 'inline', required — The type of the object. Always `inline`.
        - `name` string, required — The installed skill name.
        - `description` string, required — The installed skill description.
  - `plugins` HostedPluginResource[], required — Plugins installed in the environment, without their 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.

## Other responses

- `400` — The request was invalid.
- `401` — Authentication or project context was missing.
- `404` — The requested session or event was not found.
- `409` — The request conflicted with the current session state.
- `500` — An internal error occurred.
- `503` — The service is temporarily unavailable.

## Changes

- **2026-09-10** `f2dae1a9aced` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/openai/apis/openapi/changes/agents/environments/:environment_id/get.md)

---

[API](https://skmtc.dev/openai/apis/openapi.md) · [All operations](https://skmtc.dev/openai/apis/openapi/llms.txt) · [OpenAPI document](https://skmtc.dev/openai/apis/openapi/revisions/c40bf0ba89d2?raw)
