You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 6, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+36-18Lines changed: 36 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
The **Paperspace API** is the official devkit for automating your [Paperspace](https://www.paperspace.com) account. It's currently available in JavaScript, and we plan to offer other languages and integrations in the future. For v0, we are offering basic actions such as creating machines and managing team members. This repo includes:
12
12
13
13
*[Paperspace CLI](#Paperspace CLI)
14
-
*[JavaScript API client](#Programmatic access via Paperspace-Node) (for Nodejs and web browsers)
14
+
*[JavaScript API client](#Programmatic access via Paperspace-Node) (for Node.js and web browsers)
After downloading, make sure the binary is permitted to run on your system by marking its permissions appropriately.
32
-
Also, add the directory containing the paperspace binary to your path using a method appropriate for your platform.
31
+
After downloading, make sure the 'paperspace' binary is permitted to run on your system by marking its permissions appropriately.
32
+
Also, add the directory containing the 'paperspace' binary to your path using a method appropriate for your platform.
33
33
34
-
Option 2: Install the paperspace-node package from npm:
34
+
#### Option 2: Install the paperspace-node package from npm
35
35
36
-
For this option your system will need [Node.js](https://nodejs.org) v8+ installed. Check that you have a recent enough version by running `node -v` in your terminal. Node.js comes bundled with `npm`, the Node.js package management tool, which you'll use to install this package. Install the package using the -g option as follows:
36
+
For this option you will need [Node.js](https://nodejs.org) v8.9.3 or later. Check your Node.js version by running `node -v`. Node.js comes bundled with `npm`, the Node.js package management tool, which you'll use to install this package. Install the package using the -g option as follows:
37
37
38
38
$ npm install -g paperspace-node
39
39
40
-
The reason we recommend installing it globally is so the `paperspace` command will be available on your command line everywhere on your system. If you only want to make it available only within an individual Node.js project, you can install it locally by omitting the `-g` flag.
40
+
We recommend installing the paperspace-node package globally so that the `paperspace` command will be available on your command line everywhere on your system. If you want to make it available only within an individual Node.js project, you can install it for use only in the current directory by omitting the `-g` flag.
41
41
42
42
### Setup a Paperspace Account
43
43
44
-
Before you can use this tool, you'll need a [Paperspace account](https://paperspace.com). You'll use this account to obtain Paperspace API keys.
44
+
Before you can use this tool, you'll need a [Paperspace account](https://paperspace.com). You'll use this account request access to the Paperspace API/Gradient Beta, and to obtain a Paperspace API key.
45
+
46
+
After creating your Paperspace account check your email to confirm your account before logging in.
47
+
48
+
### Request Access to the Paperspace API and Gradient Beta
49
+
50
+
To use the Paperspace API or Gradient tools you will need to request access to the *Paperspace API and Gradient Beta*. To do this first log into your [Paperspace account](https://paperspace.com). Then go to the [Gradient console](https://www.paperspace.com/console/gradient) and fill out the form to request access.
51
+
52
+
You will subsequently receive an email confirmation when your acess request is approved (usually within 24 hours).
45
53
46
54
### Obtaining an API key
47
55
48
-
After you have set up a Paperspace account, you can create your first API token and key by logging into your account via the Paperspace CLI:
56
+
Once you have been approved for access to the *Paperspace API and Gradient Beta* you will need to obtain a API key.
57
+
58
+
Your API key allows you to access the Paperspace APIs and Gradient features from the command line, or from within apps that you develop. Each API key has an API Token name associated with it.
59
+
60
+
There are two ways to create an API key, either via the Paperspace CLI, or from within the [API]((https://www.paperspace.com/console/account/api)) section of your Paperspace console.
61
+
62
+
#### Option 1: Obtain an API key via Paperspace CLI
63
+
64
+
You can create your first API key by logging into your account via the Paperspace CLI:
If you don't already have an api token in your paperspace account, this command will generate one. If you already have and api key, the
57
-
first one listed in your account is downloaded. If you have more than one you can use the `--apiToken` option to specify the one to
58
-
download.
72
+
If you don't already have an API key in your paperspace account, this command will generate one and give it a default API token name of 'API token'.
73
+
If you already have one or more API keys, the API key associated with the first API token listed in your account is downloaded. If you want to use a particular API key you can specify the associated API token name using the '--apiToken' option.
59
74
60
-
Note: for security, please make sure access to the file `~/.papersapce/config.json`is protected in your environment.
75
+
Note: your API key is cached in a file in your home directory: `~/.papersapce/config.json`. For security, please make sure access to the file is protected so only you can access it.
61
76
62
-
You can clear your locally cached api key at any time by executing:
77
+
You can clear your locally cached API key at any time by executing:
63
78
64
79
$ paperspace logout
65
80
66
-
Alternatively you can create an API key by signing in to your [Paperspace account](https://paperspace.com). Click 'Launch Console' at top right. From your admin console, you should find an 'Account Info' section. There, you'll find a form where you can create API keys. You'll use the API keys you generate here to authenticate your requests. You will need to pick and API token name for your API key, and also provide a description.
81
+
#### Option 2: Obtain an API key via your Paperspace Console
82
+
83
+
Alternatively you can create an API key from withn your [Paperspace console](https://www.paperspace.com/console) API section. Under the API section in the left navigation bar, click [CREATE AN API KEY](https://www.paperspace.com/console/account/api). Follow the instructions there.
84
+
85
+
You will need to pick and API token name for your API key, and also provide a description. You can copy actual the API key value associated with the API token name only at the time of initial creation. If you need to access your API key in the future, you can instead access it by API token name using the 'paperspace login' command.
0 commit comments