https://beta.openai.com/docs/api-reference/files
Files
Files are used to upload documents that can be used with features like Fine-tuning.
파일은 미세 조정과 같은 기능과 함께 사용할 수 있는 문서를 업로드하는 데 사용됩니다.
List files
GET https://api.openai.com/v1/files
Returns a list of files that belong to the user's organization.
사용자의 조직에 속한 파일 목록을 반환합니다.
![](https://blog.kakaocdn.net/dn/Af5KE/btrWppKnY8X/G39b8j3346jm2WVqqcxIu0/img.png)
https://beta.openai.com/docs/api-reference/files/upload
Upload file
POST https://api.openai.com/v1/files
Upload 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.
다양한 엔드포인트/기능(endpoints/features)에서 사용할 문서가 포함된 파일을 업로드합니다. 현재 한 조직에서 업로드하는 모든 파일의 크기는 최대 1GB입니다. 저장 한도를 늘려야 하는 경우 당사에 문의하십시오.
![](https://blog.kakaocdn.net/dn/wn8Av/btrWpYMIHJX/hvf2ra8A8RJGkk8SPfbYg1/img.png)
Request body
Name of the JSON Lines file to be uploaded.
업로드할 JSON Lines 파일의 이름입니다.
If the purpose is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your training examples.
목적이 "미세 조정"으로 설정된 경우 각 줄은 교육 예제를 나타내는 "프롬프트" 및 "완료" 필드가 있는 JSON 레코드입니다.
The intended purpose of the uploaded documents.
Use "fine-tune" for Fine-tuning. This allows us to validate the format of the uploaded file.
미세 조정에는 " Fine-tuning"을 사용하십시오. 이렇게 하면 업로드된 파일의 형식을 확인할 수 있습니다.
https://beta.openai.com/docs/api-reference/files/delete
Delete file
DELETE https://api.openai.com/v1/files/{file_id}
Delete a file.
파일을 지웁니다.
![](https://blog.kakaocdn.net/dn/MJws3/btrWsTXwvAF/YcM3IBrbzwRqFYGe7lNQBK/img.png)
Path parameters
The ID of the file to use for this request.
이 요청에서 사용할 파일의 아이디 입니다.
https://beta.openai.com/docs/api-reference/files/retrieve
Retrieve file
GET https://api.openai.com/v1/files/{file_id}
Returns information about a specific file.
특정 파일에 대한 정보를 반환합니다.
![](https://blog.kakaocdn.net/dn/ctLLaO/btrWrr1vqke/sbhJcIfNKuVAEU3Wem7E4K/img.png)
Path parameters
The ID of the file to use for this request
이 요청에서 사용할 파일의 아이디 입니다.
https://beta.openai.com/docs/api-reference/files/retrieve-content
Retrieve file content
GET https://api.openai.com/v1/files/{file_id}/content
Returns the contents of the specified file
특정 파일의 내용을 반환합니다.
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
content = openai.File.download("file-XjGxS3KTG0uNmNOK362iJua3")
Path parameters
The ID of the file to use for this request
이 요청에서 사용할 파일의 아이디 입니다.
'Open AI > API REFERENCE' 카테고리의 다른 글
Chat - Create chat completion (ChatGPT API usage) (0) | 2023.03.06 |
---|---|
Parameter details (0) | 2023.01.17 |
Engines - openai.Engine.list(), (0) | 2023.01.17 |
Moderations - openai.Moderation.create() (0) | 2023.01.17 |
Fine-tunes : openai.FineTune.create(), list(), retrieve(), cancel(), list_events(), delete() (0) | 2023.01.17 |
Embeddings - openai.Embedding.create() (0) | 2023.01.17 |
Images - openai.Image.create(), openai.Image.create_edit(), openai.Image.create_variation() (0) | 2023.01.17 |
Edits - openai.Edit.create() (0) | 2023.01.17 |
Completions - openai.Completion.create() (0) | 2023.01.17 |
Models - openai.Model.list(), openai.Model.retrieve() (0) | 2023.01.16 |