Sample - OpenAI API
GET/agents/environments/{environment_id}/files

List agent environment files

Lists live files on a connected execution environment with optional directory filtering and opaque cursor pagination. See environment files.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

5 parameters
environment_idstringrequired
The ID of the environment.
pathstringoptional
Restrict the listing to this absolute workspace directory.
limitintegeroptional
The maximum number of files to return, between 1 and 100.
orderstringoptional
Sort by case-sensitive path components. Defaults to descending.
Allowed:ascdesc
pagestringoptional
The opaque token from the previous page. Keep the same path, order, and limit.

7 status codes
200A page of live environment files.
objectstringrequired
The object type. Always `page`.
Allowed:pageDefault:page
dataarray<object>required
Files available on the current page.
nextstringrequired
The opaque cursor to use when requesting the next page, if any.
has_morebooleanrequired
Whether more files follow this page.
400The request was invalid.
errorobjectrequired
The error returned by the API.
401Authentication or project context was missing.
errorobjectrequired
The error returned by the API.
404The requested session or event was not found.
errorobjectrequired
The error returned by the API.
409The request conflicted with the current session state.
errorobjectrequired
The error returned by the API.
500An internal error occurred.
errorobjectrequired
The error returned by the API.
503The service is temporarily unavailable.
errorobjectrequired
The error returned by the API.

Error handling

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