Skip to main content

Kill Vm

POST /kill

Kill the VM associated with a session.

This endpoint allows users to manually terminate their VM before the scheduled lifetime expires. Useful for freeing up resources when done with a session.

Multi-node routing:

  • The kill is dispatched via Celery to vm_queue_\{worker_id\} of the owner worker; no HTTP inter-node proxying happens at this layer. If the task lands on the wrong worker and the multinode.strict_kill_ownership flag is on, the task itself redispatches to the authoritative owner once.

Args: session_id: The session UUID whose VM should be killed

Returns: Success message with the killed VM ID

Raises: 400: Invalid session_id format 403: User doesn't own the session 404: Session not found or no VM assigned to session

Authentication

Requires authentication via: OAuth2PasswordBearer.

Parameters

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Request Body

Required: Yes

application/json

Resolved schema:

{
"properties": {
"session_id": {
"type": "string",
"title": "Session Id"
}
},
"type": "object",
"required": [
"session_id"
],
"title": "KillVMRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
session_idstringYes

Responses

200

Successful Response

application/json

Resolved schema:

{}

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