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

# VastAI.create_instances

Create multiple instances from a list of offer IDs.

## Signature

```python theme={null}
VastAI.create_instances(
    ids: List[int],
    template_hash: Optional[str] = None,
    user: Optional[str] = None,
    disk: float = 10,
    image: Optional[str] = None,
    login: Optional[str] = None,
    label: Optional[str] = None,
    onstart: Optional[str] = None,
    onstart_cmd: Optional[str] = None,
    entrypoint: Optional[str] = None,
    ssh: bool = False,
    jupyter: bool = False,
    direct: bool = False,
    jupyter_dir: Optional[str] = None,
    jupyter_lab: bool = False,
    lang_utf8: bool = False,
    python_utf8: bool = False,
    extra: Optional[str] = None,
    env: Optional[str] = None,
    args: Optional[List[str]] = None,
    force: bool = False,
    cancel_unavail: bool = False,
    bid_price: Optional[float] = None,
    create_volume: Optional[int] = None,
    link_volume: Optional[int] = None,
    volume_size: Optional[int] = None,
    mount_path: Optional[str] = None,
    volume_label: Optional[str] = None
) -> str
```

## Parameters

<ParamField path="ids" type="List[int]" required>
  List of offer/contract IDs to create instances from.
</ParamField>

<ParamField path="template_hash" type="Optional[str]">
  Hash of the instance template to use.
</ParamField>

<ParamField path="user" type="Optional[str]">
  Subaccount username to create the instances under.
</ParamField>

<ParamField path="disk" type="float" default="10">
  Disk space to allocate in GB.
</ParamField>

<ParamField path="image" type="Optional[str]">
  Docker image name to use for the instance.
</ParamField>

<ParamField path="login" type="Optional[str]">
  Docker login credentials for private registry authentication.
</ParamField>

<ParamField path="label" type="Optional[str]">
  Label to attach to the instances.
</ParamField>

<ParamField path="onstart" type="Optional[str]">
  Filename of an onstart script to run on instance start.
</ParamField>

<ParamField path="onstart_cmd" type="Optional[str]">
  Shell command to run on instance start.
</ParamField>

<ParamField path="entrypoint" type="Optional[str]">
  Override the Docker image entrypoint.
</ParamField>

<ParamField path="ssh" type="bool" default="False">
  Enable SSH access to the instances.
</ParamField>

<ParamField path="jupyter" type="bool" default="False">
  Enable Jupyter notebook server.
</ParamField>

<ParamField path="direct" type="bool" default="False">
  Enable direct (peer-to-peer) connections.
</ParamField>

<ParamField path="jupyter_dir" type="Optional[str]">
  Directory to serve Jupyter from.
</ParamField>

<ParamField path="jupyter_lab" type="bool" default="False">
  Enable JupyterLab instead of classic Jupyter.
</ParamField>

<ParamField path="lang_utf8" type="bool" default="False">
  Set system language encoding to UTF-8.
</ParamField>

<ParamField path="python_utf8" type="bool" default="False">
  Set Python I/O encoding to UTF-8.
</ParamField>

<ParamField path="extra" type="Optional[str]">
  Extra Docker run arguments passed verbatim.
</ParamField>

<ParamField path="env" type="Optional[str]">
  Environment variables to set (formatted as Docker -e flags).
</ParamField>

<ParamField path="args" type="Optional[List[str]]">
  Additional positional arguments.
</ParamField>

<ParamField path="force" type="bool" default="False">
  Skip sanity checks when creating from an existing instance.
</ParamField>

<ParamField path="cancel_unavail" type="bool" default="False">
  Return an error if scheduling fails rather than creating a stopped instance.
</ParamField>

<ParamField path="bid_price" type="Optional[float]">
  Per-machine bid price in \$/hour for interruptible (spot) instances.
</ParamField>

<ParamField path="create_volume" type="Optional[int]">
  Offer ID from "search volumes" to create a new local volume linked to each instance.
</ParamField>

<ParamField path="link_volume" type="Optional[int]">
  ID of an existing rented volume to link to each instance.
</ParamField>

<ParamField path="volume_size" type="Optional[int]">
  Size of the volume to create in GiB.
</ParamField>

<ParamField path="mount_path" type="Optional[str]">
  Filesystem path inside the instance where the volume is mounted.
</ParamField>

<ParamField path="volume_label" type="Optional[str]">
  Label to attach to the created volume.
</ParamField>

## Returns

`str`, Result from the API call.

## Example

```python theme={null}
from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.create_instances(ids=[12345])
print(result)
```
