{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oneinfer-ai/json-schema/oneinfer-ai-create-endpoint-request-schema.json",
  "title": "CreateEndpointRequest",
  "description": "Endpoint creation request for simplified deployment.\n\nRequired fields: model_id (or huggingface_image_url)\nOptional fields: All others have sensible defaults",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oneinfer-ai-openapi.json#/components/schemas/CreateEndpointRequest",
  "properties": {
    "model_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model Id",
      "description": "HuggingFace model ID (e.g., 'Qwen/Qwen2.5-7B-Instruct')"
    },
    "worker_config": {
      "anyOf": [
        {
          "$ref": "#/$defs/WorkerConfig"
        },
        {
          "type": "null"
        }
      ],
      "description": "Worker scaling configuration"
    },
    "endpoint_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Endpoint Id",
      "description": "Endpoint ID (auto-generated if not provided). If provided, uses existing endpoint instead of creating new one"
    },
    "instance_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instance Id",
      "description": "Existing GPU instance ID to use as the deployment target"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name",
      "description": "Endpoint name (auto-generated if not provided)"
    },
    "max_concurrency": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Concurrency",
      "description": "Max concurrent requests"
    },
    "gpu_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gpu Count",
      "description": "Number of GPUs"
    },
    "scale": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScalingConfig"
        },
        {
          "type": "null"
        }
      ],
      "description": "Scaling configuration"
    },
    "gpu_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gpu Id",
      "description": "GPU type ID"
    },
    "idle_timeout_seconds": {
      "type": "integer",
      "title": "Idle Timeout Seconds",
      "default": 10
    },
    "template_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Id"
    },
    "huggingface_image_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Huggingface Image Url"
    },
    "volume_size": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Volume Size",
      "description": "Additional volume size in GB (Verda: volume, Novita AI: network storage)"
    },
    "region": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Region",
      "description": "Deployment region"
    },
    "command": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Command",
      "description": "Container command/args"
    },
    "environment": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Environment",
      "description": "Environment variables for the deployment"
    },
    "hf_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hf Token",
      "description": "Hugging Face API token for private models"
    }
  },
  "type": "object",
  "$defs": {
    "ScalingConfig": {
      "properties": {
        "scaler_type": {
          "$ref": "#/$defs/ScalingType"
        },
        "scaler_value": {
          "type": "integer",
          "title": "Scaler Value"
        }
      },
      "type": "object",
      "required": [
        "scaler_type",
        "scaler_value"
      ],
      "title": "ScalingConfig"
    },
    "ScalingType": {
      "type": "string",
      "enum": [
        "queue",
        "request_count"
      ],
      "title": "ScalingType"
    },
    "WorkerConfig": {
      "properties": {
        "min_workers": {
          "type": "integer",
          "title": "Min Workers"
        },
        "max_workers": {
          "type": "integer",
          "title": "Max Workers"
        }
      },
      "type": "object",
      "required": [
        "min_workers",
        "max_workers"
      ],
      "title": "WorkerConfig"
    }
  }
}