---
title: "Creates a new model from a source"
method: POST
path: "/v1/models"
---

# Creates a new model from a source

`POST /v1/models`

Creates a new model in the caller's organization. The `source` field selects how the model is constructed (currently `library_listing`, which forks an accessible listing from `GET /v1/library_models`). The deployment isn't instantly ready; poll the GET endpoint until status is ACTIVE.

## Request body

- CreateModelRequestV1 — Body for creating a model via `POST /v1/models`.
  - `source` union, required — Where the new model is created from.
    - LibraryListingSourceV1 — Create a model by forking a library listing accessible to the caller's organization.
      - `kind` 'library_listing'
      - `lab_display_name` string, required — Identifier of the publishing organization, as returned by `GET /v1/library_models`.
      - `user_defined_listing_id` string, required — Listing identifier within the publishing organization.
      - `deployed_model_name` string, nullable — Optional name for the new deployed model. Defaults to the listing's configured name.
    - ModelArchiveSourceV1 — Create a model from an archive previously uploaded via the credentials issued by `POST /v1/prepare_model_upload`.
      - `kind` 'model_archive'
      - `name` string, required — Name of the new model.
      - `deployment` DeploymentArchivePayloadV1, required — Deployment-level fields for a model-archive push. Shared by every endpoint that creates a deployment from an uploaded archive: `POST /v1/prepare_model_upload`, the `model_archive` source on `POST /v1/models`, and `POST /v1/models/{model_id}/deployments`.
        - `config` object, required — Parsed model config as a JSON object.
        - `raw_config` string, nullable — Original config.yaml text, persisted as-is on the deployment. Best-effort: invalid raw configs are logged and dropped without failing the request.
        - `user_env` object, nullable — Client environment metadata (e.g. client version, Python version). Validated server-side.
        - `environment_name` string, nullable — Stable environment to push to (e.g. `production`). If unset, the deployment is created without environment selection. Caller must have push permission for the named environment.
        - `preserve_env_instance_type` boolean — Retain the target environment's current instance type rather than the one in `config`. Only meaningful when `environment_name` is set and that environment already exists.
        - `deploy_timeout_minutes` integer, nullable — Deploy timeout in minutes; allowed range 10 to 1440. Server default applies if unset.
        - `deployment_name` string, nullable — Optional human-readable name for the deployment.
        - `labels` object, nullable — User-provided key-value labels for the deployment.
        - `is_development` boolean — If true, push as a development deployment: the model's single mutable dev slot, created if absent and overwritten in place otherwise. The following fields must be left at their defaults: `environment_name`, `preserve_env_instance_type`, `deployment_name`.
      - `s3_key` string, nullable — S3 key of the uploaded archive, from the credentials returned by `POST /v1/prepare_model_upload`. Omit for model formats that are not built from an archive (for example, BIS-LLM), where prepare issues no upload target.
      - `disable_archive_download` boolean — If true, the uploaded archive is not downloadable after creation. Locked at model creation; cannot be changed by subsequent deployments.

## Response `200`

- CreatedModelDeploymentV1 — A newly created deployment and its model.
  - `model` ModelV1, required — A model.
    - `id` string, required — Unique identifier of the model
    - `created_at` string, date-time, required — Time the model was created in ISO 8601 format
    - `name` string, required — Name of the model
    - `deployments_count` integer, required — Number of deployments of the model
    - `production_deployment_id` string, nullable, required — Unique identifier of the production deployment of the model
    - `development_deployment_id` string, nullable, required — Unique identifier of the development deployment of the model
    - `instance_type_name` string, required — Name of the instance type for the production deployment of the model
    - `team_name` string, required — Name of the team associated with the model.
  - `deployment` DeploymentV1, required — A deployment of a model.
    - `id` string, required — Unique identifier of the deployment
    - `created_at` string, date-time, required — Time the deployment was created in ISO 8601 format
    - `name` string, required — Name of the deployment
    - `model_id` string, required — Unique identifier of the model
    - `is_production` boolean, required — Whether the deployment is the production deployment of the model
    - `is_development` boolean, required — Whether the deployment is the development deployment of the model
    - `status` 'BUILDING' | 'DEPLOYING' | 'DEPLOY_FAILED' | 'LOADING_MODEL' | 'ACTIVE' | 'UNHEALTHY' | 'BUILD_FAILED' | 'BUILD_STOPPED' | 'DEACTIVATING' | 'INACTIVE' | 'FAILED' | 'UPDATING' | 'SCALED_TO_ZERO' | 'WAKING_UP', required — The status of a deployment.
    - `active_replica_count` integer, required — Number of active replicas
    - `autoscaling_settings` AutoscalingSettingsV1, required — Autoscaling settings for a deployment.
      - `min_replica` integer, required — Minimum number of replicas
      - `max_replica` integer, required — Maximum number of replicas
      - `autoscaling_window` integer, nullable, required — Timeframe of traffic considered for autoscaling decisions
      - `scale_down_delay` integer, nullable, required — Waiting period before scaling down any active replica
      - `concurrency_target` integer, required — Number of requests per replica before scaling up
      - `target_utilization_percentage` integer, nullable, required — Target utilization percentage for scaling up/down.
      - `target_in_flight_tokens` integer, nullable — Target number of in-flight tokens for autoscaling decisions. Early access only.
      - `max_scale_down_rate` integer, nullable — Maximum percentage of replicas that can be removed per autoscaling window (1–50). E.g. 20 means at most 20% of replicas are removed per window.
    - `instance_type_name` string, nullable, required — Name of the instance type the model deployment is running on
    - `environment` string, nullable, required — The environment associated with the deployment
    - `labels` object, nullable — User-provided key-value labels for the deployment

---

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