> ## Documentation Index
> Fetch the complete documentation index at: https://novita.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Instance



## OpenAPI

````yaml api-reference/gpus-v2-spec/create-instance.json POST /gpus/v2/instances
openapi: 3.0.0
info:
  title: Novita GPU API v2
  version: 2.0.0
servers:
  - url: https://api.novita.ai
security: []
paths:
  /gpus/v2/instances:
    post:
      summary: Create Instance
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
          description: 'Allowed value: application/json.'
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
          description: 'Bearer authentication format, e.g.: `Bearer {{API_KEY}}`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - product_id
                - image
                - billing
                - resource
              properties:
                name:
                  type: string
                  description: 'Instance name. String, length: 1-255 characters.'
                  example: example-instance
                product_id:
                  type: string
                  description: Product ID.
                  example: product-id
                image:
                  type: string
                  description: 'Image address. String, length: 1-500 characters.'
                  example: registry.example.com/namespace/image:tag
                billing:
                  type: object
                  description: Billing configuration.
                  required:
                    - mode
                  properties:
                    mode:
                      type: string
                      enum:
                        - postpaid
                        - prepaid
                        - spot
                      description: >-
                        Billing mode. Allowed values: `postpaid`, `prepaid`,
                        `spot`.
                      example: prepaid
                    prepaid:
                      type: object
                      description: >-
                        Monthly subscription configuration. Required when
                        `mode=prepaid`.
                      properties:
                        months:
                          type: integer
                          description: Subscription length in months. Integer, value > 0.
                          example: 1
                        auto_renew:
                          type: object
                          description: Auto-renew configuration.
                          properties:
                            enabled:
                              type: boolean
                              description: Whether auto-renew is enabled.
                              example: true
                            months:
                              type: integer
                              description: >-
                                Auto-renew length in months. Integer, value >=
                                0.
                              example: 1
                resource:
                  type: object
                  description: Resource configuration.
                  required:
                    - rootfs_size_gb
                    - gpu_num
                  properties:
                    rootfs_size_gb:
                      type: integer
                      description: 'Root disk size. Integer, value > 1. Unit: GB.'
                      example: 20
                    gpu_num:
                      type: integer
                      description: GPU count. Integer, value > 0.
                      example: 1
                    min_cuda_version:
                      type: string
                      description: >-
                        Minimum required CUDA version. String, length: 0-255
                        characters.
                      example: ''
                type:
                  type: string
                  enum:
                    - gpu
                    - cpu
                  description: 'Instance type. Allowed values: `gpu`, `cpu`. Default: `gpu`.'
                registry_auth_id:
                  type: string
                  description: >-
                    Saved registry authentication ID. String, length: 0-255
                    characters.
                  example: registry-auth-id
                entrypoint:
                  type: string
                  description: Container entrypoint.
                  example: ''
                command:
                  type: string
                  description: Container startup command.
                  example: ''
                envs:
                  type: array
                  description: Environment variable list.
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        description: 'Variable name. String, length: 0-511 characters.'
                        example: ENV_NAME
                      value:
                        type: string
                        description: 'Variable value. String, length: 0-4095 characters.'
                        example: ENV_VALUE
                ports:
                  type: array
                  description: Exposed port list.
                  items:
                    type: object
                    required:
                      - port
                      - protocol
                    properties:
                      port:
                        type: integer
                        description: 'Port number. Integer, range: [1, 65535].'
                        example: 8080
                      protocol:
                        type: string
                        enum:
                          - tcp
                          - http
                        description: 'Port protocol. Allowed values: `tcp`, `http`.'
                        example: tcp
                network:
                  type: object
                  description: VPC network configuration.
                  properties:
                    id:
                      type: string
                      description: 'VPC network ID. String, length: 0-255 characters.'
                      example: vpc-550e8400-e29b-41d4-a716-446655440000
                    ip:
                      type: string
                      description: IP assigned to the instance by the VPC.
                      example: 10.2.1.1
                volumes:
                  type: array
                  description: Data disk / network storage mounts.
                  items:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        enum:
                          - local
                          - network
                        description: 'Storage type. Allowed values: `local`, `network`.'
                        example: network
                      id:
                        type: string
                        description: >-
                          Storage ID. Used for `network` type. String, length:
                          0-255 characters.
                        example: network-storage-id
                      mount_point:
                        type: string
                        description: 'Mount path. String, length: 0-4095 characters.'
                        example: /data
                candidate_regions:
                  type: array
                  items:
                    type: string
                  description: >-
                    Candidate regions for scheduling. The instance is finally
                    scheduled to one of them.
                  example:
                    - region-id
                tools:
                  type: object
                  description: >-
                    Instance tool configuration. Currently only Jupyter is
                    supported.
                  properties:
                    jupyter:
                      type: object
                      description: Jupyter tool configuration.
                      properties:
                        enabled:
                          type: boolean
                          description: Whether to enable Jupyter.
                          example: true
                        port:
                          type: integer
                          description: 'Jupyter port. Integer, range: [1, 65535].'
                          example: 8888
                        protocol:
                          type: string
                          description: Jupyter protocol.
                          example: http
                auto_migrate:
                  type: object
                  description: Auto-migrate configuration.
                  properties:
                    enabled:
                      type: boolean
                      description: Whether auto-migrate is enabled.
                      example: false
                    include_system_disk:
                      type: boolean
                      description: Whether the system disk is included during auto-migrate.
                      example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the created instance
                    example: ca338f12f3

````