Claude Code

CLI Tool

ເຄື່ອງມື​ການ​ຂຽນ​ໂປແກຼມ​ຂອງ​ບໍລິສັດ Anthropic ທີ່​ຢູ່​ໃນ​ເຕົາ​ໄຟ​ຂອງທ່ານ. ສົ່ງ​ມັນ​ໄປ​ທີ່​ການ​ອ້າງອີງ API ຂອງ VPS.org ເປັນ​ໄຟ​ລ໌ CLAUDE.md ແລະ​ໃຊ້​ພາສາ​ທໍາມະ​ຊາດ​ເພື່ອ​ຈັດ​ຕັ້ງ​ເຊີບເວີ, ຈັດການ​ໂດເມນ ແລະ​ຕັ້ງ​ຄ່າ​ພື້ນຖານ​ໂຄງລ່າງ.

https://docs.anthropic.com/en/docs/claude-code
ດາວໂຫລດ.md ໄຟລ໌
$ claudecode "ຂະຫຍາຍແອັບພລິເຄຊັນຂອງຂ້ອຍໄປ VPS.org"
កំពុង​បង្កើត​ម៉ាស៊ីន​បម្រើ... ສຳເລັດ
កំពុង​ចុះឈ្មោះ​ដែន... ສຳເລັດ
កំពុង​កំណត់​រចនា​សម្ព័ន្ធ DNS... ສຳເລັດ
ກຳລັງ​ຕິດຕັ້ງ​កម្មវិធី... ສຳເລັດ
ແອັບພລິເຄຊັນຢູ່ທີ່ https://myapp.com

Claude Code ຄຸນສົມບັດ

ຕົວ​ຕັ້ງ​ຄ່າ​ສະຖານີ

ແລ່ນ​ໂດຍ​ກົງ​ໃນ​ເຕຣມ​ເລດ​ຂອງທ່ານ​ດ້ວຍ​ການ​ເຂົ້າ​ເຖິງ​ສໍລ໌​ເຕັມ ເພື່ອ​ປະຕິບັດ​ຄຳ​ສັ່ງ ແລະ API ໂທ.

ການ​ປະຕິບັດ Agentic

ແຜນທີ່ແລະປະຕິບັດການຫຼາຍຂັ້ນຕອນ workflows ຢ່າງເປັນເອກະລາດໂດຍບໍ່ມີການເຂົ້າມາຮ່ວມມື.

ການສະ​ໜັບສະໜູນ​ເອກະສານ​ບັນຍາກາດ

ອ່ານ CLAUDE. md ຈາກ​ໂຄງການ​ຕົ້ນຕໍ​ຂອງ​ທ່ານ, ເຮັດໃຫ້​ມັນ​ດີ​ທີ່​ສຸດ​ສຳລັບ​ການ​ផ្ទុກ​ການ​ອ້າງອີງ API.

ວິທີການ Claude Code ເຮັດວຽກກັບ VPS.org

ການນໍາໃຊ້ Claude ໂຄດກັບ VPS.org

Claude Code ສາມາດອ່ານເອກະສານການອ້າງອີງ API VPS.org ແລະໃຊ້ມັນເປັນສະພາບການເພື່ອຂຽນແລະປະຕິບັດການໂທ API ທີ່ຕິດຕັ້ງເຊີບເວີ, ລົງທະບຽນໂດເມນ, ແລະຕັ້ງຄ່າ DNS. ພຽງແຕ່ວາງເອກະສານ.md ໃນໂຄງການ root ຂອງທ່ານເປັນ CLAUDE. md ແລະ Claude Code ຈະໃຊ້ມັນເປັນສະພາບການໂດຍອັດຕະໂນມັດ.

ຄໍາ​ແນະ​ນໍາ​ການ​ຕັ້ງ​ຄ່າ

  1. ດາວໂຫລດ.md ໄຟລ໌ ຂ້າງລຸ່ມນີ້
  2. ເກັບໄວ້ໃນນາມ CLAUDE.md ໃນໂປຼເຈັກຣັດຂອງທ່ານ
  3. ປະຕິບັດ claude ໃນ​ເຕຣມິນ​ຂອງທ່ານ
  4. ຖາມ Claude ວ່າຈະນຳໃຊ້ແອັບຂອງທ່ານໄປທີ່ VPS.org

ຄໍາ​ສັ່ງ​ຕົວຢ່າງ

  • "ສ້າງເຄື່ອງແມ່ຂ່າຍ VPS ໃໝ່ ດ້ວຍ Ubuntu 22.04 ໃນແຜນມາດຕະຖານ"
  • "ລົງທະບຽນ myapp.com ແລະ ສະແດງມັນໄປທີ່ ເຊີເວີຂອງຂ້ອຍ"
  • "ຕັ້ງຄ່າບັນທຶກ DNS ສຳ ລັບ myapp.com ດ້ວຍບັນທຶກທີ່ສະແດງໃຫ້ເຫັນ IP ຂອງເຊີບເວີຂອງຂ້ອຍ"
  • "ສ້າງ​ການ​ບີບອັດ​ຂອງ​ເຊີບເວີ​ເວັບ​ຂອງ​ຂ້ອຍ"

ເອກະສານ​ອ້າງອີງ API

ນີ້​ແມ່ນ​ເນື້ອໃນ​ຂອງ​ໄຟລ໌.md ເຕັມ. ຄັດລອກ​ມັນ ຫຼື ດາວໂຫລດ​ມັນ​ເພື່ອ​ໃຊ້​ກັບ Claude Code.

ດາວໂຫລດ.md ໄຟລ໌
# VPS.org API Integration Guide for Claude Code

This document provides Claude Code with the information needed to interact
with the VPS.org cloud hosting API. Use these endpoints to create servers,
register domains, configure DNS, and manage cloud infrastructure.

Place this file as `CLAUDE.md` in your project root for automatic context loading.

## Quick Start
1. Get API token from https://admin.vps.org/account/developers/
2. Use `Authorization: Bearer <your-token>` header in all requests
3. Base URL: https://admin.vps.org/api/v1/

## Authentication

All API requests require a Bearer token. Generate one at https://admin.vps.org/account/developers/

```
Authorization: Bearer YOUR_API_TOKEN
```

**Base URL:** `https://admin.vps.org/api/v1/`

**Rate Limit:** 300 requests per 5 minutes per token.

**Token Format:** Tokens start with `vps_` followed by 64 hex characters. They are SHA256-hashed before storage.

**Permission System:** Tokens use `app:action` format permissions (e.g., `servers:create`, `dns:*`, `*:*` for full access).

---

## Servers

### List All Servers
```
GET /api/v1/servers/
```
**Query Parameters:**
- `status` (string, optional) — Filter by status: `active`, `stopped`, `suspended`
- `location` (string, optional) — Filter by datacenter location

**Response (200):**
```json
{
  "count": 2,
  "results": [
    {
      "id": 12345,
      "name": "web-server-01",
      "hostname": "web01.example.com",
      "status": "active",
      "ip_address": "203.0.113.10",
      "location": "us-west",
      "plan": {"id": 1, "name": "Standard VPS", "vcpus": 2, "memory": 4096, "storage": 80},
      "os": {"id": 5, "name": "Ubuntu 22.04 LTS"},
      "created_at": "2025-01-10T14:30:00Z"
    }
  ]
}
```

### Create New Server
```
POST /api/v1/servers/
```
**Request Body:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| name | string | Yes | Server name (alphanumeric, hyphens allowed) |
| plan_id | integer | Yes | ID of the VPS plan |
| os_id | integer | Yes | ID of the operating system |
| location | string | Yes | Datacenter location code |
| hostname | string | No | Server hostname (FQDN) |
| ssh_key_id | integer | No | SSH key ID to install |
| backups_enabled | boolean | No | Enable automatic backups (default: false) |

**Response (201):**
```json
{
  "id": 12347,
  "name": "web-server-02",
  "hostname": "web02.example.com",
  "status": "provisioning",
  "ip_address": null,
  "location": "us-west",
  "plan": {"id": 1, "name": "Standard VPS", "vcpus": 2, "memory": 4096, "storage": 80},
  "os": {"id": 5, "name": "Ubuntu 22.04 LTS"},
  "backups_enabled": true,
  "message": "Server is being provisioned. This may take 2-5 minutes."
}
```

### Get Server Details
```
GET /api/v1/servers/{server_id}/
```
**Response (200):** Full server object including `resource_usage` (cpu_percent, memory_used, disk_used, bandwidth_used).

### Update Server
```
PUT /api/v1/servers/{server_id}/
```
**Request Body:** `name` (string), `hostname` (string), `backups_enabled` (boolean) — all required.

### Partial Update Server
```
PATCH /api/v1/servers/{server_id}/
```
Only provided fields will be updated.

### Delete Server
```
DELETE /api/v1/servers/{server_id}/
```
**Response:** 204 No Content. This action cannot be undone.

### Power Management
```
POST /api/v1/servers/{server_id}/start/    — Power on a stopped server
POST /api/v1/servers/{server_id}/stop/     — Gracefully shut down a running server
POST /api/v1/servers/{server_id}/reboot/   — Restart a running server
```
**Response (200):**
```json
{
  "status": "success",
  "message": "Server is starting",
  "server": {"id": 12345, "name": "web-server-01", "status": "starting"}
}
```

---

## Plans

### List All Plans
```
GET /api/v1/plans/
```
Returns available VPS plans with pricing, CPU, memory, storage, and bandwidth details.

### Get Plan Details
```
GET /api/v1/plans/{plan_id}/
```

---

## Operating Systems

### List Operating Systems
```
GET /api/v1/operating-systems/
```
Returns available OS images for server deployment (Ubuntu, Debian, CentOS, etc.).

### Get OS Details
```
GET /api/v1/operating-systems/{os_id}/
```

---

## Locations

### List Datacenter Locations
```
GET /api/v1/locations/
```
Returns available datacenter regions with their codes and capabilities.

---

## Backups

### List Server Backups
```
GET /api/v1/servers/{server_id}/backups/
```

### Create Backup
```
POST /api/v1/servers/{server_id}/backups/
```
**Request Body:**
- `name` (string, optional) — Backup name

### Restore Backup
```
POST /api/v1/servers/{server_id}/backups/{backup_id}/restore/
```

---

## Snapshots

### List Snapshots
```
GET /api/v1/snapshots/
```

### Create Snapshot
```
POST /api/v1/servers/{server_id}/snapshots/
```
**Request Body:**
- `name` (string, optional) — Snapshot name

### Restore Snapshot
```
POST /api/v1/snapshots/{snapshot_id}/restore/
```

### Delete Snapshot
```
DELETE /api/v1/snapshots/{snapshot_id}/
```

---

## SSH Keys

### List SSH Keys
```
GET /api/v1/ssh-keys/
```

### Add SSH Key
```
POST /api/v1/ssh-keys/
```
**Request Body:**
- `name` (string, required) — Key name
- `public_key` (string, required) — SSH public key content

### Delete SSH Key
```
DELETE /api/v1/ssh-keys/{key_id}/
```

---

## Domains

### List All Domains
```
GET /api/v1/domains/
```
**Query Parameters:**
- `status` (string, optional) — Filter: `active`, `pending`, `expired`, `locked`
- `search` (string, optional) — Search domains by name

**Response (200):**
```json
{
  "count": 2,
  "results": [
    {
      "id": 101,
      "domain_name": "example.com",
      "status": "active",
      "registration_date": "2023-01-15T10:30:00Z",
      "expiration_date": "2026-01-15T10:30:00Z",
      "auto_renew": true,
      "locked": true,
      "nameservers": ["ns1.vps.org", "ns2.vps.org"],
      "privacy_protection": true
    }
  ]
}
```

### Register New Domain
```
POST /api/v1/domains/
```
**Request Body:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| domain_name | string | Yes | Domain to register (e.g., "example.com") |
| years | integer | No | Registration period 1-10 (default: 1) |
| auto_renew | boolean | No | Enable auto-renewal (default: true) |
| privacy_protection | boolean | No | Enable WHOIS privacy (default: true) |
| nameservers | array | No | Custom nameservers (default: VPS.org) |

**Response (201):** Domain object with `status: "pending"`. Registration takes 5-10 minutes.

### Get Domain Details
```
GET /api/v1/domains/{domain_id}/
```

### Update Domain Settings
```
PUT /api/v1/domains/{domain_id}/
```
**Request Body:** `auto_renew`, `privacy_protection`, `nameservers`, `locked` — all optional.

### Delete Domain
```
DELETE /api/v1/domains/{domain_id}/
```
Removes from account only. Domain registration remains active.

### Transfer Domain
```
POST /api/v1/domains/{domain_id}/transfer/
```
**Request Body:**
- `auth_code` (string, required) — EPP/Authorization code from current registrar
- `auto_renew` (boolean, optional) — Enable auto-renewal after transfer

---

## DNS Zones

### List DNS Zones
```
GET /api/v1/dns-zones/
```
**Query Parameters:**
- `domain` (string, optional) — Filter by exact domain name

**Response (200):**
```json
[
  {
    "uuid": "abc123-def456-ghi789",
    "domain": "example.com",
    "created_at": "2024-01-15T10:30:00Z",
    "record_count": 12
  }
]
```

### Create DNS Zone
```
POST /api/v1/dns-zones/
```
**Request Body:**
- `domain` (string, required) — Domain name (e.g., "example.com")

### Get DNS Zone Details
```
GET /api/v1/dns-zones/{uuid}/
```
Returns zone with all records.

### Delete DNS Zone
```
DELETE /api/v1/dns-zones/{uuid}/
```

---

## DNS Records

### List Records in Zone
```
GET /api/v1/dns-zones/{uuid}/records/
```

### Create DNS Record
```
POST /api/v1/dns-zones/{uuid}/records/
```
**Request Body:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| record_type | string | Yes | A, AAAA, CNAME, MX, TXT, NS, SRV, CAA |
| name | string | Yes | Record name (@ for root, subdomain, or FQDN) |
| value | string | Yes | Record value (IP, hostname, text) |
| ttl | integer | No | Time to live in seconds (default: 3600) |
| priority | integer | MX/SRV | Priority (required for MX and SRV records) |

**Response (201):**
```json
{
  "uuid": "rec-003",
  "record_type": "A",
  "name": "www",
  "value": "192.0.2.1",
  "ttl": 3600,
  "priority": null,
  "created_at": "2026-01-18T16:50:00Z"
}
```

### Manage Individual Records
```
GET    /api/v1/dns-records/{uuid}/   — Get record details
PUT    /api/v1/dns-records/{uuid}/   — Full update (all fields required)
PATCH  /api/v1/dns-records/{uuid}/   — Partial update
DELETE /api/v1/dns-records/{uuid}/   — Delete record
```

**Supported Record Types:** A, AAAA, CNAME, MX, TXT, NS, SRV, CAA

---

## Common Workflows

### Deploy a New Application
```
1. GET  /api/v1/plans/                              — Choose a plan
2. GET  /api/v1/operating-systems/                   — Choose an OS
3. GET  /api/v1/locations/                           — Choose a datacenter
4. POST /api/v1/servers/                             — Create the server
   Body: {"name": "myapp", "plan_id": 1, "os_id": 5, "location": "us-west"}
5. GET  /api/v1/servers/{id}/                        — Poll until status is "active"
6. SSH into server using the IP address to deploy your application
```

### Set Up a Domain with DNS
```
1. POST /api/v1/domains/                             — Register domain
   Body: {"domain_name": "myapp.com", "years": 1}
2. POST /api/v1/dns-zones/                           — Create DNS zone
   Body: {"domain": "myapp.com"}
3. POST /api/v1/dns-zones/{uuid}/records/            — Add A record
   Body: {"record_type": "A", "name": "@", "value": "SERVER_IP", "ttl": 3600}
4. POST /api/v1/dns-zones/{uuid}/records/            — Add www CNAME
   Body: {"record_type": "CNAME", "name": "www", "value": "myapp.com", "ttl": 3600}
```

### Full Deployment (Server + Domain + DNS)
```
1. Create server (see above)
2. Wait for server to become active, note the IP address
3. Register domain
4. Create DNS zone
5. Add A record pointing to server IP
6. Add any additional records (MX for email, TXT for verification, etc.)
7. SSH into server and deploy your application
8. (Optional) Set up SSL with Let's Encrypt
```

---

## Error Codes

| Status | Description |
|--------|-------------|
| 200 | Success |
| 201 | Created |
| 204 | No Content (successful deletion) |
| 400 | Bad Request — Invalid parameters |
| 401 | Unauthorized — Invalid or missing token |
| 402 | Payment Required — Insufficient credits |
| 403 | Forbidden — Insufficient permissions |
| 404 | Not Found — Resource doesn't exist |
| 429 | Too Many Requests — Rate limit exceeded |
| 500 | Internal Server Error |

**Rate Limit Headers:**
- `X-RateLimit-Limit` — Maximum requests allowed
- `X-RateLimit-Remaining` — Requests remaining
- `X-RateLimit-Reset` — Timestamp when limit resets

---

## Nameserver Infrastructure

- **ns1.vps.org** (38.248.6.195) — Primary master with DNSSEC
- **ns2.vps.org** (38.248.6.196) — Secondary
- **ns3.vps.org** (38.248.6.197) — Secondary

## Support

- **Support Tickets:** https://admin.vps.org/tickets/
- **Email:** hello@vps.org
- **Documentation:** https://www.vps.org/docs/
- **API Docs:** https://www.vps.org/api/