---
title: "Create a model endpoint"
method: POST
path: "/models/{model_id}/endpoints"
tags: ["model_endpoints"]
---

# Create a model endpoint

`POST /models/{model_id}/endpoints`

## Path parameters

- `model_id` integer, required

## Request body

- ModelEndpoint
  - `id` integer
  - `model_id` integer
  - `model` Model
    - `id` integer
    - `project_id` integer
    - `mlflow_experiment_id` integer
    - `name` string
    - `type` 'xgboost' | 'tensorflow' | 'sklearn' | 'pytorch' | 'pyfunc' | 'pyfunc_v2' | 'pyfunc_v3' | 'custom' — Model type
    - `mlflow_url` string
    - `endpoints` ModelEndpoint[]
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `status` 'pending' | 'running' | 'serving' | 'failed' | 'terminated'
  - `url` string, hostname
  - `rule` ModelEndpointRule
    - `destinations` ModelEndpointRuleDestination[]
      - `version_endpoint_id` string, uuid
      - `version_endpoint` VersionEndpoint
        - `id` string, uuid
        - `version_id` integer
        - `status` 'pending' | 'running' | 'serving' | 'failed' | 'terminated'
        - `url` string, hostname
        - `service_name` string, hostname
        - `environment_name` string
        - `environment` Environment
          - `id` integer
          - `name` string, required
          - `cluster` string
          - `is_default` boolean
          - `region` string
          - `gcp_project` string
          - `default_resource_request` ResourceRequest
            - `min_replica` integer
            - `max_replica` integer
            - `cpu_request` string
            - `memory_request` string
            - `gpu_name` string
            - `gpu_request` string
          - `default_transformer_resource_request` ResourceRequest
            - `min_replica` integer
            - `max_replica` integer
            - `cpu_request` string
            - `memory_request` string
            - `gpu_name` string
            - `gpu_request` string
          - `default_prediction_job_resource_request` PredictionJobResourceRequest
            - `driver_cpu_request` string
            - `driver_memory_request` string
            - `executor_cpu_request` string
            - `executor_memory_request` string
            - `executor_replica` integer
          - `gpus` GPUConfig[]
            - `name` string
            - `values` string[]
            - `resource_type` string
            - `node_selector` object
            - `tolerations` GPUToleration[]
              - …
            - `min_monthly_cost_per_gpu` number
            - `max_monthly_cost_per_gpu` number
          - `created_at` string, date-time
          - `updated_at` string, date-time
        - `monitoring_url` string, hostname
        - `message` string
        - `resource_request` ResourceRequest
          - `min_replica` integer
          - `max_replica` integer
          - `cpu_request` string
          - `memory_request` string
          - `gpu_name` string
          - `gpu_request` string
        - `env_vars` EnvVar[]
          - `name` string
          - `value` string
        - `transformer` Transformer
          - `id` string
          - `enabled` boolean
          - `transformer_type` string
          - `image` string
          - `command` string
          - `args` string
          - `resource_request` ResourceRequest
            - `min_replica` integer
            - `max_replica` integer
            - `cpu_request` string
            - `memory_request` string
            - `gpu_name` string
            - `gpu_request` string
          - `env_vars` EnvVar[]
            - `name` string
            - `value` string
          - `created_at` string, date-time
          - `updated_at` string, date-time
        - `logger` Logger
          - `model` LoggerConfig
            - `enabled` boolean
            - `mode` 'all' | 'request' | 'response'
          - `transformer` LoggerConfig
            - `enabled` boolean
            - `mode` 'all' | 'request' | 'response'
          - `prediction` PredictionLoggerConfig
            - `enabled` boolean
            - `raw_features_table` string
            - `entities_table` string
        - `deployment_mode` 'serverless' | 'raw_deployment'
        - `autoscaling_policy` AutoscalingPolicy
          - `metrics_type` 'concurrency' | 'cpu_utilization' | 'memory_utilization' | 'rps'
          - `target_value` number
        - `protocol` 'HTTP_JSON' | 'UPI_V1'
        - `enable_model_observability` boolean
        - `created_at` string, date-time
        - `updated_at` string, date-time
      - `weight` integer
    - `mirror` VersionEndpoint
      - `id` string, uuid
      - `version_id` integer
      - `status` 'pending' | 'running' | 'serving' | 'failed' | 'terminated'
      - `url` string, hostname
      - `service_name` string, hostname
      - `environment_name` string
      - `environment` Environment
        - `id` integer
        - `name` string, required
        - `cluster` string
        - `is_default` boolean
        - `region` string
        - `gcp_project` string
        - `default_resource_request` ResourceRequest
          - `min_replica` integer
          - `max_replica` integer
          - `cpu_request` string
          - `memory_request` string
          - `gpu_name` string
          - `gpu_request` string
        - `default_transformer_resource_request` ResourceRequest
          - `min_replica` integer
          - `max_replica` integer
          - `cpu_request` string
          - `memory_request` string
          - `gpu_name` string
          - `gpu_request` string
        - `default_prediction_job_resource_request` PredictionJobResourceRequest
          - `driver_cpu_request` string
          - `driver_memory_request` string
          - `executor_cpu_request` string
          - `executor_memory_request` string
          - `executor_replica` integer
        - `gpus` GPUConfig[]
          - `name` string
          - `values` string[]
          - `resource_type` string
          - `node_selector` object
          - `tolerations` GPUToleration[]
            - `key` string
            - `operator` string
            - `value` string
            - `effect` string
            - `toleration_seconds` integer
          - `min_monthly_cost_per_gpu` number
          - `max_monthly_cost_per_gpu` number
        - `created_at` string, date-time
        - `updated_at` string, date-time
      - `monitoring_url` string, hostname
      - `message` string
      - `resource_request` ResourceRequest
        - `min_replica` integer
        - `max_replica` integer
        - `cpu_request` string
        - `memory_request` string
        - `gpu_name` string
        - `gpu_request` string
      - `env_vars` EnvVar[]
        - `name` string
        - `value` string
      - `transformer` Transformer
        - `id` string
        - `enabled` boolean
        - `transformer_type` string
        - `image` string
        - `command` string
        - `args` string
        - `resource_request` ResourceRequest
          - `min_replica` integer
          - `max_replica` integer
          - `cpu_request` string
          - `memory_request` string
          - `gpu_name` string
          - `gpu_request` string
        - `env_vars` EnvVar[]
          - `name` string
          - `value` string
        - `created_at` string, date-time
        - `updated_at` string, date-time
      - `logger` Logger
        - `model` LoggerConfig
          - `enabled` boolean
          - `mode` 'all' | 'request' | 'response'
        - `transformer` LoggerConfig
          - `enabled` boolean
          - `mode` 'all' | 'request' | 'response'
        - `prediction` PredictionLoggerConfig
          - `enabled` boolean
          - `raw_features_table` string
          - `entities_table` string
      - `deployment_mode` 'serverless' | 'raw_deployment'
      - `autoscaling_policy` AutoscalingPolicy
        - `metrics_type` 'concurrency' | 'cpu_utilization' | 'memory_utilization' | 'rps'
        - `target_value` number
      - `protocol` 'HTTP_JSON' | 'UPI_V1'
      - `enable_model_observability` boolean
      - `created_at` string, date-time
      - `updated_at` string, date-time
  - `environment_name` string
  - `environment` Environment
    - `id` integer
    - `name` string, required
    - `cluster` string
    - `is_default` boolean
    - `region` string
    - `gcp_project` string
    - `default_resource_request` ResourceRequest
      - `min_replica` integer
      - `max_replica` integer
      - `cpu_request` string
      - `memory_request` string
      - `gpu_name` string
      - `gpu_request` string
    - `default_transformer_resource_request` ResourceRequest
      - `min_replica` integer
      - `max_replica` integer
      - `cpu_request` string
      - `memory_request` string
      - `gpu_name` string
      - `gpu_request` string
    - `default_prediction_job_resource_request` PredictionJobResourceRequest
      - `driver_cpu_request` string
      - `driver_memory_request` string
      - `executor_cpu_request` string
      - `executor_memory_request` string
      - `executor_replica` integer
    - `gpus` GPUConfig[]
      - `name` string
      - `values` string[]
      - `resource_type` string
      - `node_selector` object
      - `tolerations` GPUToleration[]
        - `key` string
        - `operator` string
        - `value` string
        - `effect` string
        - `toleration_seconds` integer
      - `min_monthly_cost_per_gpu` number
      - `max_monthly_cost_per_gpu` number
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `protocol` 'HTTP_JSON' | 'UPI_V1'
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Response `200`

OK

## Changes

- **2023-12-05** `d062ab20ef25` — 2 breaking, 1 info
  - removed the request body
  - removed the success response with the status `201`
  - added the success response with the status `200`
- **2020-09-28** `c4b3505de7df` — 2 breaking, 1 info
  - removed the request body
  - removed the success response with the status `201`
  - added the success response with the status `200`

[Change history](https://skmtc.dev/caraml-dev/apis/merlin/changes/models/:model_id/endpoints/post.md)

---

[API](https://skmtc.dev/caraml-dev/apis/merlin.md) · [All operations](https://skmtc.dev/caraml-dev/apis/merlin/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/caraml-dev/merlin/revisions/d062ab20ef25/schema)
