API
Bạn có thể quản lý máy chủ, số dư, key và yêu cầu hỗ trợ qua REST API. Tài liệu cho con người và AI: OpenAPI và llms.txt.
Bắt đầu
Address: https://0x.cloud/v1. Format: JSON. Time: UTC. Amounts: US dollars. Errors come as {"error": {"code": "...", "message": "..."}}.
You connect to the server through the web console in the dashboard. An administrator tops up the balance when you contact support.
Key
Tạo key trong trang quản trị, ở mục “API và MCP”. Key có quyền, giới hạn số yêu cầu mỗi phút và thời hạn. Key chỉ hiển thị một lần.
curl https://0x.cloud/v1/servers \ -H "Authorization: Bearer $TOKEN"
Giá khi chưa tạo
Thêm "dry_run": true vào yêu cầu tạo máy chủ: bạn nhận được giá chính xác, thời hạn pricing_expires_at và pricing_fingerprint dạng mờ; không có gì được tạo và không bị trừ tiền. Báo giá có hiệu lực 10 phút: hãy cho chủ tài khoản xem, và không thay đổi hay tự tạo dấu vân tay.
curl https://0x.cloud/v1/servers \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"plan": "s1-2", "billing_cycle": "hourly", "dry_run": true}'
→ {"dry_run": true, "currency": "USD", "plan": "s1-2", "billing_cycle": "hourly", "monthly_usd": "7.99", "hourly_usd": "0.010945", "total_usd": "0.00", "pricing_expires_at": "…", "pricing_fingerprint": "…"}Máy chủ đã được tạo
curl https://0x.cloud/v1/servers \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"plan": "s1-2", "os_template": "Ubuntu 24.04", "billing_cycle": "hourly", "ttl_hours": 6, "pricing_fingerprint": ""}'
→ {"data": {"id": "srv_8f3k2m9x4qpz7w1c", "status": "provisioning", ...}, "username": "root", "password": "..."} Create only after the owner explicitly agreed to the price. On 409 price_changed nothing was created or charged: show error.quote, get a new yes and use the new quote with a new Idempotency-Key; never repeat the order automatically. After an unknown network outcome you may repeat only the same body with the same fingerprint and key while the quote is valid. A plan with is_auto_provision: false is issued by a person: get the same quote first, after an explicit yes send POST /v1/server-requests with accept_manual_issue: true and its pricing_fingerprint; this is a request, the server is issued by hand once capacity is confirmed. The root password is shown once. Wait for the installation: GET /v1/servers/srv_8f3k2m9x4qpz7w1c/wait?timeout=25 – repeat while the answer has "ready": false. With ttl_hours the server deletes itself and the unused rest returns to the balance. A deleted server can be brought back within 24 hours: POST /v1/servers/srv_8f3k2m9x4qpz7w1c/restore.
Quyền truy cập cho agent
A human creates the account on the website. They issue the agent a key in the dashboard, under “API”, and set its permissions, spend limit and expiry themselves. MCP clients that support sign-in connect without a key. A new account’s balance is $0.00: top it up through support before the first server.
GET /v1/overview → key, balance, servers in one answer
GET /v1/balance → what is left on the balance
POST /v1/servers {"plan": "s1-2", "dry_run": true} → the price without creatingMCP
Địa chỉ MCP server: https://0x.cloud/v1/mcp (Streamable HTTP). Xác thực bằng chính API key đó trong header Authorization: Bearer. Công cụ: gói và image, số dư, danh sách máy chủ, tạo máy chủ, yêu cầu cấp thủ công, bật/tắt nguồn, đặt lại mật khẩu, cài đặt lại, xóa và khôi phục, yêu cầu hỗ trợ. Xóa và cài đặt lại cần xác nhận rõ ràng confirm: true.
curl https://0x.cloud/v1/mcp \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'Webhook và thử lại
Webhook gửi sự kiện về máy chủ, số dư và yêu cầu hỗ trợ đến địa chỉ https của bạn. Mỗi sự kiện đều được ký: header X-0x-Signature: t=<thời gian>,v1=<chữ ký>, chữ ký là HMAC-SHA256 của chuỗi t.body với secret của webhook. Nếu gửi thất bại, hệ thống thử lại tối đa sáu lần.
curl https://0x.cloud/v1/webhooks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/hooks/0x", "events": ["server.created", "server.deleted"]}'The Idempotency-Key header makes a repeated POST, PATCH or DELETE safe: the same key with the same body within 24 hours returns the stored answer instead of doing the action twice. Use the API with curl or any HTTP client.
Tất cả phương thức
| Mục | Phương thức |
|---|---|
| Máy chủ | GET/POST /servers · GET/PATCH/DELETE /servers/{id} · POST /servers/{id}/restore · POST /servers/{id}/freeze · POST /servers/{id}/unfreeze |
| Thao tác | POST /servers/{id}/power · /install · /password-reset · /resize · GET /servers/{id}/state · /wait · /metrics · /history |
| Danh mục | GET /plans · /images · /locations · /public/pricing |
| Tiền | GET /balance · /transactions · /topups · /payment-methods · /deposit-addresses · /withdrawals |
| Tài khoản | GET /overview · GET /account · /api-keys · /ssh-keys · /referrals |
| Hỗ trợ | GET/POST /tickets · GET /tickets/{id} · POST /tickets/{id}/messages |
| Tích hợp | GET/POST /webhooks · POST /webhooks/{id}/test · GET /webhooks/{id}/deliveries · POST /mcp |
| Không có trong API | command-line tool and SDK |