---
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`

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.
- `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/files/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/26bd6202a0ad?raw)
