Create container file
containers.files.create(strcontainer_id, FileCreateParams**kwargs) -> FileCreateResponse
POST/containers/{container_id}/files
Create a Container File
You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.
Parameters
container_id: str
file_id: Optional[str]
Name of the file to create.
Returns
Create container file
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
file = client.containers.files.create(
container_id="container_id",
)
print(file.id){
"id": "id",
"bytes": 0,
"container_id": "container_id",
"created_at": 0,
"object": "container.file",
"path": "path",
"source": "source"
}Returns Examples
{
"id": "id",
"bytes": 0,
"container_id": "container_id",
"created_at": 0,
"object": "container.file",
"path": "path",
"source": "source"
}