Developer API & SDK
SDK & CLI v2.3.5
1. Install
2. Agent
Node.js
npx -y @nexuscompute/sdk@latest agent -k nexus_token_demo001 -u https://nexuscompute.net/api/v1 "Make an impressive html and JS file."
Python
nexus-agent -k nexus_token_demo001 -u https://nexuscompute.net/api/v1 "Make an impressive html and JS file."
3. Marketplace CLI
Rent hardware and run jobs from your terminal. Default API is https://nexuscompute.net/api/v1.
JavaScript
# Wallet & marketplace
npx -y @nexuscompute/sdk@latest --api-url https://nexuscompute.net/api/v1 list-hardware
npx -y @nexuscompute/sdk@latest --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 get-wallet
npx -y @nexuscompute/sdk@latest --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 pay -a 5.00
npx -y @nexuscompute/sdk@latest --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 gemm -H hw-id -a "[[1,2]]" -b "[[3],[4]]"
npx -y @nexuscompute/sdk@latest --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 rent -H hw-id --hours 24
Python
# Wallet & marketplace
nexus-renter --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 list-hardware
nexus-renter --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 get-wallet
nexus-renter --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 pay -a 5.00
nexus-renter --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 gemm -H hw-id -a "[[1,2]]" -b "[[3],[4]]"
nexus-renter --api-key nexus_token_demo001 --api-url https://nexuscompute.net/api/v1 benchmark -H hw-id
4. Renting Code
Programmatic renter client — list hardware, submit jobs, rent storage-backed nodes.
JavaScript
const { NexusRenter } = require('@nexuscompute/sdk');
const client = new NexusRenter({
// Default API token (swap yours at /tokens — cannot revoke, only swap)
apiKey: process.env.NEXUS_API_KEY || 'nexus_token_demo001',
baseUrl: process.env.NEXUS_API_URL || 'https://nexuscompute.net/api/v1'
});
(async () => {
const { hardware } = await client.listHardware();
console.log(hardware);
// Rent hardware (+ SSD at 1 $NEXUS / 250 GB-day when offered)
const rental = await client.createRental({
hardwareId: 'hw-id',
hours: 24
});
console.log(rental);
const job = await client.submitJob(
{ hardwareId: 'hw-id' },
'gemm',
{ a: [[1, 2]], b: [[3], [4]] }
);
console.log(job);
// Optional: encrypted P2P training-data sync
// await client.syncTrainingData(job, './dataset');
})();
Python
import os
from nexus_sdk import Renter
client = Renter(
# Default API token (swap yours at /tokens — cannot revoke, only swap)
api_key=os.environ.get("NEXUS_API_KEY", "nexus_token_demo001"),
base_url=os.environ.get(
"NEXUS_API_URL",
"https://nexuscompute.net/api/v1",
),
)
hw = client.list_hardware()
print(hw)
# Rent hardware (+ SSD at 1 $NEXUS / 250 GB-day when offered)
rental = client.create_rental(hardware_id="hw-id", hours=24)
print(rental)
job = client.submit_job(
"hw-id",
"gemm",
params={"a": [[1, 2]], "b": [[3], [4]]},
)
print(job)
# Optional: encrypted P2P training-data sync
# client.sync_training_data(job, "./dataset")
5. Provider CLI
Host GPU/CPU compute (and SSD storage offers). Docker is required for job isolation; the SDK auto-installs Docker when missing. Browser providers: /provide. Sign in to fill in your API key below.
JavaScript
npx -y @nexuscompute/sdk@latest install-docker --yes --quiet --accept-license
npx -y @nexuscompute/sdk@latest --token YOUR_API_OR_NODE_TOKEN --api-url https://nexuscompute.net/api/v1
npx -y @nexuscompute/sdk@latest --token YOUR_API_OR_NODE_TOKEN --api-url https://nexuscompute.net/api/v1 --daemon
npx -y @nexuscompute/sdk@latest --detect
npx -y @nexuscompute/sdk@latest sync-data receive --token YOUR_API_OR_NODE_TOKEN --port 9477
Python
nexus-install-docker --yes --quiet --accept-license
nexus-provider --token YOUR_API_OR_NODE_TOKEN --api-url https://nexuscompute.net/api/v1
nexus-provider --token YOUR_API_OR_NODE_TOKEN --api-url https://nexuscompute.net/api/v1 --daemon
nexus-provider --detect
nexus-renter sync-data receive --token YOUR_API_OR_NODE_TOKEN --port 9477