Model Management
Upload, manage, and delete custom models through the Model Management API. This API requires an API key with the models scope enabled.
Overview
Note: Model Management API endpoints use the path /proj_ABC123/v1/models. Ensure your API key has the "Model Management" scope enabled in your dashboard settings.
The Model Management API allows you to:
- List all models uploaded to your project
- Upload new models using chunked uploads
- Monitor upload progress
- Delete models you no longer need
For uploading complete model directories or archives, see the Model Upload guide.
List Project Models
GET /proj_ABC123/v1/models
Lists all models uploaded to your project.
curl https://xerotier.ai/proj_ABC123/v1/models \
-H "Authorization: Bearer xero_myproject_your_api_key"
Response
{
"models": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "my-custom-model",
"format": "safetensors",
"sizeBytes": 4294967296,
"sha256": "abc123...",
"status": "ready",
"createdAt": "2026-01-15T10:30:00Z"
}
]
}
Upload Size Limits
Maximum upload size is determined by your account type:
| Account Type | Maximum Upload Size |
|---|---|
| Free | 4 GB |
| Premium | 304 GB |
Initialize Model Upload
POST /proj_ABC123/v1/uploads
Initializes a new chunked upload session for uploading a model file.
Request Body
| Parameter | Type | Description |
|---|---|---|
| namerequired | string | Display name for the model |
| filenamerequired | string | Original filename (e.g., "model.safetensors") |
| totalSizerequired | integer | Total file size in bytes |
| chunkSizerequired | integer | Size of each chunk in bytes (recommended: 10485760 / 10MB) |
| formatrequired | string | Model format: "safetensors", "bin", or "exl2" |
| descriptionoptional | string | Description of the model |
curl -X POST https://xerotier.ai/proj_ABC123/v1/uploads \
-H "Authorization: Bearer xero_myproject_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My Custom Model",
"filename": "model.safetensors",
"totalSize": 4294967296,
"chunkSize": 10485760,
"format": "safetensors",
"description": "A fine-tuned LLM for code generation"
}'
Response
{
"sessionId": "upload_abc123def456",
"totalChunks": 410,
"chunkSize": 10485760,
"expiresAt": "2026-01-15T11:30:00Z"
}
Upload Chunk
POST /proj_ABC123/v1/uploads/{sessionId}/parts
Uploads a single chunk of the model file. Chunks must be uploaded in order, starting from index 0.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| sessionIdrequired | string | Upload session ID from the init response |
| chunkIndexrequired | integer | Zero-based index of the chunk (0, 1, 2, ...) |
Headers
| Header | Description |
|---|---|
| Content-Type | Must be application/octet-stream |
| X-Chunk-Checksum | SHA256 checksum of the chunk data (hex-encoded) |
# Calculate checksum and upload chunk
CHECKSUM=$(sha256sum chunk_0.bin | cut -d' ' -f1)
curl -X POST "https://xerotier.ai/proj_ABC123/v1/uploads/upload_abc123/parts" \
-H "Authorization: Bearer xero_myproject_your_api_key" \
-H "Content-Type: application/octet-stream" \
-H "X-Chunk-Checksum: $CHECKSUM" \
-H "X-Part-Number: 0" \
--data-binary @chunk_0.bin
Response
{
"chunkIndex": 0,
"received": true,
"checksumValid": true
}
Get Upload Status
GET /proj_ABC123/v1/uploads/{sessionId}
Returns the current status of an upload session, including which chunks have been received.
curl https://xerotier.ai/proj_ABC123/v1/uploads/upload_abc123 \
-H "Authorization: Bearer xero_myproject_your_api_key"
Response
{
"sessionId": "upload_abc123",
"status": "uploading",
"totalChunks": 410,
"uploadedChunks": 205,
"expiresAt": "2026-01-15T11:30:00Z"
}
Complete Upload
POST /proj_ABC123/v1/uploads/{sessionId}/complete
Finalizes the upload after all chunks have been uploaded. The server will assemble the chunks and verify the complete file.
curl -X POST https://xerotier.ai/proj_ABC123/v1/uploads/upload_abc123/complete \
-H "Authorization: Bearer xero_myproject_your_api_key"
Response
{
"modelId": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Custom Model",
"status": "ready",
"sha256": "abc123def456..."
}
Delete Model
DELETE /proj_ABC123/v1/models/{modelId}
Permanently deletes a model from your project. This action cannot be undone.
Cascade Deletion: Deleting a model also permanently deletes all associated endpoints, endpoint workers, and routing rules. This action cannot be undone.
Requirements
- API key with
modelsscope - Project ownership of the model
curl -X DELETE https://xerotier.ai/proj_ABC123/v1/models/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer xero_myproject_your_api_key"
import requests
API_KEY = "xero_myproject_your_api_key"
BASE_URL = "https://xerotier.ai/proj_ABC123/v1"
MODEL_ID = "550e8400-e29b-41d4-a716-446655440000"
response = requests.delete(
f"{BASE_URL}/models/{MODEL_ID}",
headers={"Authorization": f"Bearer {API_KEY}"}
)
if response.status_code == 200:
print(f"Model {MODEL_ID} deleted successfully")
else:
print(f"Error: {response.json()}")
Response
{
"deleted": true,
"modelId": "550e8400-e29b-41d4-a716-446655440000"
}