Upload file
POST
https://api.openai.com/v1/filesUpload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
Request
Header Params
Authorization
string
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params multipart/form-data
file
file
required
Name of the JSON Lines file to be uploaded.
If the purpose
is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your training examples.
purpose
string
required
The intended purpose of the uploaded documents.
Use "fine-tune" for Fine-tuning. This allows us to validate the format of the uploaded file.
Example:
fine-tune
Request samples
Responses
成功(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
id
string
required
object
string
required
bytes
integer
required
created_at
integer
required
filename
string
required
purpose
string
required
Example成功示例
{
"id": "file-XjGxS3KTG0uNmNOK362iJua3",
"object": "file",
"bytes": 140,
"created_at": 1613779121,
"filename": "mydata.jsonl",
"purpose": "fine-tune"
}
Last modified: a year ago