Sample - OpenAI API
GET/containers/{container_id}/files

List files in a container

Lists the files associated with a specific container. Use limit, after, and order to control the page size, cursor position, and creation-time ordering. The response indicates whether additional container files are available.

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

4 parameters
container_idstringrequired
The unique identifier of the container whose files to list.
limitintegeroptional
Maximum number of container files to return, from 1 to 100. Defaults to 20 when omitted.
Default:20
orderstringoptional
Sort order by creation time: `asc` for ascending or `desc` for descending. Defaults to desc when omitted.
Allowed:ascdescDefault:desc
afterstringoptional
Cursor identifying the file after which to continue listing results.

2 status codes
200Returns a list object containing container file records, the IDs of the first and last files, and a `has_more` flag indicating whether more files are available.
objectstringrequired
The type of object returned, must be 'list'.
Allowed:list
dataarray<TheContainerFileObject>required
A list of container files.
first_idstringrequired
The ID of the first file in the list.
last_idstringrequired
The ID of the last file in the list.
has_morebooleanrequired
Whether there are more files available.
429Returned when the request rate exceeds the permitted limit.
errorobjectrequired

Error handling

container_id must identify the container whose files you want to list. limit must be between 1 and 100, and order must be either asc or desc; a 429 is returned when the request rate exceeds the permitted limit.