Method: OpenApiOpenAIClient::FilesApi#create_file

Defined in:
lib/openapi_openai/api/files_api.rb

#create_file(file, purpose, opts = {}) ⇒ OpenAIFile

Upload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB. The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the [Assistants Tools guide](/docs/assistants/tools) to learn more about the types of files supported. The Fine-tuning API only supports ‘.jsonl` files. Please [contact us](help.openai.com/) if you need to increase these storage limits.

Parameters:

  • file (File)

    The File object (not file name) to be uploaded.

  • purpose (String)

    The intended purpose of the uploaded file. Use \"fine-tune\" for [Fine-tuning](/docs/api-reference/fine-tuning) and \"assistants\" for [Assistants](/docs/api-reference/assistants) and [Messages](/docs/api-reference/messages). This allows us to validate the format of the uploaded file is correct for fine-tuning.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/openapi_openai/api/files_api.rb', line 27

def create_file(file, purpose, opts = {})
  data, _status_code, _headers = create_file_with_http_info(file, purpose, opts)
  data
end