Create a file
Upload a file that can be used across various endpoints. Individual files can be up to 128 MB.
Request
POST
https://ai.api.cloud.yandex.net/v1/files
Body
multipart/form-data
{
"file": "example",
"purpose": "assistants",
"expires_after": {
"anchor": "created_at",
"seconds": 3600
}
}
|
Name |
Description |
|
file |
Type: string<binary> The File object (not file name) to be uploaded. Example: |
|
purpose |
Type: string The intended purpose of the uploaded file. One of:
Enum: |
|
expires_after |
Type: FileExpirationAfter The expiration policy for a file. By default, files with Example
|
FileExpirationAfter
The expiration policy for a file. By default, files with purpose=batch expire after 30 days and all other files are persisted until they are manually deleted.
|
Name |
Description |
|
anchor |
Type: string Anchor timestamp after which the expiration policy applies. Supported anchors: Const: Example: |
|
seconds |
Type: integer The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). Min value: Max value: |
Example
{
"anchor": "created_at",
"seconds": 3600
}
Responses
200 OK
OK
Body
application/json
{
"id": "example",
"bytes": 0,
"created_at": 0,
"expires_at": 0,
"filename": "example",
"object": "file",
"purpose": "assistants",
"status": "uploaded",
"status_details": "example"
}
|
Name |
Description |
|
bytes |
Type: integer The size of the file, in bytes. |
|
created_at |
Type: integer The Unix timestamp (in seconds) for when the file was created. |
|
filename |
Type: string The name of the file. Example: |
|
id |
Type: string The file identifier, which can be referenced in the API endpoints. Example: |
|
object |
Type: string The object type, which is always Const: Example: |
|
purpose |
Type: string The intended purpose of the file. Supported values are Enum: |
|
status |
Type: string Deprecated. The current status of the file, which can be either Enum: |
|
expires_at |
Type: integer The Unix timestamp (in seconds) for when the file will expire. |
|
status_details |
Type: string Deprecated. For details on why a fine-tuning training file failed validation, see the Example: |
No longer supported, please use an alternative and newer version.