files

Upload a file that can be used across various endpoints.

The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.

Please contact us if you need to increase these storage limits.

post/v1/files

Request

Request body multipart/form-data

expiryinteger nullable
visibility'workspace' | 'user'
purpose'fine-tune' | 'batch' | 'ocr' | 'agentic_safety'
filestring binary required

The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such:

file=@path/to/your/file.jsonl;filename=custom_name.jsonl

Otherwise, you can just keep the original file name:

file=@path/to/your/file.jsonl

Response

OK

idstring uuid required

The unique identifier of the file.

objectstring required

The object type, which is always "file".

bytesinteger required

The size of the file, in bytes.

created_atinteger required

The UNIX timestamp (in seconds) of the event.

filenamestring required

The name of the uploaded file.

purpose'fine-tune' | 'batch' | 'ocr' | 'agentic_safety' required
sample_type'pretrain' | 'instruct' | 'batch_request' | 'batch_result' | 'batch_error' required
num_linesinteger nullable
mimetypestring nullable
source'upload' | 'repository' | 'mistral' required
signaturestring nullable
expires_atinteger nullable
visibility'workspace' | 'user'

Example response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
  "object": "file",
  "bytes": 13000,
  "created_at": 1716963433,
  "filename": "files_upload.jsonl"
}

Changes

    • warning

      added the new agentic_safety enum value to the response property for the response status

    • info

      added the new agentic_safety enum value to the request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status