Complete upload
Upload uploads().complete(UploadCompleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/uploads/{upload_id}/complete
Completes the Upload.
Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform.
You can specify the order of the Parts by passing in an ordered list of the Part IDs.
The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.
Returns the Upload object with status completed, including an additional file property containing the created usable File object.
Parameters
Returns
Complete upload
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.uploads.Upload;
import com.openai.models.uploads.UploadCompleteParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
UploadCompleteParams params = UploadCompleteParams.builder()
.uploadId("upload_abc123")
.addPartId("string")
.build();
Upload upload = client.uploads().complete(params);
}
}{
"id": "upload_abc123",
"object": "upload",
"bytes": 2147483648,
"created_at": 1719184911,
"filename": "training_examples.jsonl",
"purpose": "fine-tune",
"status": "completed",
"expires_at": 1719127296,
"file": {
"id": "file-xyz321",
"object": "file",
"bytes": 2147483648,
"created_at": 1719186911,
"expires_at": 1719127296,
"filename": "training_examples.jsonl",
"purpose": "fine-tune",
}
}
Returns Examples
{
"id": "upload_abc123",
"object": "upload",
"bytes": 2147483648,
"created_at": 1719184911,
"filename": "training_examples.jsonl",
"purpose": "fine-tune",
"status": "completed",
"expires_at": 1719127296,
"file": {
"id": "file-xyz321",
"object": "file",
"bytes": 2147483648,
"created_at": 1719186911,
"expires_at": 1719127296,
"filename": "training_examples.jsonl",
"purpose": "fine-tune",
}
}