---
title: "Upload a pretrained model"
method: POST
path: "/api/{projectId}/pretrained-model/upload"
tags: ["Learn"]
---

# Upload a pretrained model

`POST /api/{projectId}/pretrained-model/upload`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/pretrained-model/upload`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/:projectId/pretrained-model/upload/post.ts> (a function with typed inputs; its response is checked against the schema)

Upload a pretrained model and receive info back about the input/output tensors. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.

## Path parameters

- `projectId` integer, required

## Query parameters

- `impulseId` integer

## Request body `multipart/form-data`

- UploadPretrainedModelRequest
  - `modelFile` string, binary, required
  - `modelFileName` string, required
  - `modelFileType` 'tflite' | 'onnx' | 'saved_model', required
  - `representativeFeatures` string, binary
  - `device` string: MCU used for calculating latency, query `latencyDevices` in `listProject` for a list of supported devices (and use the "mcu" property here). If this is kept empty then we'll show an overview of multiple devices.
  - `overrideInputShape` integer[]: Optional for ONNX files: overrides the input shape of the model. This is highly suggested if the model has dynamic dimensions. If this field is not set, then all dynamic dimensions will be set to '1'.
  - `additionalFiles` string[]

## Response `200`

OK

- StartJobResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `id` integer, required: Job identifier. Status updates will include this identifier.

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
