Fine-tuning is not yet supported.
Objects
The FileObject
Most file endpoints return aFileObject describing an uploaded file.
| Field | Type | Description |
|---|---|---|
id | string | The file identifier, referenced in API endpoints. |
object | string | The object type, always "file". |
bytes | integer | The size of the file, in bytes. |
created_at | integer | Unix timestamp (in seconds) for when the file was created. |
expires_at | integer | Unix timestamp (in seconds) for when the file will be deleted. |
filename | string | The name of the file. |
purpose | string | The intended purpose of the file. One of "batch", "fine-tune", or "batch-output". |
Create file
file
file
The file to be uploaded.
purpose
purpose
The intended purpose of the file. Can be
"batch" or "fine-tune" for upload, but only "batch" is currently supported.expires_after (optional)
expires_after (optional)
Controls how long the file remains available. An object with two fields:
anchor(optional) — must be"created_at". The expiry is measured from when the file is created. Defaults to"created_at".seconds(optional) — the number of seconds the file stays available after the anchor. An integer between3600(1 hour) and2592000(30 days). Defaults to2592000(30 days).
List files
after (optional)
after (optional)
A pagination cursor. The returned list starts from the object right after the file with this
id. If omitted, the list starts from the first file.limit (optional)
limit (optional)
An integer between
1 and 10000. The returned list will have at most limit elements. Defaults to 10000.order (optional)
order (optional)
Sort order by
created_at, either "asc" (ascending) or "desc" (descending).purpose (optional)
purpose (optional)
Only returns files of the given purpose. If omitted, files are not filtered by purpose.
| Field | Type | Description |
|---|---|---|
object | string | The object type, always "list". |
data | array | A list of FileObject. |
first_id | string | The id of the first file in the list. |
last_id | string | The id of the last file in the list. |
has_more | boolean | true if there are more files after last_id. |
Retrieve a file
file_id
file_id
The
id of the file to retrieve.Retrieve file content
file_id
file_id
The
id of the file whose content to retrieve.Delete a file
file_id
file_id
The
id of the file to delete.FileDeleted object with the following fields:
| Field | Type | Description |
|---|---|---|
id | string | The id of the deleted file. |
deleted | boolean | true if the file was deleted. |
object | string | The object type, always "file". |
File API Limits
| Limit | Value |
|---|---|
| Maximum size of a single user-created file | 512 MB |
Maximum file size with purpose = "batch" | 200 MB |
| Maximum total file size per user (including response files) | 2 GB |