{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-create-model-endpoint-v1-request-schema.json",
  "title": "CreateModelEndpointV1Request",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-llm-engine-openapi.yml#/components/schemas/CreateModelEndpointV1Request",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 63,
      "title": "Name"
    },
    "model_bundle_id": {
      "type": "string",
      "title": "Model Bundle Id"
    },
    "endpoint_type": {
      "$ref": "#/$defs/ModelEndpointType"
    },
    "metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Metadata"
    },
    "post_inference_hooks": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Post Inference Hooks"
    },
    "cpus": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "number"
        }
      ],
      "title": "Cpus"
    },
    "gpus": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Gpus"
    },
    "memory": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "number"
        }
      ],
      "title": "Memory"
    },
    "gpu_type": {
      "anyOf": [
        {
          "$ref": "#/$defs/GpuType"
        },
        {
          "type": "null"
        }
      ]
    },
    "storage": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "number"
        }
      ],
      "title": "Storage"
    },
    "nodes_per_worker": {
      "type": "integer",
      "exclusiveMinimum": 0.0,
      "title": "Nodes Per Worker",
      "default": 1
    },
    "optimize_costs": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Optimize Costs"
    },
    "min_workers": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Min Workers"
    },
    "max_workers": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Max Workers"
    },
    "per_worker": {
      "type": "integer",
      "exclusiveMinimum": 0.0,
      "title": "Per Worker"
    },
    "concurrent_requests_per_worker": {
      "anyOf": [
        {
          "type": "integer",
          "exclusiveMinimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Concurrent Requests Per Worker"
    },
    "forwarder_max_concurrency": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 20.0,
          "exclusiveMinimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Forwarder Max Concurrency",
      "description": "Max in-flight requests admitted by the HTTP forwarder container, independent of `per_worker` / autoscaling. When None (default), the forwarder inherits its `--concurrency` flag from `per_worker` (current behavior). Upper bound matches LIRA's FORWARDER_MAX_CONCURRENCY_LIMIT."
    },
    "labels": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Labels"
    },
    "prewarm": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Prewarm"
    },
    "high_priority": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "High Priority"
    },
    "billing_tags": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Billing Tags"
    },
    "default_callback_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Default Callback Url"
    },
    "default_callback_auth": {
      "anyOf": [
        {
          "$ref": "#/$defs/CallbackAuth"
        },
        {
          "type": "null"
        }
      ]
    },
    "public_inference": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Public Inference",
      "default": false
    },
    "queue_message_timeout_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 43200.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Queue Message Timeout Seconds",
      "description": "For async endpoints, the queue message visibility/lock timeout in seconds. Controls how long a worker has to process a message before it becomes visible again (SQS VisibilityTimeout / ASB lock_duration). Note: Azure Service Bus has a maximum of 300 seconds; values above this will be clamped."
    },
    "task_expires_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Task Expires Seconds",
      "description": "For async endpoints, how long a task can wait in queue before expiring (in seconds). Default: 86400 (24 hours)."
    }
  },
  "type": "object",
  "required": [
    "name",
    "model_bundle_id",
    "endpoint_type",
    "metadata",
    "cpus",
    "gpus",
    "memory",
    "storage",
    "min_workers",
    "max_workers",
    "per_worker",
    "labels"
  ],
  "$defs": {
    "CallbackAuth": {
      "oneOf": [
        {
          "$ref": "#/$defs/CallbackBasicAuth"
        },
        {
          "$ref": "#/$defs/CallbackmTLSAuth"
        }
      ],
      "title": "CallbackAuth"
    },
    "CallbackBasicAuth": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "basic",
          "title": "Kind"
        },
        "username": {
          "type": "string",
          "title": "Username"
        },
        "password": {
          "type": "string",
          "title": "Password"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "username",
        "password"
      ],
      "title": "CallbackBasicAuth"
    },
    "CallbackmTLSAuth": {
      "properties": {
        "kind": {
          "type": "string",
          "const": "mtls",
          "title": "Kind"
        },
        "cert": {
          "type": "string",
          "title": "Cert"
        },
        "key": {
          "type": "string",
          "title": "Key"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "cert",
        "key"
      ],
      "title": "CallbackmTLSAuth"
    },
    "GpuType": {
      "type": "string",
      "enum": [
        "nvidia-tesla-t4",
        "nvidia-ampere-a10",
        "nvidia-ampere-a100",
        "nvidia-ampere-a100e",
        "nvidia-hopper-h100",
        "nvidia-hopper-h100-1g20gb",
        "nvidia-hopper-h100-3g40gb"
      ],
      "title": "GpuType",
      "description": "Lists allowed GPU types for Launch."
    },
    "ModelEndpointType": {
      "type": "string",
      "enum": [
        "async",
        "sync",
        "streaming"
      ],
      "title": "ModelEndpointType"
    }
  }
}