Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Delete a container file

containers().files().delete(params, requestOptions = RequestOptions.none())
DELETE
/containers/{container_id}/files/{file_id}

Delete Container File

Delete a container file

package com.openai.example;

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

public final class Main {
    private Main() {}

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

        FileDeleteParams params = FileDeleteParams.builder()
            .containerId("container_id")
            .fileId("file_id")
            .build();
        client.containers().files().delete(params);
    }
}
Response example
{
    "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
    "object": "container.file.deleted",
    "deleted": true
}
Parameters
FileDeleteParams params
String containerId
Optional<String> fileId
Returns Examples
Response example
{
    "id": "cfile_682e0e8a43c88191a7978f477a09bdf5",
    "object": "container.file.deleted",
    "deleted": true
}