Runtime API Access
Manage the VM's internal server and access tokens. The Oblien API authorizes access and issues tokens. Runtime traffic then goes directly through vm.oblien.com to the VM, without passing through the API process. These examples use /v2; SDK 3 continues to use /v1.
Server status
Check if the internal server is enabled and running.
const status = await client.vms.apiAccess.status('0123456789abcdef');
console.log(status.enabled); // true
console.log(status.running); // trueGET /vms/:vmId/runtime-api-accesscurl "https://api.oblien.com/v2/vms/0123456789abcdef/runtime-api-access" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Enable server
Enable the internal HTTP server on port 9990 inside the VM. Returns a signed Gateway JWT for accessing the Runtime API at vm.oblien.com. Enabling also configures the managed Runtime API gateway path and verifies an authenticated runtime request.
Application public ingress may remain disabled. Runtime access requires a valid token and does not open other application ports. Application Edge, private VM traffic and public TCP still follow their firewall rules.
const result = await client.vms.apiAccess.enable('0123456789abcdef');
console.log(result.token); // Gateway JWT - use with vm.oblien.comPOST /vms/:vmId/runtime-api-access/enablecurl -X POST "https://api.oblien.com/v2/vms/0123456789abcdef/runtime-api-access/enable" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Response
{
"success": true,
"enabled": true,
"token": "eyJhbG...",
"expires_at": "2026-11-18T20:05:00.000Z"
}Use token as Authorization: Bearer <token> at vm.oblien.com. V2 tokens last up to five minutes; v1 compatibility tokens last up to one hour. Parent credential or access-grant expiry may shorten that window. Use the returned expires_at as the deadline. The guest credential is encrypted inside the signed token.
Renew a gateway token
GET /v2/vms/:vmId/runtime-api-access/token returns { success, token, expires_at } after checking the caller's current access. It does not enable the runtime or rotate its guest credential.
const access = await client.vms.apiAccess.getToken('0123456789abcdef');SDK 4's client.vms.runtime(id) renews automatically before new requests and connections. Concurrent calls share one renewal. Existing streams continue after admission-token expiry. A reconnect needs a valid token. Commands and uploads are never automatically replayed to retry authentication.
Disable server
Disable the internal server.
await client.vms.apiAccess.disable('0123456789abcdef');POST /vms/:vmId/runtime-api-access/disablecurl -X POST "https://api.oblien.com/v2/vms/0123456789abcdef/runtime-api-access/disable" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Response
{
"success": true,
"enabled": false
}Rotate token
Rotate the connection token and return a fresh Gateway JWT. Use this to invalidate old tokens.
const result = await client.vms.apiAccess.rotateToken('0123456789abcdef');
console.log(result.token); // Fresh gateway JWTPOST /vms/:vmId/runtime-api-access/tokencurl -X POST "https://api.oblien.com/v2/vms/0123456789abcdef/runtime-api-access/token" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Response
{
"success": true,
"token": "eyJhbG...",
"expires_at": "2026-11-18T20:05:00.000Z"
}Raw token
Get the raw connection token and VM private IP. Use this for VM-to-VM communication over the internal network, bypassing the edge gateway. Raw credential export requires an unrestricted owner credential; scoped and shared callers must use gateway tokens.
Direct VM-to-VM calls require a permitted private source, such as a private link, and port 9990 allowed for that source. A runtime token does not bypass the host firewall.
const raw = await client.vms.apiAccess.rawToken('0123456789abcdef');
console.log(raw.token); // hex connection token
console.log(raw.ip); // "10.x.x.x"
console.log(raw.port); // 9990GET /vms/:vmId/runtime-api-access/token/rawcurl "https://api.oblien.com/v2/vms/0123456789abcdef/runtime-api-access/token/raw" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Response
{
"success": true,
"token": "a1b2c3d4e5f6...",
"ip": "10.40.0.5",
"port": 9990
}Use the raw token with Authorization: Bearer <token> when calling the target VM directly:
curl "http://10.40.0.5:9990/files?path=/app" \
-H "Authorization: Bearer a1b2c3d4e5f6..."Requires a private link between the two VMs.
Endpoint summary
| Endpoint | Method | Description |
|---|---|---|
/runtime-api-access | GET | Server status |
/runtime-api-access/enable | POST | Enable server, get Gateway JWT |
/runtime-api-access/disable | POST | Disable server |
/runtime-api-access/token | GET | Current Gateway JWT |
/runtime-api-access/token | POST | Rotate token, get fresh Gateway JWT |
/runtime-api-access/token/raw | GET | Raw connection token + VM IP |