Machines are high-performing computing for scaling AI applications.
Visit the Web API page to learn how to authenticate with the Paperspace Web API.
The required parameters are:
region
(string): Name of the region: either ‘East Coast (NY2)’, ‘West Coast (CA1)’, or ‘Europe (AMS1)’.machineType
(string): See the list of Machine Types here.size
(number): Storage size for the machine in GB. Uses block storage.billingType
(string): ‘hourly’.machineName
(string): A name for this machine.templateId
(string): Template ID of the template to use for creating this machine (see below for more info).You can list the available base templates with:
# HTTP request:
https://api.paperspace.io
GET /templates/getTemplates
x-api-key: 1ba4f98e7c0...
# Returns 200 on success
This returns an array
of OS templates as well as any custom templates you have in your account:
// Example return value:
[
// A public template:
{
"id": "t123abc",
"name": "paperspace/t123abc",
"label": "Windows 10",
"os": "Windows 10 (Server 2016)",
"dtCreated": "2017-01-03T23:41:06.801Z"
},
// A team-owned template:
{
"id": "t456def",
"name": "t456def",
"label": "New Template 1",
"os": "Ubuntu 14.04.5 LTS; uname: 4.2.0-27-generic; distro: ubuntu; major: 14; minor: 04",
"teamId": "te456def",
"userId": null,
"region": "East Coast (NY2)",
"dtCreated": "2017-02-06T18:46:44.882Z"
}
]
Sample request with required and optional parameters:
# HTTP request:
https://api.paperspace.io
POST /machines/createSingleMachinePublic {"region": "East Coast (NY2)", "machineType": "Air", "size": 50, "billingType": "hourly", "machineName": "My Machine 1", "templateId": "t123abc", "assignPublicIp": true, "networkId": "n123abc", "teamId": "te456def", "email": "example@example.com", "password": "secret123", "firstName": "Jon", "lastName": "Snow", "notificationEmail": "example@example.com"}
x-api-key: 1ba4f98e7c0...
# Returns 201 on success
Returns The created machine JSON object
// Example return value:
{
"id": "ps123abc",
"name": "My Machine",
"os": null,
"ram": null,
"cpus": 1,
"gpu": null,
"storageTotal": null,
"storageUsed": null,
"usageRate": "Air hourly",
"shutdownTimeoutInHours": 24,
"shutdownTimeoutForces": false,
"performAutoSnapshot": false,
"autoSnapshotFrequency": null,
"autoSnapshotSaveCount": null,
"agentType": "WindowsDesktop",
"dtCreated": "2017-02-16T20:26:54.880Z",
"state": "provisioning",
"updatesPending": false,
"networkId": null,
"privateIpAddress": null,
"publicIpAddress": "169.255.255.254",
"region": null,
"userId": "u123abc",
"teamId": "te456def",
"scriptId": "sc123abc",
"dtLastRun": null,
"dynamicPublicIp": null
}
Creating a machine using an individual account assigns that account as the owner of the machine. If you are a team administrator, you must specify the user that should be assigned to the machine, either by specifying a user id, or by providing an email address, password, first name and last name for the creation of a new user on the team. (The email address must not already be associated with a Paperspace account, otherwise, a user creation error is returned.)