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
| Name | In | Type | Required | Description | Constraints |
|---|---|---|---|---|---|
session_id | path | string | Yes | ||
X-API-Key | header | string | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
session_id | string | Yes | ||
exists | boolean | Yes | ||
vm_assigned | boolean | Yes | ||
vm_status | string | null | No | nullable | |
vm_id | string | null | No | nullable | |
vm_alive | boolean | No | default=false | |
uptime_seconds | number | null | No | nullable | |
expires_in_seconds | number | null | No | nullable | |
created_at | string | null | No | format=date-time, nullable | |
env_status | string | No | default="none" | |
env_error | string | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
detail | array<object> | No | ||
detail[] | object | No | ||
detail[].loc | array<string | integer> | No | ||
detail[].loc[] | string | integer | No | ||
detail[].msg | string | No | ||
detail[].type | string | No |