Instances
/instances/create
Instances
/instances/create
Create a new GPU instance.
POST
/
instances
/
create
curl --request POST \
--url https://api.shadeform.ai/v1/instances/create \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '{
"cloud": "hyperstack",
"region": "canada-1",
"shade_instance_type": "A6000",
"shade_cloud": true,
"name": "cool-gpu-server",
"os": "ubuntu22.04_cuda12.2_shade_os",
"template_id": "template-123",
"launch_configuration": {
"type": "docker",
"docker_configuration": {
"image": "vllm/vllm-openai:latest",
"args": "--model mistralai/Mistral-7B-v0.1",
"shared_memory_in_gb": 8,
"envs": [
{
"name": "HUGGING_FACE_HUB_TOKEN",
"value": "hugging_face_api_token"
}
],
"port_mappings": [
{
"host_port": 80,
"container_port": 8000
}
],
"volume_mounts": [
{
"host_path": "~/.cache/huggingface",
"container_path": "/root/.cache/huggingface"
}
]
},
"script_configuration": {
"base64_script": "IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo="
}
},
"volume_ids": [
"78a0dd5a-dbb1-4568-b55c-5e7e0a8b0c40"
],
"ssh_key_id": "78a0dd5a-dbb1-4568-b55c-5e7e0a8b0c40",
"auto_delete": {
"date_threshold": "2006-01-02T15:04:05-07:00",
"spend_threshold": "3.14"
},
"alert": {
"date_threshold": "2006-01-02T15:04:05-07:00",
"spend_threshold": "3.14"
},
"volume_mount": {
"auto": true
},
"tags": [
"tag1"
],
"envs": [
{
"name": "HUGGING_FACE_HUB_TOKEN",
"value": "hugging_face_api_token"
}
]
}'
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}
The example in the right sidebar is a schema only and will not work out of the box. Only ‘docker_configuration’ or ‘script_configuration’ can be specified but not both.
See the following tutorials related to instance creation:
Creating an Instance
Creating an Instance with a Running Container
Creating an Instance with a Startup Script
Authorizations
Body
application/json
Response
200 - application/json
Returns a CreateResponse object
Response of the /instances/create API call
curl --request POST \
--url https://api.shadeform.ai/v1/instances/create \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '{
"cloud": "hyperstack",
"region": "canada-1",
"shade_instance_type": "A6000",
"shade_cloud": true,
"name": "cool-gpu-server",
"os": "ubuntu22.04_cuda12.2_shade_os",
"template_id": "template-123",
"launch_configuration": {
"type": "docker",
"docker_configuration": {
"image": "vllm/vllm-openai:latest",
"args": "--model mistralai/Mistral-7B-v0.1",
"shared_memory_in_gb": 8,
"envs": [
{
"name": "HUGGING_FACE_HUB_TOKEN",
"value": "hugging_face_api_token"
}
],
"port_mappings": [
{
"host_port": 80,
"container_port": 8000
}
],
"volume_mounts": [
{
"host_path": "~/.cache/huggingface",
"container_path": "/root/.cache/huggingface"
}
]
},
"script_configuration": {
"base64_script": "IyEvYmluL2Jhc2gKCiMgRW5kbGVzcyBsb29wCndoaWxlIHRydWUKZG8KICAgICMgRmV0Y2ggYSBjYXQgZmFjdCB3aXRoIGEgbWF4aW11bSBsZW5ndGggb2YgMTQwIGNoYXJhY3RlcnMKICAgIGN1cmwgLS1uby1wcm9ncmVzcy1tZXRlciBodHRwczovL2NhdGZhY3QubmluamEvZmFjdD9tYXhfbGVuZ3RoPTE0MAoKICAgICMgUHJpbnQgYSBuZXdsaW5lIGZvciByZWFkYWJpbGl0eQogICAgZWNobwoKICAgICMgU2xlZXAgZm9yIDMgc2Vjb25kcyBiZWZvcmUgdGhlIG5leHQgaXRlcmF0aW9uCiAgICBzbGVlcCAzCmRvbmUKCgo="
}
},
"volume_ids": [
"78a0dd5a-dbb1-4568-b55c-5e7e0a8b0c40"
],
"ssh_key_id": "78a0dd5a-dbb1-4568-b55c-5e7e0a8b0c40",
"auto_delete": {
"date_threshold": "2006-01-02T15:04:05-07:00",
"spend_threshold": "3.14"
},
"alert": {
"date_threshold": "2006-01-02T15:04:05-07:00",
"spend_threshold": "3.14"
},
"volume_mount": {
"auto": true
},
"tags": [
"tag1"
],
"envs": [
{
"name": "HUGGING_FACE_HUB_TOKEN",
"value": "hugging_face_api_token"
}
]
}'
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}