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.
**Heads up! This project is under construction!** We welcome your bug reports and suggestions via GitHub Issues!
7
+
**Heads up! This project is in beta!** We welcome your bug reports and suggestions via GitHub Issues!
8
8
9
9
- - - -
10
10
11
-
The **Paperspace API** is the official devkit for automating your [Paperspace](https://www.paperspace.com) account. It is currently available in [JavaScript](#programmatic-access-via-paperspace-node)and [Python](https://github.com/Paperspace/paperspace-python), and we plan to offer other languages and integrations in the future. Currently we are offering basic actions such as creating Paperspace machines and Gradient jobs. This repository includes:
11
+
The **Paperspace CORE API** is the official devkit for automating your [Paperspace](https://www.paperspace.com) account. It is currently available through the use of standard HTTP requests as well as a [JavaScript client ](#programmatic-access-via-paperspace-node)for Node.js. We plan to offer other languages and integrations in the future. This repository includes:
12
12
13
-
*[Paperspace CLI](#paperspace-cli) (command line interface)
14
13
*[JavaScript API client](#programmatic-access-via-paperspace-node) (for Node.js)
*[Script Guide](scripts.md) for creating and using startup scripts
17
16
18
17
## [Release Notes](releasenotes.md)
@@ -21,14 +20,7 @@ The **Paperspace API** is the official devkit for automating your [Paperspace](h
21
20
22
21
### Installation
23
22
24
-
#### Option 1: Download the pre-built 'paperspace' binary for your plaftorm
25
-
26
-
Head over to the [releases](https://github.com/Paperspace/paperspace-node/releases) section to download the latest version of the paperspace CLI for Linux, Mac, and Windows.
27
-
28
-
After downloading, make sure the 'paperspace' binary is permitted to run on your system by marking its permissions appropriately.
29
-
Also, add the directory containing the 'paperspace' binary to your path using a method appropriate for your platform.
30
-
31
-
#### Option 2: Install the paperspace-node package from npm
23
+
#### Install the paperspace-node package from npm
32
24
33
25
For this option you will need [Node.js](https://nodejs.org) v8.12.0 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:
34
26
@@ -46,62 +38,33 @@ After creating your Paperspace account check your email to confirm your account
46
38
47
39
Once you have created a Paperspace Account you will need to obtain a API key.
48
40
49
-
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.
41
+
Your API key allows you to access the Paperspace CORE API via conventional HTTP requests or from within apps that you develop.
50
42
51
-
There is currently only one way to create an API key: from within the [API](https://www.paperspace.com/console/account/api) section of your Paperspace console.
43
+
There is currently only one way to create an API key: from within the section of your Paperspace [console](https://console.paperspace.com/).
52
44
53
45
#### Obtain an API key via your Paperspace Console
54
46
55
-
You can create an API key from within your Paperspace console under the [API](https://www.paperspace.com/console/account/api) section. Login to your [Paperspace console](https://www.paperspace.com/console), scroll to the API section in the left navigation bar, and click [CREATE AN API KEY](https://www.paperspace.com/console/account/api). Follow the instructions there.
47
+
You can create an API key from within your Paperspace console under the API section. Login to your Paperspace [console](https://console.paperspace.com/), visit your team settings page, locate the API section, and follow the instructions to create a new API key.
56
48
57
-
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.
You'll use the API keys generate here to authenticate your requests.
51
+
You'll use the API keys generated here to authenticate your requests.
62
52
63
53
## Usage
64
54
65
-
You can interact with Paperspace's API in three ways: from the command line using the Paperspace CLI, programatically (from within a Javascript Nodejs application), or by using an HTTP client of your choice and the Paperspace API HTTP enpoints documented here.
55
+
You can interact with CORE API in two ways: by using an HTTP client of your choice and the Paperspace API HTTP endpoints or programmatically from within a Javascript Node.js application.
66
56
67
57
### Authentication
68
58
69
-
For authenticated requests, the Paperspace CLI and Paperspace-Node module will look in three places for an api key:
70
-
71
-
1) Locally in the file `~/.paperspace/config.json`, which can be created via the Paperspace CLI by executing:
59
+
For authenticated requests, the Paperspace-Node module will look for an api key:
72
60
73
-
$ paperspace login
74
-
75
-
See the previous section on [Obtaining an API key](#obtaining-an-api-key) for more information.
76
-
77
-
2) An environment variable: `PAPERSPACE_API_KEY`. Example:
61
+
An environment variable: `PAPERSPACE_API_KEY`. Example:
78
62
79
63
$ export PAPERSPACE_API_KEY=1ba4f98e7c0...
80
64
$ paperspace machines show --machineId "ps123abc"
81
65
82
-
3) A command argument: `--apiKey`. Example:
83
-
84
-
$ paperspace machines show --apiKey "1ba4f98e7c0..." --machineId "ps123abc"
85
-
86
-
87
-
88
-
### Paperspace CLI
89
-
90
-
Assuming you've installed the `paperspace-node` package or downloaded one of the pre-built executables, you can invoke the Paperspace CLI with:
91
-
92
-
$ paperspace --help
93
-
94
-
You can check the version of the Paperspace CLI with:
95
-
96
-
$ paperspace --version
97
-
98
-
#### Calling methods with the Paperspace CLI
99
-
100
-
The CLI provides all methods as subcommands, using this scheme: `paperspace <namespace> <subcommand>`. For example:
See the previous section on [Obtaining an API key](#obtaining-an-api-key) for more information.
103
67
104
-
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-node).
105
68
106
69
### Programmatic access via Paperspace-Node
107
70
@@ -127,7 +90,6 @@ Then create an instance of the client, optionally passing in your API key:
127
90
128
91
var paperspace = paperspace_node();
129
92
130
-
If you do not pass an apiKey parameter when creating the paperspace object the paperspace-node module will look for the environment variable value named`PAPERSPACE_API_KEY` for an API key, or in the cached api key location created by the `paperspace login` command, `~/.paperspace/config.json`. See the [Authentication](#authentication) section above for more information.
131
93
132
94
You can get the paperspace-node version programmatically via the VERSION attribute:
133
95
@@ -145,13 +107,11 @@ All of the methods are namespaced by category ("machines.create" or "invoices.sh
145
107
146
108
That is, the first argument is parameters object, and the second is a error-first callback function.
147
109
148
-
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-node).
110
+
For information on all the methods available, see the [API documentation](https://docs.paperspace.com/paperspace-core-api/).
149
111
150
112
## Paperspace API HTTP endpoints
151
113
152
-
If you'd prefer to build your own client instead of using the Paperspace-Node library, you can use the Paperspace API HTTP endpoints directly, as described in the [API documentation](https://paperspace.github.io/paperspace-node).
153
-
154
-
NOTE: the HTTP endpoints are subject to change in the future. We recommend using one of the programmatic APIs whenever possible to maintain forward compatibility.
114
+
If you'd prefer to build your own client instead of using the Paperspace-Node library, you can use the Paperspace API HTTP endpoints directly, as described in the [API documentation](https://docs.paperspace.com/paperspace-core-api/).
155
115
156
116
### Address for the Paperspace API HTTP endpoints
157
117
@@ -195,4 +155,4 @@ This project is open source, under the ISC license. See LICENSE.txt.
195
155
196
156
## Copyright
197
157
198
-
Copyright 2018 Paperspace Co. - All Rights Reserved
158
+
Copyright 2021 Paperspace Co. - All Rights Reserved
0 commit comments