
OpenAI UploadFile
CertifiedUpload files to OpenAI storage
OpenAI UploadFile
Upload files to OpenAI storage
Sends a file from Kestra internal storage to OpenAI for assistants, fine-tune, search, or other purposes, returning the upload ID. Uses a temp copy locally before upload; unknown purposes fall back to assistants.
type: io.kestra.plugin.openai.UploadFileExamples
Upload a file to OpenAI and get its ID for later use.
id: openai_file_upload
namespace: company.team
inputs:
- id: dataFile
type: FILE
tasks:
- id: upload_file
type: io.kestra.plugin.openai.UploadFile
apiKey: "{{ secret('OPENAI_API_KEY') }}"
file: "{{ inputs.dataFile }}"
purpose: "fine-tune"
- id: use_file_id
type: io.kestra.plugin.core.log.Log
message: "Uploaded file ID: {{ outputs.upload_file.fileId }}"
Upload a user data file with description for search purposes
id: openai_search_file
namespace: company.team
inputs:
- id: documentFile
type: FILE
tasks:
- id: upload
type: io.kestra.plugin.openai.UploadFile
apiKey: "{{ secret('OPENAI_API_KEY') }}"
file: "{{ inputs.documentFile }}"
purpose: "search"
description: "Customer knowledge base articles for retrieval"
Properties
apiKey *string
OpenAI API key
from *string
Source file URI
Required kestra:// or other storage URI pointing to the file to upload.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
purpose *string
Upload purpose
Accepted values include assistants, fine-tune, vision, user_data, evals, batch; defaults to assistants for unrecognized values.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150clientTimeout integer
10The maximum number of seconds to wait for a response
user string
A unique identifier representing your end-user
Outputs
fileId string
Uploaded file ID