Skip to content

List container files

FileListPage containers().files().list(FileListParamsparams = FileListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/containers/{container_id}/files

List Container files

ParametersExpand Collapse
FileListParams params
Optional<String> containerId
Optional<String> after

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Optional<Long> limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Optional<Order> order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

ASC("asc")
DESC("desc")
ReturnsExpand Collapse
class FileListResponse:
String id

Unique identifier for the file.

long bytes

Size of the file in bytes.

String containerId

The container this file belongs to.

long createdAt

Unix timestamp (in seconds) when the file was created.

JsonValue; object_ "container.file"constant"container.file"constant

The type of this object (container.file).

String path

Path of the file in the container.

String source

Source of the file (e.g., user, assistant).

List container files

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.containers.files.FileListPage;
import com.openai.models.containers.files.FileListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        FileListPage page = client.containers().files().list("container_id");
    }
}
{
  "data": [
    {
      "id": "id",
      "bytes": 0,
      "container_id": "container_id",
      "created_at": 0,
      "object": "container.file",
      "path": "path",
      "source": "source"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}
Returns Examples
{
  "data": [
    {
      "id": "id",
      "bytes": 0,
      "container_id": "container_id",
      "created_at": 0,
      "object": "container.file",
      "path": "path",
      "source": "source"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}