{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oneinfer-ai/json-schema/oneinfer-ai-create-instance-request-schema.json",
  "title": "CreateInstanceRequest",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oneinfer-ai-openapi.json#/components/schemas/CreateInstanceRequest",
  "properties": {
    "provider_name": {
      "type": "string",
      "title": "Provider Name"
    },
    "instance_name": {
      "type": "string",
      "title": "Instance Name"
    },
    "gpu_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gpu Id"
    },
    "gpu_num": {
      "type": "integer",
      "title": "Gpu Num",
      "default": 0
    },
    "disk_size": {
      "type": "integer",
      "title": "Disk Size",
      "default": 0
    },
    "image_url": {
      "type": "string",
      "title": "Image Url"
    },
    "ports": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ports",
      "description": "Ports exposed by the selected catalog or registry image"
    },
    "envs": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Envs",
      "description": "Environment variables required by the image"
    },
    "command": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Command",
      "description": "Container command or arguments"
    },
    "start_command": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Start Command",
      "description": "Catalog alias for the container command"
    },
    "kind": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Kind",
      "description": "Novita instance kind",
      "default": "gpu"
    },
    "image_source": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Image Source",
      "description": "Image source: catalog or registry"
    },
    "registry_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Url",
      "description": "Container registry URL or host"
    },
    "registry_image": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Image",
      "description": "Full private registry image path"
    },
    "registry_username": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Username",
      "description": "Container registry username"
    },
    "registry_password": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Password",
      "description": "Container registry password or access token"
    },
    "registry_auth_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Auth Name",
      "description": "Friendly name for saved registry credentials"
    },
    "registry_credential_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Credential Id",
      "description": "Saved OneInfer registry credential ID"
    },
    "registry_auth_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Registry Auth Id",
      "description": "Provider registry auth ID"
    },
    "container_registry_auth_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Container Registry Auth Id",
      "description": "Runpod container registry auth ID"
    },
    "region": {
      "type": "string",
      "title": "Region"
    },
    "startup_script": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Startup Script",
      "description": "Startup script to run on instance launch"
    },
    "additional_volume_size": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Additional Volume Size",
      "description": "Additional volume size in GB (Verda: volume, Novita AI: network storage)"
    },
    "additional_volume_region": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Additional Volume Region",
      "description": "Volume Region"
    },
    "storage": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/StorageAttachment"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Storage",
      "description": "Persistent storage volumes to attach"
    },
    "volume_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Volume Name",
      "description": "Name of existing volume to attach"
    },
    "volume_region": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Volume Region",
      "description": "Region hint for an existing external volume"
    },
    "compute_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Compute Type",
      "description": "Compute type (e.g. CPU, GPU)"
    },
    "plan_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plan Id",
      "description": "Provider plan ID for CPU instances"
    },
    "cpu_flavor_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cpu Flavor Id",
      "description": "CPU flavor ID for CPU instances"
    },
    "is_spot": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Spot",
      "description": "Provision as a spot instance (Verda only). Uses spot pricing for credit checks.",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "provider_name",
    "instance_name",
    "image_url",
    "region"
  ],
  "$defs": {
    "StorageAttachment": {
      "properties": {
        "storage_id": {
          "type": "string",
          "title": "Storage Id"
        },
        "mount_path": {
          "type": "string",
          "title": "Mount Path",
          "description": "Path to mount storage inside container (e.g., /workspace)"
        },
        "read_only": {
          "type": "boolean",
          "title": "Read Only",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "storage_id",
        "mount_path"
      ],
      "title": "StorageAttachment"
    }
  }
}