Skip to content
中文

Add an upload part

POST/file/v1/uploads/{upload_id}/parts◐ Partial

Official OpenAI docs ↗

Request parameters

  • upload_idstringrequired

    path: Upload identifier returned by create; belongs to your organization.

  • part_numberintegeroptional

    query: Required when create set part_size; 1 through ceil(bytes / part_size). Ignored for general uploads.

  • datastringrequired

    Raw 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. Query GET /file/v1/uploads/{upload_id} to see the received parts, resend only what is missing, then complete. Create, send parts, query, resume, complete; wait for file processing before use.

Errors follow the OpenAI format — see error codes

Request

curl
curl "https://api.deepraxis.com/file/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/file/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/file/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_pBc2UEZSzBuhw3HhyYP9bduM",
  "object": "upload.part",
  "created_at": 1792684740,
  "upload_id": "upload_XTVtShoLFqNNohPQSkj7RVrz",
  "bytes": 5242880,
  "sha256": "sha256:dbbe5517996826bd5861ac22b745d21d11219055d89243ca1aea0ad31f552b12"
}

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.
bytes integer Accepted part length in bytes.
sha256 string Part content digest prefixed sha256:.