runpod-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Runpod Client Documentation

This unofficial runpod.io client provides functionality to interact with the Runpod.io API.

Statements Branches Functions Lines
Statements Branches Functions Lines

Installation

npm install runpod-client

Import runcloud-client

import runpod from "runpod-client";

Initialize:

const rp = runpod(API_KEY); //make ure to add your api key here

List all pods

const pods = await rp({ action: "list" });
for (const pod of pods) {
	console.log(pod);
}

Get a specific pod

const pod = await rp({ action: "get", id: POD_ID }); //Replace POD_ID your existing pod id
console.log(pod);

Start a pod

const pod = await rp({ action: "start", id: POD_ID }); //Replace POD_ID your existing pod id
console.log(pod);

Stop a pod

const pod = await rp({ action: "stop", id: POD_ID }); //Replace POD_ID your existing pod id
console.log(pod);

List GPU types available

const gpuTypes = await rp({ action: "getGPUTypes" });
for (const gpuType of gpuTypes) {
	console.log(gpuType);
}

List GPU type by ID

const gpuTypes = await rp({
	action: "getGPU",
	id: "NVIDIA GeForce RTX 3090",
	count: 1,
});
for (const gpuType of gpuTypes) {
	console.log(gpuType);
}

Package Sidebar

Install

npm i runpod-client

Weekly Downloads

3

Version

1.0.9

License

MIT

Unpacked Size

30.1 kB

Total Files

14

Last publish

Collaborators

  • jmdisuanco