runpod-client
v1.0.9
Published
This unofficial runpod.io client provides functionality to interact with the Runpod.io API.
Maintainers
Readme
Runpod Client Documentation
This unofficial runpod.io client provides functionality to interact with the Runpod.io API.
| Statements | Branches | Functions | Lines |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| |
|
|
|
Installation
npm install runpod-clientImport runcloud-client
import runpod from "runpod-client";Initialize:
const rp = runpod(API_KEY); //make ure to add your api key hereList 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);
}