---
title: "Create an LXC VPS"
method: POST
path: "/api/lxc"
tags: ["lxc"]
---

# Create an LXC VPS

`POST /api/lxc`

## Request

- Base URL: `https://api.monacloud.vn`
- URL: `https://api.monacloud.vn/api/lxc`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Token`

Tạo dữ liệu hoặc thực thi thao tác tại `/api/lxc`. Phản hồi dùng JSON và tuân theo schema được công bố bên dưới.

## Request body

- LxcCreateRequest: LXC create payload. Callers may either: • pass `package_slug` (e.g. "standard-2") and let the API expand it into cpu/ram_gb/disk_gb from the matching active package, or • pass `cpu`, `ram_gb`, and `disk_gb` directly for a custom spec. Exactly one of those two shapes is required; mixing them is a 422.
  - `app_name` string, required
  - `package_slug` string, nullable
  - `cpu` integer, nullable
  - `ram_gb` integer, nullable
  - `disk_gb` integer, nullable
  - `hostname` string, nullable
  - `billing_mode` 'hourly' | 'monthly'
  - `plan_code` string, nullable
  - `period` 'month' | 'year'

## Response `200`

Successful Response

- JobResponse
  - `id` string, required
  - `status` 'awaiting_upload' | 'queued' | 'pending' | 'running' | 'done' | 'succeeded' | 'failed' | 'retrying' | 'cancelled', required
  - `type` string, required
  - `result` object, nullable
  - `error` string, nullable
  - `attempts` integer
  - `max_attempts` integer
  - `stages` JobStage[]
    - `name` string, required
    - `status` 'running' | 'succeeded' | 'failed', required
    - `started_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `completed_at` string, date-time, nullable
    - `duration_seconds` number, nullable
    - `error` string, nullable
    - `detail` object, nullable
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `sandbox` boolean
  - `expires_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud.md) · [All operations](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud/llms.txt) · [OpenAPI document](https://skmtc.dev/monacloud/apis/mona-cloud-api-compute-truoc-ay-vibecloud/revisions/34a120ed37ce?raw)
