Skip to main content

Create Assistant File

Create an assistant file by attaching a File to an assistant.

Path Parameters
assistant_id Assistant Id — REQUIRED
Request Body — REQUIRED
file_id File Id — REQUIRED

A File ID (with purpose="assistants") that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files.

Responses
200

Successful Response

Schema — OPTIONAL
_id Id — OPTIONAL

MongoDB document ObjectID

id Id

The identifier, which can be referenced in API endpoints.

object Object28

Possible values: [assistant.file]

The object type, which is always assistant.file.

created_at Created At

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

assistant_id Assistant Id

The assistant ID that the file is attached to.

422

Validation Error

Schema — OPTIONAL
detail object[] — OPTIONAL
loc undefined[]
msg Message
type Error Type