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

# List agent environment files

`GET /agents/environments/{environment_id}/files`

## Request

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

Lists live files on a connected execution environment with optional directory filtering and opaque cursor pagination. See [environment files](https://developers.openai.com/api/docs/guides/agents-api/environments/files).

## Path parameters

- `environment_id` string, required

## Query parameters

- `path` string, nullable
- `limit` integer, nullable
- `order` 'asc' | 'desc': The order in which paginated resources are returned.
- `page` string

## Response `200`

A page of live environment files.

- EnvironmentFileListResource: A paginated list of live execution environment files.
  - `object` 'page', required: The object type for a page of files in an execution environment.
  - `data` EnvironmentFileResource[], required: Files available on the current page.
    - `object` 'agent.environment.file', required: The object type. Always `agent.environment.file`.
    - `environment_id` string, required: The ID of the environment containing this file.
    - `path` string, required: The absolute file path inside the environment's workspace.
    - `size_bytes` integer, required: The file size in bytes.
  - `next` string, nullable, required: The opaque cursor to use when requesting the next page, if any.
  - `has_more` boolean, required: Whether more files follow this page.

## Other responses

- `400`: The request was invalid.
- `401`: Authentication or project context was missing.
- `403`: The API key lacks the required permission.
- `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-10-05** `7f654af7f94f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omnistack-sh/apis/openai-api/changes/agents/environments/:environment_id/files/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)
