Skip to main content

Massed Compute VM API (1.0.0)

Download OpenAPI specification:Download

API documentation for our direct on-demand offering Base URL: https://vm.massedcompute.com/api/v1 Example — GPU inventory (copy this whole URL): https://vm.massedcompute.com/api/v1/gpu-inventory Do not use api.massedcompute.com. Customer API traffic goes to vm.massedcompute.com.

If you are a marketplace looking to leverage our GPU inventory please contact us at techadmin@massedcompute.com

Authentication

Authentication of every endpoint provided requres a API token. We leverage Bearer token authentication on our endpoints.

Header Value
Authorization Bearer {{api_token}}

To provision an API key, please see our API Settings documentation.

Retrieve a list of avaialable GPU configurations.

An comprehensive list of all GPU types, configurations, and available inventory.

Responses

Response samples

Content type
application/json
{
  • "gpu_inventory": {
    }
}

Retrieve list of available images.

An Image is a preconfigured operating system and software stack.

Responses

Response samples

Content type
application/json
{
  • "images": [
    ]
}

Instances

Retrieve list of all running instances.

An instance is a virtual machine that is currently running.

Responses

Response samples

Content type
application/json
{
  • "runningInstances": [
    ]
}

Retrieve single running instances.

An instance is a virtual machine that is currently running.

Responses

Response samples

Content type
application/json
{
  • "runningInstance": {
    }
}

Deploy new instances.

Request Body schema: application/json
required
imageId
required
integer

The ID of the image to deploy

productName
required
string

The product name of the GPU instance you want to deploy. Example = 'gpu_1x_l40'

regionName
required
string

Set value equal to 'any'

instanceName
string

The name of the instance you want to deploy

coupon
string

The coupon code you want to apply to the instance

command
string

The command you want to run on startup

sshKeys
Array of strings

The SSH key you want to use to connect to the instance

volumeIds
Array of strings <= 8 items

Beta. Optional. Ids of storage to attach (Persistent Storage, powered by Backblaze), from GET /storage-volumes. At most 8. Each one mounts at /persistent/<name> on the new instance. Each one must be active and in an instance group you can manage. Attach each storage to one instance at a time. Spell it volumeIds: a body containing volume_ids is refused with 422. Errors: 403 if the account doesn't have Persistent Storage or you can't manage a storage's group; 404 for an id you can't see; 409 if a storage isn't active; 422 if the value isn't a list of strings or has more than 8 ids; 503 if Persistent Storage is unavailable right now.

Responses

Request samples

Content type
application/json
{
  • "imageId": 0,
  • "productName": "string",
  • "regionName": "string",
  • "instanceName": "string",
  • "coupon": "string",
  • "command": "string",
  • "sshKeys": [
    ],
  • "volumeIds": [
    ]
}

Response samples

Content type
application/json
{
  • "response": "8b52a46b-uuid-4fde-xxxx-6d13226908f7",
  • "warning": "string"
}

Restart an instances.

Request Body schema: application/json
required
instanceUuids
required
Array of strings

The ID or IDs of instances to restart

Responses

Request samples

Content type
application/json
{
  • "instanceUuids": [
    ]
}

Response samples

Content type
application/json
{
  • "response": [
    ]
}

Terminate an instances.

Termination completely removes the instance from the system and destroys all data.

Request Body schema: application/json
required
instanceUuids
required
Array of strings

The ID or IDs of instances to restart

Responses

Request samples

Content type
application/json
{
  • "instanceUuids": [
    ]
}

Response samples

Content type
application/json
{
  • "response": {
    }
}

Coupon

Retrieve information about a coupon.

A coupon is a discount code that can be applied to an instance when deployed.

Request Body schema: application/json
required
coupon
string

The coupon code you want to retrieve information about

Responses

Request samples

Content type
application/json
{
  • "coupon": "string"
}

Response samples

Content type
application/json
{
  • "coupon": {
    }
}

Retrieve products that a coupon is valid for.

A coupon is a discount code that can be applied to an instance when deployed.

Request Body schema: application/json
required
coupon
string

The coupon code you want to retrieve information about

Responses

Request samples

Content type
application/json
{
  • "coupon": "string"
}

Response samples

Content type
application/json
{
  • "couponValidation": {
    }
}

Account

Validate an API token.

An API token is required to access the API.

Responses

Response samples

Content type
application/json
{
  • "message": "Valid Token"
}

Retrieve billing information.

Billing information for the account.

Responses

Response samples

Content type
application/json
{
  • "billingMethod": "creditcard",
  • "rechargeThresholdCents": 1000,
  • "rechargeThreshold": 10,
  • "rechargeAmountCents": 2000,
  • "rechargeAmount": 20
}

SSH Keys

Retrieve SSH keys associated with the account.

An SSH key is a secure access credential used to connect to instances.

Responses

Response samples

Content type
application/json
{
  • "sshKeys": [
    ]
}

Add an SSH key to the account.

An SSH key is a secure access credential used to connect to instances.

Request Body schema: application/json
required
name
required
string

The name of the SSH key

publicKey
required
string

The public key associated with the SSH key

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "publicKey": "string"
}

Response samples

Content type
application/json
{
  • "sshKey": {
    }
}

Remove an SSH key from the account.

An SSH key is a secure access credential used to connect to instances.

path Parameters
id
required
string

The unique identifier for the SSH key to be removed

Responses

Response samples

Content type
application/json
{
  • "result": { }
}

Persistent Storage

List your Persistent Storage.

Beta. Account owners and admins can join the beta under Settings → Profile, or by ticking "Join the beta program" at signup, and leave it under Settings → Profile. Accounts without Persistent Storage get 403.

Persistent Storage keeps its data after the instance it is attached to is terminated. This lists the storage in instance groups you can see. Instances it is attached to in groups you can't see are counted in hiddenAttachedCount, never named. Works with a read-only API key.

Errors use the body { "message": "...", "code": "..." }.

Responses

Response samples

Content type
application/json
{
  • "storageVolumes": [
    ]
}

Create Persistent Storage.

Beta. Account owners and admins can join the beta under Settings → Profile, or by ticking "Join the beta program" at signup, and leave it under Settings → Profile. Accounts without Persistent Storage get 403.

Creates storage. Storage is billed for the data stored in it, from the moment you store data until it is deleted. Needs a full-access API key and the Manage persistent storage team permission. The storage is created in instanceGroup, or in the account's default group if you leave it out. You must be able to manage that group.

Names use lowercase letters, digits and hyphens, 1 to 22 characters, and can't start or end with a hyphen. A name must be unique among the account's storage. The name is the mount folder: /persistent/<name>.

If the connection drops, the storage may still have been created. List your storage before you retry; a retry with the same name answers 409 if the first request worked.

Request Body schema: application/json
required
name
required
string <= 22 characters ^[a-z0-9](?:[a-z0-9-]{0,20}[a-z0-9])?$

The storage name. It becomes the mount folder, /persistent/.

instanceGroup
string or null

Optional uuid of an instance group you can manage. Leave it out to use the account's default group.

Responses

Request samples

Content type
application/json
{
  • "name": "datasets",
  • "instanceGroup": "string"
}

Response samples

Content type
application/json
{
  • "storageVolume": {
    },
  • "warning": "string"
}

Delete Persistent Storage.

Beta. Account owners and admins can join the beta under Settings → Profile, or by ticking "Join the beta program" at signup, and leave it under Settings → Profile. Accounts without Persistent Storage get 403.

Destructive: permanently deletes the storage and every file in it. This can't be undone. Needs a full-access API key, the Manage persistent storage team permission, and manage access to the storage's instance group.

Storage that is still attached to any instance, including a stopped one, can't be deleted (409). Stop those instances and detach the storage under My Instances > Storage on the website, or terminate them. Detaching isn't on the REST API yet.

Large storage can take more than one request to empty. 200 with deleted: true means it is gone. 202 with deleted: false means it is still being emptied: send the same request again until you get 200. Repeating the request is safe. The storage shows status deleting in the meantime and is billed for whatever is still stored.

path Parameters
id
required
string <uuid>

The storage id from GET /storage-volumes.

Responses

Response samples

Content type
application/json
{
  • "result": {
    }
}