Skip to content

Upload File (OpenAI) v1.0.0 Help

Uploads a file to the storage associated with your OpenAI account.

How can I use the Step?

You can use the Step to upload training data for model fine-tuning.

How does the Step work?

You authorize the Step and specify the file path or URL. Taking these inputs, the Step requests OpenAI Files API to upload the file to the storage. Your data must be a JSONL document. Each line is a prompt-completion pair corresponding to a training example.

Read the Preparing your dataset guide to learn more.

Prerequisites

To get started, you need an OpenAI API key. To retrieve an API key for your requests, visit your API Keys page.

Authorization

To authorize the Step, you have two options:

  • Inherit from previous Step (default): Use the same authorization as the previous Step in the Flow.
  • Select authorization in the current Step: Choose an existing authorization or create a new one.

In case you need to create a new authorization, follow these steps:

  1. Choose Select authorization in the current Step and then select Create a new authorization from the list.
  2. In the Add authorization modal window, provide the required details:
    • Authorization name: Name your new authorization.
    • API Key: Enter your OpenAI API key.
  3. Click Add to confirm settings and add your new authorization.

Request settings

To set up the request, specify the file to upload using one of the following options:

  • File path: Enter the file path or select a file from the Files service. Make sure the file path matches the one in the service.
  • File URL: Enter the URL of the file.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. Thus you can access the output JSON object from any point of your Flow.

Output example

The output includes information about the uploaded file and has the following structure:

json
{
    "object": "file",
    "id": "file-Zz3a5FhQ8R8yMtYlbrWHEMZM",
    "purpose": "fine-tune",
    "filename": "file_example.jsonl",
    "bytes": 269,
    "created_at": 1690906928,
    "status": "uploaded",
    "status_details": null
}
{
    "object": "file",
    "id": "file-Zz3a5FhQ8R8yMtYlbrWHEMZM",
    "purpose": "fine-tune",
    "filename": "file_example.jsonl",
    "bytes": 269,
    "created_at": 1690906928,
    "status": "uploaded",
    "status_details": null
}

Error Handling

By default, the Handle error toggle is on, and the Step handles errors with a separate exit. If any error occurs during the Step execution, the Flow proceeds down the error exit.

If the Handle error toggle is disabled, the Step does not handle errors. In this case, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow timeout. To prevent the Flow from being suspended and continue handling errors, you can place the Flow Error Handling Step before the main logic or your Flow.

Reporting

The Step reports once after its execution. You can change the Step log level and add new tags in the section.

Log level

By default, the Step inherits its log level from Flow's log level. You can change the Step's log level by selecting an appropriate option from the Log level list.

Tags

Tags help organize and filter session information when generating reports. When adding a new tag, you can specify the tag category, label, and value.

Service dependencies

  • flow builder - v2.28.3
  • event-manager - v2.3.0
  • deployer - v2.6.0
  • library v2.11.3
  • studio v2.64.1

Release notes

v1.0.0

  • Initial release