---
title: "Upload a custom model"
method: POST
path: "/v1/namespaces/{namespace_id}/models"
tags: ["Custom Models"]
---

# Upload a custom model

`POST /v1/namespaces/{namespace_id}/models`

Upload custom model weights to the namespace.

**Requirements:**
- Organization must be on Enterprise tier

**Supported Model Formats:**
- `safetensors`: SafeTensors format (recommended for transformers)
- `onnx`: ONNX Runtime format
- `pytorch`: PyTorch state_dict or TorchScript
- `huggingface`: HuggingFace model directory

**Base Images (auto-selected based on format):**
- `mixpeek/serve-gpu:latest`: For safetensors, pytorch, huggingface (includes torch, transformers)
- `mixpeek/serve-minimal:latest`: For ONNX (includes onnxruntime only)

**Important:** Models run in fixed base images. You cannot install additional pip packages.
All required frameworks (torch, transformers, onnxruntime) are pre-installed.

## Path parameters

- `namespace_id` string, required

## Response `200`

Successful Response

- ModelUploadResponse — Response model for model upload.
  - `success` boolean, required — Whether upload succeeded
  - `model_id` string, required — Unique model identifier
  - `deployment_status` 'deployed' | 'pending' | 'failed' | 'not_deployed', required — Deployment status
  - `endpoint` string, required — Model inference endpoint
  - `model_archive_url` string, required — S3 URL where archive is stored

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Custom models not supported
- `404` — Not Found
- `409` — Model already exists
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/mixpeek/apis/mixpeek-api.md) · [All operations](https://skmtc.net/mixpeek/apis/mixpeek-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixpeek/mixpeek-api/versions/23e05292e326/schema)
