跳至主要内容

Register New Edition of an Existing Model

POST 

/api/v1/orgs/{orgId}/ai-models/{modelId}/editions

Creates the edition (status Pending) and, when file info is supplied, opens an upload session — step 1 of the resumable upload flow.

  • Omit all of fileName/fileSize/fileHash to create an empty Pending edition with no upload (uploadId/tusEndpoint/file are null). Supplying only some of the three returns 400 (InvalidRequest).

  • When file info is supplied, returns a scoped tusEndpoint URL plus the uploadId to send (base64-encoded) in the Upload-Metadata header when creating the TUS upload.

  • The session expires 12 hours after registration (uploadExpiresAt); the actual bytes must be transferred before then.

  • fileHash must be a 64-char lowercase SHA-256 hex string; it is re-verified server-side after the transfer completes.

  • Re-registering an edition that is still Pending reuses it (resume/retry); returns 409 (EditionAlreadyExists) only if it already has a verified file.

  • Returns 400 for a missing orgId (MissingOrgId), an invalid edition string (InvalidEditionFormat), incomplete file info (InvalidRequest), or a malformed hash (InvalidClientHash); 413 if the file exceeds the maximum size (FileTooLarge); 403 on tenant mismatch (TenantMismatch); 404 if the model is not found (ModelNotFound); and 409 if the edition already has a file (EditionAlreadyExists).

Request

Responses

Created