Add an upload part
POST
/openai/v1/uploads/{upload_id}/parts◐ PartialRequest parameters
upload_idstringrequiredpath: Upload identifier returned by create; belongs to your organization.
part_numberintegeroptionalquery: Required when create set part_size; 1 through ceil(bytes / part_size). Ignored for general uploads.
datastringrequiredRaw bytes of this part, nonempty and at most 64000000 bytes.
Returns
200 upload.part
Parts are at most 64 MB and the total is at most 20 GiB. Only user_data, assistants and vision are accepted. Pending uploads expire after 7 days. Wait for file processing before use.
Errors follow the OpenAI format — see error codes
Request
curl
curl "https://api.deepraxis.com/openai/v1/uploads/upload_123/parts?part_number=1" \
-H "Authorization: Bearer $PRAXIS_API_KEY" -F "data=@part-1.txt"Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepraxis.com/openai/v1",
api_key="$PRAXIS_API_KEY",
)
# Split document.txt into 5 MiB, 5 MiB and 1 MiB parts. Use the ID from create.
with open("part-1.txt", "rb") as data:
part = client.uploads.parts.create("upload_123", data=data, extra_query={"part_number": 1})
print(part.id)TypeScript
import OpenAI from "openai";
import fs from "node:fs";
const client = new OpenAI({
baseURL: "https://api.deepraxis.com/openai/v1",
apiKey: "$PRAXIS_API_KEY",
});
// Split document.txt into 5 MiB, 5 MiB and 1 MiB parts. Use the ID from create.
const part = await client.uploads.parts.create("upload_123", { data: fs.createReadStream("part-1.txt") }, { query: { part_number: 1 } });
console.log(part.id);Response 200
{
"id": "part_aptMkGcwMhM88UTytFfO0jqw",
"object": "upload.part",
"created_at": 1792685013,
"upload_id": "upload_iFZqxf1kveCAvf54fbudiIRn"
}Response
HTTP 200
The part was accepted.
application/json
| Name | Type | Description |
|---|---|---|
| id | string | Part identifier returned by this request. Supply it to complete in file byte order. |
| object | string | Object type; upload.part identifies an uploaded part. |
| created_at | integer | Part creation time as Unix seconds. |
| upload_id | string | Parent upload identifier supplied in the request path. |