On this page

Computers are persistent desktop VMs with a Linux desktop, streamed desktop access, and APIs for exec, files, apps, metrics, and desktop control. Base path: /api/v1/computers.

Verbs supported: GET (list/get/config), POST (create/start/stop/restart/clone/resize), PATCH (update), PUT (update), DELETE (delete).


Create a Computer

POST /api/v1/computers

Creates a new computer and begins provisioning.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name
template_typestringYesTemplate ("miosa-desktop")
sizestringNo"small" (4GB/1CPU), "medium" (8GB/2CPU), "large" (16GB/4CPU). Default: "small"
selected_appsstring[]NoApplications to install after boot
workspace_idUUIDNoWorkspace to assign this computer to. Defaults to the tenant’s default workspace.
workspace_slugstringNoExisting or auto-created workspace slug.
workspace_namestringNoWorkspace display name if auto-created.
project_idUUIDNoProject to assign this computer to. Defaults to the workspace default project.
project_slugstringNoExisting or auto-created project slug.
project_namestringNoProject display name if auto-created.
external_workspace_idstringNoYour own customer/account/workspace ID.
external_user_idstringNoYour own end-user ID.
external_project_idstringNoYour own project/app/document ID.

Response - 201 Created

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "tenant_id": "...",
  "owner_user_id": "...",
  "name": "my-computer",
  "slug": "my-computer",
  "template_type": "miosa-desktop",
  "size": "small",
  "vcpus": 1,
  "memory_mb": 4096,
  "status": "provisioning",
  "vm_id": null,
  "workspace_id": "660e8400-e29b-41d4-a716-446655440001",
  "project_id": "770e8400-e29b-41d4-a716-446655440002",
  "external_workspace_id": null,
  "external_user_id": null,
  "external_project_id": null,
  "sandbox_url": "https://my-computer.sandbox.miosa.ai",
  "desktop_url": "https://my-computer.computer.miosa.ai/desktop/index.html",
  "selected_apps": [],
  "settings": {},
  "ai_config": {},
  "agent_session_id": null,
  "agent_status": null,
  "resolution": "1280x720",
  "auto_stop": 0,
  "created_at": "2026-04-11T00:00:00Z",
  "updated_at": "2026-04-11T00:00:00Z"
}

sandbox_url is a legacy preview field on the Computer response. Use desktop_url for the desktop stream and the /computers/{id}/urls endpoint for short-lived desktop and terminal URLs.

Errors

StatusErrorCause
400name is requiredMissing name or template_type
402INSUFFICIENT_CREDITSNot enough credits to create
422TENANT_RESOLUTION_FAILEDCannot determine tenant for user
curl -X POST https://api.miosa.ai/api/v1/computers 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{
    "name": "my-computer",
    "template_type": "miosa-desktop",
    "size": "small",
    "workspace_slug": "dr-smith-clinic",
    "workspace_name": "Dr. Smith Clinic",
    "project_slug": "records-portal",
    "project_name": "Records Portal",
    "external_workspace_id": "clinic_123",
    "external_user_id": "dr-smith-456",
    "external_project_id": "project_789"
  }'

List Computers

GET /api/v1/computers

Returns all computers belonging to the authenticated user’s tenant.

Query Parameters

ParameterTypeDescription
workspace_idUUIDFilter computers to a specific workspace. Omit to return computers across all workspaces.
project_idUUIDFilter computers to a specific project.
external_workspace_idstringFilter by your customer/account/workspace ID.
external_user_idstringFilter by your end-user ID.
external_project_idstringFilter by your project/app/document ID.

Response - 200 OK

{
  "computers": [
    {
      "id": "...",
      "name": "my-computer",
      "status": "running",
      "size": "small",
      "created_at": "2026-04-11T00:00:00Z"
    }
  ],
  "total": 1
}
# All computers
curl https://api.miosa.ai/api/v1/computers 
  -H "Authorization: Bearer $MIOSA_API_KEY"

# Filtered to a workspace
curl "https://api.miosa.ai/api/v1/computers?workspace_id=660e8400-e29b-41d4-a716-446655440001" 
  -H "Authorization: Bearer $MIOSA_API_KEY"

# Filtered to a project
curl "https://api.miosa.ai/api/v1/computers?project_id=770e8400-e29b-41d4-a716-446655440002" 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Get a Computer

GET /api/v1/computers/{id}

Path Parameters

ParameterTypeDescription
idUUIDComputer ID

Response - 200 OK

Full computer object (same as create response, with current status).

Errors

StatusErrorCause
400invalid computer idNot a valid UUID
404computer not foundDoes not exist or belongs to different tenant
curl https://api.miosa.ai/api/v1/computers/{id} 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Update a Computer

PATCH /api/v1/computers/{id}

Currently supports updating agent_session_id only.

Request Body

FieldTypeDescription
agent_session_idstringLink an AI agent session

Response - 200 OK

Updated computer object.

curl -X PATCH https://api.miosa.ai/api/v1/computers/{id} 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"agent_session_id": "session-uuid"}'

Delete a Computer

DELETE /api/v1/computers/{id}

Permanently destroys the VM and removes the computer record.

Response - 200 OK

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "deleted": true
}

Errors

StatusErrorCause
403not a member of this computerNo access to this computer
404computer not foundDoes not exist
curl -X DELETE https://api.miosa.ai/api/v1/computers/{id} 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Start a Computer

POST /api/v1/computers/{id}/start

Resumes a stopped or paused computer.

Response - 200 OK

Updated computer object with status: "running".

Errors

StatusErrorCause
402INSUFFICIENT_CREDITSNot enough credits
409computer cannot be started from its current statusNot in a startable state
curl -X POST https://api.miosa.ai/api/v1/computers/{id}/start 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Stop a Computer

POST /api/v1/computers/{id}/stop

Pauses a running computer. Can be restarted later.

Response - 200 OK

Updated computer object with status: "stopped".

Errors

StatusErrorCause
409computer cannot be stopped from its current statusNot running
curl -X POST https://api.miosa.ai/api/v1/computers/{id}/stop 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Restart a Computer

POST /api/v1/computers/{id}/restart

Stops and immediately restarts a running computer.

Response - 200 OK

Updated computer object.

Errors

StatusErrorCause
409computer must be running to restartNot running
curl -X POST https://api.miosa.ai/api/v1/computers/{id}/restart 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Get Auto-Stop Configuration

GET /api/v1/computers/{id}/auto-stop

Response - 200 OK

{
  "auto_stop_seconds": 3600,
  "enabled": true
}
curl https://api.miosa.ai/api/v1/computers/{id}/auto-stop 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Update Auto-Stop Configuration

PATCH /api/v1/computers/{id}/auto-stop

Request Body

FieldTypeDescription
auto_stop_secondsintegerSeconds of inactivity before auto-stop. 0 or null to disable.

Response - 200 OK

Updated auto-stop configuration.

curl -X PATCH https://api.miosa.ai/api/v1/computers/{id}/auto-stop 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"auto_stop_seconds": 3600}'

Get Desktop Stream Credentials

GET /api/v1/computers/{id}/vnc-credentials

Returns credentials for direct desktop streaming access.

Response - 200 OK

{
  "desktop_url": "https://my-computer.computer.miosa.ai/desktop/index.html",
  "ws_url": "wss://my-computer.computer.miosa.ai/ws/vnc/550e8400-e29b-41d4-a716-446655440000?auth=stream_token",
  "token": "stream_auth_token",
  "expires_at": 1712700060,
  "computer_id": "550e8400-e29b-41d4-a716-446655440000",
  "slug": "my-computer"
}
curl https://api.miosa.ai/api/v1/computers/{id}/vnc-credentials 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Get Stream Token

POST /api/v1/computers/{id}/stream-token

Returns a time-limited auth token for desktop and terminal WebSocket connections.

Response - 200 OK

{
  "token": "stream_auth_token",
  "expires_at": 1712700060
}
curl -X POST https://api.miosa.ai/api/v1/computers/{id}/stream-token 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Get Computer URLs

GET /api/v1/computers/{id}/urls

Returns all connection URLs for the computer.

Response - 200 OK

{
  "desktop_url": "https://my-computer.computer.miosa.ai/desktop/index.html",
  "stream_url": "https://my-computer.computer.miosa.ai/desktop/index.html",
  "terminal_url": "wss://my-computer.computer.miosa.ai/ws/terminal/550e8400-e29b-41d4-a716-446655440000",
  "computer_id": "550e8400-e29b-41d4-a716-446655440000"
}
curl https://api.miosa.ai/api/v1/computers/{id}/urls 
  -H "Authorization: Bearer $MIOSA_API_KEY"

List Installed Apps

GET /api/v1/computers/{id}/apps

Returns the list of applications installed on the computer.

Response - 200 OK

Response containing the list of installed applications.

curl https://api.miosa.ai/api/v1/computers/{id}/apps 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Clone a Computer

POST /api/v1/computers/{id}/clone

Creates a new computer from the current state of an existing one. The source computer must be running; the clone starts in provisioning and progresses to running.

Response - 201 Created

Full computer object for the new clone with its own ID.

curl -X POST https://api.miosa.ai/api/v1/computers/{id}/clone 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Resize a Computer

POST /api/v1/computers/{id}/resize

Changes the vCPU and memory allocation. The computer must be stopped first.

Request Body

FieldTypeRequiredDescription
sizestringYes"small" (4 GB/1 CPU), "medium" (8 GB/2 CPU), "large" (16 GB/4 CPU)

Response - 200 OK

Updated computer object with new size, vcpus, and memory_mb.

curl -X POST https://api.miosa.ai/api/v1/computers/{id}/resize 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"size": "medium"}'

Move a Computer

POST /api/v1/computers/{id}/move

Migrates a computer to a different region. The computer must be stopped. Live migration is not supported; the computer will be moved offline.

Request Body

FieldTypeRequiredDescription
regionstringYesTarget region slug (e.g. "us-east-ny")

Response - 200 OK

Updated computer object with new region.

curl -X POST https://api.miosa.ai/api/v1/computers/{id}/move 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"region": "us-east-ny"}'

Get Metrics

GET /api/v1/computers/{id}/metrics

Returns time-series CPU, RAM, and credit-burn metrics. Useful for dashboards and auto-stop logic.

Query Parameters

ParameterTypeDescription
windowstringTime window: "1h" (default), "24h", "7d"

Response - 200 OK

{
  "cpu_percent": [
    {"ts": "2026-05-17T10:00:00Z", "value": 12.4},
    {"ts": "2026-05-17T10:01:00Z", "value": 8.1}
  ],
  "memory_percent": [
    {"ts": "2026-05-17T10:00:00Z", "value": 45.2}
  ],
  "credits_per_hour": 3
}
curl "https://api.miosa.ai/api/v1/computers/{id}/metrics?window=1h" 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Env Vars

Encrypted per-computer environment variables. Values are decrypted at boot and injected into the VM environment.

List

GET /api/v1/computers/{id}/env

curl https://api.miosa.ai/api/v1/computers/{id}/env 
  -H "Authorization: Bearer $MIOSA_API_KEY"

Create

POST /api/v1/computers/{id}/env

FieldTypeRequiredDescription
namestringYesVariable name (e.g. DATABASE_URL)
valuestringYesPlaintext value - encrypted at rest
curl -X POST https://api.miosa.ai/api/v1/computers/{id}/env 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"name": "DATABASE_URL", "value": "postgres://user:pass@host/db"}'

Update

PATCH /api/v1/computers/{id}/env/{name}

FieldTypeRequiredDescription
valuestringYesNew plaintext value

Delete

DELETE /api/v1/computers/{id}/env/{name}

Returns 200 OK.


Port Exposure

Control per-port visibility for services running inside the computer.

List Ports

GET /api/v1/computers/{id}/ports

Expose a Port

POST /api/v1/computers/{id}/ports

FieldTypeRequiredDescription
portintegerYesPort number (1-65535)
visibilitystringYes"public", "private", or "protected"

Update Port Visibility

PATCH /api/v1/computers/{id}/ports/{port}

Remove Port

DELETE /api/v1/computers/{id}/ports/{port}

curl -X POST https://api.miosa.ai/api/v1/computers/{id}/ports 
  -H "Authorization: Bearer $MIOSA_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{"port": 3000, "visibility": "public"}'

Common Errors

StatusCodeCause
400invalid computer idPath parameter is not a valid UUID
402INSUFFICIENT_CREDITSNot enough credits to start or create
403not a member of this computerNo access to this computer
404computer not foundDoes not exist or belongs to a different tenant
409COMPUTER_NOT_RUNNINGOperation requires a running computer
502AGENT_UNAVAILABLEComputer command service unavailable

See also

  • Desktop API - screenshot, click, type, scroll, drag, windows
  • Files API - read, write, stat, mkdir, rename, copy, chmod, download
  • Exec API - bash and Python execution
  • Snapshots API - create, restore, and delete checkpoints
  • Events (SSE) - computer lifecycle event stream
  • Regions - available regions for computer placement

Was this helpful?