---
title: "Save parameters for pretrained model"
method: POST
path: "/api/{projectId}/pretrained-model/save"
tags: ["Learn"]
---

# Save parameters for pretrained model

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

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/pretrained-model/save`
- 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/save/post.ts> (a function with typed inputs; its response is checked against the schema)

Save input / model configuration for a pretrained model. This overrides the current impulse. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.

## Path parameters

- `projectId` integer, required

## Query parameters

- `impulseId` integer

## Request body

- SavePretrainedModelRequest
  - `input` union, required
    - DeployPretrainedModelInputTimeSeries
      - `inputType` 'time-series', required
      - `frequencyHz` number, required
      - `windowLengthMs` integer, required
    - DeployPretrainedModelInputAudio
      - `inputType` 'audio', required
      - `frequencyHz` number, required
    - DeployPretrainedModelInputImage
      - `inputType` 'image', required
      - `inputScaling` '0..1' | '-1..1' | '-128..127' | '0..255' | 'torch' | 'bgr-subtract-imagenet-mean': Normalization that is applied to images. If this is not set then 0..1 is used. "0..1" gives you non-normalized pixels between 0 and 1. "-1..1" gives you non-normalized pixels between -1 and 1. "0..255" gives you non-normalized pixels between 0 and 255. "-128..127" gives you non-normalized pixels between -128 and 127. "torch" first scales pixels between 0 and 1, then applies normalization using the ImageNet dataset (same as `torchvision.transforms.Normalize()`). "bgr-subtract-imagenet-mean" scales to 0..255, reorders pixels to BGR, and subtracts the ImageNet mean from each channel.
      - `resizeMode` 'squash' | 'fit-short' | 'fit-long' | 'crop': Input images are resized automatically before training and testing, to match the impulse input shape. This determines the resize mode used when the aspect ratio of the input data is different to the aspect ratio of the impulse.
    - DeployPretrainedModelInputOther
      - `inputType` 'other', required
  - `model` union, required
    - DeployPretrainedModelModelClassification
      - `modelType` 'classification', required
      - `labels` string[], required
      - `addSoftmax` boolean
    - DeployPretrainedModelModelRegression
      - `modelType` 'regression', required
    - DeployPretrainedModelModelObjectDetection
      - `modelType` 'object-detection', required
      - `labels` string[], required
      - `lastLayer` 'mobilenet-ssd' | 'fomo' | 'yolov2-akida' | 'yolov5' | 'yolov5v5-drpai' | 'yolox' | 'yolov7' | 'yolo-pro' | 'tao-retinanet' | 'tao-ssd' | 'tao-yolov3' | 'tao-yolov4' | 'yolov11' | 'yolov11-abs' | 'paddleocr-detector' | 'qc-face-det-lite' | 'qc-yolox', required
      - `minimumConfidence` number, required: Deprecated: use thresholdValues instead. Threshold for objects (f.e. 0.3).
      - `thresholdValues` object: All configured thresholds for the current model. Valid keys are 'min_score' (object detection models, all but paddleocr-detector); 'min_score_pixel', 'min_score_box', 'unclip_ratio' (paddleocr-detector).
    - DeployPretrainedModelModelFreeform
      - `modelType` 'freeform', required
    - DeployPretrainedModelModelAnomaly
      - `modelType` 'anomaly', required
    - DeployPretrainedModelModelVisualAnomaly
      - `modelType` 'visual-anomaly', required
      - `thresholdValues` object: All configured thresholds for the current model. Valid keys are 'min_anomaly_score' and 'anomaly_scoring_aggregation_method'.
  - `datasetVersionId` integer: EXPERIMENTAL. Test your pretrained model against an immutable dataset snapshot when supplied, or omit to use your current mutable dataset instead. This property is supported only when the dataset versioning experiment is enabled and may change in the future.

## Response `200`

OK

- GenericApiResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)

---

[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)
