Skip to main content

Get Session Status

GET /v1/sessions/status/{session_id}

Check if a session and its VM are alive.

This endpoint provides a simple aliveness check for a session, including:

  • Whether the session exists
  • Whether a VM is assigned
  • Whether the VM is alive (active status)
  • VM uptime and remaining lifetime

Args: session_id: Your session UUID

Returns:

  • exists: True if session exists
  • vm_assigned: True if VM is assigned to this session
  • vm_alive: True if VM exists and status is 'active'
  • vm_status: Current VM status ('active', 'killed', etc.)
  • vm_id: The VM identifier (if assigned)
  • uptime_seconds: How long VM has been running (if alive)
  • expires_in_seconds: Time until VM expires (if alive)
  • created_at: When the session was created

Example: GET /v1/sessions/status/550e8400-e29b-41d4-a716-446655440000

Response (VM alive): { "session_id": "550e8400-e29b-41d4-a716-446655440000", "exists": true, "vm_assigned": true, "vm_status": "active", "vm_id": "vmid-abc-15", "vm_alive": true, "uptime_seconds": 123.45, "expires_in_seconds": 176.55, "created_at": "2025-01-10T12:34:56" }

Response (no VM assigned yet): { "session_id": "550e8400-e29b-41d4-a716-446655440000", "exists": true, "vm_assigned": false, "vm_alive": false, "vm_status": null, "vm_id": null, "uptime_seconds": null, "expires_in_seconds": null, "created_at": "2025-01-10T12:34:56" }

Response (VM dead): { "session_id": "550e8400-e29b-41d4-a716-446655440000", "exists": true, "vm_assigned": true, "vm_status": "killed", "vm_id": "vmid-abc-15", "vm_alive": false, "uptime_seconds": null, "expires_in_seconds": 0, "created_at": "2025-01-10T12:34:56" }

Authentication

Requires authentication via: OAuth2PasswordBearer.

Parameters

NameInTypeRequiredDescriptionConstraints
session_idpathstringYes
X-API-Keyheaderstring | nullNonullable

Responses

200

Successful Response

application/json

Resolved schema:

{
"properties": {
"session_id": {
"type": "string",
"title": "Session Id"
},
"exists": {
"type": "boolean",
"title": "Exists"
},
"vm_assigned": {
"type": "boolean",
"title": "Vm Assigned"
},
"vm_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Vm Status"
},
"vm_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Vm Id"
},
"vm_alive": {
"type": "boolean",
"title": "Vm Alive",
"default": false
},
"uptime_seconds": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Uptime Seconds"
},
"expires_in_seconds": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Expires In Seconds"
},
"created_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Created At"
},
"env_status": {
"type": "string",
"title": "Env Status",
"default": "none"
},
"env_error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Env Error"
}
},
"type": "object",
"required": [
"session_id",
"exists",
"vm_assigned"
],
"title": "SessionStatusResponse",
"description": "Response model for session status check."
}

Field details:

FieldTypeRequiredDescriptionConstraints
session_idstringYes
existsbooleanYes
vm_assignedbooleanYes
vm_statusstring | nullNonullable
vm_idstring | nullNonullable
vm_alivebooleanNodefault=false
uptime_secondsnumber | nullNonullable
expires_in_secondsnumber | nullNonullable
created_atstring | nullNoformat=date-time, nullable
env_statusstringNodefault="none"
env_errorstring | nullNonullable

422

Validation Error

application/json

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo