- Start Import Session - Import Model - Start Session API.
- Upload Model in Chunks - Import Model - Chunk Upload API.
- Complete the Import Process - Import Model- Completion API.
Start Import Session
The Import Model - Start Session API is executed in this step. The API initializes the import session and returns aSession Id in the response which is used in the next two steps of the import process.
| Method | POST |
|---|---|
| Endpoint | https://{host}/api/public/files/session/start |
| Content Type | application/json |
| Authorization | X-api-key - The API key used for authentication. |
Path Parameters
| PARAMETER | DESCRIPTION | TYPE | REQUIRED/OPTIONAL |
|---|---|---|---|
| host | The environment URL. For example, https://agent-platform.domain.ai/ | String | Required |
Sample Request
Body Parameters
| PARAMETER | DESCRIPTION | TYPE | REQUIRED/OPTIONAL |
|---|---|---|---|
| fileContext | Context of the file (for example, model/dataset). | String | Required |
| totalChunks | The number of chunks the file is divided into. | Integer | Required |
| fileExtension | The extension of the file (for example, tar). | String | Required |
| fileName | Name of the file being uploaded. For example, example_model22.tar | String | Required |
| fileSize | The size of the file in bytes. | Integer | Required |
| isAdapter | Indicates whether the file is an adapter model. The values include “True” or “False.” | Boolean | Optional |
Sample Response
Response Parameters
| PARAMETER | DESCRIPTION | TYPE |
|---|---|---|
| sessionId | The unique identifier of the import session. | String |
| expirationDate | The expiration date of the session. | Date |
| modelId | The unique identifier of the model. | String |
Upload Model in Chunks
The Import Model - Chunk Upload API uploads a file chunk for model import. ThesessionId from the Start Import Session API must be used here to upload the file in incrementing chunks identified by a unique chunkNumber.
| Method | POST |
|---|---|
| Endpoint | https://{host}/api/public/files/session/{sessionId} |
| Content Type | application/json |
| Authorization | X-api-key - The API key used for authentication. |
Path Parameters
| PARAMETER | DESCRIPTION | TYPE | REQUIRED/OPTIONAL |
|---|---|---|---|
| host | The environment URL. For example, https://agent-platform.domain.ai/ | String | Required |
| sessionId | The Session Id from the start import session API. | String | Required |
Sample Request
Body Parameters
| PARAMETER | DESCRIPTION | TYPE | REQUIRED/OPTIONAL |
|---|---|---|---|
| file | The file being uploaded. | File | Required |
| chunkNumber | The uploaded chunk number. | Number | Required |
Sample Response
Response Parameters
| PARAMETER | DESCRIPTION | TYPE |
|---|---|---|
| chunkNumber | The uploaded chunk number. | Number |
| sessionId | The model import Session Id. | String |
Complete the Import Process
The Import Model- Complete API completes the model import process after all file chunks have been successfully uploaded. The sessionId from the Start Import Session API must be used for this API.
| Method | POST |
|---|---|
| Endpoint | https://{host}/api/public/files/session/{sessionId}/complete |
| Content Type | application/json |
| Authorization | X-api-key - The API key used for authentication. |
Path Parameters
| PARAMETER | DESCRIPTION | TYPE | REQUIRED/OPTIONAL |
|---|---|---|---|
| host | The environment URL. For example, https://agent-platform.domain.ai/ | String | Required |
| sessionId | The Session Id from the Start Import Session API. | String | Required |
Sample Request
Body Parameters
No parameters are passed.Sample Response
Response Parameters
| PARAMETER | DESCRIPTION | TYPE |
|---|---|---|
| dockstatusId | The unique identifier to track the status of model import. | String |
| modelId | The unique identifier of the model being imported. | String |
| jobType | Type of job being performed, MODEL | String |
| action | The action performed on the model. | String |
| status | The current status of the job (SUCCESS, IN_ PROGRESS, or FAILED). | String |