Overview
Everything you do in the OctaSpace dashboard you can also do from code or from a terminal: find machines, start and stop sessions, read logs, check your balance, and manage the prices of the nodes you host. This section explains how.
What you can automate
Task | Examples |
|---|---|
Rent compute | Find a GPU machine by model, location or price, start a container on it, connect over SSH, restart or stop it |
Run render jobs | List render nodes, start one or many render sessions in a single call |
Use VPN | List VPN nodes and start a VPN session |
Manage sessions | List your running sessions, wait until a session is ready, read container logs, stop sessions |
Host nodes | List your nodes, change their prices, schedule maintenance |
Track spending | Read your balance and what each session has cost so far |
Read market data | Network statistics, current and historical GPU prices, GPU locations |
Three ways to work with OctaSpace
All three use the same API and the same API key. Pick the one that fits your task; you can mix them.
Tool | Best for | Get it |
|---|---|---|
REST API | Any language, or when you want full control over requests | https://api.octa.space, schema at /openapi.json |
SDKs | Applications and services in Go or JavaScript / TypeScript (the two official SDKs today): typed models, errors, retries and session helpers out of the box | Go: go get github.com/octaspace/go-sdk. JavaScript: npm install @octaspace/sdk |
CLI (octa) | Working from a terminal, shell scripts, cron jobs and CI pipelines | Binaries on the release page |
Not sure which to choose?
- You want to try things out or rent a machine by hand without the dashboard: use the CLI.
- You are writing a program in Go, Node.js, Deno, Bun or for the browser: use the SDK.
- You use another language (Python, Rust, PHP...): call the API directly or generate a client from the OpenAPI schema.
- You need a quick script, for example "stop all sessions every night": the CLI with -o json and jq is usually enough.
API at a glance
Base URL | https://api.octa.space |
|---|---|
Format | JSON over HTTPS |
Authentication | Authorization: Bearer <api key>, keys start with octa_ak_ |
Schema | OpenAPI 3: /openapi.json, interactive explorer at /swagger |
Amounts | Integers in micro-USD: 1 = $0.000001, 1000000 = $1 |
Errors | HTTP status code and a JSON body {"message": "..."} |
Resources
Resource | Endpoints | Key required |
|---|---|---|
Compute machines | GET /services/compute, POST /services/compute, POST /services/compute/{uuid}/restart | Listing: no. Start, restart: yes |
Compute applications | GET /compute/apps | No (with a key you also see your own apps) |
Render nodes | GET /services/render, POST /services/render | Listing: no. Start: yes |
VPN nodes | GET /services/vpn, POST /services/vpn | Listing: no. Start: yes |
Sessions | GET /sessions, GET /services/{uuid}/info, GET /services/{uuid}/logs, POST /services/{uuid}/stop | Yes |
Hosting | GET /hosting/nodes, /hosting/nodes/{number}, /hosting/nodes/{number}/prices, /hosting/nodes/{number}/maintenance | Yes |
Account | GET /accounts/balance | Yes |
Network and market | GET /network, /network/history, /stats/gpu/current, /stats/gpu/history, /stats/gpu/locations, /stats/mining | No |
The full list of endpoints, parameters and responses is in the API reference.
Identifiers
You will meet two kinds of identifiers everywhere:
- Node number, for example 7KQ4-M2XD-4. It names a machine (node) and stays with it for its whole life. You get it from the machine listings and pass it to start a session. Case, dashes and spaces are ignored, O reads as 0, I and L as 1, so 7kq4m2xd4 is the same node. The last symbol is a check symbol: a typo is rejected with 400 instead of starting a session on the wrong machine.
- Session UUID, for example 96e33710-ec12-11ed-8588-fa163e49e8aa. It names one session (one start of a service). It is returned when you start a service and used to get its info, logs, restart and stop it.
Rate limits
Requests | Limit per minute |
|---|---|
Without an API key | 60 per IP address |
With an API key | 300 per account |
Starting and restarting sessions | 10 per account |
Every response carries the RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds) headers. Over the limit the API answers 429 with a Retry-After header. The SDKs and the CLI handle this for you: read requests are retried automatically, and the error tells you how long to wait.
Security of API keys
An API key acts on behalf of your account: anyone who has it can start sessions charged to your balance.
- Keep keys out of source code, version control, shared logs and browser bundles. Pass them through environment variables or a secret store.
- Create a separate key for each program or machine, so that you can delete one without affecting the others.
- If a key leaks, delete it in the dashboard under Account → Credentials → API Keys. Every program that uses it stops working at once.
Next steps
- Quick start: create a key and start your first session in five minutes.
- API reference: every endpoint and field.
- SDKs: Go, JavaScript / TypeScript.
- CLI: installation and command reference.