{"components":{"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed in the current 60-second window (the stricter of the per-key and per-account limits).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time (seconds) when the current window ends.","schema":{"type":"integer"}},"X-Request-Id":{"description":"Identifier of this request. Quote it when contacting support.","schema":{"type":"string"}}},"responses":{"Forbidden":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403."},"RateLimited":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"Unauthorized":{"content":{"application/json":{"example":{"error":{"code":"key_invalid","message":"The API key cannot be used (wrong, expired, revoked, or IP not allowed)"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The key is missing or not usable: `unauthenticated` (no credentials), `key_invalid`, `key_expired`, `key_revoked`, `key_ip_denied` (the caller IP is not in the key allow-list), `api_keys_disabled`, or `site_mismatch` (the key belongs to another site)."}},"schemas":{"AccountActivityItem":{"description":"One entry of the activity timeline.","properties":{"amount_cents":{"description":"Money involved in US cents, if any.","type":["integer","null"]},"at":{"description":"When it happened (Unix time, seconds, UTC)","type":"integer"},"group":{"description":"Category of the entry. Use it as the `group` filter.","enum":["vm","billing","security","account"],"type":"string"},"i18n":{"description":"Translation key that describes the entry, for example `act.vm.start` or `act.wallet.topup`. Render the text on your side with `params`; the key is stable, new keys may appear.","type":"string"},"id":{"description":"Stable identifier of the entry, prefixed by its origin (`e:` server event, `l:` wallet, `n:` notification, `s:` blocked attack, `a:` AI analysis).","type":"string"},"invoice_id":{"description":"Related invoice, if any. Use it with the invoice calls.","type":["integer","null"]},"level":{"description":"`warn` for problems that may need attention (failed deployment, locked server, low balance, blocked attack).","enum":["info","warn"],"type":"string"},"params":{"additionalProperties":true,"description":"Values to substitute into the text, for example `hostname`, `amount_cents`, `ip`. The keys depend on `i18n`.","type":"object"},"read_at":{"description":"For notifications: when it was marked as read, `null` while unread. Always `null` for other entries (Unix time, seconds, UTC)","type":["integer","null"]},"source":{"description":"Where the entry comes from. `ai_analysis` is an automatic analysis of an attack on one of your IP addresses; its `params.task_id` is the id to pass to `GET /v1/portal/ai-analyses/{id}`.","enum":["vm_event","ledger","notification","ddos_event","ai_analysis"],"type":"string"},"vm_hostname":{"description":"Hostname of the related server, if any.","type":["string","null"]},"vm_id":{"description":"UUID of the related server, if any.","type":["string","null"]}},"required":["id","source","at","group","i18n","params","vm_id","vm_hostname","level","read_at","amount_cents","invoice_id"],"type":"object","x-order":["id","source","at","group","i18n","params","vm_id","vm_hostname","level","read_at","amount_cents","invoice_id"]},"AccountApiKey":{"description":"An API key of the account. The secret itself is shown only once, when the key is created in the dashboard, and is never returned by the API.","properties":{"allow_ips":{"description":"If not empty, the key only works from these addresses.","items":{"description":"IP address or CIDR range.","type":"string"},"type":"array"},"created_at":{"description":"When the key was created (Unix time, seconds, UTC)","type":"integer"},"expires_at":{"description":"When the key expires, `null` for no expiry (Unix time, seconds, UTC)","type":["integer","null"]},"hint":{"description":"Beginning of the key so you can recognise it. Never enough to use it. When listed through an API key it is 7 characters (`vk_` plus 4).","type":"string"},"id":{"description":"Key identifier (not the secret), for example `ak3f9c2d1e7a`.","type":"string"},"last_ip":{"description":"IP address of the last call made with the key.","type":["string","null"]},"last_used_at":{"description":"When the key was last used, `null` if never (Unix time, seconds, UTC)","type":["integer","null"]},"name":{"description":"Name you gave the key.","type":"string"},"req_count":{"description":"Number of calls made with the key.","type":"integer"},"revoked_at":{"description":"When the key was revoked, `null` if it was not (Unix time, seconds, UTC)","type":["integer","null"]},"scopes":{"description":"Permissions granted to the key. See the scope list in the API reference.","items":{"description":"Scope, for example `vm:read`.","type":"string"},"type":"array"},"status":{"description":"`revoked` once revoked, `expired` after `expires_at`, otherwise `active`.","enum":["active","expired","revoked"],"type":"string"}},"required":["id","name","hint","scopes","allow_ips","expires_at","created_at","last_used_at","last_ip","req_count","revoked_at","status"],"type":"object","x-order":["id","name","hint","scopes","allow_ips","expires_at","created_at","last_used_at","last_ip","req_count","revoked_at","status"]},"AccountNotification":{"description":"One notification.","properties":{"args":{"additionalProperties":true,"description":"Raw values to fill into the message named by `key` (host names, amounts in cents `*_cents`, timestamps in seconds `*_at`). An empty object when `key` is `null`.","type":"object"},"body":{"description":"Longer text, when there is one.","type":["string","null"]},"created_at":{"description":"When the notification was created (Unix time, seconds, UTC)","type":"integer"},"data":{"additionalProperties":true,"description":"Structured details used to rebuild the message: `lang` and `vars` (the values substituted in the text), and for newer notifications `t` / `b` (message code `k` and values `a` of the title and the body). `null` for older notifications.","type":["object","null"]},"dedupe_key":{"description":"Opaque key that identifies the event the notification belongs to, such as a ticket id. May be used to link to the related resource.","type":["string","null"]},"id":{"description":"Notification identifier. Use it in the `ids` of the mark-as-read call.","type":"integer"},"key":{"description":"Message code of the title, for example `n.vm_ready.title`; `null` for older notifications. With `args` it lets you show the notification in your own language; the body is in `data.b` (`k` + `a`).","type":["string","null"]},"kind":{"description":"Notification type, for example `low_balance`, `autotopup_failed` or `ticket_reply`. New types may be added.","type":"string"},"read_at":{"description":"When the notification was marked as read, `null` while unread (Unix time, seconds, UTC)","type":["integer","null"]},"title":{"description":"Short title, in the language the notification was sent in.","type":"string"},"vm_id":{"description":"UUID of the server the notification is about, when it is about one.","type":["string","null"]}},"required":["id","vm_id","kind","title","body","key","args","read_at","created_at","dedupe_key","data"],"type":"object","x-order":["id","vm_id","kind","title","body","key","args","read_at","created_at","dedupe_key","data"]},"AccountProfile":{"description":"The account behind the API key.","properties":{"blocked_reason":{"description":"Why the account is blocked. `null` for an active account.","type":["string","null"]},"created_at":{"description":"When the account was created (Unix time, seconds, UTC)","type":"integer"},"currency":{"description":"Currency used to display prices: `usd`, `vnd`, or `auto` (dong for Vietnamese-language accounts, dollars otherwise). Billing itself is always in US dollars.","enum":["auto","usd","vnd"],"type":"string"},"email":{"description":"Sign-in e-mail address.","type":"string"},"email_verified_at":{"description":"Unix time the e-mail address was verified, 0 while it is not verified. Servers cannot be created before it is verified.","type":"integer"},"has_password":{"description":"Whether the account has a password. Accounts created through a social sign-in may have none.","type":"boolean"},"id":{"description":"Account identifier.","type":"integer"},"lang":{"description":"Preferred language code, `en` or `vi`.","type":"string"},"last_login":{"description":"When the account last signed in to the dashboard, 0 if never (Unix time, seconds, UTC)","type":"integer"},"name":{"description":"Display name.","type":"string"},"status":{"description":"Account status. Calls made with an API key only succeed while it is `active`.","type":"string"},"tenant":{"properties":{"id":{"description":"Identifier of your DDoS protection workspace; it is the `tid` used by the DDoS Shield operations.","type":"string"},"name":{"description":"Workspace name, empty if none.","type":"string"},"status":{"description":"Workspace status, empty if none.","type":"string"},"targets":{"description":"Number of protected IP addresses in the workspace.","type":"integer"}},"required":["id","name","status","targets"],"type":"object"}},"required":["id","email","name","status","created_at","last_login","currency","email_verified_at","lang","blocked_reason","has_password","tenant"],"type":"object","x-order":["id","email","name","status","created_at","last_login","currency","email_verified_at","lang","blocked_reason","has_password","tenant"]},"AccountQuotaResources":{"description":"An amount of resources.","properties":{"cpu":{"description":"vCPU cores.","type":"integer"},"disk_gb":{"description":"Disk in GiB.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"vm":{"description":"Number of servers.","type":"integer"}},"required":["cpu","ram_mb","disk_gb","vm"],"type":"object","x-order":["cpu","ram_mb","disk_gb","vm"]},"AccountQuotaTier":{"description":"A resource step, defined by one plan on sale.","properties":{"cost_24h_cents":{"description":"Deprecated. Cost of running that plan for 24 hours, in US cents. No longer decides anything: a step opens by `cost_30d_cents`.","type":"integer"},"cost_30d_cents":{"description":"Cost of running that plan for 720 hours (30 days), in US cents. You unlock this step once your real deposits reach this amount.","type":"integer"},"cpu":{"description":"vCPU cores a step of this size allows.","type":"integer"},"disk_gb":{"description":"Disk in GiB allowed.","type":"integer"},"hourly_uusd":{"description":"Price per hour of that plan, in millionths of a US dollar.","type":"integer"},"month_cents":{"description":"Price of that plan for a billing month, in US cents. For display only.","type":"integer"},"name":{"description":"Plan display name.","type":"string"},"plan_id":{"description":"Plan this step corresponds to.","type":"integer"},"ram_mb":{"description":"Memory in MiB allowed.","type":"integer"},"slug":{"description":"Plan short name.","type":"string"}},"required":["plan_id","slug","name","cpu","ram_mb","disk_gb","hourly_uusd","cost_24h_cents","cost_30d_cents","month_cents"],"type":"object","x-order":["plan_id","slug","name","cpu","ram_mb","disk_gb","hourly_uusd","cost_24h_cents","cost_30d_cents","month_cents"]},"AccountSnapshot":{"properties":{"created":{"description":"Creation time as the platform reports it, for example `2026-10-18T21:14:07+0000`.","type":"string"},"created_at":{"description":"Creation time (Unix time, seconds, UTC)","type":["integer","null"]},"current":{"description":"True for the snapshot the server's present state descends from.","type":"boolean"},"description":{"description":"Description given when the snapshot was taken. Empty if none.","type":"string"},"hostname":{"description":"Host name of the server.","type":"string"},"id":{"description":"Snapshot identifier. Pass it as `sid` to restore or delete the snapshot.","type":"string"},"name":{"description":"Name of the snapshot.","type":"string"},"size":{"description":"Space the snapshot occupies, in bytes. null when the platform does not report it.","type":["integer","null"]},"source":{"description":"`schedule` for snapshots taken by an automatic schedule, `manual` for those you took yourself.","enum":["manual","schedule"],"type":"string"},"state":{"description":"Snapshot state, for example `Ready` when it can be used, or `Creating` while it is being taken.","type":"string"},"type":{"description":"Snapshot type as reported by the platform; `Disk` for the disk-only snapshots taken here.","type":"string"},"vm_id":{"description":"Identifier (UUID) of the server the snapshot belongs to.","type":"string"},"vm_name":{"description":"Display name of the server, or its host name when it has none.","type":"string"}},"required":["id","name","description","state","type","current","size","created","created_at","source","vm_id","hostname","vm_name"],"type":"object","x-order":["id","name","description","state","type","current","size","created","created_at","source","vm_id","hostname","vm_name"]},"AccountSnapshotSchedule":{"properties":{"created_at":{"description":"When the schedule was created (Unix time, seconds, UTC)","type":"integer"},"cron":{"description":"The schedule in text form: `daily HH:MM`, or `weekly D HH:MM` where D is 1 (Monday) to 7 (Sunday). Times are UTC.","type":"string"},"dow":{"description":"Day of the week, 1 (Monday) to 7 (Sunday). null for daily schedules.","type":["integer","null"]},"enabled":{"description":"Whether the schedule is active.","type":"boolean"},"hostname":{"description":"Host name of the server.","type":"string"},"hour":{"description":"Hour of the day, 0 to 23 (UTC).","type":["integer","null"]},"id":{"description":"Schedule identifier. Pass it as `pid` to delete the schedule.","type":"integer"},"keep":{"description":"How many automatic snapshots of this schedule to keep; the oldest is deleted before a new one is taken.","type":"integer"},"kind":{"description":"How often the schedule runs.","enum":["daily","weekly",null],"type":["string","null"]},"last_error":{"description":"Why the last run did not produce a snapshot, when it failed. null otherwise. The text is for people and may change.","type":["string","null"]},"last_run_at":{"description":"When the schedule last ran. null if it has not run yet (Unix time, seconds, UTC)","type":["integer","null"]},"minute":{"description":"Minute of the hour, 0 to 59.","type":["integer","null"]},"next_run_at":{"description":"When the schedule runs next (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Identifier (UUID) of the server the schedule belongs to.","type":"string"},"vm_name":{"description":"Display name of the server, or its host name when it has none.","type":"string"}},"required":["id","vm_id","cron","kind","dow","hour","minute","keep","enabled","last_run_at","next_run_at","last_error","created_at","hostname","vm_name"],"type":"object","x-order":["id","vm_id","cron","kind","dow","hour","minute","keep","enabled","last_run_at","next_run_at","last_error","created_at","hostname","vm_name"]},"AffCommission":{"properties":{"amount_cents":{"description":"Commission amount in US cents.","type":"integer"},"base_cents":{"description":"Top-up amount the commission is calculated on, in US cents.","type":"integer"},"created_at":{"description":"When the commission was recorded. (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Commission number.","type":"integer"},"mature_at":{"description":"When the holding period ends. (Unix time, seconds, UTC)","type":"integer"},"matured_at":{"description":"When the commission matured, or null while it has not. (Unix time, seconds, UTC)","type":["integer","null"]},"paid_via":{"description":"How the commission was paid out, once it is paid.","enum":["wallet","cash",null],"type":["string","null"]},"pct_bp":{"description":"Commission rate in basis points (1000 = 10%).","type":"integer"},"reason_code":{"description":"Machine-readable reason for the latest status change, when there is one.","type":["string","null"]},"ref_label":{"description":"Anonymous label of the referred customer, e.g. `#a3f1`. It is stable for one customer and reveals nothing else about them.","type":"string"},"spend_progress_pct":{"description":"Progress (0 to 100) of the referred customer's spending towards the amount required before the commission matures.","type":"integer"},"status":{"description":"`pending` while held, `review` while under manual review, `matured` when it can be taken, `reserved` when part of an open payout, `paid` once paid out, `reversed` or `clawed` when the underlying top-up was refunded or disputed.","enum":["pending","review","matured","reserved","paid","reversed","clawed"],"type":"string"}},"required":["id","created_at","ref_label","base_cents","pct_bp","amount_cents","status","mature_at","matured_at","spend_progress_pct","reason_code","paid_via"],"type":"object","x-order":["id","created_at","ref_label","base_cents","pct_bp","amount_cents","status","mature_at","matured_at","spend_progress_pct","reason_code","paid_via"]},"AffPayout":{"properties":{"admin_note":{"description":"Note from the support team, when there is one.","type":["string","null"]},"amount_cents":{"description":"Amount in US cents.","type":"integer"},"created_at":{"description":"When the payout was requested. (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Payout number.","type":"integer"},"method":{"description":"Where the money went: `wallet` for credit on your service wallet, otherwise a cash payout method.","enum":["wallet","usdt_trc20","paypal","bank_vn"],"type":"string"},"paid_at":{"description":"When it was paid, or null. (Unix time, seconds, UTC)","type":["integer","null"]},"paid_ref":{"description":"Payment reference once paid out.","type":["string","null"]},"status":{"description":"Payout state.","enum":["requested","approved","paid","rejected","cancelled"],"type":"string"}},"required":["id","amount_cents","method","status","paid_ref","created_at","paid_at","admin_note"],"type":"object","x-order":["id","amount_cents","method","status","paid_ref","created_at","paid_at","admin_note"]},"AiAgentEvent":{"description":"One event of the AI agent stream. Each `data:` line of the response holds one JSON object of this shape.","properties":{"auto_blocked":{"description":"True when the command is held back for confirmation because it is risky or not read-only, whatever `auto_execute` says. In `tool_request`.","type":"boolean"},"awaiting_confirm":{"description":"True when the stream stopped at a command that needs your confirmation. In `done`.","type":"boolean"},"code":{"description":"Machine-readable code, for example `rate_limited` when the daily quota ran out mid-stream. In `error`, when available.","type":"string"},"command":{"description":"The shell command. In `tool_request`, `tool_start` and `tool_result`.","type":"string"},"content":{"description":"Text of the assistant's answer. In `assistant_turn`.","type":"string"},"duration_ms":{"description":"Run time in milliseconds. In `tool_result`.","type":"integer"},"error":{"description":"Error text when the command could not be run; empty otherwise. In `tool_result`.","type":"string"},"exit_code":{"description":"Exit code of the command; -1 when it could not be run. In `tool_result`.","type":"integer"},"id":{"description":"Identifier of the step. In `tool_request`, `tool_start`, `tool_result` and `step_skipped`.","type":"string"},"message":{"description":"Human-readable description of the problem. In `error`.","type":"string"},"model":{"description":"Model that produced the answer. In `assistant_turn` and `done`.","type":"string"},"ok":{"description":"True when the command ran and the connection to the server worked. In `tool_result`.","type":"boolean"},"read_only":{"description":"True when the command is on the allowlist of read-only commands permitted for automatic execution (checking status, reading logs and configuration, network diagnostics). In `tool_request`.","type":"boolean"},"reason":{"description":"Why the command was chosen. In `tool_request` and `tool_start`.","type":["string","null"]},"risk_code":{"description":"Stable code of the risk (`destructive`, `files`, `exfil`, `raw_net`, `auth`, `obfuscated`, `remote_script`, `power_fw`, `pivot`, `other`); null when not risky. In `tool_request`.","type":["string","null"]},"risk_reason":{"description":"Why the command needs confirmation; null when it is not risky. In `tool_request`.","type":["string","null"]},"session_id":{"description":"Conversation identifier. In `hello` and `done`.","type":"string"},"stderr":{"description":"Standard error of the command. In `tool_result`.","type":"string"},"stdout":{"description":"Standard output of the command. In `tool_result`.","type":"string"},"timed_out":{"description":"True when the command was stopped because it ran too long. In `tool_result`.","type":"boolean"},"type":{"description":"Kind of event; it decides which other fields are present. `step_skipped` only comes from [Send to the AI agent](#operation/agent_session_send) when a pending command is declined.","enum":["hello","assistant_turn","tool_request","tool_start","tool_result","step_skipped","error","done"],"type":"string"}},"required":["type"],"type":"object","x-order":["type","session_id","content","model","id","command","reason","risk_reason","risk_code","auto_blocked","read_only","ok","stdout","stderr","exit_code","timed_out","duration_ms","error","message","code","awaiting_confirm"]},"AiAgentMessage":{"properties":{"content":{"description":"Message text.","type":"string"},"created_at":{"description":"Time the message was stored (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Message identifier. Increases with time.","type":"integer"},"meta":{"properties":{"awaiting_confirm":{"description":"True when the answer ended with a command waiting for your confirmation.","type":"boolean"},"model":{"description":"Model that produced the answer.","type":"string"},"steps":{"items":{"$ref":"#/components/schemas/AiAgentStep"},"type":"array"}},"type":["object","null"],"x-order":["model","steps","awaiting_confirm"]},"role":{"description":"Who wrote the message.","enum":["user","assistant"],"type":"string"}},"required":["id","role","content","meta","created_at"],"type":"object","x-order":["id","role","content","meta","created_at"]},"AiAgentQuota":{"description":"Daily AI SSH agent quota of the account.","properties":{"limit":{"description":"AI calls allowed per account per day.","type":"integer"},"reset_at":{"description":"Time the quota resets (00:00 UTC) (Unix time, seconds, UTC)","type":"integer"},"used":{"description":"AI calls used today.","type":"integer"}},"required":["limit","used","reset_at"],"type":"object","x-order":["limit","used","reset_at"]},"AiAgentSession":{"description":"One AI SSH agent conversation.","properties":{"ai_calls":{"description":"AI calls this conversation used; each one counts against your daily quota.","type":"integer"},"awaiting_confirm":{"description":"True when the latest answer ended with a command waiting for your confirmation.","type":"boolean"},"commands":{"description":"Shell commands run on the server in this conversation.","type":"integer"},"created_at":{"description":"Time the conversation was created (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Conversation identifier (`ais_…`).","type":"string"},"kind":{"description":"What the conversation works on: a virtual machine (`vm`) or a Bare Metal server (`dedicated`).","enum":["vm","dedicated"],"type":"string"},"message_count":{"description":"Number of stored messages.","type":"integer"},"model":{"description":"Model used by the latest answer.","type":["string","null"]},"title":{"description":"Title of the conversation. Defaults to the first request, at most 80 characters.","type":"string"},"updated_at":{"description":"Time of the latest activity (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Server the conversation works on (VM UUID, or `ds_…` for a Bare Metal server). A conversation always stays bound to this server.","type":"string"},"vm_name":{"description":"Display name of the server; null when the server no longer belongs to you (deleted or transferred). Such a VM conversation can still be read but not continued. A Bare Metal conversation is only listed while you still rent that server.","type":["string","null"]}},"required":["id","kind","vm_id","vm_name","title","model","message_count","ai_calls","commands","awaiting_confirm","created_at","updated_at"],"type":"object","x-order":["id","kind","vm_id","vm_name","title","model","message_count","ai_calls","commands","awaiting_confirm","created_at","updated_at"]},"AiAgentStep":{"description":"One command the AI agent proposed or ran.","properties":{"auto_blocked":{"description":"True when the command was held back for confirmation even though automatic execution was requested, because it is risky or not read-only.","type":"boolean"},"command":{"description":"Shell command the agent wants to run or ran.","type":"string"},"duration_ms":{"description":"Run time in milliseconds.","type":"integer"},"error":{"description":"Error text when the command could not be run; empty otherwise.","type":"string"},"exit_code":{"description":"Exit code of the command; -1 when it could not be run.","type":"integer"},"id":{"description":"Identifier of the step within the conversation.","type":"string"},"read_only":{"description":"True when the command is on the allowlist of read-only commands permitted for automatic execution (checking status, reading logs and configuration, network diagnostics).","type":"boolean"},"reason":{"description":"Why the agent chose this command.","type":["string","null"]},"risk_reason":{"description":"Present when the command needs your confirmation, with a short explanation of the risk.","type":["string","null"]},"status":{"description":"`pending` while waiting for your confirmation, `done` when the command exited with code 0, `error` otherwise, `skipped` when you declined it.","enum":["pending","done","error","skipped"],"type":"string"},"stderr":{"description":"Standard error of the command.","type":"string"},"stdout":{"description":"Standard output of the command.","type":"string"},"timed_out":{"description":"True when the command was stopped because it ran too long.","type":"boolean"}},"required":["id","command","status"],"type":"object","x-order":["id","command","reason","risk_reason","auto_blocked","read_only","status","stdout","stderr","exit_code","timed_out","duration_ms","error"]},"AutoscaleListItem":{"properties":{"base":{"description":"Base size.","properties":{"cpu":{"description":"Base vCPU cores.","type":"integer"},"ram_mb":{"description":"Base memory in MiB.","type":"integer"}},"required":["cpu","ram_mb"],"type":"object"},"cooling_since":{"description":"When the state became `cooling` (Unix time, seconds, UTC)","type":["integer","null"]},"cs_state":{"description":"Power state reported by the platform, for example `Running`; null until first known.","type":["string","null"]},"current":{"description":"Size right now.","properties":{"cpu":{"description":"Current vCPU cores.","type":"integer"},"ram_mb":{"description":"Current memory in MiB.","type":"integer"}},"required":["cpu","ram_mb"],"type":"object"},"cycle":{"description":"Billing cycle slug of the server: `hourly` or a prepaid cycle such as `monthly`.","type":"string"},"display_name":{"description":"Display name of the server (empty string when none was set).","type":"string"},"enabled":{"description":"Whether the rule is switched on.","type":"boolean"},"hostname":{"description":"Host name of the server.","type":"string"},"last_error":{"description":"Short code of the most recent step that failed or was held back.","type":["string","null"]},"last_error_at":{"description":"When `last_error` happened (Unix time, seconds, UTC)","type":["integer","null"]},"last_event":{"description":"Most recent successful size change of the server; null when there was none.","properties":{"at":{"description":"When it happened (Unix time, seconds, UTC)","type":"integer"},"kind":{"description":"`up`, `down` or `revert`.","type":"string"},"source":{"description":"`manual`, `autoscale` or `revert`.","type":"string"},"to_cpu":{"description":"vCPU cores after the change.","type":["integer","null"]},"to_ram_mb":{"description":"Memory in MiB after the change.","type":["integer","null"]}},"required":["at","kind","source","to_cpu","to_ram_mb"],"type":["object","null"]},"pending_revert":{"description":"The server will return to base size on its next restart.","type":"boolean"},"rule":{"$ref":"#/components/schemas/AutoscaleThresholds"},"scaled_at":{"description":"When the server last grew (Unix time, seconds, UTC)","type":["integer","null"]},"state":{"description":"Auto Scaling state, as in Get Auto Scaling.","enum":["base","scaled","cooling"],"type":"string"},"target":{"description":"Size the server grows to.","properties":{"cpu":{"description":"Target vCPU cores (0 when unset).","type":"integer"},"ram_mb":{"description":"Target memory in MiB (0 when unset).","type":"integer"}},"required":["cpu","ram_mb"],"type":"object"},"updated_at":{"description":"When the rule was last changed or updated (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"VM identifier (UUID).","type":"string"},"vm_state":{"description":"Lifecycle state of the server, for example `active`.","type":"string"}},"required":["vm_id","hostname","display_name","vm_state","cs_state","cycle","enabled","state","base","current","target","rule","scaled_at","cooling_since","pending_revert","last_error","last_error_at","updated_at","last_event"],"type":"object","x-order":["vm_id","hostname","display_name","vm_state","cs_state","cycle","enabled","state","base","current","target","rule","scaled_at","cooling_since","pending_revert","last_error","last_error_at","updated_at","last_event"]},"AutoscaleState":{"properties":{"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"base":{"description":"Base size: the configuration the server returns to.","properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"hourly_uusd":{"description":"Price per hour of this size in millionths of a US dollar.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["cpu","ram_mb","hourly_uusd"],"type":"object","x-order":["cpu","ram_mb","hourly_uusd"]},"blocked":{"description":"Reasons Auto Scaling cannot work on this server right now; empty when it can. Values: `vm_locked`, `vm_not_active`, `job_running`, `ram_slots_exhausted`, `needs_reboot`, `bf_locked` (a trial or refund-pending Black Friday server), `renewal_due` (a prepaid server that has expired), `windows_unsupported`, `template_no_cpu_hotplug`.","items":{"description":"Reason code.","type":"string"},"type":"array"},"caps":{"description":"Limits of the rule fields and of the site.","properties":{"down_pct":{"description":"[min, max] allowed for `down_pct`.","items":{"description":"Bound.","type":"integer"},"type":"array"},"down_secs":{"description":"[min, max] allowed for `down_secs`.","items":{"description":"Bound.","type":"integer"},"type":"array"},"max_cpu":{"description":"Largest `target_cpu` accepted by the site.","type":"integer"},"max_ram_mb":{"description":"Largest `target_ram_mb` accepted by the site.","type":"integer"},"max_steps_day":{"description":"Largest number of automatic size changes per server per day.","type":"integer"},"up_pct":{"description":"[min, max] allowed for `up_pct`.","items":{"description":"Bound.","type":"integer"},"type":"array"},"up_secs":{"description":"[min, max] allowed for `up_secs`.","items":{"description":"Bound.","type":"integer"},"type":"array"}},"required":["up_pct","up_secs","down_pct","down_secs","max_cpu","max_ram_mb","max_steps_day"],"type":"object","x-order":["up_pct","up_secs","down_pct","down_secs","max_cpu","max_ram_mb","max_steps_day"]},"cooling_since":{"description":"When the state became `cooling` (Unix time, seconds, UTC)","type":["integer","null"]},"current":{"description":"Size the server has right now.","properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"hourly_uusd":{"description":"Price per hour of this size in millionths of a US dollar.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["cpu","ram_mb","hourly_uusd"],"type":"object","x-order":["cpu","ram_mb","hourly_uusd"]},"enabled":{"description":"Whether the rule is switched on.","type":"boolean"},"extra":{"description":"Billing of the extra capacity of a prepaid server; null for an hourly server.","properties":{"active":{"description":"`true` while the server really runs larger than its base size and the extra is being billed.","type":"boolean"},"billed_until":{"description":"End of the last hour of extra capacity that has been paid; the next hour is charged when it passes. Null unless `active`. (Unix time, seconds, UTC)","type":["integer","null"]},"billing":{"description":"Always `separate_hourly`: the extra capacity is billed by the hour on top of the prepaid plan.","type":"string"},"covered_until":{"description":"When the current balance runs out for the extra capacity at the current price. Null unless `active`. (Unix time, seconds, UTC)","type":["integer","null"]},"hourly_uusd":{"description":"Price per hour of the extra capacity (target size minus base size, at the normal hourly price list) in millionths of a US dollar. While `active` this is the price being charged; otherwise the price the saved target would cost.","type":"integer"},"monthly_cents":{"description":"`hourly_uusd` for a 730-hour month in US cents.","type":"integer"},"need_cents":{"description":"Balance in US cents that covers `wallet_hours` of the saved target's extra.","type":"integer"},"preview_hourly_uusd":{"description":"Price per hour the saved target would add on top of the base size, in millionths of a US dollar.","type":"integer"},"revert_at":{"description":"When the server will be restarted back to its base size if the balance is not topped up: `warn_at` plus 24 hours. Topping up before it cancels the schedule. (Unix time, seconds, UTC)","type":["integer","null"]},"started_at":{"description":"When the current increase started (the first hour is paid at that moment). Null unless `active`. (Unix time, seconds, UTC)","type":["integer","null"]},"wallet_hours":{"description":"Hours of extra capacity your balance must cover to turn Auto Scaling on and for every size increase (the `autoscale_wallet_hours` setting, 24 by default).","type":"integer"},"warn_at":{"description":"When the low-balance warning was sent; null when none is pending. (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["billing","active","hourly_uusd","preview_hourly_uusd","monthly_cents","wallet_hours","need_cents","billed_until","started_at","warn_at","revert_at","covered_until"],"type":["object","null"],"x-order":["billing","active","hourly_uusd","preview_hourly_uusd","monthly_cents","wallet_hours","need_cents","billed_until","started_at","warn_at","revert_at","covered_until"]},"feature":{"description":"Whether the site sells Auto Scaling. When `false`, enabling it fails with `403 feature_disabled`.","type":"boolean"},"last_error":{"description":"Short code of the most recent automatic step that failed or was held back, for example `insufficient_funds`, `cooldown` or `cluster_full`; null when there is none.","type":["string","null"]},"last_error_at":{"description":"When `last_error` happened (Unix time, seconds, UTC)","type":["integer","null"]},"pending_revert":{"description":"The server is larger than its base size and will return to base size on its next restart.","type":"boolean"},"prepaid":{"description":"`true` for a server on a prepaid cycle (monthly, yearly, multi-year, including a paid Black Friday server). Its prepaid plan, expiry and renewal price never change; only the extra capacity is billed separately by the hour (see `extra`). `false` for an hourly server, which is billed for the whole size by the hour as before.","type":"boolean"},"ram_stats_at":{"description":"When `ram_used_mb` was measured (Unix time, seconds, UTC)","type":["integer","null"]},"ram_used_mb":{"description":"Memory in use inside the server at the last measurement, in MiB.","type":["integer","null"]},"revert_at":{"description":"When an automatic return to base size is planned (Unix time, seconds, UTC)","type":["integer","null"]},"revert_available":{"description":"The server is currently larger than its base size because of Auto Scaling and no return is under way, so Return to base size can be called.","type":"boolean"},"revert_manual":{"description":"A return to base size that you requested is waiting or running.","type":"boolean"},"revert_phase":{"description":"Step of a return to base size that is under way: `stopping`, `reverting` or `starting`; null when none.","type":["string","null"]},"rule":{"$ref":"#/components/schemas/AutoscaleThresholds"},"state":{"description":"`base`: at the base size, billed at the base price. `scaled`: grown to the target size, billed at the target price. `cooling`: the load is gone but the server keeps the larger size and is billed at the base price until it is returned to base.","enum":["base","scaled","cooling"],"type":"string"},"target":{"description":"Size the server grows to when the load is high.","properties":{"cpu":{"description":"Target virtual CPU cores; 0 when no rule was ever saved.","type":"integer"},"hourly_uusd":{"description":"Price per hour of the target size in millionths of a US dollar; 0 when no target is set.","type":"integer"},"monthly_cents":{"description":"Price of the target size for a 730-hour month in US cents.","type":"integer"},"ram_mb":{"description":"Target memory in MiB; 0 when no rule was ever saved.","type":"integer"}},"required":["cpu","ram_mb","hourly_uusd","monthly_cents"],"type":"object","x-order":["cpu","ram_mb","hourly_uusd","monthly_cents"]}},"required":["feature","prepaid","extra","enabled","state","base","current","target","rule","caps","pending_revert","cooling_since","revert_available","revert_manual","revert_at","revert_phase","ram_used_mb","ram_stats_at","last_error","last_error_at","blocked","balance_cents"],"type":"object","x-order":["feature","prepaid","extra","enabled","state","base","current","target","rule","caps","pending_revert","cooling_since","revert_available","revert_manual","revert_at","revert_phase","ram_used_mb","ram_stats_at","last_error","last_error_at","blocked","balance_cents"]},"AutoscaleThresholds":{"description":"Load thresholds of an Auto Scaling rule.","properties":{"down_pct":{"description":"Consider the load gone when it stays at or below this percentage (5 to 60). Always lower than `up_pct`.","type":"integer"},"down_secs":{"description":"... for at least this many seconds (300 to 7200).","type":"integer"},"up_pct":{"description":"Grow when load stays at or above this percentage (50 to 95).","type":"integer"},"up_secs":{"description":"... for at least this many seconds (120 to 1800).","type":"integer"}},"required":["up_pct","up_secs","down_pct","down_secs"],"type":"object","x-order":["up_pct","up_secs","down_pct","down_secs"]},"Backup":{"description":"One backup of a server disk.","properties":{"auto":{"description":"`true` for backups taken by the nightly automatic schedule (`interval_type` is `AUTO`).","type":"boolean"},"billable":{"description":"Whether the backup is being billed right now. Only finished backups (`BackedUp`) with data are billed.","type":"boolean"},"created_at":{"description":"When the backup was created (Unix time, seconds, UTC)","type":"integer"},"error_code":{"description":"Short machine-readable reason when `last_error` is set (`error` = unspecified failure). `null` when there was no error.","enum":["cancelled","capacity","timeout","ip_alloc","network","provision","destroy","resize","error",null],"type":["string","null"]},"free":{"description":"`true` for the one backup per server that is not billed: the newest rotating (not pinned) backup. Everything else is billed.","type":"boolean"},"id":{"description":"Backup identifier. Use it as `bid` in the delete and restore operations.","type":"integer"},"interval_type":{"description":"How the backup was taken: `MANUAL` for backups created on demand, `AUTO` for the nightly automatic backup, or `HOURLY`, `DAILY`, `WEEKLY`, `MONTHLY` for backups created by the schedule.","type":"string"},"last_error":{"description":"Short explanation when the backup failed, in the account language. `null` when there was no error.","type":["string","null"]},"name":{"description":"Backup name. For manual backups it is the `name` you gave, or `<hostname>-<date>-<time>`.","type":"string"},"paid_cents":{"description":"Total charged so far for this backup, in US cents.","type":"integer"},"pinned":{"description":"`true` when the backup is kept: the nightly rotation never deletes it and it is always billed. `false` for rotating nightly backups.","type":"boolean"},"rate_uusd":{"description":"Price locked for this backup, in millionths of a US dollar per GB-hour. If the site price drops, the lower price applies; it never rises for an existing backup.","type":"integer"},"size_bytes":{"description":"Space the backup uses on backup storage, in bytes. It is 0 until the backup finishes and it is what you are billed for.","type":"integer"},"size_gb":{"description":"Same as `size_bytes`, in GiB (1 GiB = 1,073,741,824 bytes).","type":"number"},"status":{"description":"Current state: `BackingUp` (being created), `BackedUp` (ready, the only state that can be restored), `Restoring`, `Deleting` or `Error`.","type":"string"},"type":{"description":"Backup type. Always `FULL` (every backup is a complete copy of the disk).","type":"string"},"uusd_per_hour":{"description":"What this backup costs now, in millionths of a US dollar per hour (`size_gb` x `rate_uusd`, rounded). 1,000,000 = US$1.","type":"integer"},"virtual_size_bytes":{"description":"Size of the disk that was backed up, in bytes. It is not what you are billed for.","type":"integer"}},"required":["id","name","type","interval_type","status","size_bytes","size_gb","virtual_size_bytes","rate_uusd","uusd_per_hour","paid_cents","billable","pinned","free","auto","created_at","last_error","error_code"],"type":"object","x-order":["id","name","type","interval_type","status","size_bytes","size_gb","virtual_size_bytes","rate_uusd","uusd_per_hour","paid_cents","billable","pinned","free","auto","created_at","last_error","error_code"]},"BackupJobAccepted":{"description":"The operation was queued.","properties":{"job_id":{"description":"Background job that carries out the operation. Follow it with the VM jobs call.","type":"integer"}},"required":["job_id"],"type":"object"},"BackupListItem":{"description":"A backup together with the server it belongs to.","properties":{"auto":{"description":"`true` for backups taken by the nightly automatic schedule (`interval_type` is `AUTO`).","type":"boolean"},"billable":{"description":"Whether the backup is being billed right now. Only finished backups (`BackedUp`) with data are billed.","type":"boolean"},"created_at":{"description":"When the backup was created (Unix time, seconds, UTC)","type":"integer"},"error_code":{"description":"Short machine-readable reason when `last_error` is set (`error` = unspecified failure). `null` when there was no error.","enum":["cancelled","capacity","timeout","ip_alloc","network","provision","destroy","resize","error",null],"type":["string","null"]},"free":{"description":"`true` for the one backup per server that is not billed: the newest rotating (not pinned) backup. Everything else is billed.","type":"boolean"},"hostname":{"description":"Hostname of that server.","type":"string"},"id":{"description":"Backup identifier. Use it as `bid` in the delete and restore operations.","type":"integer"},"interval_type":{"description":"How the backup was taken: `MANUAL` for backups created on demand, `AUTO` for the nightly automatic backup, or `HOURLY`, `DAILY`, `WEEKLY`, `MONTHLY` for backups created by the schedule.","type":"string"},"last_error":{"description":"Short explanation when the backup failed, in the account language. `null` when there was no error.","type":["string","null"]},"name":{"description":"Backup name. For manual backups it is the `name` you gave, or `<hostname>-<date>-<time>`.","type":"string"},"paid_cents":{"description":"Total charged so far for this backup, in US cents.","type":"integer"},"pinned":{"description":"`true` when the backup is kept: the nightly rotation never deletes it and it is always billed. `false` for rotating nightly backups.","type":"boolean"},"rate_uusd":{"description":"Price locked for this backup, in millionths of a US dollar per GB-hour. If the site price drops, the lower price applies; it never rises for an existing backup.","type":"integer"},"size_bytes":{"description":"Space the backup uses on backup storage, in bytes. It is 0 until the backup finishes and it is what you are billed for.","type":"integer"},"size_gb":{"description":"Same as `size_bytes`, in GiB (1 GiB = 1,073,741,824 bytes).","type":"number"},"status":{"description":"Current state: `BackingUp` (being created), `BackedUp` (ready, the only state that can be restored), `Restoring`, `Deleting` or `Error`.","type":"string"},"type":{"description":"Backup type. Always `FULL` (every backup is a complete copy of the disk).","type":"string"},"uusd_per_hour":{"description":"What this backup costs now, in millionths of a US dollar per hour (`size_gb` x `rate_uusd`, rounded). 1,000,000 = US$1.","type":"integer"},"virtual_size_bytes":{"description":"Size of the disk that was backed up, in bytes. It is not what you are billed for.","type":"integer"},"vm_id":{"description":"UUID of the server the backup belongs to.","type":"string"},"vm_name":{"description":"Display name of that server (its hostname when no display name is set).","type":"string"}},"required":["id","name","type","interval_type","status","size_bytes","size_gb","virtual_size_bytes","rate_uusd","uusd_per_hour","paid_cents","billable","pinned","free","auto","created_at","last_error","error_code","vm_id","hostname","vm_name"],"type":"object","x-order":["id","name","type","interval_type","status","size_bytes","size_gb","virtual_size_bytes","rate_uusd","uusd_per_hour","paid_cents","billable","pinned","free","auto","created_at","last_error","error_code","vm_id","hostname","vm_name"]},"BackupSchedule":{"description":"Backup settings of a server: the automatic schedule and the retention limit.","properties":{"day":{"description":"Day of the week 1 to 7 (WEEKLY, 1 = Monday) or day of the month 1 to 28 (MONTHLY). `null` for HOURLY and DAILY schedules and when there is no schedule.","type":["integer","null"]},"enabled":{"description":"Always `true`: only servers with Backup enabled have a schedule object.","type":"boolean"},"hour":{"description":"Hour of the day, 0 to 23, in `timezone`. `null` for HOURLY schedules and when there is no schedule.","type":["integer","null"]},"interval_type":{"description":"How often backups are taken automatically. `null` when Backup is enabled but no schedule is set.","enum":["HOURLY","DAILY","WEEKLY","MONTHLY",null],"type":["string","null"]},"last_backup_at":{"description":"When the schedule last produced a backup, `null` if never (Unix time, seconds, UTC)","type":["integer","null"]},"max_backups":{"description":"How many backups the schedule keeps. Older scheduled backups are removed automatically when the limit is exceeded.","type":"integer"},"minute":{"description":"Minute of the hour, 0 to 59. `null` when there is no schedule.","type":["integer","null"]},"schedule":{"description":"Schedule as a compact string: `MM` (HOURLY), `MM:HH` (DAILY) or `MM:HH:DD` (WEEKLY, MONTHLY). `null` when there is no schedule.","type":["string","null"]},"timezone":{"description":"Time zone in which `hour` and `minute` are interpreted, an IANA name such as `Asia/Ho_Chi_Minh`. Set by the site, you cannot change it.","type":"string"}},"required":["enabled","interval_type","schedule","minute","hour","day","timezone","max_backups","last_backup_at"],"type":"object","x-order":["enabled","interval_type","schedule","minute","hour","day","timezone","max_backups","last_backup_at"]},"BackupScheduleListItem":{"description":"A server with Backup enabled, with its schedule.","properties":{"backups":{"description":"Number of backups currently kept for the server.","type":"integer"},"cs_state":{"description":"Power state of the server as last seen, for example `Running` or `Stopped`. `null` when unknown.","type":["string","null"]},"day":{"description":"Day of the week 1 to 7 (WEEKLY, 1 = Monday) or day of the month 1 to 28 (MONTHLY). `null` for HOURLY and DAILY schedules and when there is no schedule.","type":["integer","null"]},"enabled":{"description":"Always `true`: only servers with Backup enabled have a schedule object.","type":"boolean"},"has_schedule":{"description":"Whether an automatic schedule is set.","type":"boolean"},"hostname":{"description":"Hostname of the server.","type":"string"},"hour":{"description":"Hour of the day, 0 to 23, in `timezone`. `null` for HOURLY schedules and when there is no schedule.","type":["integer","null"]},"interval_type":{"description":"How often backups are taken automatically. `null` when Backup is enabled but no schedule is set.","enum":["HOURLY","DAILY","WEEKLY","MONTHLY",null],"type":["string","null"]},"last_backup_at":{"description":"When the schedule last produced a backup, `null` if never (Unix time, seconds, UTC)","type":["integer","null"]},"max_backups":{"description":"How many backups the schedule keeps. Older scheduled backups are removed automatically when the limit is exceeded.","type":"integer"},"minute":{"description":"Minute of the hour, 0 to 59. `null` when there is no schedule.","type":["integer","null"]},"schedule":{"description":"Schedule as a compact string: `MM` (HOURLY), `MM:HH` (DAILY) or `MM:HH:DD` (WEEKLY, MONTHLY). `null` when there is no schedule.","type":["string","null"]},"timezone":{"description":"Time zone in which `hour` and `minute` are interpreted, an IANA name such as `Asia/Ho_Chi_Minh`. Set by the site, you cannot change it.","type":"string"},"vm_id":{"description":"UUID of the server.","type":"string"},"vm_name":{"description":"Display name of the server (its hostname when no display name is set).","type":"string"},"vm_state":{"description":"Lifecycle state of the server, for example `active`, `provisioning` or `locked`.","type":"string"}},"required":["enabled","interval_type","schedule","minute","hour","day","timezone","max_backups","last_backup_at","vm_id","hostname","vm_name","vm_state","cs_state","backups","has_schedule"],"type":"object","x-order":["enabled","interval_type","schedule","minute","hour","day","timezone","max_backups","last_backup_at","vm_id","hostname","vm_name","vm_state","cs_state","backups","has_schedule"]},"BandwidthAddon":{"properties":{"account_id":{"description":"Account that bought the Add-on (your own account).","type":"integer"},"amount_cents":{"description":"Amount charged in US cents. 0 for Add-ons granted free of charge by support.","type":"integer"},"created_at":{"description":"When the Add-on was bought (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Add-on identifier.","type":"integer"},"invoice_id":{"description":"Receipt invoice of the purchase, null when there is none.","type":["integer","null"]},"kind":{"description":"Kind of the service the Add-on belongs to.","enum":["vm","k8s","s3","vpn"],"type":"string"},"period_end":{"description":"End of the billing period the Add-on is valid for (exclusive). The Add-on expires then; the next period starts with the base quota again (Unix time, seconds, UTC)","type":"integer"},"period_start":{"description":"Start of the billing period the Add-on is valid for (Unix time, seconds, UTC)","type":"integer"},"ref":{"description":"Identifier of the service within its kind.","type":"string"},"status":{"description":"`active` bought and in force; `granted` given free of charge by support and in force; `pending` and `failed` belong to an interrupted purchase and add no quota.","enum":["pending","active","granted","failed"],"type":"string"},"tb":{"description":"Terabytes added (1 TB = 2^40 bytes).","type":"integer"}},"required":["id","kind","ref","account_id","period_start","period_end","tb","amount_cents","status","invoice_id","created_at"],"type":"object","x-order":["id","kind","ref","account_id","period_start","period_end","tb","amount_cents","status","invoice_id","created_at"]},"BandwidthObject":{"properties":{"account_id":{"description":"Identifier of the account that owns the service (always your own account).","type":"integer"},"addon_bytes":{"description":"Bytes added by Add-ons bought for the current period.","type":"integer"},"addon_tb":{"description":"Terabytes added by Add-ons bought for the current period.","type":"integer"},"buy_block":{"description":"Why no Add-on can be bought: `vpn_use_upgrade` VPN plans raise their bandwidth from the plan itself, `unmetered` the service has no limit, `not_active` the service is not in a state that allows purchases. Null when `can_buy` is true.","enum":["vpn_use_upgrade","unmetered","not_active",null],"type":["string","null"]},"can_buy":{"description":"Whether an Add-on can be bought for this service right now. When false, `buy_block` tells why.","type":"boolean"},"count":{"description":"How usage is measured: `edge` traffic crossing the network edge of the server or cluster, `download` object-storage downloads, `rx_tx` bytes received plus sent by the VPN plan.","enum":["edge","download","rx_tx"],"type":"string"},"kind":{"description":"Kind of service: `vm` server, `k8s` container cluster, `s3` object storage (one entry per account), `vpn` VPN plan.","enum":["vm","k8s","s3","vpn"],"type":"string"},"limit_bytes":{"description":"`quota_bytes` plus `addon_bytes`, or null when the service has no limit.","type":["integer","null"]},"metered_frac":{"description":"Share of the period (0 to 1) during which the service was metered. Below 1 when it spent part of the period unmetered.","type":"number"},"name":{"description":"Display name of the service.","type":"string"},"pct":{"description":"Percentage of the limit used, rounded to one decimal, or null when there is no limit. Can exceed 100.","type":["number","null"]},"period":{"description":"Current billing period of the service.","properties":{"end":{"description":"End of the current billing period (exclusive); the quota resets at this moment (Unix time, seconds, UTC)","type":"integer"},"kind":{"description":"How the period is defined: `anchored_month` is a month counted from the creation of the server or cluster, `calendar_month` is a calendar month in UTC+7 (object storage), `vpn_cycle` follows the billing cycle of the VPN plan.","enum":["anchored_month","calendar_month","vpn_cycle"],"type":"string"},"start":{"description":"Start of the current billing period (Unix time, seconds, UTC)","type":"integer"}},"required":["start","end","kind"],"type":"object","x-order":["start","end","kind"]},"quota_bytes":{"description":"Included quota for the period in bytes, or null when the service has no limit. For servers it is reduced in proportion to the time the server spent unmetered; for clusters it grows with the number of workers.","type":["integer","null"]},"ref":{"description":"Identifier of the service within its kind. Use it as `ref` in the other bandwidth calls.","type":"string"},"remaining_bytes":{"description":"`limit_bytes` minus `used_bytes`, or null when there is no limit. Negative when the limit is exceeded.","type":["integer","null"]},"state":{"description":"State of the service, for example `active` or `locked` (a locked service cannot be used until the lock is lifted).","type":"string"},"sub":{"description":"Short secondary label: the public IP address of a server or cluster, a one-line summary for the other kinds. May be empty.","type":"string"},"total":{"description":"Raw traffic of the current period, including traffic that is not counted against the limit (for example traffic while the service was unmetered).","properties":{"in":{"description":"Bytes received by the service in the period, counted or not.","type":"integer"},"out":{"description":"Bytes sent by the service in the period, counted or not. For `s3` this is the total download.","type":"integer"},"total":{"description":"`in` plus `out`.","type":"integer"}},"required":["in","out","total"],"type":"object"},"unmetered":{"description":"Set while the service is inside an unmetered network; no quota applies then and no Add-on can be bought.","properties":{"label":{"description":"Name of the unmetered network the service currently sits in.","type":"string"},"mbps":{"description":"Committed speed of that network in Mbps.","type":"integer"}},"required":["label","mbps"],"type":["object","null"]},"used_bytes":{"description":"Bytes counted against the limit in the current period (see `count`). For `s3` this is the part of your downloads covered by the free quota; downloads beyond it are billed pay-as-you-go and only show in `total`.","type":"integer"},"workers_avg":{"description":"Container clusters only: average number of worker nodes over the period, weighted by time. Null for the other kinds.","type":["number","null"]}},"required":["kind","ref","name","sub","state","account_id","period","quota_bytes","addon_bytes","addon_tb","limit_bytes","used_bytes","remaining_bytes","pct","total","unmetered","metered_frac","workers_avg","can_buy","buy_block","count"],"type":"object","x-order":["kind","ref","name","sub","state","account_id","period","quota_bytes","addon_bytes","addon_tb","limit_bytes","used_bytes","remaining_bytes","pct","total","unmetered","metered_frac","workers_avg","can_buy","buy_block","count"]},"BandwidthObjectDetail":{"properties":{"account_id":{"description":"Identifier of the account that owns the service (always your own account).","type":"integer"},"addon_bytes":{"description":"Bytes added by Add-ons bought for the current period.","type":"integer"},"addon_tb":{"description":"Terabytes added by Add-ons bought for the current period.","type":"integer"},"addons":{"description":"Add-ons bought for the current period of this service, newest first (at most 50).","items":{"$ref":"#/components/schemas/BandwidthAddon"},"type":"array"},"buy_block":{"description":"Why no Add-on can be bought: `vpn_use_upgrade` VPN plans raise their bandwidth from the plan itself, `unmetered` the service has no limit, `not_active` the service is not in a state that allows purchases. Null when `can_buy` is true.","enum":["vpn_use_upgrade","unmetered","not_active",null],"type":["string","null"]},"can_buy":{"description":"Whether an Add-on can be bought for this service right now. When false, `buy_block` tells why.","type":"boolean"},"count":{"description":"How usage is measured: `edge` traffic crossing the network edge of the server or cluster, `download` object-storage downloads, `rx_tx` bytes received plus sent by the VPN plan.","enum":["edge","download","rx_tx"],"type":"string"},"count_mode":{"description":"Which direction counts for servers and clusters: `both` counts inbound plus outbound traffic, `out` counts outbound traffic only.","enum":["both","out"],"type":"string"},"kind":{"description":"Kind of service: `vm` server, `k8s` container cluster, `s3` object storage (one entry per account), `vpn` VPN plan.","enum":["vm","k8s","s3","vpn"],"type":"string"},"limit_bytes":{"description":"`quota_bytes` plus `addon_bytes`, or null when the service has no limit.","type":["integer","null"]},"metered_frac":{"description":"Share of the period (0 to 1) during which the service was metered. Below 1 when it spent part of the period unmetered.","type":"number"},"name":{"description":"Display name of the service.","type":"string"},"pct":{"description":"Percentage of the limit used, rounded to one decimal, or null when there is no limit. Can exceed 100.","type":["number","null"]},"period":{"description":"Current billing period of the service.","properties":{"end":{"description":"End of the current billing period (exclusive); the quota resets at this moment (Unix time, seconds, UTC)","type":"integer"},"kind":{"description":"How the period is defined: `anchored_month` is a month counted from the creation of the server or cluster, `calendar_month` is a calendar month in UTC+7 (object storage), `vpn_cycle` follows the billing cycle of the VPN plan.","enum":["anchored_month","calendar_month","vpn_cycle"],"type":"string"},"start":{"description":"Start of the current billing period (Unix time, seconds, UTC)","type":"integer"}},"required":["start","end","kind"],"type":"object","x-order":["start","end","kind"]},"policy":{"description":"What the site does to a service that has used its whole quota. With `suspend`, servers and clusters are locked (and object-storage access is paused) until you buy an Add-on or the next period starts; with any other value the service keeps running and you are only notified at 80% and 100% of the quota.","enum":["notify","throttle","suspend"],"type":"string"},"price":{"$ref":"#/components/schemas/BandwidthPrice"},"quota_bytes":{"description":"Included quota for the period in bytes, or null when the service has no limit. For servers it is reduced in proportion to the time the server spent unmetered; for clusters it grows with the number of workers.","type":["integer","null"]},"ref":{"description":"Identifier of the service within its kind. Use it as `ref` in the other bandwidth calls.","type":"string"},"remaining_bytes":{"description":"`limit_bytes` minus `used_bytes`, or null when there is no limit. Negative when the limit is exceeded.","type":["integer","null"]},"series":{"$ref":"#/components/schemas/BandwidthSeries"},"state":{"description":"State of the service, for example `active` or `locked` (a locked service cannot be used until the lock is lifted).","type":"string"},"sub":{"description":"Short secondary label: the public IP address of a server or cluster, a one-line summary for the other kinds. May be empty.","type":"string"},"suspend_active":{"description":"Whether the `suspend` policy is being enforced right now. It can be false for a while after the policy is switched on, during which usage is only notified.","type":"boolean"},"total":{"description":"Raw traffic of the current period, including traffic that is not counted against the limit (for example traffic while the service was unmetered).","properties":{"in":{"description":"Bytes received by the service in the period, counted or not.","type":"integer"},"out":{"description":"Bytes sent by the service in the period, counted or not. For `s3` this is the total download.","type":"integer"},"total":{"description":"`in` plus `out`.","type":"integer"}},"required":["in","out","total"],"type":"object"},"unmetered":{"description":"Set while the service is inside an unmetered network; no quota applies then and no Add-on can be bought.","properties":{"label":{"description":"Name of the unmetered network the service currently sits in.","type":"string"},"mbps":{"description":"Committed speed of that network in Mbps.","type":"integer"}},"required":["label","mbps"],"type":["object","null"]},"used_bytes":{"description":"Bytes counted against the limit in the current period (see `count`). For `s3` this is the part of your downloads covered by the free quota; downloads beyond it are billed pay-as-you-go and only show in `total`.","type":"integer"},"workers_avg":{"description":"Container clusters only: average number of worker nodes over the period, weighted by time. Null for the other kinds.","type":["number","null"]}},"required":["kind","ref","name","sub","state","account_id","period","quota_bytes","addon_bytes","addon_tb","limit_bytes","used_bytes","remaining_bytes","pct","total","unmetered","metered_frac","workers_avg","can_buy","buy_block","count","addons","price","policy","suspend_active","count_mode"],"type":"object","x-order":["kind","ref","name","sub","state","account_id","period","quota_bytes","addon_bytes","addon_tb","limit_bytes","used_bytes","remaining_bytes","pct","total","unmetered","metered_frac","workers_avg","can_buy","buy_block","count","addons","price","policy","suspend_active","count_mode","series"]},"BandwidthPrice":{"properties":{"error":{"description":"Present instead of `tb_cents` when the price cannot be computed at the moment; Add-ons cannot be bought until it clears.","enum":["fx_unavailable","price_unavailable"],"type":"string"},"max_tb":{"description":"Largest number of terabytes a single purchase may add.","type":"integer"},"tb_cents":{"description":"Price of one terabyte of Add-on in US cents on this site. Absent when no price can be quoted right now (see `error`).","type":"integer"}},"required":["max_tb"],"type":"object","x-order":["tb_cents","error","max_tb"]},"BandwidthQuote":{"properties":{"amount_cents":{"description":"Total price of the purchase in US cents. Pass it as `expect_cents` when buying.","type":"integer"},"amount_vnd":{"description":"Informational equivalent of `amount_cents` in Vietnamese dong at the current exchange rate. You are always charged in US cents.","type":"integer"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"limit_after_bytes":{"description":"The limit of the service after the purchase, in bytes.","type":"integer"},"period_end":{"description":"End of that billing period (exclusive) (Unix time, seconds, UTC)","type":"integer"},"period_start":{"description":"Start of the billing period the Add-on would be valid for (Unix time, seconds, UTC)","type":"integer"},"remaining_after_bytes":{"description":"Bytes left after the purchase (`limit_after_bytes` minus current usage). Can still be negative if usage is far above the limit.","type":"integer"},"tb":{"description":"Terabytes priced.","type":"integer"},"unit_cents":{"description":"Price of one terabyte in US cents.","type":"integer"}},"required":["tb","amount_cents","unit_cents","amount_vnd","period_start","period_end","limit_after_bytes","remaining_after_bytes","balance_cents"],"type":"object","x-order":["tb","amount_cents","unit_cents","amount_vnd","period_start","period_end","limit_after_bytes","remaining_after_bytes","balance_cents"]},"BandwidthSeries":{"properties":{"bucket":{"description":"Length of each point in seconds: 3600 for `24h`, 86400 (one day) for the other ranges.","type":"integer"},"from":{"description":"Start of the covered window, rounded down to the hour (Unix time, seconds, UTC)","type":"integer"},"points":{"description":"Traffic per bucket in time order. Buckets without traffic are omitted. Always empty for `vpn`.","items":{"properties":{"in":{"description":"Bytes received during the bucket. For `s3` this is the upload.","type":"integer"},"out":{"description":"Bytes sent during the bucket. For `s3` this is the download.","type":"integer"},"t":{"description":"Start of the bucket. Daily buckets start at midnight UTC+7 (Unix time, seconds, UTC)","type":"integer"},"total":{"description":"`in` plus `out`.","type":"integer"}},"required":["t","in","out","total"],"type":"object","x-order":["t","in","out","total"]},"type":"array"},"range":{"description":"The range that was requested: `24h`, `7d`, `30d` or `period`.","type":"string"},"to":{"description":"End of the covered window (the time of the request) (Unix time, seconds, UTC)","type":"integer"}},"required":["range","bucket","from","to","points"],"type":"object","x-order":["range","bucket","from","to","points"]},"BandwidthTotals":{"properties":{"addon_bytes":{"description":"Part of the limits that comes from Add-ons bought for the current periods.","type":"integer"},"counts":{"additionalProperties":{"description":"Number of services of this kind.","type":"integer"},"description":"Number of services per kind, for example `{\"vm\": 3, \"s3\": 1}`. Kinds you do not use are absent.","type":"object"},"limit_bytes":{"description":"Sum of the limits (quota plus Add-ons) of the services that have a limit.","type":"integer"},"objects":{"description":"Total number of services.","type":"integer"},"over":{"description":"Number of services that used 100% or more of their limit.","type":"integer"},"remaining_bytes":{"description":"`limit_bytes` minus `used_bytes`, never below 0.","type":"integer"},"used_bytes":{"description":"Bytes counted against limits, summed over all services.","type":"integer"},"warn":{"description":"Number of services between 80% and 100% of their limit.","type":"integer"}},"required":["used_bytes","limit_bytes","addon_bytes","remaining_bytes","over","warn","counts","objects"],"type":"object","x-order":["used_bytes","limit_bytes","addon_bytes","remaining_bytes","over","warn","counts","objects"]},"BillingOrder":{"properties":{"created_at":{"description":"Time the order was created (Unix time, seconds, UTC)","type":"integer"},"description":{"description":"Description of the first line item; empty when there is none.","type":"string"},"id":{"description":"Order identifier (the identifier of its invoice).","type":"integer"},"kind":{"description":"Kind of the underlying invoice.","enum":["receipt","renewal","topup","manual","refund"],"type":"string"},"number":{"description":"Invoice number.","type":["string","null"]},"paid_at":{"description":"Time the order was paid (Unix time, seconds, UTC)","type":["integer","null"]},"status":{"description":"Payment status.","enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"},"sub":{"description":"For purchases paid from the wallet: `new` (a new server), `plan` (a plan change) or `cycle` (a billing-cycle change). Null for other kinds.","enum":["new","plan","cycle",null],"type":["string","null"]},"total_cents":{"description":"Amount of the order, in US cents.","type":"integer"},"vm":{"properties":{"cycle":{"description":"Billing cycle of the server, for example `hourly` or `monthly`.","type":"string"},"display_name":{"description":"Display name of the server.","type":"string"},"hostname":{"description":"Hostname of the server.","type":"string"},"id":{"description":"Server identifier.","type":"string"},"state":{"description":"State of the server.","type":"string"}},"required":["id","hostname","display_name","cycle","state"],"type":["object","null"],"x-order":["id","hostname","display_name","cycle","state"]},"vm_id":{"description":"Server the order is about.","type":["string","null"]}},"required":["id","number","kind","status","total_cents","created_at","paid_at","vm_id","description","sub","vm"],"type":"object","x-order":["id","number","kind","status","total_cents","created_at","paid_at","vm_id","description","sub","vm"]},"BlockVolume":{"properties":{"busy":{"description":"`true` while a transition is in progress; the volume rejects new operations with `409 volume_busy` until it ends.","type":"boolean"},"cents_per_month":{"description":"What this volume costs for a month of `hours_per_month` hours, in US cents.","type":"integer"},"created_at":{"description":"When the volume was requested (Unix time, seconds, UTC)","type":"integer"},"debt_since":{"description":"Since when the wallet could not cover the hourly charges; null when nothing is owed (Unix time, seconds, UTC)","type":["integer","null"]},"device_id":{"description":"Device number the volume got inside the server; null when not attached.","type":["integer","null"]},"error_code":{"description":"Short code for `last_error`, for example `capacity`, `timeout`, `resize` or `error`; null when there is no error.","type":["string","null"]},"hourly_uusd":{"description":"What this volume costs per hour at its rate, in millionths of a US dollar (`size_gb` times `rate_uusd_gb_hour`).","type":"integer"},"hours_per_month":{"description":"Hours in a billing month used for `cents_per_month` (730 by default).","type":"integer"},"id":{"description":"Volume identifier. Use it as `vid` in the volume operations.","type":"integer"},"last_error":{"description":"Human-readable reason the last operation on this volume failed; null when it did not.","type":["string","null"]},"name":{"description":"Name of the volume.","type":"string"},"paid_cents":{"description":"Total charged to your wallet for this volume so far, in US cents.","type":"integer"},"rate_uusd_gb_hour":{"description":"Price of 1 GB for 1 hour that applies to this volume, in millionths of a US dollar. It is fixed when the volume is created and never goes up; if the site lowers its price the lower price applies.","type":"integer"},"size_gb":{"description":"Size in GB.","type":"integer"},"state":{"description":"Lifecycle state. `Ready`: created and not attached. `Attached`: attached to the server in `vm_id`. `Creating`, `Attaching`, `Detaching`, `Resizing` and `Deleting` are transitions in progress (`busy` is true). `Error`: the volume could not be created; see `last_error`.","enum":["Creating","Ready","Attaching","Attached","Detaching","Resizing","Deleting","Error"],"type":"string"},"vm_id":{"description":"Server (UUID) the volume is attached to; null when it is not attached.","type":["string","null"]}},"required":["id","name","size_gb","state","busy","vm_id","device_id","hourly_uusd","rate_uusd_gb_hour","cents_per_month","hours_per_month","paid_cents","debt_since","created_at","last_error","error_code"],"type":"object","x-order":["id","name","size_gb","state","busy","vm_id","device_id","hourly_uusd","rate_uusd_gb_hour","cents_per_month","hours_per_month","paid_cents","debt_since","created_at","last_error","error_code"]},"Byoip":{"description":"An own IP prefix registered for BGP announcement.","properties":{"activated_at":{"description":"Activation time (Unix time, seconds, UTC)","type":["integer","null"]},"asn":{"description":"Origin ASN announced for the prefix.","type":"integer"},"attachments":{"items":{"additionalProperties":true,"description":"VM attached to your own-IP network.","type":"object"},"type":"array"},"bgp":{"additionalProperties":true,"description":"BGP status: `announce`, `withdraw_reason`, `roa`, `ris_peers_seeing`, `propagated_at`.","type":"object"},"billing":{"additionalProperties":true,"description":"`charged_cents`, current ASN subscription period and prices (VND list price).","type":"object"},"can":{"additionalProperties":true,"description":"Allowed actions now: `verify`, `review_request`, `cancel`, `attach`, `bind`.","type":"object"},"checks":{"additionalProperties":true,"description":"Last verification result per check (`rpki`, `irr`, `proof`, `routing`, `blocklist`, `kind_hint`). Detail only.","type":"object"},"created_at":{"description":"Creation time (Unix time, seconds, UTC)","type":"integer"},"ended_at":{"description":"End time (Unix time, seconds, UTC)","type":["integer","null"]},"family":{"description":"Address family: 4 or 6.","type":"integer"},"gateway":{"description":"Gateway address on the private L2 network (`.1` / `::1`). `null` for a prefix routed to a Bare Metal server (`routed` is true): the server keeps its current gateway.","type":["string","null"]},"id":{"description":"Prefix identifier.","type":"integer"},"instructions":{"additionalProperties":true,"description":"ROA, IRR object text and the LOA values to request from your IP provider. Detail only.","type":"object"},"kind":{"description":"`leased` = leased from an IP provider, `own` = held by your organisation.","enum":["leased","own"],"type":"string"},"kind_label":{"description":"Display label of the type.","type":"string"},"needs_vm":{"description":"Prefix is active, but no running VM or Bare Metal server is attached — select another target (BGP remains active).","type":"boolean"},"prefix":{"description":"Normalised prefix, e.g. `45.12.34.0/24` or `2a0e:1c80::/48`.","type":"string"},"public_error":{"description":"Why the prefix is waiting/blocked: `insufficient_funds`, `vm_required`, `capacity`, `infra_pending`, `applying`, `removing`, `provision_failed`…","type":["string","null"]},"review_reason":{"description":"Reason of the manual review (`announced_by_other`, `blocklisted`, `provider_declared_own`, `customer_request`).","type":["string","null"]},"routed":{"description":"True when the prefix is routed to a Bare Metal server through its primary IP: there is no private network and no gateway to configure.","type":"boolean"},"setup":{"additionalProperties":true,"description":"Sample VM configuration once active (`commands`, `netplan`, `mtu`). Detail only.","type":["object","null"]},"state":{"description":"Lifecycle state. Nothing is charged before `provisioning`.","enum":["pending_verify","needs_review","awaiting_payment","awaiting_build","provisioning","active","suspended","terminating","terminated","expired","canceled","rejected","failed"],"type":"string"},"suspend_reason":{"description":"`unpaid`, `no_vm` or `admin`.","type":["string","null"]},"target_kind":{"description":"What the prefix is attached to: VMs, or one Bare Metal server (routed to its primary IP); `null` when nothing is attached.","enum":["vm","dedicated",null],"type":["string","null"]},"token":{"description":"Verification token (publish `byoip-verify=<token>`). Detail only.","type":"string"},"updated_at":{"description":"Last update (Unix time, seconds, UTC)","type":"integer"},"usage":{"description":"`vm` = used on VMs of this platform; `external` = announced only (manual setup).","enum":["vm","external"],"type":"string"},"verify":{"additionalProperties":true,"description":"Verification progress: `attempts`, `checked_at`, `next_check_at`, `expires_at`, `verified_at`.","type":"object"},"vms":{"items":{"additionalProperties":true,"description":"Attached VMs: `vm`, `nic` (pending/attaching/attached/detaching), `setup`, `bound_at`. Detail view only.","type":"object"},"type":"array"},"vpc_requests":{"items":{"additionalProperties":true,"description":"Private Cloud attachment requests: `id`, `vpc`, `state` (requested/done/rejected/canceled), `note`, `admin_note`. Detail view only.","type":"object"},"type":"array"}},"required":["id","prefix","family","kind","kind_label","usage","asn","state","gateway","public_error","bgp","verify","can","needs_vm","target_kind","created_at","activated_at","ended_at","updated_at"],"type":"object","x-order":["id","prefix","family","kind","kind_label","usage","asn","state","gateway","routed","public_error","review_reason","suspend_reason","bgp","verify","can","needs_vm","target_kind","checks","token","instructions","setup","attachments","vms","vpc_requests","billing","created_at","activated_at","ended_at","updated_at"]},"CatalogFx":{"properties":{"margin_bp":{"description":"Margin added on top of the reference rate, in basis points (1 bp = 0.01 percent).","type":"integer"},"round_step":{"description":"Rounding step applied to local-currency amounts, in dong: 1, 100, 1000 or 10000.","type":"integer"},"source":{"description":"Where the rate comes from, for example an automatic bank feed, a manual override, or `none` when no rate has been set.","type":"string"},"stale":{"description":"True when the rate has not been refreshed recently and may be out of date.","type":"boolean"},"updated_at":{"description":"When `usd_vnd` was last changed (Unix time, seconds, UTC)","type":"integer"},"usd_vnd":{"description":"Exchange rate used to show local-currency prices: Vietnamese dong per 1 US dollar. 0 when no rate is available.","type":"integer"},"vcb_at":{"description":"When the reference bank published `vcb_sell`; 0 when unknown (Unix time, seconds, UTC)","type":"integer"},"vcb_sell":{"description":"Selling rate published by the reference bank at `vcb_at`, dong per US dollar. 0 when unknown.","type":"integer"}},"required":["usd_vnd","source","vcb_sell","vcb_at","updated_at","margin_bp","stale","round_step"],"type":"object","x-order":["usd_vnd","source","vcb_sell","vcb_at","updated_at","margin_bp","stale","round_step"]},"CatalogOs":{"properties":{"category":{"description":"`desktop` for a VM Desktop image (Ubuntu Desktop, at least 16 GB of memory), empty for a standard image. A plan below `min` is rejected with `image_requirements`.","type":"string"},"cycles":{"items":{"description":"Billing cycle slug, e.g. `monthly`.","type":"string"},"type":["array","null"]},"display_name":{"description":"Human readable name, e.g. `Ubuntu 24.04 LTS`.","type":"string"},"icon":{"description":"Icon name.","type":["string","null"]},"id":{"description":"OS image identifier. Pass it as `template_id` when creating a server.","type":"integer"},"license_hourly_uusd":{"description":"The same license fee per hour, in millionths of a US dollar.","type":["integer","null"]},"license_monthly_cents":{"description":"Operating-system license fee in US cents for a 30-day month (730 hours), added to the plan price. `0` for free operating systems and `null` for images that are not sold with a licensed region. Windows images carry a fee.","type":["integer","null"]},"min":{"properties":{"cpu":{"description":"Smallest number of vCPU cores this image can be installed on.","type":"integer"},"disk_gb":{"description":"Smallest system disk in GiB.","type":"integer"},"ram_mb":{"description":"Smallest memory in MiB.","type":"integer"}},"required":["cpu","ram_mb","disk_gb"],"type":["object","null"],"x-order":["cpu","ram_mb","disk_gb"]},"os_family":{"description":"`linux`, `windows`, `bsd` ...","type":"string"},"os_version":{"description":"Version label, when known.","type":["string","null"]},"size_gb":{"description":"Minimum system disk the image needs, in GiB, when known.","type":["integer","null"]},"username":{"description":"Default administrator account name of the image.","type":"string"},"zone_ids":{"items":{"description":"Region identifier.","type":"integer"},"type":"array"}},"required":["id","display_name","os_family","os_version","username","size_gb","zone_ids"],"type":"object","x-order":["id","display_name","os_family","os_version","username","icon","size_gb","zone_ids","license_monthly_cents","license_hourly_uusd","cycles","min","category"]},"CatalogZone":{"properties":{"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"id":{"description":"Region identifier. Pass it as `zone_id` when ordering.","type":"integer"},"is_default":{"description":"Whether this is the default region of the site.","type":"boolean"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"services":{"items":{"description":"Service sold in the region, such as `vm`, `vpn` or `s3`.","type":"string"},"type":"array"},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"}},"required":["id","slug","name","name_en","country","city","is_default","services"],"type":"object","x-order":["id","slug","name","name_en","country","city","is_default","services"]},"ConsoleShare":{"properties":{"created_at":{"description":"Time the link was created (Unix time, seconds, UTC)","type":"integer"},"expires_at":{"description":"Time the link stops working (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Share link identifier. Pass it to [Revoke a share link](#operation/vm_console_share_revoke).","type":"string"},"label":{"description":"Label you gave the link.","type":["string","null"]},"mode":{"description":"`ro` lets the viewer watch only; `rw` lets the viewer type into the terminal.","enum":["ro","rw"],"type":"string"},"token":{"description":"Secret token of the link. Only returned when the caller may use the terminal (a signed-in session, or a key with the `vm:console` scope); a key with only `vm:read` sees the link without its token.","type":"string"},"variant":{"description":"`shared` attaches the viewer to the same terminal session you use; `isolated` gives the viewer a separate session.","enum":["shared","isolated"],"type":"string"},"websocket_url":{"description":"WebSocket address to connect to together with the token. Returned together with `token`.","type":"string"}},"required":["id","mode","variant","label","expires_at","created_at"],"type":"object","x-order":["id","mode","variant","label","expires_at","created_at","token","websocket_url"]},"CycleQuote":{"properties":{"cents":{"description":"Price of one full cycle in US cents (0 for pay-by-the-hour).","type":"integer"},"discount_pct":{"description":"Discount applied to the monthly price for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"},"slug":{"description":"Billing cycle identifier, e.g. `monthly`, `quarterly`, `yearly`.","type":"string"}},"required":["slug","name","months","discount_pct","cents"],"type":"object","x-order":["slug","name","months","discount_pct","cents"]},"DedicatedAction":{"properties":{"allowed":{"description":"Whether the action can be started now.","type":"boolean"},"message":{"description":"The reason as a sentence in your account language; null when the action is allowed.","type":["string","null"]},"reason":{"description":"Why the action is unavailable, in priority order; null when it is allowed.","enum":["dedicated_ops_disabled","dedicated_server_locked","dedicated_suspended","dedicated_busy","dedicated_bmc_unavailable","not_supported",null],"type":["string","null"]}},"required":["allowed","reason","message"],"type":"object","x-order":["allowed","reason","message"]},"DedicatedAgent":{"properties":{"can_change_pw":{"description":"True when the agent is online and supports password changes.","type":"boolean"},"change":{"anyOf":[{"$ref":"#/components/schemas/DedicatedPwChange"},{"type":"null"}]},"collects":{"items":{"description":"What the agent reports: `cpu`, `memory`, `disk`, `network_total`, `version`.","type":"string"},"type":"array"},"embed_families":{"items":{"description":"Operating system families that get the agent during an automatic install.","type":"string"},"type":"array"},"last_seen":{"description":"When the agent last reported (Unix time, seconds, UTC)","type":["integer","null"]},"os":{"description":"`linux` or `windows`.","type":["string","null"]},"os_user":{"description":"The OS account whose password can be changed (`root` or `Administrator`).","type":["string","null"]},"state":{"description":"`online` the agent reported in the last minute; `offline` it did not; `waiting` an install is in progress and the agent has not registered yet; `none` no agent.","enum":["online","offline","waiting","none"],"type":"string"},"version":{"description":"Agent version.","type":["string","null"]},"window_open":{"description":"True while a one-time enrolment token is valid.","type":"boolean"}},"required":["state","version","os","last_seen","can_change_pw","window_open","embed_families","os_user","change","collects"],"type":"object","x-order":["state","version","os","last_seen","can_change_pw","window_open","embed_families","os_user","change","collects"]},"DedicatedBilling":{"properties":{"anchor_day":{"description":"Day of the month on which renewals fall (1-31); a short month uses its last day.","type":["integer","null"]},"auto_renew":{"description":"Whether the wallet is charged automatically at the renewal date.","type":"boolean"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"can_renew":{"description":"True when [Renew a Dedicated Server](#operation/dedicated_renew) can be called at any time.","type":"boolean"},"cycle":{"description":"Billing cycle of the current period.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"cycle_months":{"description":"Months in one cycle.","type":"integer"},"cycles":{"items":{"properties":{"cycle":{"description":"Cycle offered by the plan that applies at the next renewal.","type":"string"},"discount_pct":{"description":"Discount against the monthly price, in percent.","type":"number"},"months":{"description":"Months in the cycle.","type":"integer"},"price_vnd":{"description":"Price of one such cycle in VND.","type":"integer"}},"required":["cycle","months","price_vnd","discount_pct"],"type":"object","x-order":["cycle","months","price_vnd","discount_pct"]},"type":"array"},"debt":{"properties":{"amount_cents":{"description":"Amount of the open invoice in US cents.","type":["integer","null"]},"grace_until":{"description":"End of the grace period. (Unix time, seconds, UTC)","type":["integer","null"]},"invoice_id":{"description":"Identifier of the open invoice.","type":["integer","null"]},"overdue":{"description":"True when the open invoice is past its due date.","type":"boolean"},"suspended":{"description":"True when the subscription is suspended for non-payment.","type":"boolean"},"unpaid":{"description":"True when a renewal invoice is open.","type":"boolean"}},"required":["unpaid","overdue","suspended","amount_cents","invoice_id","grace_until"],"type":"object","x-order":["unpaid","overdue","suspended","amount_cents","invoice_id","grace_until"]},"free":{"description":"True for a free subscription: there is nothing to renew, change or pay.","type":"boolean"},"last_invoice":{"anyOf":[{"$ref":"#/components/schemas/DedicatedInvoice"},{"type":"null"}]},"max_periods":{"description":"Largest `periods` accepted by one renewal: the total stays within 24 real months of the cycle that will apply at the next renewal.","type":"integer"},"next":{"properties":{"amount_cents":{"description":"What the next renewal costs in US cents at today's exchange rate.","type":["integer","null"]},"cycle":{"description":"Cycle that will apply at the next renewal; differs from `cycle` after [Change the billing cycle](#operation/dedicated_cycle) or an approved downgrade.","type":"string"},"plan_code":{"description":"Plan that will apply at the next renewal.","type":["string","null"]},"price_vnd":{"description":"Price of the next renewal in VND.","type":"integer"},"scheduled_change":{"description":"True when a cycle change or a downgrade is waiting for the next renewal.","type":"boolean"}},"required":["plan_code","cycle","price_vnd","amount_cents","scheduled_change"],"type":"object","x-order":["plan_code","cycle","price_vnd","amount_cents","scheduled_change"]},"pending_cycle":{"description":"Cycle waiting for the next renewal, if you asked for a change.","type":["string","null"]},"pending_plan":{"properties":{"code":{"description":"Plan code.","type":"string"},"name":{"description":"Plan display name.","type":"string"}},"required":["code","name"],"type":["object","null"]},"plan":{"properties":{"code":{"description":"Plan code.","type":"string"},"name":{"description":"Plan display name.","type":"string"},"spec":{"description":"Plan hardware summary, as published in the public plan list."}},"required":["code","name","spec"],"type":["object","null"]},"plan_change":{"anyOf":[{"$ref":"#/components/schemas/DedicatedPlanChange"},{"type":"null"}]},"price_vnd":{"description":"Locked price of the current cycle in VND.","type":"integer"},"renew_at":{"description":"Renewal date: the service is paid up to this time. (Unix time, seconds, UTC)","type":["integer","null"]},"status":{"description":"Subscription state.","enum":["active","suspended"],"type":"string"}},"required":["free","plan","cycle","cycle_months","price_vnd","next","cycles","anchor_day","renew_at","auto_renew","status","can_renew","max_periods","debt","last_invoice","pending_cycle","pending_plan","plan_change","balance_cents"],"type":"object","x-order":["free","plan","cycle","cycle_months","price_vnd","next","cycles","anchor_day","renew_at","auto_renew","status","can_renew","max_periods","debt","last_invoice","pending_cycle","pending_plan","plan_change","balance_cents"]},"DedicatedCatalog":{"properties":{"auto_install":{"description":"False when automatic installation is not available right now; then you can only install the system yourself through ISO/Console.","type":"boolean"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"beta":{"description":"True when your account may see the catalog before the sale opens (orders are still refused).","type":"boolean"},"currency":{"description":"Always `VND`: plans are priced in VND.","type":"string"},"enabled":{"description":"True when Dedicated Servers are on sale. When false and you are not in the beta list, `plans` is empty and no price is shown.","type":"boolean"},"fx":{"additionalProperties":true,"description":"Exchange rate used to convert VND to US cents: `usd_vnd` and metadata. Absent when sales are closed.","type":"object"},"plans":{"items":{"properties":{"code":{"description":"Plan code, e.g. `DS-6138-128`.","type":"string"},"cycles":{"items":{"properties":{"cycle":{"description":"Billing cycle.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"discount_pct":{"description":"Discount of this cycle in percent.","type":"number"},"monthly_equiv_vnd":{"description":"`price_vnd` divided by `months`.","type":"integer"},"months":{"description":"Months in one cycle.","type":"integer"},"price_vnd":{"description":"Price of one cycle in VND, rounded down to 1,000.","type":"integer"}},"required":["cycle","months","discount_pct","price_vnd","monthly_equiv_vnd"],"type":"object","x-order":["cycle","months","discount_pct","price_vnd","monthly_equiv_vnd"]},"type":"array"},"monthly_vnd":{"description":"Monthly price in VND before cycle discounts.","type":"integer"},"name":{"description":"Plan display name.","type":"string"},"on_sale":{"description":"False while sales are closed or the plan is switched off (visible only to beta accounts).","type":"boolean"},"setup_fee_vnd":{"description":"One-time setup fee in VND.","type":"integer"},"spec":{"additionalProperties":true,"description":"Configuration: `cpu`, `cores`, `threads`, `ram_gb`, `storage`, `ipv4`, `console`.","type":"object"},"stock":{"items":{"properties":{"backorder":{"description":"True when no server is left: an order is accepted and waits for a server (`awaiting_stock`).","type":"boolean"},"count":{"description":"Servers available.","type":"integer"},"count_os":{"description":"Servers on which the operating system can be installed automatically.","type":"integer"},"zone_id":{"description":"Zone identifier.","type":"integer"}},"required":["zone_id","count","count_os","backorder"],"type":"object","x-order":["zone_id","count","count_os","backorder"]},"type":"array"}},"required":["code","name","spec","monthly_vnd","setup_fee_vnd","cycles","stock","on_sale"],"type":"object","x-order":["code","name","spec","monthly_vnd","setup_fee_vnd","cycles","stock","on_sale"]},"type":"array"},"templates":{"items":{"properties":{"family":{"description":"Operating system family.","enum":["ubuntu","debian","windows"],"type":"string"},"install_minutes":{"description":"Typical installation time in minutes (25 for Linux, 60 for Windows).","type":"integer"},"min_disk_gb":{"description":"Minimum disk in GiB; null when not stated.","type":["integer","null"]},"min_ram_gb":{"description":"Minimum memory in GiB; null when not stated.","type":["integer","null"]},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Template identifier, e.g. `ubuntu-24.04`.","type":"string"},"username":{"description":"Administrator account created on the installed system.","type":"string"},"version":{"description":"Version.","type":"string"}},"required":["slug","name","family","version","username","install_minutes","min_ram_gb","min_disk_gb"],"type":"object","x-order":["slug","name","family","version","username","install_minutes","min_ram_gb","min_disk_gb"]},"type":"array"},"zones":{"items":{"properties":{"country":{"description":"Two-letter country code.","type":"string"},"id":{"description":"Zone identifier.","type":"integer"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Short zone name.","type":"string"}},"required":["id","slug","name","country"],"type":"object","x-order":["id","slug","name","country"]},"type":"array"}},"required":["enabled","beta","currency","zones","plans","templates","auto_install","balance_cents"],"type":"object","x-order":["enabled","beta","currency","zones","plans","templates","auto_install","balance_cents","fx"]},"DedicatedConsoleSession":{"properties":{"error":{"description":"Reason code when `status` is `failed`: `dedicated_console_failed`.","type":"string"},"expires_at":{"description":"When the session ends (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Console session identifier (`dcs_` followed by 16 hex characters).","type":"string"},"poll_after":{"description":"While `preparing`: seconds to wait before polling again.","type":"integer"},"status":{"description":"`preparing` while the console is being enabled, `ready` and `active` when it can be used, then `closed`, `expired` or `failed`.","enum":["preparing","ready","active","closed","failed","expired"],"type":"string"},"url":{"description":"Console address to open in a browser. It works once and only for 60 seconds, then you need to ask for a new one. Present only when the session is `ready` or `active`.","type":"string"},"url_expires_in":{"description":"Seconds the `url` stays valid.","type":"integer"}},"required":["id","status","expires_at"],"type":"object","x-order":["id","status","expires_at","poll_after","url","url_expires_in","error"]},"DedicatedInvoice":{"properties":{"created_at":{"description":"When the invoice was created. (Unix time, seconds, UTC)","type":"integer"},"currency":{"description":"Invoice currency.","type":"string"},"description":{"description":"First line of the invoice.","type":["string","null"]},"due_at":{"description":"Payment due date. (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Invoice identifier.","type":"integer"},"kind":{"description":"`renewal`, `receipt` (order or plan upgrade).","type":"string"},"number":{"description":"Invoice number.","type":["string","null"]},"paid_at":{"description":"When it was paid. (Unix time, seconds, UTC)","type":["integer","null"]},"period_from":{"description":"Start of the covered period. (Unix time, seconds, UTC)","type":["integer","null"]},"period_to":{"description":"End of the covered period. (Unix time, seconds, UTC)","type":["integer","null"]},"status":{"description":"`paid`, `unpaid`, `overdue`, `cancelled` or `refunded`.","type":"string"},"total_cents":{"description":"Total in US cents.","type":"integer"}},"required":["id","number","kind","status","total_cents","currency","created_at","paid_at","due_at","description","period_from","period_to"],"type":"object","x-order":["id","number","kind","status","total_cents","currency","created_at","paid_at","due_at","description","period_from","period_to"]},"DedicatedIso":{"properties":{"attached_at":{"description":"When the ISO was attached to the server (Unix time, seconds, UTC)","type":["integer","null"]},"bytes_done":{"description":"Bytes downloaded so far.","type":"integer"},"bytes_total":{"description":"Size announced by the source; null while unknown. After the download: the real size.","type":["integer","null"]},"created_at":{"description":"When the download was requested (Unix time, seconds, UTC)","type":"integer"},"error":{"properties":{"code":{"description":"Reason code, e.g. `blocked_url`, `too_large`, `not_iso`, `timeout`, `stalled`, `http_error`, `storage_low`, `attach_failed`, `detach_failed`.","type":"string"},"message":{"description":"The reason as a sentence in your account language.","type":"string"}},"required":["code","message"],"type":["object","null"]},"expires_at":{"description":"When the ISO is detached and deleted automatically (Unix time, seconds, UTC)","type":["integer","null"]},"expires_in":{"description":"Seconds until `expires_at` (0 once passed).","type":["integer","null"]},"file_name":{"description":"File name reported by the source, sanitised. Informational.","type":["string","null"]},"id":{"description":"ISO identifier (`iso_` followed by 16 hex characters).","type":"string"},"kind":{"description":"What the signature check recognised: a plain ISO 9660 image, a bootable ISO (El Torito) or a raw disk image (MBR/GPT).","enum":["iso9660","eltorito","img",null],"type":["string","null"]},"percent":{"description":"Download progress 0-100; null while the size is unknown. 100 once downloaded.","type":["integer","null"]},"ready_at":{"description":"When the file was downloaded and verified (Unix time, seconds, UTC)","type":["integer","null"]},"sha256":{"description":"SHA-256 of the downloaded file (hex); present once the download has finished.","type":["string","null"]},"state":{"description":"`queued`, `downloading` and `verifying` while the file is fetched and checked; `ready` once it can be attached; `attaching`, `attached` and `detaching` while it is (being) mounted on the server; `expired`, `deleted` or `failed` when it is over.","enum":["queued","downloading","verifying","ready","attaching","attached","detaching","expired","deleted","failed"],"type":"string"},"url":{"description":"The address you gave, with credentials removed and the values of sensitive query parameters (token, key, signature, password…) replaced by `***`.","type":"string"}},"required":["id","state","url","file_name","bytes_total","bytes_done","percent","sha256","kind","error","created_at","ready_at","expires_at","expires_in","attached_at"],"type":"object","x-order":["id","state","url","file_name","bytes_total","bytes_done","percent","sha256","kind","error","created_at","ready_at","expires_at","expires_in","attached_at"]},"DedicatedIsoView":{"properties":{"actions":{"properties":{"attach":{"properties":{"allowed":{"description":"Whether the action can be started now.","type":"boolean"},"message":{"description":"The reason as a sentence in your account language; null when attaching is allowed.","type":["string","null"]},"reason":{"description":"Why the action is unavailable, in priority order; null when it is allowed.","enum":["dedicated_ops_disabled","dedicated_server_locked","dedicated_suspended","dedicated_busy","dedicated_bmc_unavailable","not_supported","iso_exists","iso_none","iso_not_ready","iso_not_attached","iso_busy","iso_disabled",null],"type":["string","null"]}},"required":["allowed","reason","message"],"type":"object","x-order":["allowed","reason","message"]},"delete":{"properties":{"allowed":{"description":"Whether the action can be started now.","type":"boolean"},"message":{"description":"The reason as a sentence in your account language; null when deleting is allowed.","type":["string","null"]},"reason":{"description":"Why the action is unavailable, in priority order; null when it is allowed.","enum":["dedicated_ops_disabled","dedicated_server_locked","dedicated_suspended","dedicated_busy","dedicated_bmc_unavailable","not_supported","iso_exists","iso_none","iso_not_ready","iso_not_attached","iso_busy","iso_disabled",null],"type":["string","null"]}},"required":["allowed","reason","message"],"type":"object","x-order":["allowed","reason","message"]},"detach":{"properties":{"allowed":{"description":"Whether the action can be started now.","type":"boolean"},"message":{"description":"The reason as a sentence in your account language; null when detaching is allowed.","type":["string","null"]},"reason":{"description":"Why the action is unavailable, in priority order; null when it is allowed.","enum":["dedicated_ops_disabled","dedicated_server_locked","dedicated_suspended","dedicated_busy","dedicated_bmc_unavailable","not_supported","iso_exists","iso_none","iso_not_ready","iso_not_attached","iso_busy","iso_disabled",null],"type":["string","null"]}},"required":["allowed","reason","message"],"type":"object","x-order":["allowed","reason","message"]},"download":{"properties":{"allowed":{"description":"Whether the action can be started now.","type":"boolean"},"message":{"description":"The reason as a sentence in your account language; null when downloading is allowed.","type":["string","null"]},"reason":{"description":"Why the action is unavailable, in priority order; null when it is allowed.","enum":["dedicated_ops_disabled","dedicated_server_locked","dedicated_suspended","dedicated_busy","dedicated_bmc_unavailable","not_supported","iso_exists","iso_none","iso_not_ready","iso_not_attached","iso_busy","iso_disabled",null],"type":["string","null"]}},"required":["allowed","reason","message"],"type":"object","x-order":["allowed","reason","message"]}},"required":["download","attach","detach","delete"],"type":"object","x-order":["download","attach","detach","delete"]},"iso":{"anyOf":[{"$ref":"#/components/schemas/DedicatedIso"},{"type":"null"}]},"limits":{"properties":{"max_bytes":{"description":"Largest ISO accepted, in bytes.","type":"integer"},"ports":{"items":{"description":"Port allowed in the URL.","type":"integer"},"type":"array"},"schemes":{"items":{"description":"URL scheme allowed.","type":"string"},"type":"array"},"ttl_hours":{"description":"Hours an ISO is kept after it is ready, then it is removed automatically.","type":"integer"}},"required":["max_bytes","ttl_hours","ports","schemes"],"type":"object","x-order":["max_bytes","ttl_hours","ports","schemes"]}},"required":["iso","limits","actions"],"type":"object","x-order":["iso","limits","actions"]},"DedicatedOp":{"properties":{"action":{"description":"For `power`: the requested action; null for other kinds.","type":["string","null"]},"created_at":{"description":"When the operation was requested (Unix time, seconds, UTC)","type":"integer"},"finished_at":{"description":"When the operation finished; null while it is open (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Operation identifier.","type":"integer"},"kind":{"description":"What the operation does.","enum":["power","console","os_install","iso_attach","iso_detach"],"type":"string"},"public_error":{"description":"Reason code when the operation failed, for example `ops_disabled`, `server_locked`, `timeout`, `bmc_unreachable`, `cancelled`; null otherwise.","type":["string","null"]},"requested_by":{"description":"Who asked for it: you, a support administrator or the system.","enum":["you","admin","system"],"type":"string"},"result":{"description":"Outcome once finished: `ok`, `noop` (the server was already in the requested state) or `graceful_timeout` (the operating system did not shut down in time; the server was left running). Null while open or after a failure.","type":["string","null"]},"state":{"description":"Progress of the operation.","enum":["queued","running","waiting","done","failed","cancelled"],"type":"string"},"step":{"description":"Short name of the step being worked on. Informational.","type":"string"}},"required":["id","kind","action","state","step","result","public_error","requested_by","created_at","finished_at"],"type":"object","x-order":["id","kind","action","state","step","result","public_error","requested_by","created_at","finished_at"]},"DedicatedOpBrief":{"properties":{"action":{"description":"For `power`: the requested action (`on`, `off`, `shutdown`, `reboot`, `reset`); null for other kinds.","type":["string","null"]},"id":{"description":"Operation identifier.","type":"integer"},"kind":{"description":"What the operation does.","enum":["power","console","os_install","iso_attach","iso_detach"],"type":"string"},"state":{"description":"Progress of the operation: `queued`, `running` and `waiting` are open, the others are final.","enum":["queued","running","waiting","done","failed","cancelled"],"type":"string"},"step":{"description":"Short name of the step being worked on. Informational.","type":"string"}},"required":["id","kind","action","state","step"],"type":"object","x-order":["id","kind","action","state","step"]},"DedicatedOrder":{"properties":{"amount_cents":{"description":"US cents charged from the wallet, at the exchange rate of the moment.","type":"integer"},"created_at":{"description":"When the order was placed (Unix time, seconds, UTC)","type":"integer"},"cycle":{"description":"Billing cycle.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"delivered_at":{"description":"When the server was delivered (Unix time, seconds, UTC)","type":["integer","null"]},"hostname":{"description":"Host name given at order time.","type":"string"},"id":{"description":"Order identifier.","type":"integer"},"invoice_id":{"description":"Identifier of the paid invoice.","type":["integer","null"]},"months":{"description":"Months in one cycle.","type":"integer"},"op_id":{"description":"Operation that installs the operating system; poll it with Get an operation. Null when there is no automatic install.","type":["integer","null"]},"plan_code":{"description":"Plan code you ordered.","type":"string"},"plan_name":{"description":"Plan display name.","type":"string"},"price_vnd":{"description":"Price of the first cycle in VND (locked: this is also the price of every renewal).","type":"integer"},"public_error":{"description":"Short reason code when the installation failed, e.g. `timeout`; null otherwise.","type":["string","null"]},"refund_reason":{"description":"Why the order was refunded; null otherwise.","enum":["install_failed","admin_cancel","customer_cancel",null],"type":["string","null"]},"refunded_cents":{"description":"US cents returned to the wallet; 0 when nothing was refunded.","type":"integer"},"server_id":{"description":"Dedicated Server identifier (`ds_…`) assigned to the order.","type":["string","null"]},"setup_fee_vnd":{"description":"One-time setup fee in VND.","type":"integer"},"status":{"description":"`awaiting_stock`: paid, waiting for a server to be assigned (1–3 business days; a full refund if it cannot be delivered). `installing`: the operating system is being installed. `delivered`: the server is yours and ready. `refunded`: the installation failed and the full amount was returned to your wallet. `cancelled`: cancelled by an administrator.","enum":["awaiting_stock","installing","delivered","refunded","cancelled"],"type":"string"},"template":{"description":"Operating system template that is installed automatically; null when you install it yourself.","type":["string","null"]},"total_vnd":{"description":"`price_vnd` + `setup_fee_vnd`.","type":"integer"},"zone_id":{"description":"Location identifier.","type":"integer"}},"required":["id","status","plan_code","plan_name","zone_id","cycle","months","price_vnd","setup_fee_vnd","total_vnd","amount_cents","template","hostname","server_id","op_id","invoice_id","refund_reason","refunded_cents","public_error","created_at","delivered_at"],"type":"object","x-order":["id","status","plan_code","plan_name","zone_id","cycle","months","price_vnd","setup_fee_vnd","total_vnd","amount_cents","template","hostname","server_id","op_id","invoice_id","refund_reason","refunded_cents","public_error","created_at","delivered_at"]},"DedicatedOsTemplate":{"properties":{"family":{"description":"Operating system family.","enum":["ubuntu","debian","windows"],"type":"string"},"min_disk_gb":{"description":"Minimum disk space in GiB the system needs; null when not stated.","type":["integer","null"]},"min_ram_gb":{"description":"Minimum memory in GiB the system needs; null when not stated.","type":["integer","null"]},"name":{"description":"Display name, e.g. `Ubuntu Server 24.04 LTS`.","type":"string"},"slug":{"description":"Template identifier, e.g. `ubuntu-24.04`. Use it as `template` when reinstalling.","type":"string"},"username":{"description":"Name of the administrator account created on the installed system.","type":"string"},"version":{"description":"Version, e.g. `24.04`, `13`, `2022`.","type":"string"}},"required":["slug","name","family","version","username","min_ram_gb","min_disk_gb"],"type":"object","x-order":["slug","name","family","version","username","min_ram_gb","min_disk_gb"]},"DedicatedPlanChange":{"properties":{"charged_cents":{"description":"Difference charged for an upgrade, in US cents.","type":["integer","null"]},"charged_vnd":{"description":"Difference charged for an upgrade, in VND.","type":["integer","null"]},"decided_at":{"description":"When it was approved, declined or cancelled. (Unix time, seconds, UTC)","type":["integer","null"]},"effective":{"description":"When an approved change applies: an upgrade at once, a downgrade at the next renewal.","enum":["now","next_period",null],"type":["string","null"]},"from_plan":{"properties":{"code":{"description":"Plan code.","type":"string"},"name":{"description":"Plan display name.","type":"string"}},"required":["code","name"],"type":["object","null"]},"id":{"description":"Request identifier.","type":"integer"},"invoice_id":{"description":"Invoice of the charged difference.","type":["integer","null"]},"kind":{"description":"Upgrade or downgrade, by the listed monthly price of the plans.","enum":["upgrade","downgrade"],"type":"string"},"note":{"description":"Your note, or the administrator's.","type":["string","null"]},"reason":{"description":"Why the request was declined.","type":["string","null"]},"requested_at":{"description":"When you asked. (Unix time, seconds, UTC)","type":"integer"},"status":{"description":"Request state. Nothing is charged until it is approved.","enum":["pending","approved","rejected","cancelled"],"type":"string"},"to_plan":{"properties":{"code":{"description":"Plan code.","type":"string"},"name":{"description":"Plan display name.","type":"string"}},"required":["code","name"],"type":"object"}},"required":["id","from_plan","to_plan","kind","status","note","reason","requested_at","decided_at","effective","charged_vnd","charged_cents","invoice_id"],"type":"object","x-order":["id","from_plan","to_plan","kind","status","note","reason","requested_at","decided_at","effective","charged_vnd","charged_cents","invoice_id"]},"DedicatedPlanOption":{"properties":{"code":{"description":"Plan code to send to [Request a plan change](#operation/dedicated_plan_change).","type":"string"},"diff_vnd":{"description":"Price of one cycle minus your current locked price, in VND (negative for a cheaper plan).","type":"integer"},"kind":{"description":"Direction of the change.","enum":["upgrade","downgrade"],"type":"string"},"monthly_vnd":{"description":"Listed price per month in VND.","type":"integer"},"name":{"description":"Plan display name.","type":"string"},"price_vnd":{"description":"Price of one cycle of your current billing cycle in VND.","type":"integer"},"quote":{"properties":{"basis_source":{"description":"`renewal`, `order` or `subscription`.","type":"string"},"basis_vnd":{"description":"What you have already paid for the current period, in VND. The difference is computed from this, never from today's list price.","type":"integer"},"charge_cents":{"description":"Estimated difference in US cents.","type":"integer"},"charge_vnd":{"description":"Estimated difference if it were approved now, in VND.","type":"integer"},"new_price_vnd":{"description":"Price of one cycle of the new plan in VND.","type":"integer"},"period_from":{"description":"Start of the paid period. (Unix time, seconds, UTC)","type":"integer"},"period_to":{"description":"End of the paid period. (Unix time, seconds, UTC)","type":"integer"},"remaining_secs":{"description":"Seconds left in the paid period.","type":"integer"}},"required":["basis_vnd","basis_source","new_price_vnd","period_from","period_to","remaining_secs","charge_vnd","charge_cents"],"type":["object","null"],"x-order":["basis_vnd","basis_source","new_price_vnd","period_from","period_to","remaining_secs","charge_vnd","charge_cents"]},"spec":{"description":"Plan hardware summary."}},"required":["code","name","spec","monthly_vnd","price_vnd","diff_vnd","kind","quote"],"type":"object","x-order":["code","name","spec","monthly_vnd","price_vnd","diff_vnd","kind","quote"]},"DedicatedPwChange":{"properties":{"code":{"description":"Short reason when `failed`/`cancelled`, e.g. `policy`, `chpasswd_failed`, `stale`.","type":["string","null"]},"created_at":{"description":"When the change was requested (Unix time, seconds, UTC)","type":"integer"},"done_at":{"description":"When the state became final (Unix time, seconds, UTC)","type":["integer","null"]},"expires_at":{"description":"When the request stops being delivered (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Identifier of the password change.","type":"string"},"state":{"description":"`pending` while the agent has not answered; `applied` when the agent confirmed (the new password is then the one shown in Credentials); `failed` when the agent refused (see `code`); `unconfirmed` when no answer came in time (the password may or may not have changed - submit it again); `cancelled` when the server was reinstalled, transferred or the request was replaced.","enum":["pending","applied","failed","unconfirmed","cancelled"],"type":"string"}},"required":["id","state","code","created_at","expires_at","done_at"],"type":"object","x-order":["id","state","code","created_at","expires_at","done_at"]},"DedicatedQuote":{"properties":{"amount_cents":{"description":"US cents that would be charged now.","type":"integer"},"backorder":{"description":"True when no server is left in the zone: the order is still accepted and it waits for a server (`awaiting_stock`), delivered in 1–3 business days; if it cannot be delivered you get a full refund.","type":"boolean"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"can_order":{"description":"True when an order placed now would be accepted.","type":"boolean"},"cycle":{"description":"Billing cycle.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"fx_usd_vnd":{"description":"Exchange rate (VND per USD) used for `amount_cents`.","type":"integer"},"months":{"description":"Months in one cycle.","type":"integer"},"plan_code":{"description":"Plan code.","type":"string"},"price_vnd":{"description":"Price of the first cycle in VND.","type":"integer"},"reasons":{"items":{"description":"Why the order cannot be placed now.","enum":["sales_disabled","os_install_unavailable","insufficient_funds","email_unverified"],"type":"string"},"type":"array"},"renew_at_estimate":{"description":"When the first renewal would be due (Unix time, seconds, UTC)","type":"integer"},"setup_fee_vnd":{"description":"One-time setup fee in VND.","type":"integer"},"shortfall_cents":{"description":"US cents missing in the wallet; 0 when the balance is enough.","type":"integer"},"shortfall_vnd":{"description":"The same shortfall in VND, rounded up.","type":"integer"},"stock":{"description":"Servers available for the plan in the zone.","type":"integer"},"stock_os":{"description":"Of those, servers on which the operating system can be installed automatically.","type":"integer"},"total_vnd":{"description":"Total in VND.","type":"integer"},"zone_id":{"description":"Zone identifier.","type":"integer"}},"required":["plan_code","zone_id","cycle","months","price_vnd","setup_fee_vnd","total_vnd","amount_cents","fx_usd_vnd","balance_cents","shortfall_cents","shortfall_vnd","can_order","reasons","stock","backorder","stock_os","renew_at_estimate"],"type":"object","x-order":["plan_code","zone_id","cycle","months","price_vnd","setup_fee_vnd","total_vnd","amount_cents","fx_usd_vnd","balance_cents","shortfall_cents","shortfall_vnd","can_order","reasons","stock","backorder","stock_os","renew_at_estimate"]},"DedicatedRenewal":{"properties":{"amount_cents":{"description":"What paying now costs in US cents: the amount locked on the open invoice, otherwise the price of the next cycle at today's exchange rate. Null when the exchange rate is not available.","type":["integer","null"]},"auto_renew":{"description":"When true the wallet is charged automatically on the renewal date if the balance is enough.","type":"boolean"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"can_pay":{"description":"True when [Renew a Dedicated Server](#operation/dedicated_renew) can be called now: an invoice is open, or the renewal date is within the last 14 days.","type":"boolean"},"cycle":{"description":"Billing cycle.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"cycle_months":{"description":"Months in one cycle (1, 3, 6, 12 or 24).","type":"integer"},"grace_until":{"description":"While `unpaid` or `suspended`: the end of the grace period after which an unpaid subscription is suspended; null otherwise (Unix time, seconds, UTC)","type":["integer","null"]},"invoice_id_open":{"description":"Identifier of the open renewal invoice (see Invoices); null when there is none","type":["integer","null"]},"period_to":{"description":"The renewal date you will have after paying now (Unix time, seconds, UTC)","type":"integer"},"price_vnd":{"description":"Locked price of one cycle in VND. It is the price of your subscription, not the catalog price.","type":"integer"},"renew_at":{"description":"Next renewal date: the invoice for the next cycle is issued at this time (Unix time, seconds, UTC)","type":"integer"},"status":{"description":"`ok`: nothing to do. `due_soon`: renews within 7 days. `unpaid`: an invoice is open and waiting for payment. `suspended`: the invoice was not paid before the end of the grace period and the subscription is read-only (the server keeps running).","enum":["ok","due_soon","unpaid","suspended"],"type":"string"}},"required":["renew_at","price_vnd","cycle","cycle_months","auto_renew","status","grace_until","invoice_id_open","amount_cents","balance_cents","period_to","can_pay"],"type":"object","x-order":["renew_at","price_vnd","cycle","cycle_months","auto_renew","status","grace_until","invoice_id_open","amount_cents","balance_cents","period_to","can_pay"]},"DedicatedSensors":{"properties":{"at":{"description":"When the sensors were last read (Unix time, seconds, UTC)","type":["integer","null"]},"fans":{"items":{"properties":{"health":{"description":"Health.","type":["string","null"]},"name":{"description":"Fan name.","type":"string"},"rpm":{"description":"Speed in revolutions per minute.","type":"integer"}},"required":["name","rpm","health"],"type":"object","x-order":["name","rpm","health"]},"type":"array"},"health":{"description":"Overall hardware health.","type":["string","null"]},"network":{"properties":{"at":{"description":"Start of the 5-minute interval the rate comes from (Unix time, seconds, UTC)","type":["integer","null"]},"in_bps":{"description":"Current traffic received by the server, in bits per second (average of the last 5 minutes).","type":["integer","null"]},"month":{"properties":{"in_bytes":{"description":"Bytes received in the month.","type":"integer"},"month":{"description":"Month of the total, `YYYY-MM`.","type":"string"},"out_bytes":{"description":"Bytes sent in the month.","type":"integer"}},"required":["month","in_bytes","out_bytes"],"type":"object","x-order":["month","in_bytes","out_bytes"]},"out_bps":{"description":"Current traffic sent by the server, in bits per second (average of the last 5 minutes).","type":["integer","null"]},"reason":{"description":"`no_data` when no recent measurement exists; the rates are then `null`.","type":["string","null"]}},"required":["in_bps","out_bps","at","month","reason"],"type":"object","x-order":["in_bps","out_bps","at","month","reason"]},"power":{"properties":{"avg":{"description":"Average over the last minute.","type":["integer","null"]},"capacity":{"description":"Power capacity in watts.","type":["integer","null"]},"max":{"description":"Maximum over the last minute.","type":["integer","null"]},"min":{"description":"Minimum over the last minute.","type":["integer","null"]},"watts":{"description":"Current power draw in watts.","type":["integer","null"]}},"required":["watts","avg","min","max","capacity"],"type":["object","null"],"x-order":["watts","avg","min","max","capacity"]},"psus":{"items":{"properties":{"health":{"description":"Health.","type":["string","null"]},"input_v":{"description":"Input voltage.","type":["integer","null"]},"name":{"description":"Power supply name.","type":"string"}},"required":["name","health","input_v"],"type":"object","x-order":["name","health","input_v"]},"type":"array"},"series":{"properties":{"points":{"items":{"properties":{"cpu_max_c":{"description":"Average hottest processor temperature in degrees Celsius.","type":["integer","null"]},"cpu_pct":{"description":"Average processor usage in percent.","type":["integer","null"]},"inlet_c":{"description":"Average inlet temperature in degrees Celsius.","type":["integer","null"]},"io_pct":{"description":"Average input/output usage in percent.","type":["integer","null"]},"mem_pct":{"description":"Average memory usage in percent.","type":["integer","null"]},"t":{"description":"Start of the point (Unix time, seconds, UTC)","type":"integer"},"watts":{"description":"Average power draw in watts.","type":["integer","null"]}},"required":["t","watts","inlet_c","cpu_max_c","cpu_pct","mem_pct","io_pct"],"type":"object","x-order":["t","watts","inlet_c","cpu_max_c","cpu_pct","mem_pct","io_pct"]},"type":"array"},"step":{"description":"Seconds between points.","type":"integer"}},"required":["step","points"],"type":"object","x-order":["step","points"]},"stale":{"description":"True when the reading may be outdated.","type":"boolean"},"storage":{"properties":{"drives":{"description":"Number of drives.","type":["integer","null"]},"total_bytes":{"description":"Total capacity of the drives in bytes.","type":["integer","null"]}},"required":["total_bytes","drives"],"type":"object","x-order":["total_bytes","drives"]},"temps":{"items":{"properties":{"c":{"description":"Temperature in degrees Celsius.","type":"integer"},"health":{"description":"Health.","type":["string","null"]},"name":{"description":"Sensor name, e.g. `Inlet Temp`.","type":"string"}},"required":["name","c","health"],"type":"object","x-order":["name","c","health"]},"type":"array"},"usage":{"properties":{"agent":{"properties":{"at":{"description":"When the agent measured it (Unix time, seconds, UTC)","type":"integer"},"disk":{"description":"System disk usage in percent measured inside the operating system by the platform agent.","type":["integer","null"]},"mem":{"description":"Memory usage in percent measured inside the operating system by the platform agent.","type":["integer","null"]}},"required":["mem","disk","at"],"type":"object","x-order":["mem","disk","at"]},"at":{"description":"When the usage was measured (Unix time, seconds, UTC)","type":["integer","null"]},"cpu":{"description":"Processor usage in percent (0–100).","type":["integer","null"]},"io":{"description":"Input/output usage in percent (0–100).","type":["integer","null"]},"mem":{"description":"Memory usage in percent (0–100), as reported by the machine's controller.","type":["integer","null"]},"reason":{"description":"Why the numbers are `null`: `unreachable`, `powered_off`, `no_data` (not measured yet) or `unsupported`.","type":["string","null"]}},"required":["cpu","mem","io","at","reason"],"type":"object","x-order":["cpu","mem","io","agent","at","reason"]}},"required":["at","stale","health","power","temps","fans","psus","usage","network","storage"],"type":"object","x-order":["at","stale","health","power","temps","fans","psus","usage","network","storage","series"]},"DedicatedServer":{"properties":{"actions":{"properties":{"console":{"$ref":"#/components/schemas/DedicatedAction"},"power":{"$ref":"#/components/schemas/DedicatedAction"}},"required":["power","console"],"type":"object","x-order":["power","console"]},"agent":{"$ref":"#/components/schemas/DedicatedAgent"},"assigned_at":{"description":"When the server was assigned to your account (Unix time, seconds, UTC)","type":"integer"},"billing":{"anyOf":[{"$ref":"#/components/schemas/DedicatedBilling"},{"type":"null"}]},"capabilities":{"properties":{"bandwidth":{"description":"Bandwidth statistics are available.","type":"boolean"},"console":{"description":"Remote console is supported.","type":"boolean"},"events":{"description":"Hardware log is available.","type":"boolean"},"power":{"description":"Power control is supported.","type":"boolean"},"reinstall":{"description":"Operating system reinstall is available.","type":"boolean"},"sensors":{"description":"Sensors are available.","type":"boolean"}},"required":["power","console","reinstall","sensors","events","bandwidth"],"type":"object","x-order":["power","console","reinstall","sensors","events","bandwidth"]},"cpu":{"properties":{"cores":{"description":"Total physical cores.","type":["integer","null"]},"model":{"description":"Processor model.","type":["string","null"]},"sockets":{"description":"Number of processors.","type":["integer","null"]},"threads":{"description":"Total hardware threads.","type":["integer","null"]}},"required":["model","sockets","cores","threads"],"type":"object","x-order":["model","sockets","cores","threads"]},"hardware":{"properties":{"bios":{"description":"BIOS version.","type":["string","null"]},"boot_mode":{"description":"Boot mode, e.g. `UEFI`.","type":["string","null"]},"cpus":{"items":{"properties":{"cores":{"description":"Cores.","type":["integer","null"]},"health":{"description":"Health.","type":["string","null"]},"model":{"description":"Model.","type":["string","null"]},"socket":{"description":"Socket number.","type":["integer","null"]},"threads":{"description":"Threads.","type":["integer","null"]}},"required":["socket","model","cores","threads","health"],"type":"object","x-order":["socket","model","cores","threads","health"]},"type":"array"},"drives":{"items":{"properties":{"health":{"description":"Health.","type":["string","null"]},"media":{"description":"`SSD` or `HDD`.","type":["string","null"]},"model":{"description":"Model.","type":["string","null"]},"protocol":{"description":"Interface, e.g. `SATA`.","type":["string","null"]},"size_bytes":{"description":"Capacity in bytes.","type":["integer","null"]}},"required":["model","size_bytes","media","protocol","health"],"type":"object","x-order":["model","size_bytes","media","protocol","health"]},"type":"array"},"memory":{"items":{"properties":{"health":{"description":"Health.","type":["string","null"]},"manufacturer":{"description":"Manufacturer.","type":["string","null"]},"part":{"description":"Part number.","type":["string","null"]},"size_gb":{"description":"Module size in GiB.","type":["integer","null"]},"slot":{"description":"Memory slot, e.g. `A5`.","type":["string","null"]},"speed_mhz":{"description":"Speed in MHz.","type":["integer","null"]},"type":{"description":"Memory type, e.g. `DDR4`.","type":["string","null"]}},"required":["slot","size_gb","type","speed_mhz","manufacturer","part","health"],"type":"object","x-order":["slot","size_gb","type","speed_mhz","manufacturer","part","health"]},"type":"array"},"nics":{"items":{"properties":{"id":{"description":"Interface identifier, e.g. `NIC.Mezzanine.3-1`.","type":"string"},"link":{"description":"Link state when known.","type":["string","null"]},"mac":{"description":"MAC address.","type":["string","null"]},"speed_mbps":{"description":"Link speed in Mbit/s when known.","type":["integer","null"]}},"required":["id","mac","speed_mbps","link"],"type":"object","x-order":["id","mac","speed_mbps","link"]},"type":"array"},"psus":{"items":{"properties":{"health":{"description":"Health.","type":["string","null"]},"input_v":{"description":"Input voltage.","type":["integer","null"]},"name":{"description":"Power supply name.","type":"string"}},"required":["name","health","input_v"],"type":"object","x-order":["name","health","input_v"]},"type":"array"}},"required":["cpus","memory","drives","nics","psus","bios","boot_mode"],"type":"object","x-order":["cpus","memory","drives","nics","psus","bios","boot_mode"]},"health":{"description":"Overall hardware health.","type":["string","null"]},"hostname":{"description":"Host name reported by the operating system, when known.","type":["string","null"]},"id":{"description":"Dedicated Server identifier.","type":"string"},"lock":{"properties":{"code":{"description":"Why it is locked, e.g. `imported`, `maintenance`, `locked`.","type":["string","null"]},"locked":{"description":"True when control actions are locked.","type":"boolean"},"message":{"description":"Standard explanation for the lock code, in your account language.","type":["string","null"]},"note":{"description":"Free-text note written by the administrator when locking, if any; show it in addition to `message`.","type":["string","null"]}},"required":["locked","code","message","note"],"type":"object","x-order":["locked","code","message","note"]},"locked":{"description":"True when control actions are locked.","type":"boolean"},"memory_gb":{"description":"Installed memory in GiB.","type":["integer","null"]},"model":{"description":"Hardware model.","type":["string","null"]},"name":{"description":"Name of the server; you can change it.","type":"string"},"network":{"properties":{"dns":{"items":{"description":"Resolver address.","type":"string"},"type":"array"},"gateway":{"description":"Gateway address.","type":["string","null"]},"netmask":{"description":"Netmask matching the prefix.","type":["string","null"]},"prefix":{"description":"Prefix length of the public network.","type":["integer","null"]},"public_ip":{"description":"Public IPv4 address.","type":["string","null"]}},"required":["public_ip","gateway","prefix","netmask","dns"],"type":"object","x-order":["public_ip","gateway","prefix","netmask","dns"]},"op":{"anyOf":[{"$ref":"#/components/schemas/DedicatedOpBrief"},{"type":"null"}]},"order":{"anyOf":[{"$ref":"#/components/schemas/DedicatedOrder"},{"type":"null"}]},"os":{"properties":{"access":{"description":"Whether the web panel can show the login of the current install: `ready`; `installing` (an install is running); `install_failed` (the latest install failed; no password is shown); `not_installed` (no install for this subscription yet). The password itself is never part of this response.","enum":["ready","installing","install_failed","not_installed"],"type":"string"},"access_error":{"description":"Public failure code of the latest install when `access` is `install_failed`, otherwise null.","type":["string","null"]},"installed_at":{"description":"When the system was installed (Unix time, seconds, UTC)","type":["integer","null"]},"name":{"description":"Installed operating system, when known.","type":["string","null"]},"username":{"description":"Administrator account name of the installed system.","type":["string","null"]}},"required":["name","username","installed_at","access","access_error"],"type":"object","x-order":["name","username","installed_at","access","access_error"]},"polled_at":{"description":"When the status was last refreshed (Unix time, seconds, UTC)","type":["integer","null"]},"power_state":{"description":"`On` or `Off`.","type":["string","null"]},"public_ip":{"description":"Public IPv4 address.","type":["string","null"]},"sensors_at":{"description":"When the sensors were last read (Unix time, seconds, UTC)","type":["integer","null"]},"service_tag":{"description":"Hardware service tag printed on the machine.","type":["string","null"]},"stale":{"description":"True when the status shown may be outdated.","type":"boolean"},"status":{"description":"State of your subscription.","enum":["active","suspended"],"type":"string"},"storage_bytes":{"description":"Total capacity of the disks in bytes.","type":["integer","null"]},"subscription":{"properties":{"cycle":{"description":"Billing cycle.","type":"string"},"free":{"description":"True when the subscription is free of charge. A free subscription is never renewed or billed.","type":"boolean"},"id":{"description":"Subscription identifier.","type":"integer"},"plan":{"description":"Plan code; null for machines assigned without a plan.","type":["string","null"]},"price_vnd":{"description":"Locked price per cycle in VND; 0 for free subscriptions.","type":"integer"},"renew_at":{"description":"Next renewal; null when the subscription never renews (Unix time, seconds, UTC)","type":["integer","null"]},"renewal":{"anyOf":[{"$ref":"#/components/schemas/DedicatedRenewal"},{"type":"null"}]},"started_at":{"description":"When the subscription started (Unix time, seconds, UTC)","type":"integer"},"status":{"description":"Subscription state.","enum":["active","suspended"],"type":"string"}},"required":["id","plan","cycle","free","price_vnd","renew_at","status","started_at","renewal"],"type":"object","x-order":["id","plan","cycle","free","price_vnd","renew_at","status","started_at","renewal"]},"zone":{"properties":{"country":{"description":"Two-letter country code.","type":"string"},"id":{"description":"Zone identifier.","type":"integer"},"name":{"description":"Display name of the zone.","type":"string"},"slug":{"description":"Short zone name, e.g. `hcm`.","type":"string"}},"required":["id","slug","name","country"],"type":["object","null"],"x-order":["id","slug","name","country"]}},"required":["id","name","model","cpu","memory_gb","storage_bytes","public_ip","zone","power_state","health","status","locked","op","polled_at","stale","assigned_at","hostname","service_tag","hardware","network","os","subscription","capabilities","actions","lock","sensors_at"],"type":"object","x-order":["id","name","model","cpu","memory_gb","storage_bytes","public_ip","zone","power_state","health","status","locked","op","polled_at","stale","assigned_at","agent","hostname","service_tag","hardware","network","os","subscription","capabilities","actions","lock","sensors_at","order","billing"]},"DedicatedServerBrief":{"properties":{"assigned_at":{"description":"When the server was assigned to your account (Unix time, seconds, UTC)","type":"integer"},"cpu":{"properties":{"cores":{"description":"Total physical cores.","type":["integer","null"]},"model":{"description":"Processor model.","type":["string","null"]},"sockets":{"description":"Number of processors.","type":["integer","null"]},"threads":{"description":"Total hardware threads.","type":["integer","null"]}},"required":["model","sockets","cores","threads"],"type":"object","x-order":["model","sockets","cores","threads"]},"health":{"description":"Overall hardware health: `OK`, `Warning` or `Critical`; null before the first reading.","type":["string","null"]},"id":{"description":"Dedicated Server identifier (`ds_` followed by 16 hex characters).","type":"string"},"locked":{"description":"True when control actions (power, console) are locked for this server.","type":"boolean"},"memory_gb":{"description":"Installed memory in GiB.","type":["integer","null"]},"model":{"description":"Hardware model, e.g. `PowerEdge C6420`.","type":["string","null"]},"name":{"description":"Name of the server; you can change it.","type":"string"},"op":{"anyOf":[{"$ref":"#/components/schemas/DedicatedOpBrief"},{"type":"null"}]},"polled_at":{"description":"When the status was last refreshed (Unix time, seconds, UTC)","type":["integer","null"]},"power_state":{"description":"`On` or `Off` as last read from the machine; null before the first reading.","type":["string","null"]},"public_ip":{"description":"Public IPv4 address of the server.","type":["string","null"]},"stale":{"description":"True when the status shown is older than expected or cannot be refreshed right now; treat `power_state` and sensors as possibly outdated.","type":"boolean"},"status":{"description":"State of your subscription. A `suspended` server is read-only.","enum":["active","suspended"],"type":"string"},"storage_bytes":{"description":"Total capacity of the disks in bytes.","type":["integer","null"]},"zone":{"properties":{"country":{"description":"Two-letter country code.","type":"string"},"id":{"description":"Zone identifier.","type":"integer"},"name":{"description":"Display name of the zone.","type":"string"},"slug":{"description":"Short zone name, e.g. `hcm`.","type":"string"}},"required":["id","slug","name","country"],"type":["object","null"],"x-order":["id","slug","name","country"]}},"required":["id","name","model","cpu","memory_gb","storage_bytes","public_ip","zone","power_state","health","status","locked","op","polled_at","stale","assigned_at"],"type":"object","x-order":["id","name","model","cpu","memory_gb","storage_bytes","public_ip","zone","power_state","health","status","locked","op","polled_at","stale","assigned_at"]},"Error":{"description":"Every error response has this shape. `code` is a stable machine-readable identifier; `message` is human-readable and may change. Some errors add extra fields next to `code` and `message`.","example":{"error":{"code":"not_found","message":"Not found"}},"properties":{"error":{"additionalProperties":true,"properties":{"code":{"description":"Stable error code, e.g. `scope_required`, `not_found`, `rate_limited`.","type":"string"},"message":{"description":"Human-readable explanation.","type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"FirewallRule":{"properties":{"cidr_list":{"description":"Source addresses the rule lets in, as a CIDR block such as `203.0.113.0/24`. `0.0.0.0/0` (IPv4) or `::/0` (IPv6) means everywhere.","type":["string","null"]},"end_port":{"description":"Last port of the range; equal to `start_port` for a single port. Null for `icmp`.","type":["integer","null"]},"family":{"description":"Address family the rule applies to.","enum":["ipv4","ipv6"],"type":"string"},"icmp_code":{"description":"ICMP code, only for `icmp` rules.","type":["integer","null"]},"icmp_type":{"description":"ICMP type, only for `icmp` rules.","type":["integer","null"]},"id":{"description":"Rule identifier. Pass it to [Delete a firewall rule](#operation/vm_firewall_delete).","type":"string"},"protocol":{"description":"`tcp`, `udp` or `icmp`.","type":["string","null"]},"start_port":{"description":"First port of the range. Null for `icmp`.","type":["integer","null"]},"state":{"description":"Rule state: `Active` once applied, or `Add` / `Revoke` while a change is still being applied.","type":["string","null"]}},"required":["id","protocol","start_port","end_port","cidr_list","state","icmp_type","icmp_code","family"],"type":"object","x-order":["id","protocol","start_port","end_port","cidr_list","state","icmp_type","icmp_code","family"]},"GpuActionAccepted":{"properties":{"ok":{"description":"Always `true`.","type":"boolean"},"pending":{"description":"Always `true`: the command was accepted and is being carried out in the background. Follow `state` and `intent` on the instance.","type":"boolean"}},"required":["ok","pending"],"type":"object"},"GpuCatalogPlan":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cuda_max":{"description":"Highest CUDA version supported.","type":"number"},"disk_gb":{"description":"Disk size the prices are computed for, in GB (the `disk_gb` query value, never below the template minimum).","type":"integer"},"gpu_count":{"description":"Number of GPUs in the configuration.","type":"integer"},"gpu_name":{"description":"GPU model.","type":"string"},"hot":{"description":"Whether the configuration is among the most popular ones.","type":"boolean"},"hot_rank":{"description":"Popularity rank among configurations (1 = most popular); null when not ranked.","type":["integer","null"]},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar, for the displayed disk size.","type":"integer"},"id":{"description":"Plan identifier, the same as `slug`.","type":"string"},"is_5090":{"description":"Whether the configuration uses an RTX 5090.","type":"boolean"},"max_disk_gb":{"description":"Largest disk currently available for this configuration, in GB.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours), in US cents, including the monthly-cycle discount.","type":"integer"},"name":{"description":"Display name, e.g. `RTX 4090 - 24 GB`.","type":"string"},"ram_mb":{"description":"System memory in MiB.","type":"integer"},"slug":{"description":"Stable short name of the configuration, e.g. `1x-rtx-4090`. Pass it as the configuration when ordering a GPU server.","type":"string"},"stock":{"description":"Number of matching machines in stock right now.","type":"integer"},"storage_uusd_gb_h":{"description":"Price per extra GB of disk per hour, in millionths of a US dollar.","type":"integer"},"tier":{"description":"Class of the GPU: `rtx5090`, `cluster`, `enterprise`, `workstation`, `prosumer` or `mainstream`.","type":"string"},"top_locations":{"items":{"description":"ISO country code.","type":"string"},"type":"array"},"vram_gb":{"description":"Total GPU memory in GB.","type":"integer"}},"required":["id","slug","name","gpu_name","gpu_count","vram_gb","cpu","ram_mb","disk_gb","max_disk_gb","tier","is_5090","stock","hourly_uusd","storage_uusd_gb_h","monthly_cents","cuda_max","top_locations"],"type":"object","x-order":["id","slug","name","gpu_name","gpu_count","vram_gb","cpu","ram_mb","disk_gb","max_disk_gb","tier","is_5090","stock","hourly_uusd","storage_uusd_gb_h","monthly_cents","cuda_max","top_locations","hot_rank","hot"]},"GpuEvent":{"properties":{"actor":{"description":"Who caused the event: `customer` for commands you sent, `support` for the platform and its staff.","enum":["customer","support"],"type":"string"},"args":{"additionalProperties":true,"description":"Raw values to fill into the message named by `key` (string values). An empty object when `key` is `null`.","type":"object"},"at":{"description":"Time of the event (Unix time, seconds, UTC)","type":"integer"},"key":{"description":"Stable message code, for example `gpu.order_accepted`; `null` for older entries.","type":["string","null"]},"kind":{"description":"Kind of event, for example `gpu.create`, `gpu.action` or `gpu.state`.","type":"string"},"message":{"description":"What happened, for example `GPU order accepted`, `stop` or `provisioning -> active`.","type":"string"}},"required":["at","kind","actor","message","key","args"],"type":"object","x-order":["at","kind","actor","message","key","args"]},"GpuInstance":{"properties":{"billed_until":{"description":"End of the period that is currently paid. For hourly instances this is the end of the paid hour. Null before the first start (Unix time, seconds, UTC)","type":["integer","null"]},"charged_cents":{"description":"Total charged to your wallet for this instance so far, in US cents, including renewals and restarts.","type":"integer"},"cpu":{"description":"Number of vCPU cores.","type":"integer"},"created_at":{"description":"Time the order was placed (Unix time, seconds, UTC)","type":"integer"},"cuda_max":{"description":"Highest CUDA version the machine's driver supports.","type":["number","null"]},"cycle":{"description":"Billing cycle chosen at order time.","enum":["hourly","monthly","quarterly","semiannual","yearly","2y","3y"],"type":"string"},"cycle_cents":{"description":"Price of one billing cycle in US cents. 0 for hourly instances.","type":"integer"},"disk_gb":{"description":"Disk size you ordered, in GiB.","type":"integer"},"display_name":{"description":"Display name of the instance. It starts out equal to `hostname`.","type":"string"},"error_msg":{"description":"Last problem message, for example why an order failed or why a start was refused. Null when there is none.","type":["string","null"]},"geolocation":{"description":"Where the machine is located, for example `Texas, US`.","type":["string","null"]},"gpu_count":{"description":"Number of GPUs.","type":"integer"},"gpu_name":{"description":"GPU model, for example `RTX 4090`.","type":"string"},"hostname":{"description":"Host name you chose when you ordered the instance.","type":"string"},"hourly_uusd":{"description":"Price per hour while the machine runs, in millionths of a US dollar. It includes the disk you ordered.","type":"integer"},"id":{"description":"Instance identifier: `gpu-` followed by 16 hexadecimal characters. Use it in the path of every call about this instance.","type":"string"},"intent":{"description":"Command being carried out right now, or null when the instance is idle. `suspend` is a stop started by the platform because the wallet could not pay.","enum":["start","stop","reboot","recycle","destroy","suspend",null],"type":["string","null"]},"jupyter_url":{"description":"URL of the Jupyter interface, for templates that provide one; null otherwise.","type":["string","null"]},"paid_until":{"description":"End of the prepaid billing cycle. Null for hourly instances and until the first start (Unix time, seconds, UTC)","type":["integer","null"]},"ports":{"additionalProperties":true,"description":"Port mappings of the instance. Keys look like `22/tcp`; each value is a list of `{\"HostIp\": \"0.0.0.0\", \"HostPort\": \"40122\"}` objects. For direct SSH connect to `public_ip` on the `HostPort` of `22/tcp`. Empty until the instance runs.","type":"object"},"public_ip":{"description":"Public address of the machine. Null until the instance has been placed.","type":["string","null"]},"ram_gb":{"description":"System memory in GiB.","type":"integer"},"refunded_cents":{"description":"Total refunded to your wallet for this instance so far, in US cents.","type":"integer"},"reliability":{"description":"Reliability score of the machine between 0 and 1.","type":["number","null"]},"runtime_status":{"description":"Status the machine itself reports, for example `loading`, `running` or `stopped`. Informational only: decide what you can do from `state`. An `active` instance is ready when this is `running`.","type":"string"},"runtype":{"description":"How the template is reached, for example `ssh` or `jupyter`.","type":"string"},"ssh_host":{"description":"Relay host name that reaches the instance over SSH together with `ssh_port`. Null until the instance has been placed.","type":["string","null"]},"ssh_port":{"description":"Port of the SSH relay on `ssh_host`.","type":["integer","null"]},"state":{"description":"Lifecycle state. `queued`: the order is paid and waiting to be placed. `renting`: the machine is being rented. `provisioning`: the machine is booting. `active`: ready to use. `starting`, `stopping`, `rebooting`, `recycling`, `destroying`: a command is being carried out. `stopped`: powered off, disk kept. `locked`: stopped because the wallet could not pay, deleted after 7 days unless you add funds and start it. `failed`: the order could not be completed and was refunded, see `error_msg`. `deleted`: removed (never returned by the list).","enum":["queued","renting","provisioning","active","starting","stopping","stopped","locked","rebooting","recycling","destroying","failed","deleted"],"type":"string"},"storage_hourly_uusd":{"description":"Disk price per hour while the instance is stopped, in millionths of a US dollar.","type":"integer"},"template_id":{"description":"Template the instance was created from. See the GPU catalog.","type":"integer"},"template_name":{"description":"Display name of the template.","type":"string"},"updated_at":{"description":"Time the instance last changed (Unix time, seconds, UTC)","type":"integer"},"vram_gb":{"description":"Total GPU memory over all GPUs, in GiB.","type":"integer"}},"required":["id","hostname","display_name","gpu_name","gpu_count","vram_gb","cpu","ram_gb","disk_gb","template_id","template_name","runtype","state","runtime_status","public_ip","ssh_host","ssh_port","jupyter_url","ports","hourly_uusd","cycle","charged_cents","paid_until","geolocation","cuda_max","reliability","error_msg","created_at","updated_at","billed_until","storage_hourly_uusd","cycle_cents","intent","refunded_cents"],"type":"object","x-order":["id","hostname","display_name","gpu_name","gpu_count","vram_gb","cpu","ram_gb","disk_gb","template_id","template_name","runtype","state","runtime_status","public_ip","ssh_host","ssh_port","jupyter_url","ports","hourly_uusd","cycle","charged_cents","paid_until","geolocation","cuda_max","reliability","error_msg","created_at","updated_at","billed_until","storage_hourly_uusd","cycle_cents","intent","refunded_cents"]},"GpuLogs":{"properties":{"logs":{"description":"The log text, empty until it is ready. Secrets such as tokens and passwords are masked.","type":"string"},"pending":{"description":"True while the machine is still preparing the log you requested. Call [Read GPU instance logs](#operation/gpu_logs_get) again in a few seconds.","type":"boolean"},"requested":{"description":"Whether a log was requested in the last 5 minutes.","type":"boolean"},"truncated":{"description":"Present once the log is ready: true when the log was longer than 1 MiB and was cut.","type":"boolean"}},"required":["pending","requested","logs"],"type":"object","x-order":["pending","requested","logs","truncated"]},"GpuOffer":{"properties":{"country_code":{"description":"Two-letter country code of the location.","type":"string"},"cpu":{"description":"Number of vCPU cores you get.","type":"integer"},"cuda_max":{"description":"Highest CUDA version the machine's driver supports.","type":"number"},"disk_gb":{"description":"Free disk space the machine can offer, in GiB. Your ordered size is the top-level `disk_gb`.","type":"integer"},"geolocation":{"description":"Where the machine is located, for example `Texas, US`.","type":"string"},"gpu_count":{"description":"Number of GPUs on the machine.","type":"integer"},"gpu_name":{"description":"GPU model.","type":"string"},"hourly_uusd":{"description":"The same hourly price in millionths of a US dollar. This is what the instance is billed per hour.","type":"integer"},"inet_down":{"description":"Download bandwidth of the machine, in Mbit/s.","type":"integer"},"inet_up":{"description":"Upload bandwidth of the machine, in Mbit/s.","type":"integer"},"monthly_cents":{"description":"Price of one month (730 hours) with the monthly cycle discount, in US cents. For comparison only.","type":"integer"},"offer_id":{"description":"Identifier of the machine offer. Pass it as `offer_id` to price this exact machine again.","type":"integer"},"ram_gb":{"description":"System memory you get, in GiB.","type":"integer"},"reliability":{"description":"Reliability score of the machine between 0 and 1.","type":"number"},"sell_usd_h":{"description":"Price per hour while the machine runs, in US dollars, including the disk.","type":"number"},"storage_uusd_gb_h":{"description":"Disk price per GiB and hour while the instance is stopped, in millionths of a US dollar.","type":"integer"},"verified":{"description":"Whether the machine is verified by the platform.","type":"boolean"},"vms_enabled":{"description":"Whether the machine can run full virtual-machine templates (templates that are not plain containers).","type":"boolean"},"vram_gb":{"description":"Total GPU memory over all GPUs, in GiB.","type":"integer"}},"required":["offer_id","gpu_name","gpu_count","vram_gb","cpu","ram_gb","disk_gb","inet_down","inet_up","cuda_max","reliability","geolocation","country_code","verified","vms_enabled","sell_usd_h","hourly_uusd","storage_uusd_gb_h","monthly_cents"],"type":"object","x-order":["offer_id","gpu_name","gpu_count","vram_gb","cpu","ram_gb","disk_gb","inet_down","inet_up","cuda_max","reliability","geolocation","country_code","verified","vms_enabled","sell_usd_h","hourly_uusd","storage_uusd_gb_h","monthly_cents"]},"Image":{"properties":{"bootable":{"description":"ISO only: whether the ISO can be booted. Always true for templates.","type":"boolean"},"busy":{"description":"True while `state` is `Queued`, `Downloading`, `Creating` or `Deleting`. A busy image cannot be deleted or changed in storage.","type":"boolean"},"cents_per_month":{"description":"Estimated monthly cost in US cents, rounded, for `hours_per_month` hours.","type":"integer"},"checksum":{"description":"Checksum you supplied, normalised to the form `{SHA-256}` followed by the lowercase hex digest. Null when none was given.","type":["string","null"]},"created_at":{"description":"When the image was created (Unix time, seconds, UTC)","type":"integer"},"debt_since":{"description":"Set while your wallet could not cover the storage charge: since when the image has been unpaid. Images unpaid for long enough are deleted automatically (Unix time, seconds, UTC)","type":["integer","null"]},"declared_bytes":{"description":"Size announced by the source before the transfer (the file size from the URL, or the disk size of the source server); 0 when unknown.","type":"integer"},"description":{"description":"Free-text description, or null.","type":["string","null"]},"error_code":{"description":"Machine-readable failure reason when `state` is `Error`, for example `invalid_url`, `blocked_url`, `url_redirect`, `url_unreachable`, `too_large`, `invalid_image`, `checksum_mismatch` or `download_failed`; other values may appear. Null when there is no error.","type":["string","null"]},"format":{"description":"Disk format: `QCOW2` for templates, `ISO` for ISO images.","type":["string","null"]},"hours_per_month":{"description":"Hours per month used for the monthly estimate (730 by default).","type":"integer"},"id":{"description":"Image identifier. Use it as `iid` in the other image calls.","type":"integer"},"kind":{"description":"`template` is a bootable operating system disk used to create servers; `iso` is an installation or rescue disc that can be attached to a server.","enum":["template","iso"],"type":"string"},"last_error":{"description":"Human-readable explanation of the failure when `state` is `Error`; null otherwise.","type":["string","null"]},"lock_reason":{"description":"Reason given for the lock.","type":["string","null"]},"locked":{"description":"True when support has locked the image. A locked image is not billed and cannot be attached.","type":"boolean"},"locked_at":{"description":"When the image was locked (Unix time, seconds, UTC)","type":["integer","null"]},"name":{"description":"Name you gave the image.","type":"string"},"os_type_id":{"description":"Operating system type chosen at import (an `id` from List OS types).","type":["string","null"]},"os_type_name":{"description":"Name of that operating system type.","type":["string","null"]},"paid_cents":{"description":"Total amount charged for storing this image so far, in US cents.","type":"integer"},"password_enabled":{"description":"Templates only: whether servers created from this image support password reset. False for ISOs.","type":"boolean"},"progress":{"description":"Download or copy progress in percent, 0 to 100.","type":"integer"},"rate_uusd_gb_hour":{"description":"Hourly storage rate locked in for this image, in millionths of a US dollar per GB. It can only go down over time.","type":"integer"},"ready_at":{"description":"When the image became `Ready`; null before that (Unix time, seconds, UTC)","type":["integer","null"]},"size_bytes":{"description":"Real size on storage in bytes, known once the image is `Ready`; 0 before that.","type":"integer"},"size_gb":{"description":"Billed size: `size_bytes` rounded up to whole GB (1 GB = 2^30 bytes); 0 until the image is `Ready`.","type":"integer"},"source":{"description":"How the image was made: imported from a `url`, or created from one of your servers (`vm`).","enum":["url","vm"],"type":"string"},"src_vm_id":{"description":"For images created from a server: UUID of that server. Otherwise null.","type":["string","null"]},"state":{"description":"Processing state. `Queued` waiting to start, `Downloading` being fetched from the URL, `Creating` being copied from a server, `Ready` usable and billed, `Error` failed (see `error_code`), `Deleting` being removed.","enum":["Queued","Downloading","Creating","Ready","Error","Deleting"],"type":"string"},"template_id":{"description":"Templates only: identifier to pass as `template_id` when creating a server from this image. Null until the image is `Ready`, and always null for ISOs.","type":["integer","null"]},"updated_at":{"description":"When the image last changed (Unix time, seconds, UTC)","type":"integer"},"url":{"description":"Download URL the image was imported from, as normalised by the server. Null for images created from a server.","type":["string","null"]},"username":{"description":"For images created from a server: the login user name servers created from the image start with. Otherwise null.","type":["string","null"]},"uusd_per_hour":{"description":"Current hourly cost of the image in millionths of a US dollar (`size_gb` times the rate).","type":"integer"},"virtual_size_bytes":{"description":"Size of the virtual disk in bytes, known once the image is `Ready`; 0 before that.","type":"integer"},"vm_count":{"description":"Templates only: number of your servers that currently use this image. Absent for ISOs and for images that are not `Ready` yet.","type":"integer"},"zone_id":{"description":"Region where the image is stored. Servers can only use images of their own region.","type":"integer"}},"required":["id","kind","source","name","description","zone_id","template_id","url","format","os_type_id","os_type_name","bootable","password_enabled","checksum","src_vm_id","username","state","busy","progress","size_bytes","virtual_size_bytes","declared_bytes","size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_month","hours_per_month","paid_cents","debt_since","locked","locked_at","lock_reason","last_error","error_code","created_at","updated_at","ready_at"],"type":"object","x-order":["id","kind","source","name","description","zone_id","template_id","url","format","os_type_id","os_type_name","bootable","password_enabled","checksum","src_vm_id","username","state","busy","progress","size_bytes","virtual_size_bytes","declared_bytes","size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_month","hours_per_month","paid_cents","debt_since","locked","locked_at","lock_reason","last_error","error_code","created_at","updated_at","ready_at","vm_count"]},"ImageDetail":{"properties":{"bootable":{"description":"ISO only: whether the ISO can be booted. Always true for templates.","type":"boolean"},"busy":{"description":"True while `state` is `Queued`, `Downloading`, `Creating` or `Deleting`. A busy image cannot be deleted or changed in storage.","type":"boolean"},"cents_per_month":{"description":"Estimated monthly cost in US cents, rounded, for `hours_per_month` hours.","type":"integer"},"checksum":{"description":"Checksum you supplied, normalised to the form `{SHA-256}` followed by the lowercase hex digest. Null when none was given.","type":["string","null"]},"created_at":{"description":"When the image was created (Unix time, seconds, UTC)","type":"integer"},"debt_since":{"description":"Set while your wallet could not cover the storage charge: since when the image has been unpaid. Images unpaid for long enough are deleted automatically (Unix time, seconds, UTC)","type":["integer","null"]},"declared_bytes":{"description":"Size announced by the source before the transfer (the file size from the URL, or the disk size of the source server); 0 when unknown.","type":"integer"},"description":{"description":"Free-text description, or null.","type":["string","null"]},"error_code":{"description":"Machine-readable failure reason when `state` is `Error`, for example `invalid_url`, `blocked_url`, `url_redirect`, `url_unreachable`, `too_large`, `invalid_image`, `checksum_mismatch` or `download_failed`; other values may appear. Null when there is no error.","type":["string","null"]},"format":{"description":"Disk format: `QCOW2` for templates, `ISO` for ISO images.","type":["string","null"]},"hours_per_month":{"description":"Hours per month used for the monthly estimate (730 by default).","type":"integer"},"id":{"description":"Image identifier. Use it as `iid` in the other image calls.","type":"integer"},"kind":{"description":"`template` is a bootable operating system disk used to create servers; `iso` is an installation or rescue disc that can be attached to a server.","enum":["template","iso"],"type":"string"},"last_error":{"description":"Human-readable explanation of the failure when `state` is `Error`; null otherwise.","type":["string","null"]},"lock_reason":{"description":"Reason given for the lock.","type":["string","null"]},"locked":{"description":"True when support has locked the image. A locked image is not billed and cannot be attached.","type":"boolean"},"locked_at":{"description":"When the image was locked (Unix time, seconds, UTC)","type":["integer","null"]},"name":{"description":"Name you gave the image.","type":"string"},"os_type_id":{"description":"Operating system type chosen at import (an `id` from List OS types).","type":["string","null"]},"os_type_name":{"description":"Name of that operating system type.","type":["string","null"]},"paid_cents":{"description":"Total amount charged for storing this image so far, in US cents.","type":"integer"},"password_enabled":{"description":"Templates only: whether servers created from this image support password reset. False for ISOs.","type":"boolean"},"progress":{"description":"Download or copy progress in percent, 0 to 100.","type":"integer"},"rate_uusd_gb_hour":{"description":"Hourly storage rate locked in for this image, in millionths of a US dollar per GB. It can only go down over time.","type":"integer"},"ready_at":{"description":"When the image became `Ready`; null before that (Unix time, seconds, UTC)","type":["integer","null"]},"size_bytes":{"description":"Real size on storage in bytes, known once the image is `Ready`; 0 before that.","type":"integer"},"size_gb":{"description":"Billed size: `size_bytes` rounded up to whole GB (1 GB = 2^30 bytes); 0 until the image is `Ready`.","type":"integer"},"source":{"description":"How the image was made: imported from a `url`, or created from one of your servers (`vm`).","enum":["url","vm"],"type":"string"},"src_vm_id":{"description":"For images created from a server: UUID of that server. Otherwise null.","type":["string","null"]},"src_vm_name":{"description":"For images created from a server: the current name of that server, or null if it no longer exists.","type":["string","null"]},"state":{"description":"Processing state. `Queued` waiting to start, `Downloading` being fetched from the URL, `Creating` being copied from a server, `Ready` usable and billed, `Error` failed (see `error_code`), `Deleting` being removed.","enum":["Queued","Downloading","Creating","Ready","Error","Deleting"],"type":"string"},"template_id":{"description":"Templates only: identifier to pass as `template_id` when creating a server from this image. Null until the image is `Ready`, and always null for ISOs.","type":["integer","null"]},"updated_at":{"description":"When the image last changed (Unix time, seconds, UTC)","type":"integer"},"url":{"description":"Download URL the image was imported from, as normalised by the server. Null for images created from a server.","type":["string","null"]},"username":{"description":"For images created from a server: the login user name servers created from the image start with. Otherwise null.","type":["string","null"]},"uusd_per_hour":{"description":"Current hourly cost of the image in millionths of a US dollar (`size_gb` times the rate).","type":"integer"},"virtual_size_bytes":{"description":"Size of the virtual disk in bytes, known once the image is `Ready`; 0 before that.","type":"integer"},"vm_count":{"description":"Number of your servers that currently use this image (0 for ISOs and for images that are not ready).","type":"integer"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]},"zone_id":{"description":"Region where the image is stored. Servers can only use images of their own region.","type":"integer"}},"required":["id","kind","source","name","description","zone_id","template_id","url","format","os_type_id","os_type_name","bootable","password_enabled","checksum","src_vm_id","username","state","busy","progress","size_bytes","virtual_size_bytes","declared_bytes","size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_month","hours_per_month","paid_cents","debt_since","locked","locked_at","lock_reason","last_error","error_code","created_at","updated_at","ready_at","vm_count","zone"],"type":"object","x-order":["id","kind","source","name","description","zone_id","template_id","url","format","os_type_id","os_type_name","bootable","password_enabled","checksum","src_vm_id","username","state","busy","progress","size_bytes","virtual_size_bytes","declared_bytes","size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_month","hours_per_month","paid_cents","debt_since","locked","locked_at","lock_reason","last_error","error_code","created_at","updated_at","ready_at","vm_count","zone","src_vm_name"]},"ImageLimits":{"properties":{"count":{"description":"Number of images you have now.","type":"integer"},"gb":{"description":"Storage counted against your limit, in whole GB. Images that are still downloading count with their announced size, or with the maximum size when it is unknown.","type":"integer"},"iso_max_gb":{"description":"Maximum size of one ISO image, in GB.","type":"integer"},"max_count":{"description":"Maximum number of images per account.","type":"integer"},"max_gb":{"description":"Maximum total storage per account, in GB.","type":"integer"},"template_max_gb":{"description":"Maximum size of one template image, in GB.","type":"integer"}},"required":["count","gb","max_count","max_gb","iso_max_gb","template_max_gb"],"type":"object","x-order":["count","gb","max_count","max_gb","iso_max_gb","template_max_gb"]},"ImagePrice":{"properties":{"cents_per_hour":{"description":"Hourly cost in US cents, rounded to the nearest cent (often 0 for small images).","type":"integer"},"cents_per_month":{"description":"Monthly cost in US cents, rounded, for `hours_per_month` hours.","type":"integer"},"hours_per_month":{"description":"Hours per month used for the monthly figure (730 by default).","type":"integer"},"rate_uusd_gb_hour":{"description":"Hourly storage rate in millionths of a US dollar per GB.","type":"integer"},"size_gb":{"description":"Size priced, in whole GB.","type":"integer"},"uusd_per_hour":{"description":"Hourly cost for `size_gb` in millionths of a US dollar.","type":"integer"}},"required":["size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_hour","cents_per_month","hours_per_month"],"type":"object","x-order":["size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_hour","cents_per_month","hours_per_month"]},"ImagePublicOs":{"properties":{"id":{"description":"Operating system image identifier. Pass it as `template_id` when creating a server.","type":"integer"},"name":{"description":"Display name, for example `Ubuntu 24.04 LTS`.","type":"string"},"os_family":{"description":"`linux`, `windows`, `bsd` ...","type":"string"},"os_version":{"description":"Version label, when known.","type":["string","null"]},"size_gb":{"description":"Minimum system disk the image needs, in GB, when known.","type":["integer","null"]},"username":{"description":"Default administrator account name of the image.","type":"string"},"zones":{"description":"Regions where the image is available.","items":{"$ref":"#/components/schemas/Zone"},"type":"array"}},"required":["id","name","os_family","os_version","username","size_gb","zones"],"type":"object","x-order":["id","name","os_family","os_version","username","size_gb","zones"]},"Invoice":{"properties":{"account_id":{"description":"Your account identifier. Null on invoices issued to a previous owner of a server that was transferred to you.","type":["integer","null"]},"balance_after":{"description":"Wallet balance in US cents right after the transaction that paid this invoice; null when the invoice was not paid from the wallet.","type":["integer","null"]},"buyer_json":{"description":"Buyer details as a JSON-encoded string: `account_id`, `email`, `name`. The single-invoice operation also returns it parsed, as `buyer`.","type":"string"},"created_at":{"description":"Time the invoice was created (Unix time, seconds, UTC)","type":"integer"},"currency":{"description":"Currency of the amounts. Always `usd`.","type":"string"},"due_at":{"description":"Payment due date (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Invoice identifier.","type":"integer"},"kind":{"description":"`receipt`: a purchase or change paid from the wallet. `renewal`: an automatic renewal. `topup`: a wallet top-up. `manual`: an invoice issued by support. `refund`: a refund.","enum":["receipt","renewal","topup","manual","refund"],"type":"string"},"ledger_ref":{"description":"Reference of the wallet transaction that paid or refunded the invoice; matches `ref` in [Get the wallet](#operation/billing_wallet).","type":["string","null"]},"note":{"description":"Free-text note on the invoice. Null on invoices issued to a previous owner.","type":["string","null"]},"number":{"description":"Invoice number shown on the document, for example `EX202610-000123`.","type":["string","null"]},"paid_at":{"description":"Time the invoice was paid (Unix time, seconds, UTC)","type":["integer","null"]},"previous_owner":{"description":"Present and true on invoices issued to a previous owner of a server that was transferred to you. Their buyer details are hidden.","type":"boolean"},"seller_json":{"description":"Seller details as a JSON-encoded string: `name`, `address`, `tax_id`, `email`. The single-invoice operation also returns it parsed, as `seller`.","type":"string"},"status":{"description":"Payment status.","enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"},"subtotal_cents":{"description":"Sum of the line items, in US cents.","type":"integer"},"total_cents":{"description":"Amount of the invoice, in US cents.","type":"integer"},"updated_at":{"description":"Time the invoice was last changed (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Server the invoice is about, when it is about one.","type":["string","null"]}},"required":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at","balance_after"],"type":"object","x-order":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at","balance_after","previous_owner"]},"InvoiceDetail":{"properties":{"account_id":{"description":"Your account identifier. Null on invoices issued to a previous owner of a server that was transferred to you.","type":["integer","null"]},"buyer":{"properties":{"account_id":{"description":"Buyer account identifier.","type":"integer"},"email":{"description":"Buyer e-mail.","type":"string"},"name":{"description":"Buyer name.","type":"string"},"redacted":{"description":"True when the buyer details are hidden because the invoice belongs to a previous owner.","type":"boolean"}},"type":["object","null"]},"buyer_json":{"description":"Buyer details as a JSON-encoded string: `account_id`, `email`, `name`. The single-invoice operation also returns it parsed, as `buyer`.","type":"string"},"created_at":{"description":"Time the invoice was created (Unix time, seconds, UTC)","type":"integer"},"currency":{"description":"Currency of the amounts. Always `usd`.","type":"string"},"due_at":{"description":"Payment due date (Unix time, seconds, UTC)","type":["integer","null"]},"fx_usd_vnd":{"description":"Exchange rate (VND per US dollar) recorded when the invoice was issued; 0 when none was recorded.","type":"integer"},"id":{"description":"Invoice identifier.","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/InvoiceItem"},"type":"array"},"kind":{"description":"`receipt`: a purchase or change paid from the wallet. `renewal`: an automatic renewal. `topup`: a wallet top-up. `manual`: an invoice issued by support. `refund`: a refund.","enum":["receipt","renewal","topup","manual","refund"],"type":"string"},"ledger_ref":{"description":"Reference of the wallet transaction that paid or refunded the invoice; matches `ref` in [Get the wallet](#operation/billing_wallet).","type":["string","null"]},"note":{"description":"Free-text note on the invoice. Null on invoices issued to a previous owner.","type":["string","null"]},"number":{"description":"Invoice number shown on the document, for example `EX202610-000123`.","type":["string","null"]},"paid_at":{"description":"Time the invoice was paid (Unix time, seconds, UTC)","type":["integer","null"]},"previous_owner":{"description":"Present and true on invoices issued to a previous owner of a server that was transferred to you. Their buyer details are hidden.","type":"boolean"},"received_vnd":{"description":"Amount received in Vietnamese dong, for top-ups paid by bank transfer; null otherwise.","type":["integer","null"]},"seller":{"properties":{"address":{"description":"Seller address.","type":"string"},"email":{"description":"Seller contact e-mail.","type":"string"},"name":{"description":"Seller name.","type":"string"},"processor":{"additionalProperties":true,"description":"Payment processor details (`name`, `note`), present when payments are collected by a platform on the seller's behalf.","type":"object"},"tax_id":{"description":"Seller tax identifier.","type":"string"}},"type":["object","null"],"x-order":["name","address","tax_id","email","processor"]},"seller_json":{"description":"Seller details as a JSON-encoded string: `name`, `address`, `tax_id`, `email`. The single-invoice operation also returns it parsed, as `seller`.","type":"string"},"status":{"description":"Payment status.","enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"},"subtotal_cents":{"description":"Sum of the line items, in US cents.","type":"integer"},"total":{"description":"`total_cents` formatted for display in US dollars, for example `$5.00`.","type":"string"},"total_cents":{"description":"Amount of the invoice, in US cents.","type":"integer"},"updated_at":{"description":"Time the invoice was last changed (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Server the invoice is about, when it is about one.","type":["string","null"]}},"required":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at","seller","buyer","items","total","fx_usd_vnd","received_vnd"],"type":"object","x-order":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at","previous_owner","seller","buyer","items","total","fx_usd_vnd","received_vnd"]},"InvoiceItem":{"properties":{"amount_cents":{"description":"Amount of the line, in US cents.","type":"integer"},"description":{"description":"What was charged.","type":"string"},"id":{"description":"Line item identifier.","type":"integer"},"invoice_id":{"description":"Invoice the line belongs to.","type":"integer"},"period_from":{"description":"Start of the period the line covers (Unix time, seconds, UTC)","type":["integer","null"]},"period_to":{"description":"End of the period the line covers (Unix time, seconds, UTC)","type":["integer","null"]},"qty":{"description":"Quantity.","type":"number"},"unit_cents":{"description":"Price of one unit, in US cents.","type":"integer"}},"required":["id","invoice_id","description","qty","unit_cents","amount_cents","period_from","period_to"],"type":"object","x-order":["id","invoice_id","description","qty","unit_cents","amount_cents","period_from","period_to"]},"K8sBandwidth":{"description":"Traffic allowance and usage of a cluster for the current period.","properties":{"account_id":{"description":"Identifier of the owning account.","type":"integer"},"addon_bytes":{"description":"Extra traffic bought with Add-ons for this period, in bytes.","type":"integer"},"addon_tb":{"description":"Extra traffic bought with Add-ons for this period, in TiB.","type":"integer"},"addons":{"description":"Add-ons of the current period.","items":{"properties":{"account_id":{"description":"Owning account.","type":"integer"},"amount_cents":{"description":"Price paid in US cents.","type":"integer"},"created_at":{"description":"When the Add-on was bought (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Add-on identifier.","type":"integer"},"invoice_id":{"description":"Receipt identifier, if one was issued.","type":["integer","null"]},"kind":{"description":"`k8s`.","type":"string"},"period_end":{"description":"End of the period the Add-on applies to (Unix time, seconds, UTC)","type":"integer"},"period_start":{"description":"Start of the period the Add-on applies to (Unix time, seconds, UTC)","type":"integer"},"ref":{"description":"Cluster identifier.","type":"string"},"status":{"description":"`active`: bought and counted. `granted`: given free by the site operator.","enum":["pending","active","granted","failed"],"type":"string"},"tb":{"description":"Extra traffic in TiB.","type":"integer"}},"required":["id","kind","ref","account_id","period_start","period_end","tb","amount_cents","status","invoice_id","created_at"],"type":"object","x-order":["id","kind","ref","account_id","period_start","period_end","tb","amount_cents","status","invoice_id","created_at"]},"type":"array"},"buy_block":{"description":"Why an Add-on cannot be bought (`unmetered` or `not_active`), or null when it can.","type":["string","null"]},"can_buy":{"description":"Whether a Bandwidth Add-on can be bought for the cluster now.","type":"boolean"},"count":{"description":"What is measured: `edge`, traffic at the network edge.","type":"string"},"count_mode":{"description":"Which directions count: `both` or `out` only.","enum":["both","out"],"type":"string"},"kind":{"description":"Always `k8s` for a cluster.","type":"string"},"limit_bytes":{"description":"Total allowance for the period (`quota_bytes` + `addon_bytes`), or null when unmetered.","type":["integer","null"]},"metered_frac":{"description":"Fraction of the period (0 to 1) during which traffic was metered.","type":"number"},"name":{"description":"Cluster name.","type":"string"},"pct":{"description":"Percent of the allowance used, or null when unmetered.","type":["number","null"]},"period":{"description":"Current accounting period.","properties":{"end":{"description":"End of the current monthly period (when the counter resets) (Unix time, seconds, UTC)","type":"integer"},"kind":{"description":"How the period is defined. A cluster uses `anchored_month`: a month counted from the creation hour.","type":"string"},"start":{"description":"Start of the current monthly period (Unix time, seconds, UTC)","type":"integer"}},"required":["start","end","kind"],"type":"object","x-order":["start","end","kind"]},"policy":{"description":"What happens when the allowance is used up: `notify` (only warn), `throttle` (slow down) or `suspend` (block).","enum":["notify","throttle","suspend"],"type":"string"},"price":{"description":"Add-on price on this site.","properties":{"error":{"description":"Reason code when the price is unavailable.","type":"string"},"max_tb":{"description":"Most TiB one Add-on purchase may add.","type":"integer"},"tb_cents":{"description":"Price of 1 TiB of Add-on in US cents. Missing when the price cannot be computed right now.","type":"integer"}},"required":["max_tb"],"type":"object","x-order":["tb_cents","max_tb","error"]},"quota_bytes":{"description":"Included traffic for the period in bytes: the per-server quota multiplied by the average number of workers over the period. Null when the cluster is unmetered.","type":["integer","null"]},"ref":{"description":"Cluster identifier.","type":"string"},"remaining_bytes":{"description":"Allowance left, in bytes (negative when over), or null when unmetered.","type":["integer","null"]},"series":{"description":"Traffic over time.","properties":{"bucket":{"description":"Length of each point in seconds: 3600 for `24h`, 86400 otherwise.","type":"integer"},"from":{"description":"Start of the series (Unix time, seconds, UTC)","type":"integer"},"points":{"items":{"properties":{"in":{"description":"Bytes received in the bucket.","type":"integer"},"out":{"description":"Bytes sent in the bucket.","type":"integer"},"t":{"description":"Start of the bucket (Unix time, seconds, UTC)","type":"integer"},"total":{"description":"`in` + `out`.","type":"integer"}},"required":["t","in","out","total"],"type":"object","x-order":["t","in","out","total"]},"type":"array"},"range":{"description":"Range that was returned (`24h`, `7d`, `30d` or `period`).","type":"string"},"to":{"description":"End of the series (Unix time, seconds, UTC)","type":"integer"}},"required":["range","bucket","from","to","points"],"type":"object","x-order":["range","bucket","from","to","points"]},"state":{"description":"Cluster state, see the `state` field of a cluster.","type":"string"},"sub":{"description":"Public IP address of the cluster, or an empty string.","type":"string"},"suspend_active":{"description":"Whether the `suspend` policy is already being enforced.","type":"boolean"},"total":{"description":"Real traffic of the period, whether or not it counts against the allowance.","properties":{"in":{"description":"Bytes received in the period.","type":"integer"},"out":{"description":"Bytes sent in the period.","type":"integer"},"total":{"description":"`in` + `out`.","type":"integer"}},"required":["in","out","total"],"type":"object"},"unmetered":{"properties":{"label":{"description":"Name of the unmetered network.","type":"string"},"mbps":{"description":"Committed bandwidth in Mbit/s.","type":"integer"}},"required":["label","mbps"],"type":["object","null"]},"used_bytes":{"description":"Traffic counted against the allowance so far, in bytes.","type":"integer"},"workers_avg":{"description":"Average number of workers over the period.","type":["number","null"]}},"required":["kind","ref","name","sub","state","account_id","period","quota_bytes","addon_bytes","addon_tb","limit_bytes","used_bytes","remaining_bytes","pct","total","unmetered","metered_frac","workers_avg","can_buy","buy_block","count","addons","price","policy","suspend_active","count_mode","series"],"type":"object","x-order":["kind","ref","name","sub","state","account_id","period","quota_bytes","addon_bytes","addon_tb","limit_bytes","used_bytes","remaining_bytes","pct","total","unmetered","metered_frac","workers_avg","can_buy","buy_block","count","addons","price","policy","suspend_active","count_mode","series"]},"K8sCatalog":{"description":"Everything needed to order a cluster.","properties":{"control_plane":{"description":"Control plane that comes with every cluster.","properties":{"count":{"description":"Number of control plane nodes.","type":"integer"},"cpu":{"description":"vCPU of each control plane node.","type":"integer"},"free":{"description":"Always true.","type":"boolean"},"ram_mb":{"description":"Memory of each control plane node in MiB.","type":"integer"}},"required":["free","count","cpu","ram_mb"],"type":"object","x-order":["free","count","cpu","ram_mb"]},"cycles":{"description":"Billing cycles you can choose for workers.","items":{"properties":{"discount_pct":{"description":"Discount for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Billing cycle identifier. Pass it as `cycle`.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"type":"array"},"enabled":{"description":"Whether any region currently sells Kubernetes to your account.","type":"boolean"},"hours_per_month":{"description":"Hours in a billing month, used for the monthly estimates (730).","type":"integer"},"limits":{"description":"Limits that apply to your account.","properties":{"clusters_max":{"description":"Most clusters one account may have.","type":"integer"},"clusters_used":{"description":"Clusters your account currently has.","type":"integer"},"min_hours_to_create":{"description":"Hours of worker cost your wallet balance must cover to create or enlarge a cluster.","type":"integer"},"workers_max":{"description":"Most workers a cluster may have.","type":"integer"},"workers_min":{"description":"Fewest workers a cluster may have.","type":"integer"}},"required":["workers_min","workers_max","clusters_max","clusters_used","min_hours_to_create"],"type":"object","x-order":["workers_min","workers_max","clusters_max","clusters_used","min_hours_to_create"]},"versions":{"description":"Versions you can order in `zone`, default first.","items":{"$ref":"#/components/schemas/K8sVersion"},"type":"array"},"worker_disk_gb":{"description":"NVMe system disk of every worker in GiB.","type":"integer"},"worker_plans":{"description":"Worker plans on sale with their prices on this site.","items":{"$ref":"#/components/schemas/K8sWorkerPlan"},"type":"array"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}],"description":"Region the `versions` belong to: the one you asked for, otherwise the site default. Null when no region qualifies."},"zones":{"description":"Regions that offer Kubernetes.","items":{"$ref":"#/components/schemas/Zone"},"type":"array"}},"required":["enabled","zones","zone","versions","worker_plans","worker_disk_gb","cycles","control_plane","limits","hours_per_month"],"type":"object","x-order":["enabled","zones","zone","versions","worker_plans","worker_disk_gb","cycles","control_plane","limits","hours_per_month"]},"K8sCluster":{"description":"A Kubernetes cluster.","properties":{"billing":{"$ref":"#/components/schemas/K8sCycleBilling"},"can":{"description":"Which actions are possible in the current state.","properties":{"delete":{"description":"Delete can be called now.","type":"boolean"},"kubeconfig":{"description":"The kubeconfig can be downloaded now.","type":"boolean"},"scale":{"description":"Scale can be called now.","type":"boolean"},"start":{"description":"Start can be called now.","type":"boolean"},"stop":{"description":"Stop can be called now.","type":"boolean"},"upgrade":{"description":"Version upgrades. Always false: upgrades are not available through the API yet.","type":"boolean"}},"required":["scale","start","stop","kubeconfig","upgrade","delete"],"type":"object","x-order":["scale","start","stop","kubeconfig","upgrade","delete"]},"control_plane":{"description":"Control plane specification. It is free and managed for you.","properties":{"count":{"description":"Number of control plane nodes.","type":"integer"},"cpu":{"description":"vCPU of each control plane node.","type":"integer"},"free":{"description":"Always true: the control plane is not billed.","type":"boolean"},"ram_mb":{"description":"Memory of each control plane node in MiB.","type":"integer"}},"required":["count","cpu","ram_mb","free"],"type":"object","x-order":["count","cpu","ram_mb","free"]},"created_at":{"description":"When the cluster was ordered (Unix time, seconds, UTC)","type":"integer"},"cs_state":{"description":"Live status of the cluster software, e.g. `Running`, `Stopped`, `Starting`, `Scaling`, `Alert`, `Error`. Null until it has been reported. A cluster is usable when `state` is `active` and this is `Running`.","type":["string","null"]},"endpoint":{"description":"URL of the Kubernetes API server, e.g. `https://203.0.113.10:6443`. Null until the cluster is ready.","type":["string","null"]},"id":{"description":"Cluster identifier (UUID). Use it as the `id` path parameter of every cluster operation.","type":"string"},"lock":{"description":"Present only while `state` is `locked`. While locked, scale, start, stop and kubeconfig are refused with `423 cluster_locked`; deleting is still allowed.","properties":{"destroy_after":{"description":"When an unresolved lock leads to automatic deletion, if scheduled (Unix time, seconds, UTC)","type":["integer","null"]},"locked_at":{"description":"When the cluster was locked (Unix time, seconds, UTC)","type":["integer","null"]},"reason":{"description":"Why the cluster is locked: `no_funds` (the wallet could not pay the hourly charges), `expired` (a prepaid period ended and was not renewed), `admin` (blocked by the site operator), `abuse` (blocked for a policy violation).","enum":["no_funds","expired","admin","abuse",null],"type":["string","null"]}},"required":["reason","locked_at","destroy_after"],"type":["object","null"],"x-order":["reason","locked_at","destroy_after"]},"name":{"description":"Cluster name: 3 to 40 lowercase letters, digits and hyphens.","type":"string"},"note":{"description":"Free-form note set with Update a cluster, or null when empty. Left out of the items of List clusters.","type":["string","null"]},"op":{"anyOf":[{"$ref":"#/components/schemas/K8sOp"},{"type":"null"}],"description":"The operation in progress, or null when the cluster is idle."},"pricing":{"$ref":"#/components/schemas/K8sPricing"},"public_error":{"description":"Only when `state` is `failed`: reason code (`capacity`, `timeout`, `cloud_limit`, `network`, `cancelled`, `cks_failed` or `internal`). Null otherwise.","type":["string","null"]},"public_ip":{"description":"Public IP address of the cluster. Null until the cluster is ready.","type":["string","null"]},"ready_at":{"description":"When the cluster first became ready, or null if it has not (Unix time, seconds, UTC)","type":["integer","null"]},"state":{"description":"Lifecycle state. `provisioning`: being built. `active`: built and running. `stopped`: stopped by you. `locked`: stopped and blocked by the platform (see `lock`). `deleting`: being removed. `deleted`: gone (still readable for 30 days). `failed`: the build failed (see `public_error`); delete it to clean up.","enum":["provisioning","active","stopped","locked","deleting","deleted","failed"],"type":"string"},"updated_at":{"description":"When the cluster record last changed (Unix time, seconds, UTC)","type":"integer"},"version":{"description":"Kubernetes version the cluster runs.","properties":{"eol_at":{"description":"End-of-life date of the version, or null when none is announced (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Version identifier.","type":"integer"},"name":{"description":"Display name, e.g. `v1.35.0`.","type":"string"},"semver":{"description":"Semantic version, e.g. `1.35.0`.","type":"string"}},"required":["id","name","semver","eol_at"],"type":"object","x-order":["id","name","semver","eol_at"]},"workers":{"description":"Worker node configuration.","properties":{"cpu":{"description":"vCPU of each worker.","type":"integer"},"custom":{"description":"True only for older clusters created before fixed worker plans existed; `plan_code` is then null.","type":"boolean"},"desired":{"description":"Number of workers you asked for. After a scale call it keeps the old value until the operation finishes.","type":"integer"},"disk_gb":{"description":"NVMe system disk of each worker in GiB.","type":"integer"},"observed":{"description":"Number of workers the platform last counted.","type":"integer"},"plan":{"description":"Display label of the worker plan, e.g. `K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)`.","type":"string"},"plan_code":{"description":"Worker plan code, e.g. `K8S-3`.","type":["string","null"]},"ram_mb":{"description":"Memory of each worker in MiB.","type":"integer"},"running":{"description":"Number of workers that are running right now.","type":"integer"}},"required":["custom","plan_code","plan","cpu","ram_mb","disk_gb","desired","observed","running"],"type":"object","x-order":["custom","plan_code","plan","cpu","ram_mb","disk_gb","desired","observed","running"]},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}],"description":"Region the cluster runs in."}},"required":["id","name","state","cs_state","zone","version","endpoint","public_ip","control_plane","workers","pricing","billing","lock","op","can","public_error","created_at","ready_at","updated_at"],"type":"object","x-order":["id","name","note","state","cs_state","zone","version","endpoint","public_ip","control_plane","workers","pricing","billing","lock","op","can","public_error","created_at","ready_at","updated_at"]},"K8sCycleBilling":{"description":"How the cluster is billed.","properties":{"auto_renew":{"description":"Whether a prepaid cluster renews at the end of the paid period. Only meaningful for prepaid cycles.","type":"boolean"},"cycle":{"description":"Billing cycle identifier: `hourly`, or a prepaid cycle such as `monthly`.","type":"string"},"cycle_cents":{"description":"Price of one full cycle for all workers (`worker_cycle_cents` times the worker count) in US cents.","type":"integer"},"months":{"description":"Length of the cycle in months (0 = billed by the hour).","type":"integer"},"paid_until":{"description":"End of the period already paid for, or null for hourly clusters (Unix time, seconds, UTC)","type":["integer","null"]},"worker_cycle_cents":{"description":"Price of one worker for one full cycle in US cents (0 for hourly clusters).","type":"integer"}},"required":["cycle","months","paid_until","auto_renew","worker_cycle_cents","cycle_cents"],"type":"object","x-order":["cycle","months","paid_until","auto_renew","worker_cycle_cents","cycle_cents"]},"K8sNode":{"description":"A node of the cluster.","properties":{"billable":{"description":"Whether the node is billed. False for control plane nodes.","type":"boolean"},"cpu":{"description":"vCPU of the node.","type":"integer"},"cs_state":{"description":"Live status of the node, e.g. `Running` or `Stopped`.","type":["string","null"]},"disk_gb":{"description":"System disk of the node in GiB.","type":"integer"},"hourly_uusd":{"description":"Hourly price of the node in millionths of a US dollar. 0 for control plane nodes.","type":"integer"},"id":{"description":"Node identifier.","type":"string"},"name":{"description":"Node host name.","type":["string","null"]},"private_ip":{"description":"Private IP address of the node inside the cluster network.","type":["string","null"]},"ram_mb":{"description":"Memory of the node in MiB.","type":"integer"},"role":{"description":"`control`: control plane node (free). `worker`: billed worker node. `etcd`: dedicated datastore node.","enum":["control","worker","etcd"],"type":"string"},"since":{"description":"When the node started to exist (and to be billed, for workers) (Unix time, seconds, UTC)","type":"integer"},"source":{"description":"`op`: created by an operation of the cluster. `observed`: found on the cluster later, for example added from inside the cluster.","enum":["op","observed"],"type":"string"},"state":{"description":"Always `active` in this list: removed nodes are not returned.","enum":["active","removed"],"type":"string"}},"required":["id","name","role","cs_state","private_ip","cpu","ram_mb","disk_gb","hourly_uusd","billable","source","since","state"],"type":"object","x-order":["id","name","role","cs_state","private_ip","cpu","ram_mb","disk_gb","hourly_uusd","billable","source","since","state"]},"K8sOp":{"description":"A background operation on a cluster. A cluster runs at most one operation at a time.","properties":{"created_at":{"description":"When the operation was queued (Unix time, seconds, UTC)","type":"integer"},"finished_at":{"description":"When the operation finished, or null while it is still queued or running (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Operation identifier.","type":"integer"},"kind":{"description":"What the operation does. `create`, `scale`, `start`, `stop` and `delete` are started by you; the others are started by the platform.","enum":["create","scale","start","stop","upgrade","delete","limits","autoscale","worker_plan","ingress_sync"],"type":"string"},"public_error":{"description":"Reason code when the operation failed: `capacity`, `timeout`, `cloud_limit`, `network`, `cancelled`, `cks_failed` or `internal`; null otherwise.","type":["string","null"]},"state":{"description":"`queued` and `running` mean work is in progress; `done`, `failed` and `cancelled` are final.","enum":["queued","running","done","failed","cancelled"],"type":"string"},"step":{"description":"Current step of the operation, for progress display only. The set of values can change.","type":"string"}},"required":["id","kind","state","step","public_error","created_at","finished_at"],"type":"object","x-order":["id","kind","state","step","public_error","created_at","finished_at"]},"K8sOpQueued":{"description":"The operation queued by a create, scale, start, stop or delete call.","properties":{"id":{"description":"Operation identifier. Follow it with List operations.","type":"integer"},"kind":{"description":"Kind of operation that was queued.","enum":["create","scale","start","stop","upgrade","delete","limits","autoscale","worker_plan","ingress_sync"],"type":"string"},"state":{"description":"Always `queued` right after the call.","enum":["queued"],"type":"string"}},"required":["id","kind","state"],"type":"object"},"K8sPricing":{"description":"What the cluster costs at its current size.","properties":{"control_plane_cents":{"description":"Price of the control plane. Always 0.","type":"integer"},"hourly_uusd":{"description":"Price of the whole cluster per hour in millionths of a US dollar (workers only; the control plane is free).","type":"integer"},"monthly_cents":{"description":"Price of the whole cluster for a month of 730 hours in US cents.","type":"integer"},"worker_hourly_uusd":{"description":"Price of one worker per hour in millionths of a US dollar.","type":"integer"}},"required":["worker_hourly_uusd","hourly_uusd","monthly_cents","control_plane_cents"],"type":"object","x-order":["worker_hourly_uusd","hourly_uusd","monthly_cents","control_plane_cents"]},"K8sQuote":{"description":"A priced cluster order and the result of every pre-flight check. Nothing is created or charged.","properties":{"can_create":{"description":"True only when every check passes and the balance is enough. When false, the failing item above shows why.","type":"boolean"},"checks":{"description":"Pre-flight checks that Create a cluster would apply.","properties":{"clusters":{"properties":{"max":{"description":"Most clusters one account may have.","type":"integer"},"site_ok":{"description":"Whether the site-wide cluster limit still has room.","type":"boolean"},"total_ok":{"description":"Whether the platform-wide cluster limit still has room.","type":"boolean"},"used":{"description":"Clusters you currently have (not deleted or failed).","type":"integer"}},"required":["used","max","site_ok","total_ok"],"type":"object","x-order":["used","max","site_ok","total_ok"]},"email_verified":{"description":"Whether the account e-mail requirement is met.","type":"boolean"},"provider_ok":{"description":"Whether capacity for new resources is available on the site right now.","type":"boolean"},"quota":{"additionalProperties":true,"description":"Set when the account's resource quota would be exceeded: `reason`, `used`, `requested`, `limit`, `need_more_cents`, `message` and related fields. Null when the quota allows the order.","type":["object","null"]},"quota_request":{"properties":{"cpu":{"description":"vCPU the cluster would add to your quota usage (workers plus control plane).","type":"integer"},"disk_gb":{"description":"Disk the cluster would add, in GiB.","type":"integer"},"ram_mb":{"description":"Memory the cluster would add, in MiB.","type":"integer"},"vm":{"description":"Server count the cluster would add (one per worker).","type":"integer"}},"required":["cpu","ram_mb","disk_gb","vm"],"type":"object","x-order":["cpu","ram_mb","disk_gb","vm"]},"sales_enabled":{"description":"Whether the site accepts new orders.","type":"boolean"}},"required":["sales_enabled","email_verified","quota","quota_request","clusters","provider_ok"],"type":"object","x-order":["sales_enabled","email_verified","quota","quota_request","clusters","provider_ok"]},"control_plane":{"description":"Control plane that comes with the cluster.","properties":{"count":{"description":"Number of control plane nodes.","type":"integer"},"cpu":{"description":"vCPU of each control plane node.","type":"integer"},"free":{"description":"Always true.","type":"boolean"},"hourly_uusd":{"description":"Always 0.","type":"integer"},"monthly_cents":{"description":"Always 0.","type":"integer"},"ram_mb":{"description":"Memory of each control plane node in MiB.","type":"integer"}},"required":["free","count","cpu","ram_mb","hourly_uusd","monthly_cents"],"type":"object","x-order":["free","count","cpu","ram_mb","hourly_uusd","monthly_cents"]},"funds":{"description":"Wallet check.","properties":{"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"enough":{"description":"Whether `balance_cents` covers `need_cents`.","type":"boolean"},"first_charge_cents":{"description":"Amount charged to the wallet at creation, in US cents. 0 for hourly billing.","type":"integer"},"min_hours":{"description":"Hours of worker cost the balance must cover (the site setting behind `need_cents`).","type":"integer"},"need_cents":{"description":"Wallet balance required to create this cluster, in US cents: the larger of the up-front charge of a prepaid cycle, the site's minimum balance, and the cost of `min_hours` hours of the new workers plus any cluster still being built.","type":"integer"}},"required":["balance_cents","need_cents","enough","first_charge_cents","min_hours"],"type":"object","x-order":["balance_cents","need_cents","enough","first_charge_cents","min_hours"]},"pricing":{"description":"Price of the cluster.","properties":{"control_plane_cents":{"description":"Price of the control plane. Always 0.","type":"integer"},"cycle":{"description":"Billing cycle that was priced.","type":"string"},"cycle_cents":{"description":"Amount charged at creation for all workers in US cents (0 for hourly).","type":"integer"},"cycle_name":{"description":"Display name of the billing cycle.","type":"string"},"discount_pct":{"description":"Discount for paying the cycle up front, in percent.","type":"number"},"first_charge_cents":{"description":"Same as `cycle_cents`: what the wallet is charged at creation.","type":"integer"},"hourly_uusd":{"description":"Price of all workers per hour in millionths of a US dollar.","type":"integer"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"monthly_cents":{"description":"Price of all workers for a month of `hours_per_month` hours, in US cents.","type":"integer"},"months":{"description":"Length of the cycle in months (0 = hourly).","type":"integer"},"worker_cycle_cents":{"description":"Price of one worker for one full cycle in US cents (0 for hourly).","type":"integer"},"worker_hourly_uusd":{"description":"Price of one worker per hour in millionths of a US dollar.","type":"integer"},"worker_monthly_cents":{"description":"Price of one worker for a month of `hours_per_month` hours, in US cents.","type":"integer"}},"required":["worker_monthly_cents","worker_hourly_uusd","hourly_uusd","monthly_cents","control_plane_cents","hours_per_month","cycle","cycle_name","months","discount_pct","worker_cycle_cents","cycle_cents","first_charge_cents"],"type":"object","x-order":["worker_monthly_cents","worker_hourly_uusd","hourly_uusd","monthly_cents","control_plane_cents","hours_per_month","cycle","cycle_name","months","discount_pct","worker_cycle_cents","cycle_cents","first_charge_cents"]},"version":{"$ref":"#/components/schemas/K8sVersion"},"worker":{"description":"The worker plan that was priced.","properties":{"disk_gb":{"description":"NVMe system disk of each worker in GiB.","type":"integer"},"name":{"description":"Display label of the plan, e.g. `K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)`.","type":"string"},"plan":{"description":"Worker plan code.","type":"string"},"ram_gb":{"description":"Memory of each worker in GiB.","type":"integer"},"ram_mb":{"description":"Memory of each worker in MiB.","type":"integer"},"vcpu":{"description":"vCPU of each worker.","type":"integer"}},"required":["plan","vcpu","ram_gb","ram_mb","disk_gb","name"],"type":"object","x-order":["plan","vcpu","ram_gb","ram_mb","disk_gb","name"]},"worker_count":{"description":"Number of workers that was priced.","type":"integer"},"zone":{"$ref":"#/components/schemas/Zone"}},"required":["funds","checks","can_create","zone","version","worker","worker_count","control_plane","pricing"],"type":"object","x-order":["funds","checks","can_create","zone","version","worker","worker_count","control_plane","pricing"]},"K8sVersion":{"description":"A Kubernetes version you can choose for a new cluster.","properties":{"eol_at":{"description":"End-of-life date of the version, or null when none is announced (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Version identifier. Pass it as `version_id` when creating a cluster.","type":"integer"},"is_default":{"description":"Whether this version is used when you omit `version_id`.","type":"boolean"},"min_cpu":{"description":"Smallest worker vCPU count this version accepts. Worker plans below it are refused.","type":"integer"},"min_ram_mb":{"description":"Smallest worker memory this version accepts, in MiB. Worker plans below it are refused.","type":"integer"},"name":{"description":"Display name, e.g. `v1.35.0`.","type":"string"},"semver":{"description":"Semantic version, e.g. `1.35.0`.","type":"string"},"status":{"description":"`supported` while the version can be ordered; `eol` once its end-of-life date has passed (such versions are no longer offered for new clusters).","enum":["supported","eol"],"type":"string"},"supports_autoscaling":{"description":"Whether the version supports automatic scaling of workers.","type":"boolean"},"supports_ha":{"description":"Whether the version supports a highly available control plane.","type":"boolean"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}],"description":"Region the version is offered in. Filled in by List versions; null inside the catalog and the quote, where the region is given separately."}},"required":["id","name","semver","is_default","status","eol_at","min_cpu","min_ram_mb","supports_ha","supports_autoscaling","zone"],"type":"object","x-order":["id","name","semver","is_default","status","eol_at","min_cpu","min_ram_mb","supports_ha","supports_autoscaling","zone"]},"K8sWorkerPlan":{"description":"A worker plan on sale, with its price on this site.","properties":{"code":{"description":"Plan code. Pass it as `worker_plan` when creating a cluster, e.g. `K8S-3`.","type":"string"},"cycles":{"items":{"properties":{"cycle":{"description":"Billing cycle identifier, e.g. `monthly`. Pass it as `cycle` when creating a cluster.","type":"string"},"cycle_cents":{"description":"Price of one worker for one full cycle in US cents (0 for hourly billing).","type":"integer"},"discount_pct":{"description":"Discount for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"}},"required":["cycle","months","discount_pct","cycle_cents"],"type":"object","x-order":["cycle","months","discount_pct","cycle_cents"]},"type":"array"},"disk_gb":{"description":"NVMe system disk of each worker in GiB (the same for every plan).","type":"integer"},"hourly_uusd":{"description":"Price of one worker per hour in millionths of a US dollar (1,000,000 = US$1).","type":"integer"},"monthly_cents":{"description":"Approximate price of one worker for a month of `hours_per_month` hours, in US cents.","type":"integer"},"ram_gb":{"description":"Memory of each worker in GiB.","type":"integer"},"ram_mb":{"description":"Memory of each worker in MiB.","type":"integer"},"vcpu":{"description":"Virtual CPU cores of each worker.","type":"integer"}},"required":["code","vcpu","ram_gb","ram_mb","disk_gb","hourly_uusd","monthly_cents","cycles"],"type":"object","x-order":["code","vcpu","ram_gb","ram_mb","disk_gb","hourly_uusd","monthly_cents","cycles"]},"Order":{"properties":{"count":{"description":"Number of wallet charges grouped in this order (1 except for usage).","type":"integer"},"created_at":{"description":"Time the order was created (for usage: the last charge of that day) (Unix time, seconds, UTC)","type":"integer"},"description":{"description":"First line of the invoice, the wallet note, or a usage summary.","type":"string"},"id":{"description":"Order key, unique within the list: `i<invoice id>` for an invoice, `l<transaction id>` for a wallet charge without an invoice, `u<account>:<service>:<day>` for a day of metered usage.","type":"string"},"invoice_id":{"description":"Invoice identifier for orders with `source` `invoice`; open it with [Get one invoice](#operation/billing_invoice_get).","type":["integer","null"]},"number":{"description":"Invoice number, for orders with an invoice.","type":["string","null"]},"paid_at":{"description":"Time the order was paid (Unix time, seconds, UTC)","type":["integer","null"]},"service":{"description":"Product line the order belongs to, for example `vm` (Instances), `gpu` (GPU Instances), `dedicated` (Bare Metal), `s3` (Object Storage), `volume` (Block Storage), `backup` (Backups), `images` (OS and ISO Images), `bandwidth` (Bandwidth add-on), `ai` (AI Models), `byoip` (Bring Your Own IP and IPv4 subnets), `wallet` (top-ups) or `other`. Product lines that are not sold on this site never appear.","enum":["vm","gpu","vpn","proxy6","dedicated","blackfriday","s3","k8s","vpc","volume","backup","images","bandwidth","ai","byoip","llc","wallet","other"],"type":"string"},"source":{"description":"Where the order comes from: an invoice, a single wallet charge or refund that has no invoice, or one UTC day of metered (hourly) usage of one service.","enum":["invoice","ledger","usage"],"type":"string"},"status":{"description":"Payment status. Wallet charges are `paid`, wallet refunds `refunded`.","enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"},"total_cents":{"description":"Amount, in US cents. Always positive; refunds are money returned to your wallet.","type":"integer"},"type":{"description":"`new` purchase, `renew` renewal, `upgrade` plan, cycle or bandwidth change, `addon` add-on, `topup` wallet top-up, `refund`, `usage` metered or pay-as-you-go usage, `manual` invoice issued by support.","enum":["new","renew","upgrade","addon","topup","refund","usage","manual"],"type":"string"},"vm":{"properties":{"display_name":{"description":"Display name of the server.","type":"string"},"hostname":{"description":"Hostname of the server.","type":"string"},"id":{"description":"Server identifier.","type":"string"}},"required":["id","hostname","display_name"],"type":["object","null"],"x-order":["id","hostname","display_name"]},"vm_id":{"description":"Server the order is about, when it is about one.","type":["string","null"]}},"required":["id","source","invoice_id","number","service","type","status","total_cents","created_at","paid_at","vm_id","description","count","vm"],"type":"object","x-order":["id","source","invoice_id","number","service","type","status","total_cents","created_at","paid_at","vm_id","description","count","vm"]},"PaymentRecord":{"properties":{"amount_cents":{"description":"Amount charged to the payment method, in US cents.","type":"integer"},"completed_at":{"description":"Time the payment completed (Unix time, seconds, UTC)","type":["integer","null"]},"created_at":{"description":"Time the payment was started (Unix time, seconds, UTC)","type":"integer"},"credit_cents":{"description":"Amount added to the wallet, in US cents.","type":"integer"},"expires_at":{"description":"Time a pending payment stops being accepted (Unix time, seconds, UTC)","type":["integer","null"]},"fee_cents":{"description":"Processing fee included in `amount_cents`, in US cents.","type":"integer"},"id":{"description":"Payment identifier.","type":"integer"},"kind":{"description":"`topup`: a top-up you started. `autotopup`: an automatic top-up. `refund`: money returned.","enum":["topup","autotopup","refund"],"type":"string"},"meta":{"additionalProperties":true,"description":"Channel-specific, non-sensitive details of the payment. Keys depend on the channel.","type":["object","null"]},"method":{"description":"Payment method within the channel, for example `card` or `alipay`.","type":["string","null"]},"provider":{"description":"Payment channel that handled the payment, for example `stripe`, `paypal`, `binance` or `sepay`.","type":"string"},"ref":{"description":"Reference of the payment at the payment channel.","type":"string"},"status":{"description":"Payment status. Only `completed` payments add to the wallet.","enum":["pending","completed","failed","refunded","disputed","canceled"],"type":"string"}},"required":["id","kind","status","amount_cents","fee_cents","credit_cents","created_at","completed_at","provider","ref","method","meta","expires_at"],"type":"object","x-order":["id","kind","status","amount_cents","fee_cents","credit_cents","created_at","completed_at","provider","ref","method","meta","expires_at"]},"Plan":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cpu_type":{"description":"CPU type of the plan in regions that offer several: `A` Availability (shared cores, best value), `B` General Purpose (consistent performance), `D` Dedicated (dedicated cores). `null` in the platform's standard regions.","enum":["A","B","D",null],"type":["string","null"]},"cycles":{"items":{"$ref":"#/components/schemas/CycleQuote"},"type":"array"},"description":{"description":"Marketing description of the plan.","type":["string","null"]},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly":{"description":"Exact price per hour as a decimal string, e.g. `$0.004704`.","type":"string"},"hourly_mills":{"description":"Price per hour in mills (1 mill = US$0.001), rounded. Use `hourly` for the exact decimal price.","type":"integer"},"hourly_uusd":{"description":"Exact price per hour in micro-dollars (1 = US$0.000001), e.g. `5500` = US$0.0055.","type":"integer"},"id":{"description":"Plan identifier. Pass it as `plan_id` when creating a server.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"name":{"description":"Display name.","type":"string"},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"slug":{"description":"Stable short name, e.g. `s-2c-4g`.","type":"string"},"zone_id":{"description":"Region the plan is sold in. See `zones`.","type":"integer"}},"required":["id","slug","name","cpu","ram_mb","disk_gb","hourly_mills","hourly","monthly_cents"],"type":"object","x-order":["id","slug","name","cpu","ram_mb","disk_gb","hourly_mills","hourly","hourly_uusd","monthly_cents","description","cycles","zone_id","cpu_type"]},"PortForwardRule":{"properties":{"id":{"description":"Rule identifier. Pass it to [Delete a port forwarding rule](#operation/vm_port_forward_delete).","type":"string"},"private_end":{"description":"Last server port the traffic is sent to.","type":["integer","null"]},"private_start":{"description":"First server port the traffic is sent to.","type":["integer","null"]},"protocol":{"description":"`tcp` or `udp`.","type":["string","null"]},"public_end":{"description":"Last public port of the range.","type":["integer","null"]},"public_start":{"description":"First public port of the range.","type":["integer","null"]},"state":{"description":"Rule state: `Active` once applied, or `Add` / `Revoke` while a change is still being applied.","type":["string","null"]},"vm_guest_ip":{"description":"Private address of the server the traffic is forwarded to.","type":["string","null"]}},"required":["id","protocol","public_start","public_end","private_start","private_end","vm_guest_ip","state"],"type":"object","x-order":["id","protocol","public_start","public_end","private_start","private_end","vm_guest_ip","state"]},"Proxy6Address":{"properties":{"addr":{"description":"IPv6 address.","type":"string"},"net64":{"description":"The network the address is reserved under: its /64 (for example `2001:db8:5a1:7c3::/64`), or the address itself with `/128` when the plan is served from a single /64.","type":"string"},"port":{"description":"Advanced, optional: dedicated port of the address on a static plan (`ports.static_from + slot - 1`, base user name). Normal use is the shared ports with the `user` name of this address. Null for other plan types.","type":["integer","null"]},"since":{"description":"When the address was assigned (Unix time, seconds, UTC)","type":"integer"},"slot":{"description":"Position of the address in the plan, starting at 1.","type":"integer"},"user":{"description":"User name that selects this address. On a static plan it is `<username>-<slot>`; otherwise the plan user name.","type":"string"}},"required":["slot","addr","net64","port","user","since"],"type":"object","x-order":["slot","addr","net64","port","user","since"]},"Proxy6PlanSummary":{"allOf":[{"$ref":"#/components/schemas/VpnPlanSummary"},{"properties":{"ip_version":{"description":"Always `ipv6`.","type":"string"},"proxy6":{"properties":{"addresses":{"description":"Number of IPv6 addresses currently assigned.","type":"integer"},"count":{"description":"Number of addresses (static) or rotations included (rotate).","type":"integer"},"current_addr":{"description":"Current IPv6 address of a rotating plan.","type":["string","null"]},"device_addons":{"description":"Extra device slots bought.","type":"integer"},"devices":{"description":"Number of devices (source IPs) that may connect at once.","type":"integer"},"devices_locked":{"items":{"description":"Source IP of a device locked to the plan.","type":"string"},"type":"array"},"exhausted":{"description":"True when all rotations are used.","type":"boolean"},"exhausted_at":{"description":"When the rotations ran out (Unix time, seconds, UTC)","type":["integer","null"]},"host":{"description":"Proxy host name or IP to connect to.","type":"string"},"kind":{"description":"`static` keeps fixed addresses, `rotate` changes the address on demand or on a timer.","enum":["static","rotate"],"type":"string"},"last_rotated_at":{"description":"Time of the last rotation (Unix time, seconds, UTC)","type":["integer","null"]},"mbps":{"description":"Speed limit in Mbps.","type":"integer"},"mbps_addons":{"description":"Extra 100 Mbps steps bought.","type":"integer"},"next_rotate_at":{"description":"Time of the next automatic rotation (Unix time, seconds, UTC)","type":["integer","null"]},"password":{"description":"Proxy password. Included on detail calls, null in lists.","type":["string","null"]},"plan":{"description":"Plan slug.","type":"string"},"ports":{"additionalProperties":true,"description":"Ports: `http`, `https`, `socks5`, and for static plans the advanced `static_from` / `static_to`, an optional range where port N selects address N. Normal use is `http` / `https` / `socks5` with the user name `user-N` picking address N.","type":"object"},"rotate_interval_s":{"description":"Automatic rotation interval in seconds, 0 when off.","type":"integer"},"rotate_path":{"description":"Public rotation link path of a rotating plan. It is returned when you buy the plan; detail calls made with an API key return null. Issue a fresh link with the rotation-token call.","type":["string","null"]},"turns_left":{"description":"Rotations left.","type":"integer"},"turns_total":{"description":"Rotations included in the plan.","type":"integer"},"turns_used":{"description":"Rotations already used.","type":"integer"},"username":{"description":"Proxy user name.","type":"string"}},"required":["kind","plan","count","mbps","mbps_addons","devices","device_addons","devices_locked","username","password","host","ports","addresses","current_addr","turns_total","turns_used","turns_left","exhausted","exhausted_at","rotate_interval_s","next_rotate_at","last_rotated_at","rotate_path"],"type":"object","x-order":["kind","plan","count","mbps","mbps_addons","devices","device_addons","devices_locked","username","password","host","ports","addresses","current_addr","turns_total","turns_used","turns_left","exhausted","exhausted_at","rotate_interval_s","next_rotate_at","last_rotated_at","rotate_path"]}},"required":["ip_version","proxy6"],"type":"object"}],"description":"A Proxy IPv6 plan: the common plan fields plus the proxy settings in `proxy6`."},"Proxy6PriceSet":{"properties":{"daily":{"description":"Price of one day, in millionths of a US dollar.","type":"integer"},"monthly":{"description":"Price of one month, in millionths of a US dollar.","type":"integer"},"weekly":{"description":"Price of one week (7 days), in millionths of a US dollar.","type":"integer"},"yearly":{"description":"Price of one year, in millionths of a US dollar.","type":"integer"}},"required":["daily","weekly","monthly","yearly"],"type":"object","x-order":["daily","weekly","monthly","yearly"]},"Proxy6Rotation":{"properties":{"created_at":{"description":"When the change happened (Unix time, seconds, UTC)","type":"integer"},"new_addr":{"description":"Address after the change. Null when the rotations ran out.","type":["string","null"]},"old_addr":{"description":"Address before the change.","type":["string","null"]},"reason":{"description":"Why the address changed: `manual`, `link`, `interval`, `topup` or `exhausted`.","type":"string"},"slot":{"description":"Slot of the address that changed.","type":"integer"}},"required":["slot","old_addr","new_addr","reason","created_at"],"type":"object","x-order":["slot","old_addr","new_addr","reason","created_at"]},"Proxy6Subscription":{"properties":{"activated_at":{"description":"When the plan became active, or null if it never did (Unix time, seconds, UTC)","type":["integer","null"]},"addons":{"description":"Add-ons bought with the plan.","items":{"description":"Add-on key.","type":"string"},"type":"array"},"auto_renew":{"description":"Whether the plan renews itself from the wallet balance shortly before it ends. Always false for plans that can no longer be renewed.","type":"boolean"},"bandwidth_gb":{"description":"Always 0: traffic is not metered per plan.","type":"integer"},"canceled_at":{"description":"When the plan was canceled or failed, or null otherwise (Unix time, seconds, UTC)","type":["integer","null"]},"created_at":{"description":"When the order was placed (Unix time, seconds, UTC)","type":"integer"},"cycle":{"description":"Billing cycle chosen at purchase, for example `daily`, `weekly`, `monthly` or `yearly`.","type":"string"},"expires_at":{"description":"When the current paid period ends (Unix time, seconds, UTC)","type":"integer"},"fail_reason":{"description":"Short machine-readable reason when the plan is `canceled` or `failed` (for example `not_charged` or `refunded`); null otherwise.","type":["string","null"]},"hidden_at":{"description":"When you removed the plan from your list, or null otherwise. Removed plans are only returned with `include_hidden` (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Plan identifier.","type":"integer"},"ip_count":{"description":"Size of the plan: the number of IPv6 addresses of a static plan, the number of rotations per period of a rotating plan, and 0 for an unlimited plan.","type":"integer"},"ip_released_at":{"description":"When the IP addresses went back to the pool, or null while the plan still holds them (Unix time, seconds, UTC)","type":["integer","null"]},"ip_version":{"description":"Always `ipv6`.","type":"string"},"keep_until":{"description":"For an `expired` plan that still holds its IP addresses: the time after which they are released unless the plan is renewed. Null otherwise (Unix time, seconds, UTC)","type":["integer","null"]},"monthly_uusd":{"description":"Price per month in millionths of a US dollar, as sold.","type":"integer"},"months":{"description":"Length of one billing period in months. 0 for plans billed per day or per week (see `period_days`).","type":"integer"},"period_days":{"description":"Length of one billing period in days for plans billed per day or per week; 0 when billing follows calendar months (`months`).","type":"integer"},"proxy6":{"description":"Connection details and rotation state of the Proxy IPv6 plan.","properties":{"addresses":{"description":"Number of IPv6 addresses currently assigned to the plan.","type":"integer"},"count":{"description":"Plan size: number of addresses (`static`), rotations per period (`rotate`), or 0 (`unlimited`).","type":"integer"},"current_addr":{"description":"Current outgoing address of a rotating plan. Null for static plans.","type":["string","null"]},"device_addons":{"description":"Number of extra-device add-ons bought with the plan.","type":"integer"},"devices":{"description":"Number of client source IP addresses the plan can be used from. The first sources that connect are locked to the plan and other sources are refused; 0 means no limit.","type":"integer"},"devices_locked":{"description":"Source IP addresses currently locked to the plan. They can be released in the dashboard.","items":{"description":"Source IP address.","type":"string"},"type":"array"},"exhausted":{"description":"True when all rotations are used. Renew the plan to get more.","type":"boolean"},"exhausted_at":{"description":"When the rotations ran out, or null if they have not (Unix time, seconds, UTC)","type":["integer","null"]},"host":{"description":"Host name to connect to.","type":"string"},"kind":{"description":"`static`: a fixed set of IPv6 addresses. `rotate`: one address that changes, with a limited number of rotations per period. `unlimited`: one address that changes, with unlimited rotations.","enum":["static","rotate","unlimited"],"type":"string"},"last_rotated_at":{"description":"When the address last changed, or null if it never did (Unix time, seconds, UTC)","type":["integer","null"]},"mbps":{"description":"Bandwidth cap of the plan in Mbit/s, including bought add-ons.","type":"integer"},"mbps_addons":{"description":"Number of bandwidth add-ons bought with the plan.","type":"integer"},"next_rotate_at":{"description":"When the next automatic rotation happens, or null when automatic rotation is off (Unix time, seconds, UTC)","type":["integer","null"]},"password":{"description":"Password to authenticate with. Null in list responses; returned by Get a Proxy IPv6 plan. Treat it as a secret.","type":["string","null"]},"plan":{"description":"Slug of the plan that was bought, for example `static-100`.","type":"string"},"ports":{"description":"Ports of the connection host.","properties":{"http":{"description":"Port for HTTP proxy connections.","type":"integer"},"https":{"description":"Port for HTTP proxy connections over TLS.","type":"integer"},"socks5":{"description":"Port for SOCKS5 connections.","type":"integer"},"static_from":{"description":"Advanced, optional: first per-address port of a static plan. Normally connect on `http` / `https` / `socks5` and pick address number `slot` with the user name `user-slot`; the address is also reachable on port `static_from + slot - 1` with the base user name.","type":"integer"},"static_to":{"description":"Last per-address port of a static plan. Not used by other plan types.","type":"integer"}},"required":["http","https","socks5","static_from","static_to"],"type":"object"},"rotate_interval_s":{"description":"Automatic rotation interval in seconds; 0 means automatic rotation is off.","type":"integer"},"rotate_path":{"description":"Path of the public rotation link. Always null in responses to API keys.","type":["string","null"]},"turns_left":{"description":"Rotations still available in the current period.","type":"integer"},"turns_total":{"description":"Rotations included in the current period (rotating plans).","type":"integer"},"turns_used":{"description":"Rotations already used in the current period.","type":"integer"},"username":{"description":"User name to authenticate with.","type":"string"}},"required":["kind","plan","count","mbps","mbps_addons","devices","device_addons","devices_locked","username","password","host","ports","addresses","current_addr","turns_total","turns_used","turns_left","exhausted","exhausted_at","rotate_interval_s","next_rotate_at","last_rotated_at","rotate_path"],"type":"object","x-order":["kind","plan","count","mbps","mbps_addons","devices","device_addons","devices_locked","username","password","host","ports","addresses","current_addr","turns_total","turns_used","turns_left","exhausted","exhausted_at","rotate_interval_s","next_rotate_at","last_rotated_at","rotate_path"]},"renew_cents":{"description":"Price of renewing one billing period, in US cents. It is fixed when the plan is bought.","type":"integer"},"renew_max_periods":{"description":"Largest number of billing periods that can be paid in a single renewal.","type":"integer"},"renewable":{"description":"Whether the plan can be renewed now (it is `active`, or `expired` and still holds its IP addresses).","type":"boolean"},"status":{"description":"`pending`: payment is being confirmed. `active`: usable. `expired`: ended; it can still be renewed while the IP addresses are held (see `keep_until`). `canceled` and `failed`: ended for good.","enum":["pending","active","expired","canceled","failed"],"type":"string"},"tier":{"description":"Always `dedicated` for Proxy IPv6 plans.","enum":["shared","private","dedicated"],"type":"string"},"total_uusd":{"description":"Price of one full billing period in millionths of a US dollar, as sold.","type":"integer"}},"required":["id","tier","ip_count","bandwidth_gb","cycle","addons","monthly_uusd","total_uusd","status","created_at","expires_at","months","renew_cents","renew_max_periods","period_days","activated_at","fail_reason","canceled_at","ip_released_at","hidden_at","renewable","auto_renew","ip_version","proxy6"],"type":"object","x-order":["id","tier","ip_count","bandwidth_gb","cycle","addons","monthly_uusd","total_uusd","status","created_at","expires_at","months","renew_cents","renew_max_periods","period_days","activated_at","fail_reason","canceled_at","ip_released_at","hidden_at","renewable","auto_renew","keep_until","ip_version","proxy6"]},"S3AccessKey":{"properties":{"access_key":{"description":"Access key ID.","type":"string"},"created_at":{"description":"When the key was created; null for keys created outside this API (Unix time, seconds, UTC)","type":["integer","null"]},"last_used_at":{"description":"Reserved; always null because the last use of a key is not recorded (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["access_key","created_at","last_used_at"],"type":"object"},"S3Account":{"properties":{"billing_owner":{"description":"Billing system that manages the account. `legacy` marks an account that still belongs to a previous billing system: it can be read but not modified until it is migrated.","enum":["native","legacy"],"type":"string"},"billing_start":{"description":"Start of the first billed hour (Unix time, seconds, UTC)","type":"integer"},"created_at":{"description":"When the account was created (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Account identifier. Use it as `{id}` in every S3 path.","type":"string"},"name":{"description":"Display name of the account (1 to 80 characters).","type":"string"},"quota_gb":{"description":"Storage quota of the account in GiB. Writes are refused once the stored size reaches it.","type":"integer"},"state":{"description":"Lifecycle state. `provisioning`: being created. `active`: normal. `suspended_billing`: unpaid usage is above the allowed limit; it reactivates by itself once the balance is paid. `suspended_account`: your account is blocked. `suspended_admin`: suspended by support. Operations that write data fail with 423 unless the state is `active`.","enum":["provisioning","active","suspended_billing","suspended_account","suspended_admin"],"type":"string"},"zone_id":{"description":"Region where the account's data is stored.","type":"integer"}},"required":["id","name","state","billing_start","quota_gb","zone_id","created_at"],"type":"object","x-order":["id","name","state","billing_owner","billing_start","quota_gb","zone_id","created_at"]},"S3Bucket":{"properties":{"created_at":{"description":"Creation time as an ISO 8601 timestamp.","type":["string","null"]},"name":{"description":"Bucket name.","type":"string"},"objects":{"description":"Number of objects in the bucket.","type":"integer"},"size_bytes":{"description":"Total size of the objects in bytes.","type":"integer"}},"required":["name","created_at","objects","size_bytes"],"type":"object","x-order":["name","created_at","objects","size_bytes"]},"S3IssuedKey":{"properties":{"access_key":{"description":"Access key ID.","type":"string"},"secret_key":{"description":"Secret access key. Shown only in this response; store it now. If it is lost, rotate the key.","type":"string"}},"required":["access_key","secret_key"],"type":"object"},"S3ObjectList":{"properties":{"next":{"description":"Token for the next page, or null on the last page. Pass it as `continuation-token`.","type":["string","null"]},"objects":{"items":{"properties":{"etag":{"description":"Entity tag of the object, including the surrounding quotes. Empty when unknown.","type":"string"},"key":{"description":"Object key.","type":"string"},"modified":{"description":"Last modification time as an ISO 8601 timestamp.","type":"string"},"size":{"description":"Size in bytes.","type":"integer"}},"required":["key","size","modified","etag"],"type":"object","x-order":["key","size","modified","etag"]},"type":"array"},"prefixes":{"items":{"properties":{"prefix":{"description":"Folder prefix ending in `/`. Pass it as `prefix` to list inside that folder.","type":"string"}},"required":["prefix"],"type":"object"},"type":"array"},"truncated":{"description":"True when more entries exist beyond this page.","type":"boolean"}},"required":["objects","prefixes","next","truncated"],"type":"object","x-order":["objects","prefixes","next","truncated"]},"S3Policy":{"properties":{"bandwidth_in_price_per_gb":{"description":"Price of 1 GiB uploaded, in VND. Always 0: uploads are free.","type":"number"},"bandwidth_out_price_per_gb":{"description":"Price of 1 GiB downloaded, in VND.","type":"number"},"default_quota_gb":{"description":"Storage quota in GiB given to a new account.","type":"integer"},"free_tier_gb":{"description":"Free storage allowance in GiB. It applies while you have a running server (see `free_eligible`) and is shared by all your S3 accounts.","type":"number"},"max_accounts_per_user":{"description":"Maximum number of S3 accounts one user may have.","type":"integer"},"max_debt":{"description":"Unpaid usage in VND above which your wallet is charged immediately. If the wallet cannot cover it, your S3 accounts are suspended until the balance is paid.","type":"number"},"min_balance_create":{"description":"Wallet balance, in VND (converted at the current exchange rate), required to create a new account.","type":"number"},"min_settle":{"description":"Smallest amount in VND that is invoiced in a daily settlement. Smaller amounts are carried over to the next day; everything is settled on the first day of each month.","type":"number"},"storage_price_per_gb_month":{"description":"Price of storing 1 GiB for a 730-hour month, in VND. Storage is metered every hour at this price divided by 730.","type":"number"}},"required":["storage_price_per_gb_month","bandwidth_out_price_per_gb","bandwidth_in_price_per_gb","free_tier_gb","max_debt","min_settle","min_balance_create","max_accounts_per_user","default_quota_gb"],"type":"object","x-order":["storage_price_per_gb_month","bandwidth_out_price_per_gb","bandwidth_in_price_per_gb","free_tier_gb","max_debt","min_settle","min_balance_create","max_accounts_per_user","default_quota_gb"]},"S3Preferences":{"properties":{"alert_threshold_vnd":{"description":"Monthly usage cost in VND at which you are notified. 0 means no alert.","type":"number"}},"required":["alert_threshold_vnd"],"type":"object"},"S3Quota":{"properties":{"enabled":{"description":"Whether the quota is enforced.","type":"boolean"},"max_objects":{"description":"Maximum number of objects. -1 means unlimited.","type":"integer"},"max_size":{"description":"Maximum stored size in bytes. -1 means unlimited.","type":"integer"}},"type":"object","x-order":["enabled","max_size","max_objects"]},"S3ShareLink":{"properties":{"allow_download":{"description":"Whether visitors may download the file. When false, they can only preview browser-displayable media (images, audio, video).","type":"boolean"},"bucket":{"description":"Bucket that holds the shared object.","type":"string"},"created_at":{"description":"When the link was created (Unix time, seconds, UTC)","type":"integer"},"expires_at":{"description":"Unix time (seconds) after which the link stops working. 0 means it never expires.","type":"integer"},"has_password":{"description":"Whether visitors must enter a password.","type":"boolean"},"id":{"description":"Link identifier. Use it as `{link}` to edit or revoke the link.","type":"string"},"key":{"description":"Key of the shared object.","type":"string"},"max_views":{"description":"Maximum number of times the link can be opened. 0 means unlimited.","type":"integer"},"referer_allow":{"description":"Comma-separated list of referrer hosts that may use the link (for example `example.com, *.example.org`). Empty means any referrer.","type":"string"},"revoked_at":{"description":"When the link was revoked, or null while it is active (Unix time, seconds, UTC)","type":["integer","null"]},"url":{"description":"Path of the public link page, `/s/<token>`. Append it to the base URL of your site to get the full link. Anyone who has the link can open the object, so keep it private.","type":"string"},"view_count":{"description":"How many times the link has been opened.","type":"integer"}},"required":["id","bucket","key","url","has_password","expires_at","max_views","view_count","referer_allow","allow_download","revoked_at","created_at"],"type":"object","x-order":["id","bucket","key","url","has_password","expires_at","max_views","view_count","referer_allow","allow_download","revoked_at","created_at"]},"S3UsageHour":{"properties":{"bandwidth_cost_vnd":{"description":"Download cost of the hour in VND.","type":"number"},"bytes_in":{"description":"Bytes uploaded during the hour.","type":"integer"},"bytes_out":{"description":"Bytes downloaded during the hour.","type":"integer"},"cost_vnd":{"description":"Total cost of the hour in VND (storage plus download).","type":"number"},"free_bytes":{"description":"Part of the stored bytes covered by the free allowance.","type":"integer"},"hour":{"description":"Start of the measured hour (Unix time, seconds, UTC)","type":"integer"},"status":{"description":"How the hour is billed. `accrued`: added to your usage bill. `forgiven_account_suspended`: not billed because your account was blocked. Values starting with `legacy_` are hours that were billed by a previous billing system.","type":"string"},"storage_bytes":{"description":"Bytes stored at the end of the hour.","type":"integer"},"storage_cost_vnd":{"description":"Storage cost of the hour in VND.","type":"number"}},"required":["hour","storage_bytes","free_bytes","bytes_in","bytes_out","storage_cost_vnd","bandwidth_cost_vnd","cost_vnd","status"],"type":"object","x-order":["hour","storage_bytes","free_bytes","bytes_in","bytes_out","storage_cost_vnd","bandwidth_cost_vnd","cost_vnd","status"]},"S3Zone":{"properties":{"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO country code.","type":"string"},"id":{"description":"Region identifier.","type":"integer"},"is_default":{"description":"Whether this is the default region of the site.","type":"boolean"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"services":{"items":{"description":"Service available in the region, e.g. `vm`, `s3`.","type":"string"},"type":"array"},"slug":{"description":"Short name of the region.","type":"string"}},"required":["id","slug","name","name_en","country","city","is_default","services"],"type":"object","x-order":["id","slug","name","name_en","country","city","is_default","services"]},"ScaleChange":{"properties":{"at":{"description":"When the change was accepted, or the scheduled time for a scheduled change (Unix time, seconds, UTC)","type":"integer"},"charged_cents":{"description":"Amount charged to your wallet by this call, in US cents (0 when nothing was charged).","type":"integer"},"event_id":{"description":"Identifier of the entry written to the scaling history (see List scaling events).","type":"integer"},"from":{"$ref":"#/components/schemas/ScaleSize"},"job_id":{"description":"Background job that performs the resize. Absent for a scheduled change, which has no job until its time comes.","type":["integer","null"]},"live":{"description":"`true` when the change is applied without restarting the server; `false` when the background job stops and starts the server (or when the change is only scheduled).","type":"boolean"},"refunded_cents":{"description":"Amount refunded to your wallet by this call, in US cents.","type":"integer"},"replay":{"description":"`true` when this answer repeats the result of an earlier request with the same `Idempotency-Key` instead of running again.","type":"boolean"},"scheduled":{"description":"Present and `true` when the change was only scheduled (a decrease requested with `at`).","type":"boolean"},"to":{"$ref":"#/components/schemas/ScaleSize"}},"required":["live","charged_cents","refunded_cents"],"type":"object","x-order":["live","charged_cents","refunded_cents","job_id","event_id","replay","scheduled","at","from","to"]},"ScaleEvent":{"properties":{"actor":{"description":"Who or what caused the event: `customer:<account id>` for changes made with your account, or an identifier starting with `system:` for automatic actions (`system:autoscale`, `system:scale_sched`, `system:scale_revert`). Treat the value as an opaque label.","type":"string"},"at":{"description":"When the event was recorded (Unix time, seconds, UTC)","type":"integer"},"charged_cents":{"description":"Amount charged to your wallet for the change, in US cents.","type":"integer"},"cpu_pct":{"description":"CPU load in percent that triggered an automatic change; null for manual changes.","type":["integer","null"]},"from":{"description":"Size before the change.","properties":{"cpu":{"description":"vCPU cores before.","type":["integer","null"]},"disk_gb":{"description":"Disk in GiB before.","type":["integer","null"]},"hourly_uusd":{"description":"Hourly price before, in millionths of a US dollar.","type":["integer","null"]},"ram_mb":{"description":"Memory in MiB before.","type":["integer","null"]}},"required":["cpu","ram_mb","disk_gb","hourly_uusd"],"type":"object","x-order":["cpu","ram_mb","disk_gb","hourly_uusd"]},"id":{"description":"Event identifier.","type":"integer"},"job_id":{"description":"Background job that carried the change out, when there was one.","type":["integer","null"]},"kind":{"description":"What happened: `up` (grew), `down` (shrank), `revert` (returned to base size), `blocked` (Auto Scaling wanted to grow but was held back, see `reason`) or `pending` (a request that is still being processed). Other values may appear in future.","type":"string"},"live":{"description":"The change was applied without restarting the server.","type":"boolean"},"ok":{"description":"`false` for a change that did not happen (`blocked`, or still `pending`).","type":"boolean"},"reason":{"description":"Short machine-readable note, for example `scheduled`, or the reason a change was held back: `insufficient_funds`, `cooldown`, `max_steps_day`, `cluster_full`, `quota_exceeded`, `under_attack`, ...","type":["string","null"]},"refunded_cents":{"description":"Amount refunded to your wallet for the change, in US cents.","type":"integer"},"source":{"description":"What started it: `manual` (a resize requested through the API or the dashboard, including scheduled ones), `autoscale` (Auto Scaling) or `revert` (return to base size). Other values may appear in future.","type":"string"},"to":{"description":"Size after the change (the target size for a `blocked` event).","properties":{"cpu":{"description":"vCPU cores after.","type":["integer","null"]},"disk_gb":{"description":"Disk in GiB after.","type":["integer","null"]},"hourly_uusd":{"description":"Hourly price after, in millionths of a US dollar; may be 0 or null when not applicable.","type":["integer","null"]},"ram_mb":{"description":"Memory in MiB after.","type":["integer","null"]}},"required":["cpu","ram_mb","disk_gb","hourly_uusd"],"type":"object","x-order":["cpu","ram_mb","disk_gb","hourly_uusd"]},"vm_id":{"description":"VM identifier (UUID).","type":"string"}},"required":["id","at","vm_id","source","kind","from","to","cpu_pct","live","charged_cents","refunded_cents","job_id","ok","reason","actor"],"type":"object","x-order":["id","at","vm_id","source","kind","from","to","cpu_pct","live","charged_cents","refunded_cents","job_id","ok","reason","actor"]},"ScaleSize":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly_uusd":{"description":"Price per hour of this size in millionths of a US dollar. Absent on a replayed response.","type":"integer"},"monthly_cents":{"description":"Price of this size for a 730-hour month in US cents (informational).","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["cpu","ram_mb","disk_gb"],"type":"object","x-order":["cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents"]},"ScaleStatus":{"properties":{"autoscale_feature":{"description":"Whether Auto Scaling can be enabled on this server: the site sells it, the server is billed by the hour and it does not run Windows.","type":"boolean"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"billed_until":{"description":"End of the hour or cycle already paid (Unix time, seconds, UTC)","type":["integer","null"]},"blocked":{"description":"Reasons a resize cannot be applied right now; empty when it can. Values: `vm_locked`, `vm_not_active`, `job_running`, `ram_slots_exhausted`, `needs_reboot`.","items":{"description":"Reason code.","type":"string"},"type":"array"},"caps":{"description":"What the server can do without a restart.","properties":{"cpu_hotplug":{"description":"The operating system image can bring added vCPUs online without a restart. When `false`, increasing vCPUs needs a restart.","type":"boolean"},"hotplug":{"description":"The server has been restarted since live resizing became available. When `false`, the first change needs one restart (see Restart for scaling).","type":"boolean"},"ram_hotplugs_max":{"description":"A server accepts at most this many live RAM additions between restarts (16); restart it to reset the counter.","type":"integer"},"ram_hotplugs_used":{"description":"Number of live RAM additions since the last start.","type":"integer"},"running":{"description":"The server is running. Only a running server can be resized without a restart.","type":"boolean"},"windows":{"description":"The server runs Windows. Windows servers are always restarted to resize and cannot use Auto Scaling.","type":"boolean"}},"required":["running","hotplug","cpu_hotplug","windows","ram_hotplugs_used","ram_hotplugs_max"],"type":"object","x-order":["running","hotplug","cpu_hotplug","windows","ram_hotplugs_used","ram_hotplugs_max"]},"feature":{"description":"Whether the site sells resizing. When `false`, the write operations fail with `403 feature_disabled`.","type":"boolean"},"hours_per_month":{"description":"Hours in a billing month used to convert hourly prices to monthly ones (730 by default).","type":"integer"},"limits":{"description":"Allowed values and unit prices.","properties":{"cpu":{"description":"vCPU cores you can choose.","properties":{"max":{"description":"Largest allowed value.","type":"integer"},"min":{"description":"Smallest allowed value.","type":"integer"},"step":{"description":"Values must grow in multiples of this step.","type":"integer"}},"required":["min","max","step"],"type":"object","x-order":["min","max","step"]},"disk_gb":{"description":"Disk in GiB you can choose. `min` is the current disk because a disk can only grow.","properties":{"max":{"description":"Largest allowed value.","type":"integer"},"min":{"description":"Smallest allowed value.","type":"integer"},"step":{"description":"Values must grow in multiples of this step.","type":"integer"}},"required":["min","max","step"],"type":"object","x-order":["min","max","step"]},"ram_gb":{"description":"RAM in GiB you can choose.","properties":{"max":{"description":"Largest allowed value.","type":"integer"},"min":{"description":"Smallest allowed value.","type":"integer"},"step":{"description":"Values must grow in multiples of this step.","type":"integer"}},"required":["min","max","step"],"type":"object","x-order":["min","max","step"]},"ram_mb_step":{"description":"`ram_mb` in a resize request must be a multiple of this value (1024).","type":"integer"},"unit_uusd_h":{"description":"Unit prices of your site, so you can estimate a price locally.","properties":{"cpu":{"description":"Price of one vCPU per hour, in millionths of a US dollar.","type":"integer"},"disk_gb":{"description":"Price of 1 GiB of disk per hour, in millionths of a US dollar.","type":"integer"},"ram_gb":{"description":"Price of 1 GiB of RAM per hour, in millionths of a US dollar.","type":"integer"}},"required":["cpu","ram_gb","disk_gb"],"type":"object","x-order":["cpu","ram_gb","disk_gb"]}},"required":["cpu","ram_gb","disk_gb","ram_mb_step","unit_uusd_h"],"type":"object","x-order":["cpu","ram_gb","disk_gb","ram_mb_step","unit_uusd_h"]},"pending_revert":{"description":"The server is larger than its base size and will return to base size on its next restart.","type":"boolean"},"state":{"description":"Auto Scaling state of the server: `base` (at its base size), `scaled` (grown by Auto Scaling) or `cooling` (still larger, billed at the base price until it is returned to base).","enum":["base","scaled","cooling"],"type":"string"},"vm":{"description":"The server as it is now.","properties":{"cpu":{"description":"Current virtual CPU cores.","type":"integer"},"cs_state":{"description":"Power state reported by the platform, for example `Running` or `Stopped`; null until first known.","type":["string","null"]},"cycle":{"description":"Billing cycle slug of the server, `hourly` or a prepaid cycle such as `monthly`.","type":"string"},"disk_gb":{"description":"Current system disk in GiB.","type":"integer"},"hostname":{"description":"Host name of the server.","type":"string"},"hourly_uusd":{"description":"Current price per hour in millionths of a US dollar.","type":"integer"},"id":{"description":"VM identifier (UUID).","type":"string"},"monthly_cents":{"description":"Current price for a month of `hours_per_month` hours in US cents.","type":"integer"},"plan_id":{"description":"Plan the server is currently on.","type":"integer"},"ram_mb":{"description":"Current memory in MiB.","type":"integer"},"state":{"description":"Lifecycle state of the server, for example `active`, `locked` or `provisioning`. Only `active` servers can be resized.","type":"string"}},"required":["id","hostname","state","cs_state","cycle","plan_id","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents"],"type":"object","x-order":["id","hostname","state","cs_state","cycle","plan_id","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents"]}},"required":["feature","autoscale_feature","vm","hours_per_month","limits","caps","blocked","billed_until","balance_cents","state","pending_revert"],"type":"object","x-order":["feature","autoscale_feature","vm","hours_per_month","limits","caps","blocked","billed_until","balance_cents","state","pending_revert"]},"ShieldAgentInfo":{"properties":{"arch":{"description":"CPU architecture.","type":"string"},"enforce":{"description":"Whether the agent blocks sources by itself when a threshold is exceeded.","type":"boolean"},"enrolled_at":{"description":"When the agent was set up (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Agent identifier.","type":"string"},"last_seen":{"description":"Last heartbeat (0 = never) (Unix time, seconds, UTC)","type":"integer"},"name":{"description":"Agent name.","type":"string"},"note":{"description":"Note.","type":"string"},"os":{"description":"Operating system.","type":"string"},"status":{"description":"`active` or `suspended`.","type":"string"},"thr_conns":{"description":"Connections threshold per source, 0 = default (8000).","type":"integer"},"thr_pps":{"description":"Packets-per-second threshold per source, 0 = default (20000).","type":"integer"},"version":{"description":"Agent version.","type":"string"}},"required":["id","name","status","os","arch","version","enrolled_at","last_seen","enforce","thr_pps","thr_conns","note"],"type":"object","x-order":["id","name","status","os","arch","version","enrolled_at","last_seen","enforce","thr_pps","thr_conns","note"]},"ShieldAiQuota":{"properties":{"account_max":{"description":"Daily limit per tenant (10).","type":"integer"},"account_used":{"description":"Analyses used today (UTC) across your tenant.","type":"integer"},"ip_max":{"description":"Daily limit per IP (3).","type":"integer"},"ip_used":{"description":"Analyses used today (UTC) for this IP.","type":"integer"}},"required":["ip_used","ip_max","account_used","account_max"],"type":"object","x-order":["ip_used","ip_max","account_used","account_max"]},"ShieldAiTask":{"properties":{"actions":{"items":{"properties":{"reason":{"description":"Why the action is proposed."},"type":{"description":"Action type."},"valid":{"description":"Whether the action passed validation.","type":"boolean"},"value":{"description":"Action value, e.g. an address."}},"required":["type","value","reason","valid"],"type":"object","x-order":["type","value","reason","valid"]},"type":"array"},"applied":{"items":{"description":"Action that was applied."},"type":"array"},"at":{"description":"When the analysis finished (Unix time, seconds, UTC)","type":"integer"},"confidence":{"description":"Confidence between 0 and 1.","type":["number","null"]},"event_id":{"description":"Attack event that was analyzed, or null for the last 30 minutes.","type":["string","null"]},"evidence":{"items":{"description":"Evidence line.","type":"string"},"type":"array"},"id":{"description":"Task identifier.","type":"string"},"kind":{"description":"Attack type."},"ms":{"description":"Processing time in milliseconds.","type":["integer","null"]},"note":{"description":"Note.","type":"string"},"severity":{"description":"Severity."},"status":{"description":"Task status."},"summary":{"description":"Short explanation.","type":"string"},"trigger":{"description":"What started the analysis."},"verdict":{"description":"Verdict, e.g. `attack`."}},"required":["id","at","event_id","trigger","status","verdict","confidence","kind","severity","summary","evidence","actions","applied","ms","note"],"type":"object","x-order":["id","at","event_id","trigger","status","verdict","confidence","kind","severity","summary","evidence","actions","applied","ms","note"]},"ShieldAttackEvent":{"properties":{"avg_packet":{"description":"Average packet size in bytes when the attack was detected.","type":"number"},"baseline_pps":{"description":"Normal inbound packet rate of the IP before the attack, in packets per second.","type":"number"},"duration_s":{"description":"Duration in seconds (up to now while the event is open). Only present when `brief=1`.","type":"integer"},"ended":{"description":"When the attack ended, or null while it is still going on (Unix time, seconds, UTC)","type":["integer","null"]},"has_sample":{"description":"True when a packet sample was captured for the event.","type":"boolean"},"id":{"description":"Event identifier.","type":"string"},"kind":{"description":"Attack class: `syn_flood`, `packet_flood`, `volumetric`, `udp_amplification`, `traffic_spike` or `unknown`. Events reported by an agent installed on a server can carry other values.","type":"string"},"label":{"description":"Short description of the attack class. The text is not translated and is currently provided in Vietnamese only; use `kind` in code.","type":"string"},"open":{"description":"True while the attack is still going on. Only present when `brief=1`.","type":"boolean"},"peak_bits":{"description":"Highest inbound rate in bits per second. Only present when `brief=1`.","type":"number"},"peak_bps":{"description":"Highest inbound rate seen during the event, in BYTES per second despite the name. Multiply by 8 for bits per second, or read `peak_bits`.","type":"number"},"peak_pps":{"description":"Highest inbound rate seen during the event, in packets per second.","type":"number"},"reopened":{"description":"How many times the event was reopened after a short pause. Absent if never.","type":"integer"},"samples":{"description":"Only present when `brief=0`. Up to 40 samples taken during the attack, each `[unix_time, inbound_packets_per_s, inbound_bytes_per_s, outbound_packets_per_s, outbound_bytes_per_s]`.","items":{"items":{"description":"Value.","type":"number"},"type":"array"},"type":"array"},"severity":{"description":"Severity of the attack, derived from its peak packet and bit rate: `medium` from 20,000 packets/s or 200 Mbit/s, `high` from 100,000 packets/s or 1 Gbit/s, `critical` from 500,000 packets/s or several Gbit/s.","enum":["low","medium","high","critical"],"type":"string"},"source":{"description":"`agent` when the event was reported by an agent installed on a server; absent for events detected at the network edge.","type":"string"},"started":{"description":"When the attack was detected (Unix time, seconds, UTC)","type":"integer"},"target":{"description":"The attacked IP address.","type":"string"}},"required":["id","target","kind","label","started","ended","peak_pps","peak_bps","severity"],"type":"object","x-order":["id","target","kind","label","started","ended","peak_pps","peak_bps","avg_packet","baseline_pps","severity","has_sample","reopened","source","peak_bits","duration_s","open","samples"]},"ShieldBlock":{"properties":{"at":{"description":"Creation time (Unix time, seconds, UTC)","type":"integer"},"by":{"description":"Actor label of the creator.","type":"string"},"id":{"description":"`{target_id}:{rule_id}`.","type":"string"},"kind":{"description":"Rule kind.","type":"string"},"note":{"description":"Note.","type":"string"},"prefixes":{"description":"Number of networks the rule expands to.","type":"integer"},"target_id":{"description":"Target identifier.","type":"string"},"target_ip":{"description":"Protected IP the rule belongs to.","type":"string"},"value":{"description":"Blocked address, network, AS or country.","type":"string"}},"required":["id","target_id","target_ip","kind","value","prefixes","note","by","at"],"type":"object","x-order":["id","target_id","target_ip","kind","value","prefixes","note","by","at"]},"ShieldEvent":{"properties":{"avg_packet":{"description":"Average packet size in bytes.","type":"number"},"baseline_pps":{"description":"Normal packet rate before the attack.","type":"number"},"duration_s":{"description":"Duration in seconds (brief form only).","type":"integer"},"ended":{"description":"End time, null while the attack is ongoing (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Event identifier.","type":"string"},"label":{"description":"Attack type label.","type":"string"},"open":{"description":"True while the attack is ongoing (brief form only).","type":"boolean"},"peak_bits":{"description":"Peak rate in bits per second (brief form only).","type":"number"},"peak_bps":{"description":"Peak rate in BYTES per second (see `peak_bits` for bits).","type":"number"},"peak_pps":{"description":"Peak packets per second.","type":"number"},"samples":{"description":"Rate samples during the attack (omitted in the brief form)."},"severity":{"description":"Severity derived from the peak rate.","enum":["low","medium","high","critical"],"type":"string"},"started":{"description":"Start time (Unix time, seconds, UTC)","type":"integer"},"target":{"description":"The attacked IP.","type":"string"},"top_sources":{"description":"Busiest sources seen during the attack."}},"required":["id","target","label","started","ended","peak_pps","peak_bps","severity"],"type":"object","x-order":["id","target","label","started","ended","peak_pps","peak_bps","severity","peak_bits","duration_s","open","avg_packet","baseline_pps","top_sources","samples"]},"ShieldRtbhEntry":{"properties":{"actor":{"description":"Actor label of the creator.","type":"string"},"bps_before":{"description":"Bit rate before the blackhole","type":["number","null"]},"bps_now":{"description":"Bit rate now","type":["number","null"]},"created":{"description":"When the entry was created (Unix time, seconds, UTC)","type":"integer"},"drop_ratio":{"description":"Share of traffic that is being dropped, 0 to 1","type":["number","null"]},"event_id":{"description":"Attack event the entry relates to, if any.","type":"string"},"id":{"description":"Blackhole entry identifier.","type":"string"},"ip":{"description":"The blackholed address.","type":"string"},"mine":{"description":"True when you created the entry; only those can be withdrawn or extended.","type":"boolean"},"note":{"description":"Note.","type":"string"},"pps_before":{"description":"Packet rate before the blackhole","type":["number","null"]},"pps_now":{"description":"Packet rate now","type":["number","null"]},"remaining_s":{"description":"Seconds left before it expires.","type":"integer"},"scope":{"description":"Which traffic is dropped: from abroad, from the home country, or everything.","enum":["international","domestic","all"],"type":"string"},"scope_label":{"description":"Display label of the scope.","type":"string"},"source":{"description":"`manual` for entries you created, `auto` for entries created by the protection system.","type":"string"},"status":{"description":"`pending`, `announced`, `active`, `expired` or `withdrawn`.","type":"string"},"ttl_s":{"description":"Lifetime in seconds.","type":"integer"},"until":{"description":"When the entry expires (Unix time, seconds, UTC)","type":"integer"},"withdrawn_at":{"description":"When the entry was withdrawn (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["id","ip","scope","scope_label","status","created","until","ttl_s","remaining_s","source","note","event_id","pps_before","bps_before","pps_now","bps_now","drop_ratio","withdrawn_at","mine","actor"],"type":"object","x-order":["id","ip","scope","scope_label","status","created","until","ttl_s","remaining_s","source","note","event_id","pps_before","bps_before","pps_now","bps_now","drop_ratio","withdrawn_at","mine","actor"]},"ShieldRule":{"properties":{"actor":{"description":"Who created the rule, from the point of view of your account: `you` (your account, in the dashboard or through the API), `portal` (an integration acting for you), `ips`, `ai`, `auto`, or `system` (an operator).","enum":["you","portal","ips","ai","auto","system"],"type":"string"},"at":{"description":"When the rule was created (Unix time, seconds, UTC)","type":"integer"},"expires":{"description":"When the rule is removed automatically, or null for a permanent rule (Unix time, seconds, UTC)","type":["integer","null"]},"hits":{"description":"Traffic that matched the rule since it was installed (cumulative).","properties":{"bytes":{"description":"Bytes that matched the rule.","type":"integer"},"packets":{"description":"Packets that matched the rule.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]},"id":{"description":"Rule identifier. Use it as `rid` to delete the rule.","type":"string"},"ip":{"description":"IP address of that target.","type":"string"},"kind":{"description":"What the rule matches: an IPv4 address, an IPv4 network, an IPv6 address, an IPv6 network, an autonomous system or a country.","enum":["ip","cidr","ip6","cidr6","asn","country"],"type":"string"},"label":{"description":"Label of that target.","type":"string"},"mode":{"description":"`block`: matching packets are dropped. `count`: matching packets are only counted, which lets you test a rule safely.","enum":["block","count"],"type":"string"},"note":{"description":"Free text note, at most 120 characters.","type":"string"},"prefixes":{"description":"For `asn` and `country` rules, the networks the value expands to (can be thousands). Empty for other kinds.","items":{"description":"Network in CIDR notation.","type":"string"},"type":"array"},"readonly":{"description":"True when you cannot delete the rule: only rules created by your own account (`actor` is `you`) can be deleted.","type":"boolean"},"source":{"description":"Kind of creator: `portal` is a customer account or an integration acting for it (dashboard or API); `ips` is automatic intrusion prevention; `ai` is the AI analysis; `auto` is automatic mitigation; `admin` is an operator.","enum":["portal","ips","ai","auto","admin"],"type":"string"},"target_id":{"description":"Protected target the rule belongs to.","type":"string"},"value":{"description":"The matched value, normalised: an address with its prefix length such as `198.51.100.7/32`, a network such as `203.0.113.0/24`, an AS number such as `AS64500`, or a two-letter country code.","type":"string"}},"required":["id","kind","value","prefixes","note","at","mode","expires","target_id","ip","label","hits","source","readonly","actor"],"type":"object","x-order":["id","kind","value","prefixes","note","at","mode","expires","target_id","ip","label","hits","source","readonly","actor"]},"ShieldRuleRaw":{"properties":{"at":{"description":"Creation time (Unix time, seconds, UTC)","type":"integer"},"by":{"description":"Who created the rule, as an actor label: `you`, `portal`, `ips`, `ai`, `auto` or `system`.","type":"string"},"expires":{"description":"Expiry of a temporary rule (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Rule identifier.","type":"string"},"kind":{"description":"What the rule matches.","enum":["ip","cidr","asn","country"],"type":"string"},"mode":{"description":"`block`, or `count` for rules that only count.","type":"string"},"note":{"description":"Free-text note.","type":"string"},"prefixes":{"items":{"description":"Networks the rule expanded to (for AS and country rules).","type":"string"},"type":"array"},"value":{"description":"The address, network, AS number or country code.","type":"string"}},"required":["id","kind","value","prefixes","note","by","at","mode","expires"],"type":"object","x-order":["id","kind","value","prefixes","note","by","at","mode","expires"]},"ShieldTarget":{"properties":{"created_at":{"description":"When the IP was registered for protection (Unix time, seconds, UTC)","type":"integer"},"enabled":{"description":"Whether protection is switched on for this IP.","type":"boolean"},"id":{"description":"Protected target identifier. Use it as `id` in the rule and event operations.","type":"string"},"ip":{"description":"The protected IP address. An IPv6 target can also be a network such as `2001:db8:1::/48`.","type":"string"},"kind":{"description":"Kind of resource behind the IP.","enum":["vm","baremetal","service"],"type":"string"},"label":{"description":"Label of the target. It starts with your tenant identifier, for example `<tenant>/vm:<server id>` for the public IP of a server.","type":"string"},"rules":{"items":{"$ref":"#/components/schemas/ShieldTargetRule"},"type":"array"},"seen_at":{"description":"Last time traffic was measured for the IP; 0 if never (Unix time, seconds, UTC)","type":"integer"},"web":{"description":"Per-source rate limits for the web ports of the IP.","properties":{"enabled":{"description":"Whether web protection is on.","type":"boolean"},"pkt_rate":{"description":"Maximum packets per second from one source to the web ports; 0 means no limit.","type":"integer"},"ports":{"description":"Web ports covered. Empty means 80 and 443.","items":{"description":"TCP port.","type":"integer"},"type":"array"},"syn_rate":{"description":"Maximum new TCP connections (SYN packets) per second from one source to the web ports; 0 means no limit.","type":"integer"}},"required":["enabled","syn_rate","pkt_rate","ports"],"type":"object","x-order":["enabled","syn_rate","pkt_rate","ports"]}},"required":["id","ip","label","kind","enabled","created_at","rules","web","seen_at"],"type":"object","x-order":["id","ip","label","kind","enabled","created_at","rules","web","seen_at"]},"ShieldTargetRaw":{"properties":{"created_at":{"description":"When the IP was added (Unix time, seconds, UTC)","type":"integer"},"enabled":{"description":"Whether protection is on.","type":"boolean"},"id":{"description":"Target identifier (`pt…`).","type":"string"},"ip":{"description":"The protected IP address.","type":"string"},"kind":{"description":"What the IP belongs to.","enum":["vm","baremetal","service"],"type":"string"},"label":{"description":"Label: your tenant id, optionally followed by `/vm:{id}` for IPs of your servers.","type":"string"},"rules":{"items":{"$ref":"#/components/schemas/ShieldRuleRaw"},"type":"array"},"seen_at":{"description":"Last time traffic was seen (Unix time, seconds, UTC)","type":"integer"},"web":{"$ref":"#/components/schemas/ShieldWebPolicy"}},"required":["id","ip","label","kind","enabled","created_at","rules","web","seen_at"],"type":"object","x-order":["id","ip","label","kind","enabled","created_at","rules","web","seen_at"]},"ShieldTargetRule":{"properties":{"at":{"description":"When the rule was created (Unix time, seconds, UTC)","type":"integer"},"by":{"description":"Who created the rule, from the point of view of your account: `you` (your account, in the dashboard or through the API), `portal` (an integration acting for you), `ips` (intrusion prevention), `ai` (AI analysis), `auto` (automatic mitigation) or `system` (an operator).","enum":["you","portal","ips","ai","auto","system"],"type":"string"},"expires":{"description":"When the rule is removed automatically, or null for a permanent rule (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Rule identifier.","type":"string"},"kind":{"description":"What the rule matches: an IPv4 address, an IPv4 network, an IPv6 address, an IPv6 network, an autonomous system or a country.","enum":["ip","cidr","ip6","cidr6","asn","country"],"type":"string"},"mode":{"description":"Empty string means `block`: matching packets are dropped. `count`: matching packets are only counted.","type":"string"},"note":{"description":"Free text note, at most 120 characters.","type":"string"},"prefixes":{"description":"For `asn` and `country` rules, the networks the value expands to (can be thousands). Empty for other kinds.","items":{"description":"Network in CIDR notation.","type":"string"},"type":"array"},"value":{"description":"The matched value, normalised: an address with its prefix length such as `198.51.100.7/32`, a network such as `203.0.113.0/24`, an AS number such as `AS64500`, or a two-letter country code.","type":"string"}},"required":["id","kind","value","prefixes","note","at","mode","expires","by"],"type":"object","x-order":["id","kind","value","prefixes","note","at","mode","expires","by"]},"ShieldWebPolicy":{"properties":{"enabled":{"description":"Whether web protection is on.","type":"boolean"},"pkt_rate":{"description":"Maximum packets per second from one source to the web ports. 0 = no limit.","type":"integer"},"ports":{"items":{"description":"Web port, 1 to 65535. An empty list means 80 and 443.","type":"integer"},"type":"array"},"syn_rate":{"description":"Maximum SYN packets per second from one source to the web ports. 0 = no limit.","type":"integer"}},"required":["enabled","syn_rate","pkt_rate","ports"],"type":"object","x-order":["enabled","syn_rate","pkt_rate","ports"]},"Snapshot":{"properties":{"created":{"description":"Creation time as the platform reports it, for example `2026-10-19T08:00:00+0000`.","type":["string","null"]},"created_at":{"description":"Creation time (Unix time, seconds, UTC)","type":["integer","null"]},"current":{"description":"True for the snapshot the server's present state descends from.","type":"boolean"},"description":{"description":"Description given when the snapshot was taken.","type":["string","null"]},"id":{"description":"Snapshot identifier. Pass it to [Delete a snapshot](#operation/vm_snapshot_delete).","type":"string"},"name":{"description":"Name of the snapshot.","type":["string","null"]},"physicalsize":{"description":"Space the snapshot occupies, in bytes.","type":["integer","null"]},"state":{"description":"Snapshot state, for example `Ready` when it can be used, or `Creating` while it is being taken.","type":["string","null"]},"type":{"description":"Snapshot type as reported by the platform; `Disk` for the disk-only snapshots taken here.","type":["string","null"]},"virtualsize":{"description":"Provisioned size of the snapshotted disks, in bytes.","type":["integer","null"]}},"required":["id","name","description","state","type","current","created","created_at","physicalsize","virtualsize"],"type":"object","x-order":["id","name","description","state","type","current","created","created_at","physicalsize","virtualsize"]},"SnapshotSchedule":{"properties":{"created_at":{"description":"When the schedule was created (Unix time, seconds, UTC)","type":"integer"},"cron":{"description":"The schedule in text form: `daily HH:MM`, or `weekly D HH:MM` where D is 1 (Monday) to 7 (Sunday). Times are UTC.","type":"string"},"dow":{"description":"Day of the week, 1 (Monday) to 7 (Sunday). null for daily schedules.","type":["integer","null"]},"enabled":{"description":"Whether the schedule is active.","type":"boolean"},"hour":{"description":"Hour of the day, 0 to 23 (UTC).","type":["integer","null"]},"id":{"description":"Schedule identifier. Pass it as `pid` to delete the schedule.","type":"integer"},"keep":{"description":"How many automatic snapshots of this schedule to keep; the oldest is deleted before a new one is taken.","type":"integer"},"kind":{"description":"How often the schedule runs.","enum":["daily","weekly",null],"type":["string","null"]},"last_error":{"description":"Why the last run did not produce a snapshot, when it failed. null otherwise. The text is for people and may change.","type":["string","null"]},"last_run_at":{"description":"When the schedule last ran. null if it has not run yet (Unix time, seconds, UTC)","type":["integer","null"]},"minute":{"description":"Minute of the hour, 0 to 59.","type":["integer","null"]},"next_run_at":{"description":"When the schedule runs next (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Identifier (UUID) of the server the schedule belongs to.","type":"string"}},"required":["id","vm_id","cron","kind","dow","hour","minute","keep","enabled","last_run_at","next_run_at","last_error","created_at"],"type":"object","x-order":["id","vm_id","cron","kind","dow","hour","minute","keep","enabled","last_run_at","next_run_at","last_error","created_at"]},"SshKey":{"properties":{"created_at":{"description":"Time the key was added (Unix time, seconds, UTC)","type":"integer"},"fingerprint":{"description":"SHA-256 fingerprint of the key in the form `SHA256:<base64>`, the same format `ssh-keygen -l` prints.","type":"string"},"id":{"description":"SSH key identifier. Use it to attach or delete the key.","type":"integer"},"name":{"description":"Name you gave the key.","type":"string"},"public_key":{"description":"The public key in OpenSSH format: `<type> <base64> [comment]`.","type":"string"},"type":{"description":"Key algorithm.","enum":["ssh-ed25519","ssh-rsa"],"type":"string"}},"required":["id","name","fingerprint","public_key","created_at","type"],"type":"object","x-order":["id","name","fingerprint","public_key","created_at","type"]},"Ticket":{"properties":{"created_at":{"description":"When the ticket was opened. (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Ticket number.","type":"integer"},"last_author":{"description":"Who wrote the latest message: `customer` or `admin` (the support team).","type":"string"},"last_msg_at":{"description":"When the latest message was posted. (Unix time, seconds, UTC)","type":"integer"},"messages":{"description":"Number of messages in the ticket.","type":"integer"},"status":{"description":"`open` while the support team has not answered the latest message, `answered` once they have, `closed` when the ticket is finished. Replying to an answered ticket makes it `open` again.","enum":["open","answered","closed"],"type":"string"},"subject":{"description":"Subject line, 1 to 120 characters.","type":"string"},"updated_at":{"description":"When the status last changed. (Unix time, seconds, UTC)","type":"integer"}},"required":["id","subject","status","created_at","updated_at","last_msg_at","last_author","messages"],"type":"object","x-order":["id","subject","status","created_at","updated_at","last_msg_at","last_author","messages"]},"TicketMessage":{"properties":{"attachments":{"items":{"properties":{"bytes":{"description":"Size in bytes.","type":"integer"},"height":{"description":"Height in pixels.","type":"integer"},"id":{"description":"Attachment number.","type":"integer"},"mime":{"description":"`image/png` or `image/jpeg` (images are re-encoded when uploaded).","type":"string"},"name":{"description":"Sanitised file name.","type":"string"},"width":{"description":"Width in pixels.","type":"integer"}},"required":["id","name","mime","bytes","width","height"],"type":"object","x-order":["id","name","mime","bytes","width","height"]},"type":"array"},"author":{"description":"`customer` for your own messages, `admin` for the support team.","enum":["customer","admin"],"type":"string"},"author_name":{"description":"Display name of the author. Messages from the support team always show `Support`.","type":"string"},"body":{"description":"Message text, plain text, up to 4000 characters.","type":"string"},"created_at":{"description":"When the message was posted. (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Message number.","type":"integer"}},"required":["id","author","author_name","body","created_at","attachments"],"type":"object","x-order":["id","author","author_name","body","created_at","attachments"]},"Transfer":{"description":"A transfer request. Requests addressed to you (`dir=in`) show fewer fields than requests you sent.","properties":{"created_at":{"description":"When the request was created. (Unix time, seconds, UTC)","type":"integer"},"executed_at":{"description":"When the service was moved. (Unix time, seconds, UTC)","type":["integer","null"]},"fail_reason":{"description":"Why the transfer failed, when it did.","type":["string","null"]},"id":{"description":"Transfer request number.","type":"integer"},"owner_confirmed_at":{"description":"When the owner confirmed by e-mail. (Unix time, seconds, UTC)","type":["integer","null"]},"owner_token_expires_at":{"description":"Deadline of the owner's e-mail confirmation. Present on requests you sent. (Unix time, seconds, UTC)","type":["integer","null"]},"recipient_decided_at":{"description":"When the recipient accepted or declined. (Unix time, seconds, UTC)","type":["integer","null"]},"resource_id":{"description":"Identifier of the service: a server UUID for `vm`, the plan number for `vpn`.","type":"string"},"resource_kind":{"description":"Kind of service being transferred.","enum":["vm","vpn"],"type":"string"},"status":{"description":"`pending_owner` waits for the owner's e-mail confirmation, `pending_recipient` waits for the recipient to accept, `executing` is the move itself, `done` is final success; `cancelled`, `declined`, `expired` and `failed` are final without a move.","enum":["pending_owner","pending_recipient","executing","done","cancelled","declined","expired","failed"],"type":"string"},"to_email":{"description":"E-mail address of the recipient. Present on requests you sent, absent on requests addressed to you.","type":"string"},"updated_at":{"description":"When the request last changed. (Unix time, seconds, UTC)","type":"integer"}},"required":["id","resource_kind","resource_id","status","owner_confirmed_at","recipient_decided_at","executed_at","fail_reason","created_at","updated_at"],"type":"object","x-order":["id","resource_kind","resource_id","status","owner_confirmed_at","recipient_decided_at","executed_at","fail_reason","created_at","updated_at","to_email","owner_token_expires_at"]},"Vm":{"properties":{"auto_renew":{"description":"Whether a prepaid server renews automatically from the wallet when the period ends.","type":"boolean"},"autoscale_enabled":{"description":"Whether automatic vertical scaling is switched on for this server.","type":"boolean"},"autoscale_state":{"description":"State of the automatic scaling rule (for example `idle` or `scaled`). Present only when a rule exists.","type":"string"},"autoscale_target_cpu":{"description":"vCPU count the automatic scaling rule is currently aiming for. Present only when a rule exists.","type":"integer"},"autoscale_target_ram_mb":{"description":"Memory in MiB the automatic scaling rule is currently aiming for. Present only when a rule exists.","type":"integer"},"billed_until":{"description":"End of the hour already billed. null for prepaid servers (Unix time, seconds, UTC)","type":["integer","null"]},"cancel_requested":{"description":"`true` when deletion was requested while the server was still being created; the deployment stops at its next step and the order is refunded.","type":"boolean"},"capabilities":{"$ref":"#/components/schemas/VmCapabilities"},"created_at":{"description":"When the order was placed (Unix time, seconds, UTC)","type":"integer"},"credentials_once":{"description":"Token the web panel uses to show the initial password a single time. It cannot be redeemed with an API key; the password itself is e-mailed to the account holder.","type":["string","null"]},"cs_state":{"description":"Power state reported by the hypervisor, for example `Running`, `Stopped`, `Starting` or `Stopping`. null until the first status sync after creation.","type":["string","null"]},"cs_vm_id":{"description":"Identifier of the server on the underlying infrastructure. null until deployment has created it. Quote it in support requests.","type":["string","null"]},"cycle":{"description":"Billing cycle slug: `hourly` or a prepaid cycle such as `monthly` or `yearly`. See the catalog for the cycles on sale.","type":"string"},"cycle_cents":{"description":"Price of one billing cycle in US cents, as locked in for the current period. 0 for hourly servers.","type":"integer"},"cycle_started_at":{"description":"Start of the current billing cycle (Unix time, seconds, UTC)","type":["integer","null"]},"cycles":{"items":{"description":"Billing cycle slug.","type":"string"},"type":["array","null"]},"destroy_after":{"description":"When a locked server will be destroyed automatically if it is not unlocked before. null when no deadline applies (Unix time, seconds, UTC)","type":["integer","null"]},"display_name":{"description":"Free-form label shown in dashboards. Change it with Update a VM.","type":"string"},"enable_ipv6":{"description":"Whether the server is on the dual-stack (IPv4 + IPv6) network.","type":"boolean"},"extras":{"properties":{"extra_ips":{"description":"Additional IPv4 addresses chosen when the server was ordered (0 to 3).","type":"integer"}},"required":["extra_ips"],"type":"object"},"failed_reason":{"description":"Short reason when `state` is `failed`.","type":["string","null"]},"ha":{"description":"Whether the server is restarted automatically on another host if its host fails.","type":"boolean"},"hostname":{"description":"Host name chosen at creation: lowercase letters, digits and hyphens. It is unique on the platform and cannot be changed.","type":"string"},"hourly_mills":{"description":"Hourly price in mills (1 mill = US$0.001), rounded. Use `hourly_uusd` for the exact price.","type":"integer"},"hourly_uusd":{"description":"Exact hourly price in millionths of a US dollar (4704 = US$0.004704 per hour). This is the price the server is billed at, whatever its cycle.","type":"integer"},"id":{"description":"Server identifier (UUID). Use it in every `/v1/vm/{id}` path.","type":"string"},"imported":{"description":"`true` for a server that the team assigned to your account (free of charge). Only an administrator can delete it or change its plan or billing cycle; those calls fail with `409 imported_vm_admin_only`. Absent or `false` for every other server.","type":"boolean"},"ips":{"items":{"description":"Every public IPv4 address of the server, the main one first. Present for servers in regions with extra addresses.","type":"string"},"type":"array"},"ipv6":{"description":"Public IPv6 address, when IPv6 is enabled and assigned.","type":["string","null"]},"job_running":{"description":"`true` while a background job (start, resize, deletion...) is queued or running on the server. New actions fail with `409 job_running` until it ends.","type":"boolean"},"live":{"properties":{"cs_state":{"description":"Power state read from the hypervisor.","type":["string","null"]},"ip":{"description":"Public IPv4 address.","type":["string","null"]},"ipv6":{"description":"Public IPv6 address.","type":["string","null"]},"nic":{"description":"Private IPv4 address.","type":["string","null"]},"synced_at":{"description":"When the data was read (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["cs_state","nic","ip","ipv6","synced_at"],"type":"object","x-order":["cs_state","nic","ip","ipv6","synced_at"]},"lock_note":{"description":"Note left by an administrator when the server was locked.","type":["string","null"]},"lock_reason":{"description":"Why the server is locked. `no_funds`: the wallet could not pay an hourly charge. `expired`: a prepaid period ended without renewal. `admin`: suspended by an administrator. `abuse`: suspended after an abuse report.","enum":["no_funds","expired","admin","abuse",null],"type":["string","null"]},"locked_at":{"description":"When the server was locked, or null (Unix time, seconds, UTC)","type":["integer","null"]},"network":{"$ref":"#/components/schemas/VmNetwork"},"paid_until":{"description":"End of the period already paid for. null for hourly servers (Unix time, seconds, UTC)","type":["integer","null"]},"password_lost":{"description":"`true` when the platform could not obtain the administrator password after the last install or reset. Use Reset password to get a new one.","type":"boolean"},"plan":{"$ref":"#/components/schemas/VmPlanBrief"},"private_ip":{"description":"Private IPv4 address inside the platform network, once known.","type":["string","null"]},"provisioning":{"anyOf":[{"$ref":"#/components/schemas/VmProvisioning"},{"type":"null"}]},"public_ip":{"description":"Public IPv4 address, once assigned.","type":["string","null"]},"ready_at":{"description":"When the server first became ready. null while it is still being created (Unix time, seconds, UTC)","type":["integer","null"]},"ssh_key":{"description":"Name of the SSH key installed on the server, or null when no key was chosen.","type":["string","null"]},"state":{"description":"Lifecycle state. `provisioning`: being created. `active`: ready to use (see `cs_state` for the power state). `locked`: suspended for lack of funds, expiry or by an administrator (see `lock_reason`). `failed`: creation failed and was refunded. `deleting`: deletion in progress. `deleted`: gone.","enum":["provisioning","active","locked","failed","deleting","deleted"],"type":"string"},"template":{"$ref":"#/components/schemas/VmTemplateBrief"},"traffic":{"anyOf":[{"$ref":"#/components/schemas/VmTraffic"},{"type":"null"}]},"username":{"description":"Default administrator account name of the operating system image (for example `ubuntu` or `Administrator`).","type":"string"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]}},"required":["id","hostname","display_name","state","cs_state","public_ip","private_ip","ipv6","plan","template","cycle","paid_until","billed_until","hourly_mills","hourly_uusd","locked_at","lock_reason","destroy_after","created_at","ready_at","job_running","autoscale_enabled","username","ssh_key","cs_vm_id","ha","password_lost","cycle_cents","cycle_started_at","auto_renew","cancel_requested","enable_ipv6"],"type":"object","x-order":["id","hostname","display_name","state","cs_state","public_ip","private_ip","ipv6","plan","template","cycle","paid_until","billed_until","hourly_mills","hourly_uusd","locked_at","lock_reason","destroy_after","created_at","ready_at","job_running","autoscale_enabled","capabilities","traffic","ips","extras","cycles","provisioning","imported","username","ssh_key","cs_vm_id","ha","password_lost","cycle_cents","cycle_started_at","auto_renew","cancel_requested","enable_ipv6","autoscale_state","autoscale_target_cpu","autoscale_target_ram_mb","zone","network","live","lock_note","failed_reason","credentials_once"]},"VmActionAccepted":{"properties":{"job_id":{"description":"Identifier of the background job that carries out the action. Follow it with List a VM's jobs.","type":"integer"}},"required":["job_id"],"type":"object"},"VmCapabilities":{"description":"What the server's region supports. Every flag is `true` (and `console` is `vnc`) for servers in the platform's standard regions. A call that needs a flag that is `false` fails with `409 not_supported_in_zone`.","properties":{"autoscale":{"description":"Automatic vertical scaling.","type":"boolean"},"backup":{"description":"Backups and backup schedules.","type":"boolean"},"bandwidth":{"description":"The monthly bandwidth meter and quota apply.","type":"boolean"},"byoip":{"description":"A bring-your-own IP range can be attached to the server.","type":"boolean"},"change_ip":{"description":"The public IPv4 address can be replaced.","type":"boolean"},"console":{"description":"Console offered for this server: `vnc` graphical console ([Open the console](#operation/vm_console)), `ssh` web terminal only ([Get an SSH ticket](#operation/vm_ssh_token)), or `none`.","enum":["vnc","ssh","none"],"type":"string"},"ddos_shield":{"description":"The server sits behind the platform's DDoS Shield. `false` in regions served by other infrastructure.","type":"boolean"},"firewall":{"description":"Firewall rules can be managed.","type":"boolean"},"hypervisor":{"description":"The hypervisor type is known and shown for the server.","type":"boolean"},"ipv6":{"description":"IPv6 can be switched on and off.","type":"boolean"},"iso":{"description":"An ISO image can be attached to boot from.","type":"boolean"},"metrics":{"description":"CPU and network charts are available.","type":"boolean"},"metrics_mem_disk":{"description":"Memory and disk charts are available in addition to CPU and network.","type":"boolean"},"nics":{"description":"The network interfaces can be listed. When `false`, use `public_ip` and `ipv6` of the server.","type":"boolean"},"port_forward":{"description":"Port forwarding rules can be managed.","type":"boolean"},"private_ip":{"description":"The server has a private IPv4 address inside the platform network (`private_ip`).","type":"boolean"},"reinstall":{"description":"The operating system can be reinstalled or replaced.","type":"boolean"},"reset_password":{"description":"The administrator password can be reset.","type":"boolean"},"resize_cpu_ram":{"description":"The plan (vCPU and memory) can be changed.","type":"boolean"},"resize_disk_grow":{"description":"The system disk can be enlarged when the plan changes.","type":"boolean"},"resize_live":{"description":"The CPU and memory can be changed while the server runs (Scale). When `false`, changing the plan stops and restarts the server.","type":"boolean"},"snapshot":{"description":"Snapshots, snapshot schedules and creating an image from the server.","type":"boolean"},"ssh_key_reset":{"description":"Another SSH key can be installed after creation.","type":"boolean"},"volumes":{"description":"Data volumes can be attached.","type":"boolean"},"vpc":{"description":"The server can join a Private Cloud network.","type":"boolean"}},"required":["resize_live","resize_cpu_ram","resize_disk_grow","snapshot","reinstall","reset_password","ipv6","firewall","port_forward","change_ip","backup","volumes","iso","autoscale","ddos_shield","metrics","bandwidth","vpc","private_ip","hypervisor","nics","ssh_key_reset","byoip","metrics_mem_disk","console"],"type":"object","x-order":["resize_live","resize_cpu_ram","resize_disk_grow","snapshot","reinstall","reset_password","ipv6","firewall","port_forward","change_ip","backup","volumes","iso","autoscale","ddos_shield","metrics","bandwidth","vpc","private_ip","hypervisor","nics","ssh_key_reset","byoip","metrics_mem_disk","console"]},"VmCatalogCustom":{"description":"What a region lets you choose for a custom size. The values are discrete lists, not ranges: send only listed values. `null` in the platform's standard regions, which use the site's own custom limits (`settings.custom_*`).","properties":{"cpu_types":{"items":{"properties":{"cores":{"items":{"description":"Number of cores you can choose for this type.","type":"integer"},"type":"array"},"label":{"description":"Display name of the CPU type.","type":"string"},"type":{"description":"CPU type: `A` Availability (shared cores, best value), `B` General Purpose (consistent performance), `D` Dedicated (dedicated cores).","enum":["A","B","D"],"type":"string"}},"required":["type","label","cores"],"type":"object","x-order":["type","label","cores"]},"type":"array"},"disk_gb":{"items":{"description":"System disk sizes in GiB you can choose.","type":"integer"},"type":"array"},"enabled":{"description":"`true` when you can order your own CPU type, cores, RAM and disk in this region (`custom` of Create a VM, quoted by Quote a custom size in a region).","type":"boolean"},"min":{"properties":{"cores":{"description":"Smallest number of cores.","type":"integer"},"disk_gb":{"description":"Smallest disk in GiB.","type":"integer"},"ram_mb":{"description":"Smallest memory in MiB.","type":"integer"}},"required":["cores","ram_mb","disk_gb"],"type":"object","x-order":["cores","ram_mb","disk_gb"]},"ram_mb":{"additionalProperties":true,"description":"Memory in MiB you can choose for each CPU type, keyed by type: `{\"A\": [1024, 2048, ...], \"B\": [...]}`.","type":"object"}},"required":["enabled","cpu_types","ram_mb","disk_gb","min"],"type":"object","x-order":["enabled","cpu_types","ram_mb","disk_gb","min"]},"VmCatalogZone":{"properties":{"billed_when_stopped":{"description":"`true` when a stopped server in this region is still charged, at a reduced hourly rate, because its disk and address stay reserved. `false` otherwise.","type":"boolean"},"capabilities":{"$ref":"#/components/schemas/VmCapabilities"},"city":{"description":"City.","type":["string","null"]},"continent":{"description":"Continent of the region, for grouping. `null` in the platform's standard regions.","enum":["asia","europe","north_america","middle_east","oceania",null],"type":["string","null"]},"country":{"description":"ISO country code.","type":"string"},"custom":{"anyOf":[{"$ref":"#/components/schemas/VmCatalogCustom"},{"type":"null"}]},"cycles":{"items":{"description":"Billing cycle slug, as in the catalog `cycles`.","type":"string"},"type":["array","null"]},"extras":{"anyOf":[{"$ref":"#/components/schemas/VmZoneExtras"},{"type":"null"}]},"id":{"description":"Region identifier. Pass it as `zone_id` when creating a server.","type":"integer"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"price_from_cents":{"description":"Monthly price in US cents of the cheapest fixed plan on sale in the region. `null` in the platform's standard regions.","type":["integer","null"]},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"},"traffic":{"anyOf":[{"$ref":"#/components/schemas/VmTraffic"},{"type":"null"}]}},"required":["id","slug","name","capabilities","cycles","traffic","billed_when_stopped"],"type":"object","x-order":["id","slug","name","name_en","country","city","capabilities","cycles","traffic","billed_when_stopped","continent","price_from_cents","custom","extras"]},"VmEvent":{"properties":{"actor":{"description":"Who caused the event: `customer:<account id>`, `system:<reason>`, or `previous_owner` for actions taken by an earlier owner of a transferred server.","type":"string"},"args":{"additionalProperties":true,"description":"Raw values to fill into the message named by `key` (string values): IPs, plan names, billing cycle codes such as `hourly`, amounts in cents (`*_cents`), prices in micro-dollars (`*_uusd`), timestamps in seconds (`*_at`). An empty object when `key` is `null`.","type":"object"},"at":{"description":"When the event happened (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Event identifier. Higher means newer.","type":"integer"},"key":{"description":"Stable message code, for example `vm.ready` or `bill.ordered`; `null` for entries written before message codes existed. Failed operations carry a public code such as `error.capacity` instead of the raw error.","type":["string","null"]},"kind":{"description":"Event type, for example `create`, `start`, `stop`, `reboot`, `rename`, `change_plan`, `renewal`, `refund`, `lock`, `unlock`, `destroy`, `job_failed`. New kinds can appear.","type":"string"},"msg":{"description":"Human-readable text for display, in English (older entries can be in Vietnamese). Do not parse it; use `kind` for logic, and `key` + `args` to show the message in your own language.","type":"string"},"status":{"description":"Outcome badge derived from `kind`.","enum":["success","failed","warning"],"type":"string"}},"required":["id","at","kind","actor","msg","key","args","status"],"type":"object","x-order":["id","at","kind","actor","msg","key","args","status"]},"VmInvoice":{"properties":{"account_id":{"description":"Account that was invoiced. null for invoices of a previous owner.","type":["integer","null"]},"buyer_json":{"description":"Buyer details as a JSON-encoded string. `{\"redacted\":true}` for invoices of a previous owner.","type":"string"},"created_at":{"description":"When the invoice was created (Unix time, seconds, UTC)","type":"integer"},"currency":{"description":"Lower-case currency code, `usd`.","type":"string"},"due_at":{"description":"Payment deadline (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Invoice identifier.","type":"integer"},"kind":{"description":"Invoice type.","enum":["receipt","renewal","topup","manual","refund"],"type":"string"},"ledger_ref":{"description":"Reference of the wallet entry that paid the invoice.","type":["string","null"]},"note":{"description":"Free-form note. null for invoices of a previous owner.","type":["string","null"]},"number":{"description":"Invoice number, for example `EX202610-000042`.","type":["string","null"]},"paid_at":{"description":"When the invoice was paid (Unix time, seconds, UTC)","type":["integer","null"]},"previous_owner":{"description":"`true` when the invoice was issued to an earlier owner of a transferred server; personal fields are then redacted.","type":"boolean"},"seller_json":{"description":"Seller details as a JSON-encoded string.","type":"string"},"status":{"description":"Payment status.","enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"},"subtotal_cents":{"description":"Amount before tax in US cents.","type":"integer"},"total_cents":{"description":"Amount due in US cents.","type":"integer"},"updated_at":{"description":"When the invoice last changed (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Server the invoice relates to.","type":["string","null"]}},"required":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at"],"type":"object","x-order":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at","previous_owner"]},"VmJob":{"properties":{"attempt":{"description":"Number of attempts made so far. Jobs are retried automatically on transient errors.","type":"integer"},"created_at":{"description":"When the job was queued (Unix time, seconds, UTC)","type":"integer"},"error_code":{"description":"Stable short code for `last_error`: `capacity` (no room on the infrastructure), `timeout`, `ip_alloc` (no public IP available), `network`, `provision`, `destroy`, `resize`, `cancelled` or the generic `error`.","enum":["cancelled","capacity","timeout","ip_alloc","network","provision","destroy","resize","error",null],"type":["string","null"]},"finished_at":{"description":"When the job reached a final state. null while it is in flight (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Job identifier (the `job_id` returned by the action).","type":"integer"},"kind":{"description":"What the job does: `deploy`, `start`, `stop`, `force_stop`, `reboot`, `reset_password`, `reinstall`, `change_template`, `change_plan`, `sshkey_reset`, `change_ip`, `toggle_ipv6`, `destroy`... New kinds can appear.","type":"string"},"last_error":{"description":"Short, customer-safe description of the last error, or null.","type":["string","null"]},"payload":{"properties":{"enable":{"description":"Target IPv6 setting requested by the job.","type":["boolean","null"]}},"required":["enable"],"type":"object"},"state":{"description":"`queued` and `running` are in flight; `done`, `failed` and `cancelled` are final.","enum":["queued","running","done","failed","cancelled"],"type":"string"},"step":{"description":"Free-form progress marker of the job. Informational only; the values can change.","type":"string"},"updated_at":{"description":"Last progress update (Unix time, seconds, UTC)","type":"integer"}},"required":["id","kind","state","step","attempt","created_at","updated_at","finished_at","last_error","error_code"],"type":"object","x-order":["id","kind","state","step","attempt","created_at","updated_at","finished_at","last_error","error_code","payload"]},"VmJobAccepted":{"properties":{"job_id":{"description":"Identifier of the background job that carries out the operation. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"},"VmLedgerEntry":{"properties":{"account_id":{"description":"Account the entry belongs to.","type":"integer"},"actor":{"description":"Who caused the entry: `customer:<account id>` or `system:<reason>`.","type":"string"},"at":{"description":"When the entry was written (Unix time, seconds, UTC)","type":"integer"},"delta_cents":{"description":"Change of the wallet balance in US cents. Negative for charges, positive for refunds and top-ups.","type":"integer"},"id":{"description":"Ledger entry identifier.","type":"integer"},"kind":{"description":"Entry type.","enum":["deposit","charge","refund","adjust"],"type":"string"},"note":{"description":"Human-readable note.","type":["string","null"]},"ref":{"description":"Unique reference of the entry; it also makes charges idempotent.","type":"string"},"vm_id":{"description":"Server the entry relates to.","type":["string","null"]}},"required":["id","account_id","delta_cents","kind","ref","vm_id","note","actor","at"],"type":"object","x-order":["id","account_id","delta_cents","kind","ref","vm_id","note","actor","at"]},"VmNetwork":{"properties":{"cidr":{"description":"Tier address range. Present when `type` is `vpc`.","type":"string"},"mbps":{"description":"Bandwidth of the Private Cloud in Mbit/s. Present when `type` is `vpc`.","type":"integer"},"tier":{"description":"Tier name. Present when `type` is `vpc`.","type":"string"},"tier_id":{"description":"Tier identifier. Present when `type` is `vpc`.","type":"string"},"type":{"description":"`shared`: the standard shared network. `vpc`: a tier of your own Private Cloud.","enum":["shared","vpc"],"type":"string"},"unmetered":{"description":"Whether traffic inside the Private Cloud plan is unmetered. Present when `type` is `vpc`.","type":"boolean"},"vpc_id":{"description":"Private Cloud identifier. Present when `type` is `vpc`.","type":"string"},"vpc_name":{"description":"Private Cloud name. Present when `type` is `vpc`.","type":"string"}},"required":["type"],"type":"object","x-order":["type","vpc_id","vpc_name","tier_id","tier","cidr","mbps","unmetered"]},"VmPlanBrief":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"is_custom":{"description":"`true` for a custom configuration (own vCPU / RAM / disk) rather than a fixed plan.","type":"boolean"},"name":{"description":"Plan name at the time of the order, or the generated name of a custom configuration (for example `Custom 4C/8G/80G`).","type":"string"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["name","cpu","ram_mb","disk_gb","is_custom"],"type":"object","x-order":["name","cpu","ram_mb","disk_gb","is_custom"]},"VmPlanQuote":{"properties":{"allowed":{"description":"Whether Change plan would accept this change right now.","type":"boolean"},"amount_due_cents":{"description":"Amount that would be charged now, in US cents. 0 when the new plan is cheaper or the server is billed hourly.","type":"integer"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"cycle":{"description":"Billing cycle the quote was computed for.","type":"string"},"disk_shrink":{"description":"`true` when the new plan has a smaller disk. Disks cannot shrink, so the change is not allowed.","type":"boolean"},"from":{"$ref":"#/components/schemas/VmQuotePlan"},"hourly_note":{"description":"`true` for hourly servers, where the new price simply applies from the next hour.","type":"boolean"},"immediate":{"description":"Always `true`: the money moves when the change is requested.","type":"boolean"},"months":{"description":"Months in that cycle. 0 for hourly billing.","type":"integer"},"refund_cents":{"description":"Amount that would be credited back now, in US cents (never more than you actually paid for the period).","type":"integer"},"remaining_hours":{"description":"Hours left in the paid period of the server (0 for hourly billing).","type":"integer"},"same_plan":{"description":"`true` when the target is the plan the server already has.","type":"boolean"},"to":{"$ref":"#/components/schemas/VmQuotePlan"},"unused_cents":{"description":"Value in US cents of the unused part of the current period.","type":"integer"}},"required":["from","to","cycle","months","remaining_hours","unused_cents","amount_due_cents","refund_cents","immediate","disk_shrink","same_plan","allowed","balance_cents","hourly_note"],"type":"object","x-order":["from","to","cycle","months","remaining_hours","unused_cents","amount_due_cents","refund_cents","immediate","disk_shrink","same_plan","allowed","balance_cents","hourly_note"]},"VmProvisioning":{"description":"Progress of a server that is still being created. `null` once the server is ready or when the region does not report progress.","properties":{"eta_s":{"description":"Rough number of seconds still needed when the phase began. Subtract the time since `since` for a running countdown; it is an estimate, not a promise.","type":"integer"},"phase":{"description":"Current step of the creation: `queued` waiting to start, `creating` building the server, `network` connecting the network, `os` installing the operating system (the longest step), `finishing` last checks.","enum":["queued","creating","network","os","finishing"],"type":"string"},"since":{"description":"When the server entered this phase (Unix time, seconds, UTC)","type":"integer"}},"required":["phase","since","eta_s"],"type":"object","x-order":["phase","since","eta_s"]},"VmQuotePlan":{"properties":{"cents":{"description":"Price of one full cycle of the quoted billing cycle, in US cents. 0 for hourly billing.","type":"integer"},"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly":{"description":"Hourly price as a decimal string, for example `$0.005`.","type":"string"},"hourly_mills":{"description":"Hourly price in mills (US$0.001), rounded.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"name":{"description":"Plan name.","type":"string"},"plan_id":{"description":"Plan identifier.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["plan_id","name","cpu","ram_mb","disk_gb","hourly_mills","cents"],"type":"object","x-order":["plan_id","name","cpu","ram_mb","disk_gb","hourly_mills","hourly","monthly_cents","cents"]},"VmSummary":{"properties":{"autoscale_enabled":{"description":"Whether automatic vertical scaling is switched on for this server.","type":"boolean"},"billed_until":{"description":"End of the hour already billed. null for prepaid servers (Unix time, seconds, UTC)","type":["integer","null"]},"capabilities":{"$ref":"#/components/schemas/VmCapabilities"},"created_at":{"description":"When the order was placed (Unix time, seconds, UTC)","type":"integer"},"cs_state":{"description":"Power state reported by the hypervisor, for example `Running`, `Stopped`, `Starting` or `Stopping`. null until the first status sync after creation.","type":["string","null"]},"cycle":{"description":"Billing cycle slug: `hourly` or a prepaid cycle such as `monthly` or `yearly`. See the catalog for the cycles on sale.","type":"string"},"destroy_after":{"description":"When a locked server will be destroyed automatically if it is not unlocked before. null when no deadline applies (Unix time, seconds, UTC)","type":["integer","null"]},"display_name":{"description":"Free-form label shown in dashboards. Change it with Update a VM.","type":"string"},"hostname":{"description":"Host name chosen at creation: lowercase letters, digits and hyphens. It is unique on the platform and cannot be changed.","type":"string"},"hourly_mills":{"description":"Hourly price in mills (1 mill = US$0.001), rounded. Use `hourly_uusd` for the exact price.","type":"integer"},"hourly_uusd":{"description":"Exact hourly price in millionths of a US dollar (4704 = US$0.004704 per hour). This is the price the server is billed at, whatever its cycle.","type":"integer"},"id":{"description":"Server identifier (UUID). Use it in every `/v1/vm/{id}` path.","type":"string"},"imported":{"description":"`true` for a server that the team assigned to your account (free of charge). Only an administrator can delete it or change its plan or billing cycle; those calls fail with `409 imported_vm_admin_only`. Absent or `false` for every other server.","type":"boolean"},"ipv6":{"description":"Public IPv6 address, when IPv6 is enabled and assigned.","type":["string","null"]},"job_running":{"description":"`true` while a background job (start, resize, deletion...) is queued or running on the server. New actions fail with `409 job_running` until it ends.","type":"boolean"},"lock_reason":{"description":"Why the server is locked. `no_funds`: the wallet could not pay an hourly charge. `expired`: a prepaid period ended without renewal. `admin`: suspended by an administrator. `abuse`: suspended after an abuse report.","enum":["no_funds","expired","admin","abuse",null],"type":["string","null"]},"locked_at":{"description":"When the server was locked, or null (Unix time, seconds, UTC)","type":["integer","null"]},"paid_until":{"description":"End of the period already paid for. null for hourly servers (Unix time, seconds, UTC)","type":["integer","null"]},"plan":{"$ref":"#/components/schemas/VmPlanBrief"},"private_ip":{"description":"Private IPv4 address inside the platform network, once known.","type":["string","null"]},"public_ip":{"description":"Public IPv4 address, once assigned.","type":["string","null"]},"ready_at":{"description":"When the server first became ready. null while it is still being created (Unix time, seconds, UTC)","type":["integer","null"]},"state":{"description":"Lifecycle state. `provisioning`: being created. `active`: ready to use (see `cs_state` for the power state). `locked`: suspended for lack of funds, expiry or by an administrator (see `lock_reason`). `failed`: creation failed and was refunded. `deleting`: deletion in progress. `deleted`: gone.","enum":["provisioning","active","locked","failed","deleting","deleted"],"type":"string"},"template":{"$ref":"#/components/schemas/VmTemplateBrief"},"traffic":{"anyOf":[{"$ref":"#/components/schemas/VmTraffic"},{"type":"null"}]},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]}},"required":["id","hostname","display_name","state","cs_state","public_ip","private_ip","ipv6","plan","template","cycle","paid_until","billed_until","hourly_mills","hourly_uusd","locked_at","lock_reason","destroy_after","created_at","ready_at","job_running","autoscale_enabled","zone","capabilities","traffic"],"type":"object","x-order":["id","hostname","display_name","state","cs_state","public_ip","private_ip","ipv6","plan","template","cycle","paid_until","billed_until","hourly_mills","hourly_uusd","locked_at","lock_reason","destroy_after","created_at","ready_at","job_running","autoscale_enabled","zone","capabilities","traffic","imported"]},"VmTemplateBrief":{"properties":{"category":{"description":"Present when the image is a VM Desktop image (Ubuntu Desktop with a remote screen through RustDesk or Remote Desktop). Absent for standard images.","enum":["desktop"],"type":"string"},"display_name":{"description":"Human readable image name, for example `Ubuntu 24.04 LTS`.","type":"string"},"icon":{"description":"Icon name for the image, when known.","type":["string","null"]},"id":{"description":"Image identifier (the `template_id` used at creation). 0 when the image no longer exists.","type":"integer"},"os_family":{"description":"Operating system family: `linux`, `windows`...","type":"string"},"os_version":{"description":"Version label, when known.","type":["string","null"]}},"required":["id","display_name","os_family","os_version","icon"],"type":"object","x-order":["id","display_name","os_family","os_version","icon","category"]},"VmTraffic":{"description":"How the traffic of a server is provided in its region. Exactly one shape is present: `{unlimited, uplink_gbps}` in every region that offers extra IPv4 addresses (unlimited bandwidth, 1 Gbps uplink port, no traffic fee); servers ordered earlier may instead show `{pay_per_use, usd_per_gb}` or `{included_tb}`. The whole value is `null` for servers in the platform's standard regions, where the bandwidth quota of the site (`bw_quota_gb` in the price list `settings`) applies.","properties":{"included_gb":{"description":"Gigabytes included per calendar month with this server (`mode` `included`); `null` when nothing is included. Present on a server, not in the catalog.","type":["integer","null"]},"included_tb":{"description":"Traffic included each month, in terabytes (1 TB = 1000 GB).","type":"number"},"mode":{"description":"How this server is charged for traffic: `per_gb` every gigabyte is billed at `usd_per_gb` (servers paid by the hour), `included` a monthly allowance is included and only the part above it is billed, `unmetered` bandwidth is unlimited (the shape is `{unlimited, uplink_gbps}`). Present on a server, not in the catalog.","enum":["per_gb","included","unmetered"],"type":"string"},"monthly_included_gb":{"description":"Present with `pay_per_use`: gigabytes included each calendar month when the server is paid by the month (1000 in Hong Kong, Singapore, Tokyo and Sydney, 5000 in the other regions). Above it every gigabyte costs `usd_per_gb`. Hourly servers have no included traffic.","type":["integer","null"]},"net_blocked":{"description":"`true` when the instance's Internet access is suspended due to insufficient wallet funds for traffic fees. The instance remains running and keeps its IP; top up your wallet to settle the fees and automatically restore connectivity within minutes.","type":"boolean"},"pay_per_use":{"description":"`true` when traffic is not included and is billed per gigabyte used. `usd_per_gb` carries the price.","type":"boolean"},"unlimited":{"description":"`true` when the bandwidth of the server is unlimited: no traffic allowance and no traffic fee.","type":"boolean"},"unpaid_cents":{"description":"Unpaid traffic fees due, in USD cents (0 when none are owed).","type":"integer"},"uplink_gbps":{"description":"Uplink port speed in Gbit/s (1). Present with `unlimited`.","type":"integer"},"usage":{"$ref":"#/components/schemas/VmTrafficUsage"},"usd_per_gb":{"description":"Price of one gigabyte of traffic in US dollars. Present with `pay_per_use`.","type":"number"}},"type":"object","x-order":["pay_per_use","usd_per_gb","included_tb","unlimited","uplink_gbps","monthly_included_gb","mode","included_gb","usage","net_blocked","unpaid_cents"]},"VmTrafficUsage":{"description":"Traffic used and charged this month. Present with `pay_per_use`.","properties":{"billed_cents":{"description":"US cents already charged to your wallet for that traffic. Whole cents are charged as the usage grows; the last fraction of a cent is rounded up when the month closes.","type":"integer"},"gb":{"description":"Gigabytes of traffic the server used in the month so far. Updated about hourly; never decreases within a month.","type":"number"},"included_gb":{"description":"Gigabytes included this month (`null` for a server paid by the hour: every gigabyte is billed).","type":["number","null"]},"month":{"description":"Calendar month of the figures, `YYYY-MM` (UTC).","type":"string"},"overage_gb":{"description":"Gigabytes billed at `usd_per_gb` so far this month: everything above the allowance, or all usage when nothing is included.","type":"number"},"remaining_gb":{"description":"Gigabytes of the monthly allowance still unused; `null` when nothing is included.","type":["number","null"]}},"required":["month","gb","billed_cents"],"type":"object","x-order":["month","gb","billed_cents","included_gb","remaining_gb","overage_gb"]},"VmZoneExtras":{"description":"Options chosen when ordering a server in a region of this kind: additional IPv4 addresses. The price of a server is the plan price plus this amount for the chosen billing cycle. Bandwidth is unlimited on every server in such a region (see `traffic`).","properties":{"ip":{"properties":{"cycles":{"additionalProperties":{"description":"US cents","type":"integer"},"description":"Price of one additional IPv4 address for one whole billing cycle, in US cents, discount applied. Keyed by billing cycle slug.","type":"object"},"max":{"description":"Most additional IPv4 addresses one server can have (3, so 4 in total). Chosen when ordering; they cannot be added or removed later.","type":"integer"},"month_cents":{"description":"Price of one additional IPv4 address per month, in US cents.","type":"integer"}},"required":["max","month_cents","cycles"],"type":"object","x-order":["max","month_cents","cycles"]}},"required":["ip"],"type":"object"},"VolumePrice":{"properties":{"cents_per_hour":{"description":"Price per hour for `size_gb` rounded to US cents; can be 0 for small volumes.","type":"integer"},"cents_per_month":{"description":"Price for `hours_per_month` hours in US cents.","type":"integer"},"hours_per_month":{"description":"Hours in a billing month used to compute `cents_per_month` (730 by default).","type":"integer"},"rate_uusd_gb_hour":{"description":"Price of 1 GB for 1 hour, in millionths of a US dollar.","type":"integer"},"size_gb":{"description":"Size in GB this price is computed for.","type":"integer"},"uusd_per_hour":{"description":"Price per hour for `size_gb`, in millionths of a US dollar.","type":"integer"}},"required":["size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_hour","cents_per_month","hours_per_month"],"type":"object","x-order":["size_gb","rate_uusd_gb_hour","uusd_per_hour","cents_per_hour","cents_per_month","hours_per_month"]},"Vpc":{"properties":{"bandwidth":{"properties":{"effective_mbps":{"description":"Bandwidth applied right now. Equals `mbps`, except `1` while the Private Cloud is locked.","type":"integer"},"label":{"description":"Short human-readable description of the bandwidth.","type":"string"},"mbps":{"description":"Dedicated bandwidth of the current plan in Mbit/s.","type":"integer"},"unmetered":{"description":"Always `true`: traffic is not metered, there is no transfer quota or overage charge.","type":"boolean"}},"required":["mbps","unmetered","label","effective_mbps"],"type":"object","x-order":["mbps","unmetered","label","effective_mbps"]},"billing":{"properties":{"auto_renew":{"description":"Whether a prepaid cycle renews automatically from the wallet.","type":"boolean"},"cycle":{"description":"Billing cycle slug, `hourly` or a prepaid cycle such as `monthly`.","type":"string"},"cycle_cents":{"description":"Price of one cycle in US cents; `0` for hourly billing.","type":"integer"},"months":{"description":"Months in the cycle; `0` for hourly billing.","type":"integer"},"paid_until":{"description":"End of the period already paid; null for hourly billing (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["cycle","months","paid_until","auto_renew","cycle_cents"],"type":"object","x-order":["cycle","months","paid_until","auto_renew","cycle_cents"]},"can":{"properties":{"acl":{"description":"ACL rules can be added and deleted (state `active` or `locked`).","type":"boolean"},"add_tier":{"description":"A tier can be added now (state `active`, no operation running; the tier limit is checked when you add).","type":"boolean"},"change_plan":{"description":"The bandwidth plan can be changed now (state `active`, no operation running).","type":"boolean"},"create_vm":{"description":"Servers can be created in this Private Cloud (state `active`).","type":"boolean"},"delete":{"description":"The Private Cloud can be deleted now: state `active` or `locked`, no operation running, no servers, and not locked by support.","type":"boolean"}},"required":["change_plan","add_tier","acl","create_vm","delete"],"type":"object","x-order":["change_plan","add_tier","acl","create_vm","delete"]},"cidr":{"description":"Private IPv4 range of the Private Cloud, always a /16 inside 10.128.0.0/9, e.g. `10.128.0.0/16`.","type":"string"},"created_at":{"description":"When it was ordered (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Private Cloud identifier (UUID). Use it in the `:id` path parameter and as the network when creating servers.","type":"string"},"ipv6":{"items":{"properties":{"cidr":{"description":"IPv6 /64 subnet of that tier.","type":"string"},"tier":{"description":"Tier name.","type":"string"}},"required":["tier","cidr"],"type":"object","x-order":["tier","cidr"]},"type":"array"},"lock":{"properties":{"destroy_after":{"description":"When an unpaid Private Cloud without servers will be deleted automatically; null when no automatic deletion is scheduled (Unix time, seconds, UTC)","type":["integer","null"]},"locked_at":{"description":"When it was locked (Unix time, seconds, UTC)","type":["integer","null"]},"reason":{"description":"Why it is locked: `no_funds` (hourly bill unpaid), `expired` (prepaid period ended), `admin` or `abuse` (locked by support - it cannot be deleted until support unlocks it).","enum":["no_funds","expired","admin","abuse",null],"type":["string","null"]}},"required":["reason","locked_at","destroy_after"],"type":["object","null"],"x-order":["reason","locked_at","destroy_after"]},"name":{"description":"Name, unique within your account.","type":"string"},"note":{"description":"Free-text note, up to 500 characters. Only present on the detail view (Get, Create, Update, Change plan).","type":["string","null"]},"op":{"anyOf":[{"$ref":"#/components/schemas/VpcOp"},{"type":"null"}]},"plan":{"properties":{"id":{"description":"Plan identifier.","type":"integer"},"mbps":{"description":"Bandwidth of the plan in Mbit/s.","type":"integer"},"name":{"description":"Plan display name.","type":["string","null"]},"slug":{"description":"Plan slug.","type":["string","null"]}},"required":["id","slug","name","mbps"],"type":"object","x-order":["id","slug","name","mbps"]},"pricing":{"properties":{"hourly_uusd":{"description":"Price you pay per hour in millionths of a US dollar. It is fixed when you order or change plan.","type":"integer"},"monthly_cents":{"description":"The same price for a month of 730 hours, in US cents.","type":"integer"}},"required":["hourly_uusd","monthly_cents"],"type":"object"},"public_error":{"description":"Reason code when `state` is `failed` (for example `capacity`, `timeout`, `no_public_ip`, `internal`); null otherwise.","type":["string","null"]},"public_ip":{"description":"Public IPv4 address used by the virtual router for outbound traffic (source NAT); null until the Private Cloud is ready.","type":["string","null"]},"ready_at":{"description":"When it became active; null before that (Unix time, seconds, UTC)","type":["integer","null"]},"router":{"description":"State of the virtual router, for example `Running`; null until the first health check.","type":["string","null"]},"state":{"description":"`provisioning`: being created. `active`: ready. `locked`: suspended for an unpaid bill or by support - bandwidth is cut to 1 Mbps until it is unlocked (see `lock`). `deleting`: being deleted. `deleted`: gone (still listed for 30 days). `failed`: creation failed (prepaid charges were refunded).","enum":["provisioning","active","locked","deleting","deleted","failed"],"type":"string"},"tier_count":{"description":"Number of tiers.","type":"integer"},"tiers":{"items":{"$ref":"#/components/schemas/VpcTier"},"type":"array"},"updated_at":{"description":"Last change (Unix time, seconds, UTC)","type":"integer"},"vm_count":{"description":"Number of servers in the Private Cloud.","type":"integer"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]}},"required":["id","name","state","zone","cidr","public_ip","router","plan","bandwidth","ipv6","tier_count","vm_count","pricing","billing","lock","op","can","public_error","created_at","ready_at","updated_at"],"type":"object","x-order":["id","name","note","state","zone","cidr","public_ip","router","plan","bandwidth","ipv6","tier_count","vm_count","pricing","billing","lock","op","can","public_error","created_at","ready_at","updated_at","tiers"]},"VpcAclRule":{"properties":{"action":{"description":"What happens to matching traffic.","enum":["allow","deny"],"type":"string"},"cidr":{"description":"Remote address range the rule matches: the source for `ingress`, the destination for `egress`. IPv4 or IPv6 CIDR, e.g. `0.0.0.0/0` or `::/0`.","type":"string"},"created_at":{"description":"When the rule was added (Unix time, seconds, UTC)","type":"integer"},"direction":{"description":"`ingress` filters traffic entering the Private Cloud, `egress` traffic leaving it.","enum":["ingress","egress"],"type":"string"},"end_port":{"description":"Last port of the range for `tcp` / `udp`; null for `icmp` and `all`.","maximum":65535,"minimum":1,"type":["integer","null"]},"error":{"description":"`apply_failed` when the rule could not be applied; null otherwise.","enum":["apply_failed",null],"type":["string","null"]},"id":{"description":"Rule identifier. Pass it to Delete an ACL rule.","type":"string"},"is_default":{"description":"True for rules created together with the Private Cloud and for platform rules.","type":"boolean"},"note":{"description":"Free-text label, at most 100 characters.","type":["string","null"]},"number":{"description":"Priority of the rule, 1-9999. Rules are evaluated in ascending order of number and the first match decides. Numbers 1-8 belong to platform rules.","type":"integer"},"protocol":{"description":"Protocol the rule matches.","enum":["tcp","udp","icmp","all"],"type":"string"},"start_port":{"description":"First port of the range for `tcp` / `udp`; null for `icmp` and `all`.","maximum":65535,"minimum":1,"type":["integer","null"]},"state":{"description":"`pending` until the rule is applied, `active` when it filters traffic, `deleting` while it is removed, `failed` when it could not be applied (delete it and try again).","enum":["pending","active","deleting","failed"],"type":"string"},"system":{"description":"True for platform rules (numbers 1-8). They protect the infrastructure and cannot be changed or deleted.","type":"boolean"}},"required":["id","number","direction","protocol","start_port","end_port","cidr","action","note","is_default","system","state","error","created_at"],"type":"object","x-order":["id","number","direction","protocol","start_port","end_port","cidr","action","note","is_default","system","state","error","created_at"]},"VpcCycle":{"properties":{"discount_pct":{"description":"Discount for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months. `0` means pay by the hour.","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"},"slug":{"description":"Billing cycle identifier. Pass it as `cycle` when ordering, e.g. `hourly`, `monthly`, `yearly`.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"VpcOp":{"properties":{"created_at":{"description":"When the operation was requested (Unix time, seconds, UTC)","type":"integer"},"finished_at":{"description":"When the operation finished; null while it is still open (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Operation identifier.","type":"integer"},"kind":{"description":"What the operation does: `create`, `change_plan` (bandwidth plan), `tier_add`, `tier_del`, `acl_sync` (apply ACL changes), `suspend` / `resume` (applied when the Private Cloud is locked for unpaid bills / unlocked) or `delete`.","enum":["create","change_plan","tier_add","tier_del","acl_sync","suspend","resume","delete"],"type":"string"},"public_error":{"description":"Reason code when the operation failed (for example `capacity`, `timeout`, `no_public_ip`, `cancelled`, `internal`); null otherwise.","type":["string","null"]},"state":{"description":"Progress of the operation. `queued` and `running` are open; the other states are final.","enum":["queued","running","done","failed","cancelled"],"type":"string"},"step":{"description":"Short name of the step being worked on, for example `queued`, `vpc`, `tier`, `acl_rule` or `done`. Informational.","type":"string"}},"required":["id","kind","state","step","public_error","created_at","finished_at"],"type":"object","x-order":["id","kind","state","step","public_error","created_at","finished_at"]},"VpcOpRef":{"properties":{"id":{"description":"Operation identifier. It also appears in List operations.","type":"integer"},"kind":{"description":"What the operation does.","enum":["create","change_plan","tier_add","tier_del","acl_sync","suspend","resume","delete"],"type":"string"},"state":{"description":"State when the call returned. Operations always start `queued`.","enum":["queued"],"type":"string"}},"required":["id","kind","state"],"type":"object"},"VpcPlan":{"properties":{"cycles":{"items":{"$ref":"#/components/schemas/VpcPlanCycle"},"type":"array"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"id":{"description":"Plan identifier. It can be passed as `plan` instead of the slug.","type":"integer"},"label":{"description":"Short marketing label, e.g. `Unmetered traffic · 100 Mbps dedicated`.","type":"string"},"mbps":{"description":"Dedicated bandwidth of the plan in Mbit/s, for inbound and outbound traffic.","type":"integer"},"monthly_cents":{"description":"Price for a month of 730 hours in US cents (`hours_per_month` of the catalog).","type":"integer"},"name":{"description":"Display name, e.g. `100 Mbps`.","type":"string"},"slug":{"description":"Stable short name of the plan, e.g. `100m`. Pass it as `plan` when ordering or changing plan.","type":"string"}},"required":["id","slug","name","mbps","hourly_uusd","monthly_cents","label","cycles"],"type":"object","x-order":["id","slug","name","mbps","hourly_uusd","monthly_cents","label","cycles"]},"VpcPlanCycle":{"properties":{"cycle":{"description":"Billing cycle identifier.","type":"string"},"cycle_cents":{"description":"Price of one full cycle of this plan in US cents. `0` for hourly billing (you pay per hour instead).","type":"integer"},"discount_pct":{"description":"Discount for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months. `0` means pay by the hour.","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"}},"required":["cycle","name","months","discount_pct","cycle_cents"],"type":"object","x-order":["cycle","name","months","discount_pct","cycle_cents"]},"VpcQuote":{"properties":{"cycle":{"description":"Billing cycle slug the quote is for.","type":"string"},"cycle_cents":{"description":"Price of one full cycle in US cents. `0` for hourly billing.","type":"integer"},"cycle_name":{"description":"Display name of the cycle.","type":"string"},"discount_pct":{"description":"Cycle discount in percent.","type":"number"},"first_charge_cents":{"description":"Amount taken from the wallet when the order is placed, in US cents. `0` for hourly billing: the first hour is charged when the Private Cloud becomes active.","type":"integer"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"mbps":{"description":"Dedicated bandwidth of the plan in Mbit/s.","type":"integer"},"monthly_cents":{"description":"Price for a month of 730 hours in US cents.","type":"integer"},"months":{"description":"Months in the cycle. `0` for hourly billing.","type":"integer"},"plan_id":{"description":"Plan identifier.","type":"integer"}},"required":["plan_id","mbps","cycle","cycle_name","months","discount_pct","hourly_uusd","monthly_cents","cycle_cents","first_charge_cents"],"type":"object","x-order":["plan_id","mbps","cycle","cycle_name","months","discount_pct","hourly_uusd","monthly_cents","cycle_cents","first_charge_cents"]},"VpcTier":{"properties":{"can_delete":{"description":"True when the tier can be deleted now: it is active, not the default tier and has no servers.","type":"boolean"},"cidr":{"description":"IPv4 subnet of the tier, e.g. `10.128.2.0/24`.","type":"string"},"created_at":{"description":"When the tier was requested (Unix time, seconds, UTC)","type":"integer"},"gateway":{"description":"IPv4 gateway address of the tier (the `.1` address of the subnet).","type":"string"},"id":{"description":"Tier identifier.","type":"string"},"index":{"description":"Position of the tier in the Private Cloud, 1-254. The tier subnet is the `/24` of the same number inside the Private Cloud range; the default tier has index 1.","type":"integer"},"ipv6_cidr":{"description":"IPv6 `/64` subnet of the tier; null until the tier is ready.","type":["string","null"]},"ipv6_gateway":{"description":"IPv6 gateway address of the tier; null until the tier is ready.","type":["string","null"]},"is_default":{"description":"True for the tier created with the Private Cloud. It cannot be deleted.","type":"boolean"},"name":{"description":"Tier name, 2-32 characters of lowercase letters, digits and hyphens.","type":"string"},"state":{"description":"`provisioning` while the tier is being created, `active` when servers can use it, `deleting` while it is removed.","enum":["provisioning","active","deleting"],"type":"string"},"vm_count":{"description":"Number of servers currently in the tier.","type":"integer"}},"required":["id","name","index","cidr","gateway","is_default","ipv6_cidr","ipv6_gateway","state","vm_count","created_at","can_delete"],"type":"object","x-order":["id","name","index","cidr","gateway","is_default","ipv6_cidr","ipv6_gateway","state","vm_count","created_at","can_delete"]},"VpnAddonPrice":{"properties":{"key":{"description":"Add-on key. Pass it in the `addons` list of a quote or order.","type":"string"},"name":{"description":"Display name.","type":"string"},"uusd_month":{"description":"Monthly price of the add-on, in millionths of a US dollar.","type":"integer"}},"required":["key","name","uusd_month"],"type":"object"},"VpnBandwidthUpgrade":{"properties":{"charged_cents":{"description":"Amount charged from the wallet for the upgrade, in US cents.","type":"integer"},"created_at":{"description":"When the upgrade was requested (Unix time, seconds, UTC)","type":"integer"},"days_left":{"description":"Days left in the period when the upgrade was bought; the charge covers these days.","type":"integer"},"from_gb":{"description":"Traffic allowance before the upgrade in GB (0 = unlimited).","type":"integer"},"id":{"description":"Upgrade identifier.","type":"integer"},"new_renew_cents":{"description":"Price of one renewal period after the upgrade, in US cents.","type":"integer"},"seq":{"description":"Sequence number of the upgrade within the plan, starting at 1.","type":"integer"},"status":{"description":"`done` once applied; `failed` and `canceled` upgrades are refunded.","enum":["pending","done","failed","canceled"],"type":"string"},"to_gb":{"description":"Traffic allowance after the upgrade in GB (0 = unlimited).","type":"integer"}},"required":["id","seq","from_gb","to_gb","days_left","charged_cents","new_renew_cents","status","created_at"],"type":"object","x-order":["id","seq","from_gb","to_gb","days_left","charged_cents","new_renew_cents","status","created_at"]},"VpnCancelPreview":{"properties":{"can_cancel":{"description":"Whether the plan can be canceled now.","type":"boolean"},"can_hide":{"description":"Whether the plan can be removed from your list (canceled or expired, IPs already released).","type":"boolean"},"expires_at":{"description":"Current expiry of the plan (Unix time, seconds, UTC)","type":"integer"},"ips_released":{"description":"Number of IP addresses that would go back to the pool.","type":"integer"},"keep_until":{"description":"For expired plans: when the IPs will be released (Unix time, seconds, UTC)","type":["integer","null"]},"reason":{"description":"Why it cannot be canceled, when `can_cancel` is false.","type":["string","null"]},"refund_cents":{"description":"Always 0: canceling never refunds.","type":"integer"},"status":{"description":"Current plan status.","type":"string"}},"required":["can_cancel","reason","refund_cents","ips_released","expires_at","status","can_hide","keep_until"],"type":"object","x-order":["can_cancel","reason","refund_cents","ips_released","expires_at","status","can_hide","keep_until"]},"VpnCyclePrice":{"properties":{"days":{"description":"Length of the cycle in days for day-based cycles; 0 otherwise.","type":"integer"},"discount_pct":{"description":"Discount applied to the monthly price for paying this cycle up front, in percent (month-based cycles).","type":"number"},"months":{"description":"Length of the cycle in months; 0 for day-based cycles.","type":"integer"},"name":{"description":"Display name of the cycle. It is a label only; use `slug` in requests.","type":"string"},"price_bp":{"description":"For day-based cycles, price of one cycle as a share of the monthly price in basis points (10000 = the full monthly price); 0 otherwise.","type":"integer"},"slug":{"description":"Billing cycle identifier, e.g. `daily`, `weekly`, `monthly`, `yearly`.","type":"string"}},"required":["slug","name","months","discount_pct","days","price_bp"],"type":"object","x-order":["slug","name","months","discount_pct","days","price_bp"]},"VpnEndpoint":{"properties":{"capabilities":{"description":"Capabilities of this IP.","properties":{"addons":{"description":"This IP supports Pro add-ons.","type":"boolean"},"http":{"description":"HTTP proxy is available.","type":"boolean"},"ip_auth":{"description":"This IP accepts authorized source IPs without a password.","type":"boolean"},"ip_auth_protocols":{"description":"Protocols that work without a password from an authorized IP. A protocol that is not listed always needs the username and password.","items":{"description":"Protocol.","enum":["http","socks5"],"type":"string"},"type":"array"},"metering":{"description":"`directional`: download and upload are counted separately. `combined`: only the total is counted.","enum":["directional","combined"],"type":"string"},"protocols":{"description":"Protocols offered.","items":{"description":"Protocol.","enum":["http","socks5","udp"],"type":"string"},"type":"array"},"socks5":{"description":"SOCKS5 proxy is available.","type":"boolean"},"udp":{"description":"This IP offers UDP (`port_udp`).","type":"boolean"}},"required":["http","socks5","udp","ip_auth","ip_auth_protocols","addons","metering","protocols"],"type":"object","x-order":["http","socks5","udp","ip_auth","ip_auth_protocols","addons","metering","protocols"]},"city":{"description":"City of the IP address, when known.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code of the IP address, when known.","type":["string","null"]},"id":{"description":"Endpoint identifier.","type":"integer"},"ip":{"description":"IPv4 address of the endpoint. Traffic sent through the endpoint leaves from this address.","type":"string"},"password":{"description":"Password for the proxy login. Treat it as a secret.","type":"string"},"period_bytes":{"description":"Total bytes through this IP in the current billing period. Only in the plan detail response.","type":"integer"},"period_rx":{"description":"Bytes downloaded through this IP in the current period; null when the IP only counts total traffic (`capabilities.metering` is `combined`).","type":["integer","null"]},"period_seen":{"description":"Last time this IP carried traffic (or, for an IP that only counts totals, when its counter was last read); null when there is no data yet. (Unix time, seconds, UTC)","type":["integer","null"]},"period_tx":{"description":"Bytes uploaded through this IP in the current period; null when the IP only counts total traffic.","type":["integer","null"]},"port_http":{"description":"Port of the HTTP proxy.","type":"integer"},"port_socks":{"description":"Port of the SOCKS5 proxy (TCP).","type":"integer"},"port_udp":{"description":"Port of the UDP relay; 0 when this IP does not offer UDP (see `capabilities.udp`).","type":"integer"},"state":{"description":"`provisioning`: being set up, may not accept connections yet. `active`: ready to use.","enum":["provisioning","active"],"type":"string"},"subscription_id":{"description":"Plan this endpoint belongs to.","type":"integer"},"username":{"description":"User name for the proxy login.","type":"string"}},"required":["id","subscription_id","ip","port_socks","port_http","port_udp","username","password","country","city","state"],"type":"object","x-order":["id","subscription_id","ip","port_socks","port_http","port_udp","username","password","country","city","state","capabilities","period_bytes","period_rx","period_tx","period_seen"]},"VpnIpReport":{"properties":{"admin_note":{"description":"Message from the reviewer, shown when a report is rejected or replaced.","type":["string","null"]},"created_at":{"description":"When the report was filed (Unix time, seconds, UTC)","type":"integer"},"decided_at":{"description":"When the report was reviewed (Unix time, seconds, UTC)","type":["integer","null"]},"dnsbl_lists":{"items":{"description":"Blacklists that currently list the IP.","type":"string"},"type":"array"},"dnsbl_status":{"description":"Result of the blacklist check run at report time: `clean`, `listed` or `unknown`.","type":["string","null"]},"endpoint_id":{"description":"Endpoint (IP) the report is about.","type":"integer"},"id":{"description":"Report identifier.","type":"integer"},"ip":{"description":"The reported IP address.","type":"string"},"new_ip":{"description":"The replacement IP, once replaced.","type":["string","null"]},"note":{"description":"Free-text description.","type":["string","null"]},"reason":{"description":"Why the IP is reported.","enum":["dnsbl","site_block","other"],"type":"string"},"site":{"description":"Site that blocks the IP, for `site_block` reports.","type":["string","null"]},"status":{"description":"`open` while waiting for review, `replaced` when a clean IP was swapped in, `rejected` when the request was declined.","enum":["open","replaced","rejected"],"type":"string"},"subscription_id":{"description":"Plan the report belongs to.","type":"integer"},"zone_id":{"description":"Location of the IP.","type":["integer","null"]}},"required":["id","subscription_id","endpoint_id","ip","zone_id","reason","site","note","dnsbl_status","dnsbl_lists","status","new_ip","admin_note","decided_at","created_at"],"type":"object","x-order":["id","subscription_id","endpoint_id","ip","zone_id","reason","site","note","dnsbl_status","dnsbl_lists","status","new_ip","admin_note","decided_at","created_at"]},"VpnPlanInvoice":{"properties":{"account_id":{"description":"Your account id, or null on invoices issued to a previous owner of the plan.","type":["integer","null"]},"buyer_json":{"description":"Buyer details as a JSON string (redacted on invoices issued to a previous owner).","type":"string"},"created_at":{"description":"Creation time (Unix time, seconds, UTC)","type":"integer"},"currency":{"description":"Currency code of the amounts.","type":"string"},"due_at":{"description":"Due time (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Invoice identifier.","type":"integer"},"kind":{"description":"Invoice kind, e.g. `receipt`.","type":"string"},"ledger_ref":{"description":"Wallet ledger reference.","type":["string","null"]},"note":{"description":"Invoice note.","type":["string","null"]},"number":{"description":"Human-readable invoice number.","type":["string","null"]},"paid_at":{"description":"Payment time (Unix time, seconds, UTC)","type":["integer","null"]},"previous_owner":{"description":"Present and true on invoices issued before the plan was transferred to you.","type":"boolean"},"seller_json":{"description":"Seller details as a JSON string.","type":"string"},"status":{"description":"Invoice status, e.g. `paid`.","type":"string"},"subtotal_cents":{"description":"Subtotal in US cents.","type":"integer"},"total_cents":{"description":"Total in US cents.","type":"integer"},"updated_at":{"description":"Last update time (Unix time, seconds, UTC)","type":"integer"},"vm_id":{"description":"Always null for plan invoices.","type":["string","null"]}},"required":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at"],"type":"object","x-order":["id","number","account_id","vm_id","kind","status","subtotal_cents","total_cents","currency","due_at","paid_at","ledger_ref","seller_json","buyer_json","note","created_at","updated_at","previous_owner"]},"VpnPlanRenewal":{"properties":{"charged_cents":{"description":"Amount charged from the wallet, in US cents.","type":"integer"},"created_at":{"description":"When the renewal was requested (Unix time, seconds, UTC)","type":"integer"},"from":{"description":"Expiry before the renewal (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Renewal identifier.","type":"integer"},"months":{"description":"Months added by the renewal (0 for plans billed per day or per week).","type":"integer"},"periods":{"description":"Number of billing periods paid.","type":"integer"},"seq":{"description":"Sequence number of the renewal within the plan, starting at 1.","type":"integer"},"status":{"description":"`done` once applied; `failed` and `canceled` renewals are refunded.","enum":["pending","done","failed","canceled"],"type":"string"},"to":{"description":"Expiry after the renewal (Unix time, seconds, UTC)","type":"integer"}},"required":["id","seq","periods","months","charged_cents","from","to","status","created_at"],"type":"object","x-order":["id","seq","periods","months","charged_cents","from","to","status","created_at"]},"VpnPlanSummary":{"properties":{"activated_at":{"description":"When the plan became active (Unix time, seconds, UTC)","type":["integer","null"]},"addons":{"items":{"description":"Add-on key, e.g. `ipauth`.","type":"string"},"type":"array"},"auto_renew":{"description":"Whether the plan renews itself from the wallet shortly before it expires.","type":"boolean"},"bandwidth_gb":{"description":"Monthly bandwidth quota in GB (decimal). `0` means unlimited.","type":"integer"},"canceled_at":{"description":"When the plan was canceled (Unix time, seconds, UTC)","type":["integer","null"]},"created_at":{"description":"When the order was created (Unix time, seconds, UTC)","type":"integer"},"cycle":{"description":"Billing cycle slug: `daily`, `weekly`, `monthly` or `yearly`.","type":"string"},"expires_at":{"description":"End of the paid period (Unix time, seconds, UTC)","type":"integer"},"fail_reason":{"description":"Short code explaining why the order failed, when it did.","type":["string","null"]},"hidden_at":{"description":"When the plan was removed from your list (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Plan identifier.","type":"integer"},"ip_count":{"description":"Number of IP addresses in the plan.","type":"integer"},"ip_released_at":{"description":"When the IP addresses went back to the pool (Unix time, seconds, UTC)","type":["integer","null"]},"keep_until":{"description":"For expired plans: the time after which the IP addresses are released (Unix time, seconds, UTC)","type":["integer","null"]},"monthly_uusd":{"description":"Monthly list price in millionths of a US dollar.","type":"integer"},"months":{"description":"Months per cycle (0 for daily and weekly cycles).","type":"integer"},"period_days":{"description":"Days per period for daily and weekly cycles, 0 otherwise.","type":"integer"},"renew_cents":{"description":"Price of one renewal period in US cents, fixed at purchase time.","type":"integer"},"renew_max_periods":{"description":"Largest number of periods a single renewal call accepts.","type":"integer"},"renewable":{"description":"Whether the plan can be renewed in its current state.","type":"boolean"},"status":{"description":"Lifecycle state of the plan.","enum":["pending","active","expired","canceled","failed"],"type":"string"},"tier":{"description":"IP type: `dedicated` (the only type on sale), or `shared` / `private` on older plans.","type":"string"},"total_uusd":{"description":"Price of one full cycle in millionths of a US dollar.","type":"integer"},"zone":{"additionalProperties":true,"description":"Location the plan is served from.","type":["object","null"]}},"required":["id","tier","ip_count","bandwidth_gb","cycle","addons","monthly_uusd","total_uusd","status","created_at","expires_at","months","renew_cents","renew_max_periods","period_days","activated_at","fail_reason","canceled_at","ip_released_at","hidden_at","renewable","auto_renew"],"type":"object","x-order":["id","tier","ip_count","bandwidth_gb","cycle","addons","monthly_uusd","total_uusd","status","created_at","expires_at","months","renew_cents","renew_max_periods","period_days","activated_at","fail_reason","canceled_at","ip_released_at","hidden_at","renewable","auto_renew","zone","keep_until"]},"VpnQuote":{"properties":{"addon_lines":{"items":{"description":"Pair `[name, uusd_month]`: the add-on name and its monthly price in millionths of a US dollar.","maxItems":2,"minItems":2,"type":"array"},"type":"array"},"addons_uusd_month":{"description":"Add-on part of the monthly price, in millionths of a US dollar.","type":"integer"},"bandwidth_gb":{"description":"Monthly bandwidth in GB that was priced (0 = unlimited).","type":"integer"},"bandwidth_uusd_month":{"description":"Bandwidth part of the monthly price, in millionths of a US dollar.","type":"integer"},"cycle":{"description":"Billing cycle slug that was priced.","type":"string"},"days":{"description":"Length of the cycle in days for day-based cycles (daily, weekly); 0 for monthly cycles.","type":"integer"},"discount_pct":{"description":"Cycle discount applied to the total, in percent (0 for day-based cycles).","type":"number"},"effective_monthly_uusd":{"description":"`total_uusd` converted to a per-month figure, for display only, in millionths of a US dollar.","type":"integer"},"errors":{"items":{"description":"Reason the order is not valid, for example an IP count or bandwidth tier outside what is on sale. Empty when the quote is valid. The wording may change; do not parse it.","type":"string"},"type":"array"},"ip_count":{"description":"Number of IPs priced. When the request was outside the allowed range the value is clamped to the nearest limit and `errors` explains why.","type":"integer"},"ips_uusd_month":{"description":"IP part of the monthly price (`unit_uusd_month` x `ip_count`), in millionths of a US dollar.","type":"integer"},"list_monthly_uusd":{"description":"Monthly price at list (non-volume) unit prices, for strike-through display, in millionths of a US dollar.","type":"integer"},"list_unit_uusd_month":{"description":"Price of one IP per month at the smallest order size, before volume pricing, in millionths of a US dollar.","type":"integer"},"monthly_uusd":{"description":"Monthly price before the cycle discount (IPs + bandwidth + add-ons), in millionths of a US dollar.","type":"integer"},"months":{"description":"Length of the cycle in months (0 for day-based cycles).","type":"integer"},"tier":{"description":"Tier that was priced: `shared`, `private` or `dedicated`.","type":"string"},"total_uusd":{"description":"Total for one full cycle after the cycle discount, in millionths of a US dollar. This is the amount an order would be charged.","type":"integer"},"unit_uusd_month":{"description":"Price of one IP per month at this order size, in millionths of a US dollar.","type":"integer"}},"required":["tier","ip_count","bandwidth_gb","cycle","months","days","unit_uusd_month","list_unit_uusd_month","ips_uusd_month","bandwidth_uusd_month","addons_uusd_month","addon_lines","monthly_uusd","list_monthly_uusd","discount_pct","total_uusd","effective_monthly_uusd","errors"],"type":"object","x-order":["tier","ip_count","bandwidth_gb","cycle","months","days","unit_uusd_month","list_unit_uusd_month","ips_uusd_month","bandwidth_uusd_month","addons_uusd_month","addon_lines","monthly_uusd","list_monthly_uusd","discount_pct","total_uusd","effective_monthly_uusd","errors"]},"VpnQuoteRequest":{"properties":{"addons":{"description":"Add-ons to include. Default none. Duplicates are ignored; at most 16 entries.","items":{"description":"Add-on key from the catalog `addons`.","type":"string"},"type":"array"},"bandwidth_gb":{"description":"Monthly bandwidth tier in GB; must be one of the catalog `bw_breaks[].gb` values. 0 means unlimited (fair use).","type":"integer"},"cycle":{"description":"Billing cycle slug from the catalog `cycles`, e.g. `monthly`.","type":"string"},"ip_count":{"description":"Number of IPs, at least 1. The allowed maximum is in the catalog (`dedicated.max_ips`).","type":"integer"},"tier":{"description":"IP sharing tier. Only `dedicated` can be ordered; the other two are rejected with `tier_retired`.","enum":["shared","private","dedicated"],"type":"string"},"zone":{"description":"Region slug, used when `zone_id` is not given. Does not change the price.","type":"string"},"zone_id":{"description":"Region to order from, as returned by `zones`. Does not change the price.","type":"integer"}},"required":["tier","ip_count","bandwidth_gb","cycle"],"type":"object","x-order":["tier","ip_count","bandwidth_gb","cycle","addons","zone_id","zone"]},"VpnRenewal":{"properties":{"charged_cents":{"description":"Amount charged in US cents.","type":"integer"},"created_at":{"description":"When the renewal was requested (Unix time, seconds, UTC)","type":"integer"},"from":{"description":"Previous expiry (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Renewal identifier.","type":"integer"},"months":{"description":"Months added.","type":"integer"},"periods":{"description":"Number of periods bought.","type":"integer"},"seq":{"description":"Sequence number of the renewal within the plan.","type":"integer"},"status":{"description":"`done`, or `pending` while the payment is being finalized.","type":"string"},"to":{"description":"New expiry (Unix time, seconds, UTC)","type":"integer"}},"required":["id","seq","periods","months","charged_cents","from","to","status","created_at"],"type":"object","x-order":["id","seq","periods","months","charged_cents","from","to","status","created_at"]},"VpnSubscription":{"properties":{"activated_at":{"description":"When the plan became active, or null if it never did (Unix time, seconds, UTC)","type":["integer","null"]},"addons":{"description":"Add-ons bought with the plan.","items":{"description":"Add-on key.","type":"string"},"type":"array"},"auto_renew":{"description":"Whether the plan renews itself from the wallet balance shortly before it ends. Always false for plans that can no longer be renewed.","type":"boolean"},"bandwidth_gb":{"description":"Traffic allowance per billing period in GB; 0 means unlimited.","type":"integer"},"canceled_at":{"description":"When the plan was canceled or failed, or null otherwise (Unix time, seconds, UTC)","type":["integer","null"]},"capabilities":{"description":"Capabilities of the plan, summarised over its IPs.","properties":{"addons":{"description":"Pro add-ons can be used: every IP of the plan supports them.","type":"boolean"},"http":{"description":"HTTP proxy is available.","type":"boolean"},"ip_auth":{"description":"At least one IP of the plan accepts authorized source IPs without a password.","type":"boolean"},"ip_auth_all":{"description":"Every IP of the plan accepts authorized source IPs.","type":"boolean"},"ip_auth_protocols":{"description":"Protocols that work without a password from an authorized IP on every IP of the plan that accepts authorized IPs.","items":{"description":"Protocol.","enum":["http","socks5"],"type":"string"},"type":"array"},"metering":{"description":"`directional`: download and upload are counted separately. `combined`: only the total is counted.","enum":["directional","combined"],"type":"string"},"protocols":{"description":"Protocols offered.","items":{"description":"Protocol.","enum":["http","socks5","udp"],"type":"string"},"type":"array"},"socks5":{"description":"SOCKS5 proxy is available.","type":"boolean"},"udp":{"description":"At least one IP of the plan offers UDP.","type":"boolean"},"udp_all":{"description":"Every IP of the plan offers UDP.","type":"boolean"}},"required":["http","socks5","udp","ip_auth","ip_auth_protocols","addons","metering","protocols","udp_all","ip_auth_all"],"type":"object","x-order":["http","socks5","udp","ip_auth","ip_auth_protocols","addons","metering","protocols","udp_all","ip_auth_all"]},"created_at":{"description":"When the order was placed (Unix time, seconds, UTC)","type":"integer"},"cycle":{"description":"Billing cycle chosen at purchase, for example `daily`, `weekly`, `monthly` or `yearly`.","type":"string"},"endpoint_count":{"description":"Number of endpoints of the plan. Only present in the list response.","type":"integer"},"expires_at":{"description":"When the current paid period ends (Unix time, seconds, UTC)","type":"integer"},"fail_reason":{"description":"Short machine-readable reason when the plan is `canceled` or `failed` (for example `not_charged` or `refunded`); null otherwise.","type":["string","null"]},"hidden_at":{"description":"When you removed the plan from your list, or null otherwise. Removed plans are only returned with `include_hidden` (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Plan identifier.","type":"integer"},"ip_count":{"description":"Number of IP addresses (endpoints) in the plan.","type":"integer"},"ip_released_at":{"description":"When the IP addresses went back to the pool, or null while the plan still holds them (Unix time, seconds, UTC)","type":["integer","null"]},"keep_until":{"description":"For an `expired` plan that still holds its IP addresses: the time after which they are released unless the plan is renewed. Null otherwise (Unix time, seconds, UTC)","type":["integer","null"]},"monthly_uusd":{"description":"Price per month in millionths of a US dollar, as sold.","type":"integer"},"months":{"description":"Length of one billing period in months. 0 for plans billed per day or per week (see `period_days`).","type":"integer"},"period_days":{"description":"Length of one billing period in days for plans billed per day or per week; 0 when billing follows calendar months (`months`).","type":"integer"},"renew_cents":{"description":"Price of renewing one billing period, in US cents. It is fixed when the plan is bought.","type":"integer"},"renew_max_periods":{"description":"Largest number of billing periods that can be paid in a single renewal.","type":"integer"},"renewable":{"description":"Whether the plan can be renewed now (it is `active`, or `expired` and still holds its IP addresses).","type":"boolean"},"status":{"description":"`pending`: payment is being confirmed. `active`: usable. `expired`: ended; it can still be renewed while the IP addresses are held (see `keep_until`). `canceled` and `failed`: ended for good.","enum":["pending","active","expired","canceled","failed"],"type":"string"},"tier":{"description":"IP type of the plan. New plans are `dedicated` (the IP is for your exclusive use); older plans can be `private` or `shared`.","enum":["shared","private","dedicated"],"type":"string"},"total_uusd":{"description":"Price of one full billing period in millionths of a US dollar, as sold.","type":"integer"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]}},"required":["id","tier","ip_count","bandwidth_gb","cycle","addons","monthly_uusd","total_uusd","status","created_at","expires_at","months","renew_cents","renew_max_periods","period_days","activated_at","fail_reason","canceled_at","ip_released_at","hidden_at","renewable","auto_renew","keep_until","zone"],"type":"object","x-order":["id","tier","ip_count","bandwidth_gb","cycle","addons","monthly_uusd","total_uusd","status","created_at","expires_at","months","renew_cents","renew_max_periods","period_days","activated_at","fail_reason","canceled_at","ip_released_at","hidden_at","renewable","auto_renew","keep_until","endpoint_count","zone","capabilities"]},"VpnTierPricing":{"properties":{"bw_breaks":{"items":{"properties":{"gb":{"description":"Monthly bandwidth tier in GB. 0 means unlimited (fair use).","type":"integer"},"uusd_month":{"description":"Extra monthly price of this tier on top of the base tier (which costs 0), in millionths of a US dollar.","type":"integer"}},"required":["gb","uusd_month"],"type":"object"},"type":"array"},"ip_breaks":{"items":{"properties":{"min_ip":{"description":"Order sizes of at least this many IPs get this unit price.","type":"integer"},"uusd_ip_month":{"description":"Price of one IP per month, in millionths of a US dollar. The unit price of the highest `min_ip` not above the order size applies to the whole order.","type":"integer"}},"required":["min_ip","uusd_ip_month"],"type":"object"},"type":"array"},"max_ips":{"description":"Largest number of IPs in one order.","type":"integer"},"min_ips":{"description":"Smallest number of IPs in one order.","type":"integer"}},"required":["ip_breaks","bw_breaks","min_ips","max_ips"],"type":"object","x-order":["ip_breaks","bw_breaks","min_ips","max_ips"]},"VpnTraffic":{"properties":{"bucket_secs":{"description":"Nominal length of one series bucket in seconds (60 for 1h and 6h, 3600 for 24h, 7d and 30d, 86400 for month, about 30 days for all).","type":"integer"},"data_from":{"description":"Earliest sample kept at this granularity: when the requested range is longer than the data kept, the series starts here. (Unix time, seconds, UTC)","type":["integer","null"]},"endpoints":{"items":{"properties":{"id":{"description":"Endpoint identifier.","type":"integer"},"ip":{"description":"Endpoint IP address.","type":"string"},"last_seen":{"description":"`directional`: last time the endpoint carried traffic. `combined`: when the counters were last read (Unix time, seconds, UTC)","type":["integer","null"]},"rx_bytes":{"description":"Bytes downloaded through this endpoint in the period (`directional` only).","type":"integer"},"total_bytes":{"description":"Total bytes through this endpoint in the period.","type":"integer"},"tx_bytes":{"description":"Bytes uploaded through this endpoint in the period (`directional` only).","type":"integer"}},"required":["id","ip","total_bytes","last_seen"],"type":"object","x-order":["id","ip","rx_bytes","tx_bytes","total_bytes","last_seen"]},"type":"array"},"granularity":{"description":"Bucket size of `series`.","enum":["minute","hour","day","month"],"type":"string"},"live":{"properties":{"age_secs":{"description":"Age of the latest sample in seconds.","type":["integer","null"]},"at":{"description":"Time of the latest sample (Unix time, seconds, UTC)","type":["integer","null"]},"conns":{"description":"Latest connection count.","type":"integer"},"rx_bps":{"description":"Latest download rate in bits per second.","type":"number"},"tx_bps":{"description":"Latest upload rate in bits per second.","type":"number"},"window_secs":{"description":"Length of the sample: the rates are an average over this many seconds (60), not an instantaneous speed.","type":"integer"}},"required":["rx_bps","tx_bps","conns","at"],"type":["object","null"],"x-order":["rx_bps","tx_bps","conns","at","window_secs","age_secs"]},"metering":{"description":"`combined` when the plan has an IP that only counts total traffic: then `series` is empty, `live` is null and only totals are returned (no download/upload split).","enum":["directional","combined"],"type":"string"},"periods":{"items":{"properties":{"period_end":{"description":"End of the billing period (Unix time, seconds, UTC)","type":"integer"},"period_start":{"description":"Start of the billing period (Unix time, seconds, UTC)","type":"integer"},"rx_bytes":{"description":"Bytes downloaded in the period.","type":"integer"},"total_bytes":{"description":"Total bytes in the period.","type":"integer"},"tx_bytes":{"description":"Bytes uploaded in the period.","type":"integer"}},"required":["period_start","period_end","rx_bytes","tx_bytes","total_bytes"],"type":"object","x-order":["period_start","period_end","rx_bytes","tx_bytes","total_bytes"]},"type":"array"},"range":{"description":"The range that was returned.","enum":["1h","6h","24h","7d","30d","month","all"],"type":"string"},"series":{"items":{"properties":{"conns":{"description":"Connections seen in the bucket.","type":"integer"},"peak_rx_bps":{"description":"Highest download rate seen in the bucket, in bits per second (equals the average for minute and hour buckets).","type":"number"},"peak_tx_bps":{"description":"Highest upload rate seen in the bucket, in bits per second.","type":"number"},"rx_bps":{"description":"Average download rate in bits per second.","type":"number"},"rx_bytes":{"description":"Bytes downloaded in the bucket.","type":"integer"},"t":{"description":"Bucket start (Unix time, seconds, UTC)","type":"integer"},"tx_bps":{"description":"Average upload rate in bits per second.","type":"number"},"tx_bytes":{"description":"Bytes uploaded in the bucket.","type":"integer"}},"required":["t","rx_bps","tx_bps","conns"],"type":"object","x-order":["t","rx_bps","tx_bps","conns","peak_rx_bps","peak_tx_bps","rx_bytes","tx_bytes"]},"type":"array"},"usage":{"properties":{"pct":{"description":"Share of the quota used, in percent (0 when unlimited).","type":"number"},"period_end":{"description":"End of the current billing period (Unix time, seconds, UTC)","type":"integer"},"period_start":{"description":"Start of the current billing period (Unix time, seconds, UTC)","type":"integer"},"quota_bytes":{"description":"Quota in bytes, 0 when unlimited.","type":"integer"},"rx_bytes":{"description":"Bytes downloaded in the period (`directional` only).","type":"integer"},"total_bytes":{"description":"Total bytes in the period.","type":"integer"},"tx_bytes":{"description":"Bytes uploaded in the period (`directional` only).","type":"integer"}},"required":["period_start","period_end","total_bytes","quota_bytes","pct"],"type":"object","x-order":["period_start","period_end","rx_bytes","tx_bytes","total_bytes","quota_bytes","pct"]}},"required":["range","metering","bucket_secs","series","live","usage","endpoints"],"type":"object","x-order":["range","granularity","data_from","metering","bucket_secs","series","live","usage","endpoints","periods"]},"WalletEntry":{"properties":{"account_id":{"description":"Your account identifier.","type":"integer"},"actor":{"description":"Who or what created the entry, for example `customer:<account id>` or `system:<task>`.","type":"string"},"at":{"description":"Time of the entry (Unix time, seconds, UTC)","type":"integer"},"balance_after":{"description":"Wallet balance in US cents right after this entry.","type":["integer","null"]},"delta_cents":{"description":"Change of the balance in US cents: positive when money was added, negative when it was spent.","type":"integer"},"id":{"description":"Entry identifier. Increases with time.","type":"integer"},"invoice_id":{"description":"Invoice whose `ledger_ref` equals this entry's `ref`, when there is one.","type":["integer","null"]},"kind":{"description":"`deposit`: money added. `charge`: money spent. `refund`: money returned. `adjust`: a correction made by support.","enum":["deposit","charge","refund","adjust"],"type":"string"},"note":{"description":"Free-text note.","type":["string","null"]},"ref":{"description":"Unique reference of the transaction, for example `vm:new:<server id>`. Invoices link to it through `ledger_ref`.","type":"string"},"service":{"description":"Product the entry belongs to, derived from `ref` (for example `vm`, `vpn`, `deposit`, `refund_out`, `other`).","type":"string"},"vm_id":{"description":"Server the entry is about, when it is about one.","type":["string","null"]}},"required":["id","account_id","delta_cents","kind","ref","vm_id","note","actor","at","balance_after","service","invoice_id"],"type":"object","x-order":["id","account_id","delta_cents","kind","ref","vm_id","note","actor","at","balance_after","service","invoice_id"]},"Zone":{"properties":{"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO country code.","type":"string"},"id":{"description":"Region identifier. Pass it as `zone_id` when creating resources.","type":"integer"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"}},"required":["id","slug","name"],"type":"object","x-order":["id","slug","name","name_en","country","city"]}},"securitySchemes":{"bearerAuth":{"bearerFormat":"vk_…","description":"API key created on the API Keys page of the dashboard, sent as `Authorization: Bearer vk_…`. The scopes listed in `x-scopes` can be granted to a key; each operation names the one it needs.","scheme":"bearer","type":"http","x-scopes":{"account:read":"Read your profile, overview, activity, bandwidth and notifications","account:write":"Mark notifications as read (nothing else)","aff:read":"Read the affiliate program: code, referrals, commissions (READ ONLY)","apikey:read":"List the account's API keys and key usage log (cannot create, edit or revoke keys)","apikey:self":"Inspect the calling key itself (every key has it implicitly)","backup:read":"Read backups, backup schedules and pricing","backup:restore":"RESTORE a VM from a backup (overwrites the disk)","backup:write":"Enable/disable backup, create/delete backups, set schedules (storage billed per GB-hour)","bandwidth:buy":"BUY Bandwidth Add-ons (costs money)","billing:read":"Read wallet, invoices, payments (READ ONLY)","byoip:create":"Register a new own IP prefix (may charge the wallet once verification passes)","byoip:destroy":"Cancel an own IP prefix (removes the setup and stops the BGP announcement)","byoip:read":"Read your own IP prefixes (BYOIP), verification results, ROA/IRR instructions, quotes and activity","byoip:write":"Re-verify, request review, attach/detach own IP prefixes to VMs","catalog:read":"Read plans and catalog","dedicated:console":"Open Dedicated Server consoles, change the OS password, install/remove the agent (regain shell access)","dedicated:create":"Order Dedicated Servers (charges the wallet)","dedicated:destroy":"ERASE the disks: reinstall the OS of Dedicated Servers (DELETE, data is lost)","dedicated:proxy":"Manage Proxy App on Dedicated Servers: create, delete and change SOCKS5 proxies, export the list with passwords","dedicated:read":"Read Dedicated Servers: hardware, status, sensors, hardware log, bandwidth","dedicated:write":"Power on/off/reboot, rename and renew Dedicated Servers","gpu:console":"Open SSH WebSocket tickets for GPU instances","gpu:create":"RENT GPU instances (costs money)","gpu:destroy":"DELETE or recycle GPU instances (data is lost)","gpu:read":"Read GPU instances, quotes, diagnostics and logs","gpu:write":"Start/stop/reboot GPU instances and request logs (a restart can charge the wallet)","image:read":"Read your OS Images / ISO Images","image:write":"Import images from URL, create from instances, delete, attach/detach ISO (storage is billed hourly)","k8s:create":"CREATE Kubernetes clusters (costs money)","k8s:destroy":"DELETE Kubernetes clusters","k8s:kubeconfig":"Download kubeconfig (cluster-admin access)","k8s:read":"Read Kubernetes clusters, nodes, logs, billing","k8s:scale":"SCALE Kubernetes workers (costs money)","k8s:write":"Start/stop, rename Kubernetes clusters","s3:create":"CREATE S3 accounts (usage is billed)","s3:destroy":"DELETE S3 accounts, buckets and objects (data is lost)","s3:keys":"List, create, rotate and delete S3 access keys (the secret is shown once)","s3:read":"Read S3 accounts, buckets, object listings, usage and cost","s3:write":"Create buckets, edit S3 accounts, manage share links and object operations (uploads, downloads, public access; deleting objects also needs s3:destroy)","shield:agent":"Control the agent on your own machine (block/unblock IP commands, auto-block, thresholds) — high risk","shield:read":"Read your own DDoS Shield","shield:write":"Write your own DDoS Shield rules","sshkey:read":"Read stored SSH keys","sshkey:write":"Add/remove SSH keys","ticket:read":"Read your support tickets","ticket:write":"Create, reply to and close support tickets","transfer:read":"Read service transfer requests (READ ONLY)","vm:console":"Open VNC console tickets, reset the admin password, attach SSH keys (regain shell access)","vm:create":"CREATE new VMs (costs money)","vm:destroy":"DELETE VMs","vm:plan":"CHANGE PLAN / custom resize (costs money)","vm:read":"Read VMs, metrics and VM invoices","vm:restore":"RESTORE a VM from a snapshot (overwrites the current disk)","vm:write":"Power actions, minor changes, firewall, snapshots","volume:create":"CREATE / ENLARGE data volumes (costs money, billed per GB-hour)","volume:destroy":"DELETE data volumes (data is lost)","volume:read":"Read data volumes and volume quotes","volume:write":"Attach/detach data volumes","vpc:create":"CREATE Private Cloud / CHANGE bandwidth plan (costs money)","vpc:destroy":"DELETE Private Cloud","vpc:read":"Read Private Cloud, tiers, Network ACL, bandwidth, billing","vpc:write":"Edit Network ACL, tiers, name, auto-renew (enabling auto-renew may renew from the wallet)","vpn:create":"BUY / RENEW / upgrade bandwidth / add features to VPN & Proxy IPv6 plans (costs money)","vpn:destroy":"CANCEL or remove VPN & Proxy IPv6 plans from the list (immediate, no refund; IPs return to the pool)","vpn:detail":"Read VPN / Proxy IPv6 plan management details: config export (incl. passwords), traffic, logs, authorized IPs, IP reports, upgrade/cancel quotes","vpn:read":"Read VPN / Proxy IPv6 plans and connection details (incl. proxy passwords)","vpn:write":"Edit VPN / Proxy IPv6 plans: auto-renew (enabling may renew from the wallet), authorized IPs, IP rotation, proxy password, device release, IP reports, feed link — returns fresh connection secrets","wallet:iap":"Top up wallet via Apple In-App Purchase (VPN app for iPhone)"}}}},"info":{"description":"The ONIE API lets you create and manage your cloud resources from scripts, CI jobs and tools. It is a JSON REST API over HTTPS. Base URL: `https://api.onie.net`. Every path in this document starts with `/v1`.\n\n## Authentication\n\nSend an API key in the `Authorization` header:\n\n```\nAuthorization: Bearer vk_xxxxxxxxxxxxxxxx\n```\n\nCreate keys on the **API Keys** page of the dashboard. A key is shown once, at creation; only a one-way hash is stored, so a lost key must be revoked and replaced. Each key carries its own **scopes**, an optional expiry and an optional IP allow-list.\n\nA key can never create or revoke other keys, top up or withdraw money, change payment methods, change the password, e-mail address or two-factor settings, or delete the account. Those actions are only available when signed in to the dashboard.\n\nThe API does not enable CORS. Call it from servers, CI jobs or the command line, never from a web page, so the key is not exposed to visitors.\n\n## Scopes\n\nEach operation requires exactly one scope (shown on the operation as `x-scope` and in the security requirement). A key that lacks it receives `403 scope_required`. Create keys with the smallest set of scopes the integration needs. Scopes that cost money or destroy data are separate from read scopes.\n\n## Rate limits\n\nDefaults: 120 requests per minute per key and 300 requests per minute per account (all keys together), counted in fixed 60-second windows. Operators can change these limits. Every response that passes the scope check carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix time when the window resets) for the stricter of the two limits. When exceeded the API answers `429 rate_limited` with a `Retry-After` header (seconds).\n\n## Idempotency\n\nOperations that charge your wallet or cannot be repeated safely (creating or deleting servers, changing plans, buying add-ons) require an `Idempotency-Key` header: any unique string up to 200 characters, for example a UUID. Repeating a request with the same key returns the original response with the header `Idempotency-Replayed: 1` instead of running again, so it is always safe to retry after a timeout or a dropped connection. Only successful (2xx) results are remembered, for 24 hours; a failed attempt can be retried with the same key. A concurrent duplicate gets `409 idempotency_in_progress` with `Retry-After: 1`. Use a new key for each distinct operation: reusing a key for another method or path fails with `422 idempotency_key_reused`.\n\n## Errors\n\nErrors use standard HTTP status codes and one JSON shape:\n\n```\n{ \"error\": { \"code\": \"scope_required\", \"message\": \"...\" } }\n```\n\nBranch on `error.code`, which is stable; `message` is for humans and may change. Some errors add extra fields beside `code` and `message` (for example the balance needed for a purchase). Every response, success or error, carries an `X-Request-Id` header; quote it when contacting support. You may send your own `X-Request-Id` (letters, digits, `-`, `_`, `.`, up to 80 characters) and it will be echoed back.\n\n| Status | Meaning |\n|---|---|\n| 400 | Malformed request or missing `Idempotency-Key` |\n| 401 | Missing, invalid, expired or revoked key, or IP not allowed |\n| 402 | Not enough wallet balance |\n| 403 | Key lacks the required scope, feature disabled, or action not allowed |\n| 404 | Not found, or not yours |\n| 409 | Conflict with the current state of the resource |\n| 422 | Valid JSON but a field is missing or out of range |\n| 429 | Rate limit exceeded |\n| 5xx | Server error. Retry with the same `Idempotency-Key` where one is required |\n\nResources that belong to another account always answer `404`, never `403`, so identifiers cannot be probed.\n\n## Pagination\n\nList operations that can return many rows take `page` (1-based) and `per_page` and return `{ \"items\": [...], \"total\": N, \"page\": P, \"per_page\": S }`. `per_page` above the maximum of the operation is clamped; the value used is echoed in the response.\n\n## Conventions\n\nRequest and response bodies are UTF-8 JSON (`Content-Type: application/json`). Timestamps are Unix seconds (UTC) unless a field says otherwise. Monetary amounts are integers in the smallest unit named by the field (for example `*_cents`). Unknown request fields are ignored; new response fields may be added at any time, so ignore fields you do not know.","summary":"REST API for ONIE cloud services","title":"ONIE API v1","version":"1.0.0"},"openapi":"3.1.0","paths":{"/v1/aff":{"get":{"description":"Returns the programme rules, whether you have joined, and (once you have) your referral `code`, `link`, status, balances and a 30-day activity series. Use it to check eligibility before sending customers to your link. Cash payout details and verification status are not included; they are shown in the web console only.\n\n**Required scope:** `aff:read`.","operationId":"aff_status","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"cash":{"enabled":false,"max_per_month_cents":100000,"method":null,"method_locked_until":null,"methods":[],"min_cents":5000,"next_allowed_at":null,"season_days":120,"seasoned_cents":0},"cash_season_days":120,"code":"K7M2QX9P","cookie_days":30,"credit_after_days":30,"eligible":{"age_ok":true,"email_verified":true,"min_account_age_days":7,"min_topup_cents":1000,"missing":[],"topup_ok":true},"enabled":true,"hold_days":60,"joined":true,"last_payout_at":null,"link":"https://cloud.example.com/?ref=K7M2QX9P","min_account_age_days":7,"min_credit_cents":500,"min_spend_pct":50,"min_topup_cents":1000,"open_payout":null,"pct":10.0,"stats":{"active_referrals":5,"available_cents":500,"balance_cents":1500,"clawed_cents":0,"clicks_30d":42,"deposits_cents":15000,"earned_30d_cents":1500,"locked_cents":0,"matured_cents":500,"negative":false,"paid_cents":0,"paying_referred":2,"pending_cents":1000,"reserved_cents":0,"reversed_cents":0,"review_cents":0,"series_30d":[{"clicks":3,"commission_cents":500,"day":"2026-10-19","signups":1}],"signups":5},"status":"active","status_reason":null,"tos_accepted":true,"tos_accepted_at":1758240000,"tos_version":1,"window_months":12},"schema":{"properties":{"cash":{"properties":{"enabled":{"description":"Whether cash payouts are offered.","type":"boolean"},"max_per_month_cents":{"description":"Largest total cash payout per month in US cents.","type":"integer"},"method":{"description":"Payout method you chose in the web console, once joined.","type":["string","null"]},"method_locked_until":{"description":"Until when the method cannot be changed. (Unix time, seconds, UTC)","type":["integer","null"]},"methods":{"items":{"description":"Payout method identifier.","type":"string"},"type":"array"},"min_cents":{"description":"Smallest cash payout in US cents.","type":"integer"},"next_allowed_at":{"description":"When you may request the next cash payout. (Unix time, seconds, UTC)","type":["integer","null"]},"season_days":{"description":"Days a commission must age before it counts for cash payouts.","type":"integer"},"seasoned_cents":{"description":"Commission that is old enough for a cash payout, in US cents.","type":"integer"}},"required":["enabled","methods","min_cents","season_days","max_per_month_cents"],"type":"object","x-order":["enabled","methods","min_cents","season_days","max_per_month_cents","method","method_locked_until","next_allowed_at","seasoned_cents"]},"cash_season_days":{"description":"Days a commission must age before it counts for cash payouts.","type":"integer"},"code":{"description":"Your referral code. Present once you have joined.","type":"string"},"cookie_days":{"description":"Days the referral link is remembered in the visitor's browser.","type":"integer"},"credit_after_days":{"description":"Days a matured commission must wait before it can be converted to wallet credit.","type":"integer"},"eligible":{"properties":{"age_ok":{"description":"Your account is old enough to join.","type":"boolean"},"email_verified":{"description":"Your e-mail address is verified.","type":"boolean"},"min_account_age_days":{"description":"Minimum account age in days.","type":"integer"},"min_topup_cents":{"description":"Minimum total top-up in US cents.","type":"integer"},"missing":{"items":{"description":"Requirement that is not met yet.","type":"string"},"type":"array"},"topup_ok":{"description":"You topped up enough to join.","type":"boolean"}},"required":["email_verified","age_ok","topup_ok","missing","min_account_age_days","min_topup_cents"],"type":"object","x-order":["email_verified","age_ok","topup_ok","missing","min_account_age_days","min_topup_cents"]},"enabled":{"description":"Whether the programme is currently open.","type":"boolean"},"hold_days":{"description":"Days a commission is held before it can mature.","type":"integer"},"joined":{"description":"Whether your account has joined the programme.","type":"boolean"},"last_payout_at":{"description":"When you were last paid, or null. (Unix time, seconds, UTC)","type":["integer","null"]},"link":{"description":"Your referral link. Present once you have joined.","type":"string"},"min_account_age_days":{"description":"Same as `eligible.min_account_age_days`.","type":"integer"},"min_credit_cents":{"description":"Smallest amount that can be converted to wallet credit, in US cents.","type":"integer"},"min_spend_pct":{"description":"Share of the referred customer's top-up that must be spent before the commission matures, in percent.","type":"integer"},"min_topup_cents":{"description":"Same as `eligible.min_topup_cents`.","type":"integer"},"open_payout":{"properties":{"amount_cents":{"description":"Amount in US cents.","type":"integer"},"created_at":{"description":"When it was requested. (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Payout number.","type":"integer"},"method":{"description":"Payout method.","type":"string"},"status":{"description":"`requested` or `approved`.","type":"string"}},"required":["id","amount_cents","method","status","created_at"],"type":["object","null"],"x-order":["id","amount_cents","method","status","created_at"]},"pct":{"description":"Your commission rate in percent.","type":"number"},"stats":{"properties":{"active_referrals":{"description":"Referred customers still counting.","type":"integer"},"available_cents":{"description":"Commission you can take now.","type":"integer"},"balance_cents":{"description":"Net commission balance.","type":"integer"},"clawed_cents":{"description":"Commission taken back after it was paid.","type":"integer"},"clicks_30d":{"description":"Visits on your link in the last 30 days.","type":"integer"},"deposits_cents":{"description":"Total top-ups of referred customers, in US cents.","type":"integer"},"earned_30d_cents":{"description":"Commission recorded in the last 30 days, in US cents.","type":"integer"},"locked_cents":{"description":"Matured commission that is not yet available.","type":"integer"},"matured_cents":{"description":"Commission that has matured.","type":"integer"},"negative":{"description":"True when clawbacks exceed your balance.","type":"boolean"},"paid_cents":{"description":"Commission already paid out.","type":"integer"},"paying_referred":{"description":"Referred customers who topped up.","type":"integer"},"pending_cents":{"description":"Commission still being held.","type":"integer"},"reserved_cents":{"description":"Commission reserved by an open payout.","type":"integer"},"reversed_cents":{"description":"Commission cancelled because a top-up was refunded or disputed.","type":"integer"},"review_cents":{"description":"Commission under manual review.","type":"integer"},"series_30d":{"items":{"properties":{"clicks":{"description":"Visits that day.","type":"integer"},"commission_cents":{"description":"Commission recorded that day, in US cents.","type":"integer"},"day":{"description":"Day in `YYYY-MM-DD` (UTC).","type":"string"},"signups":{"description":"Registrations that day.","type":"integer"}},"required":["day","clicks","signups","commission_cents"],"type":"object","x-order":["day","clicks","signups","commission_cents"]},"type":"array"},"signups":{"description":"Customers who registered through your link.","type":"integer"}},"required":["clicks_30d","signups","active_referrals","paying_referred","deposits_cents","earned_30d_cents","pending_cents","review_cents","matured_cents","locked_cents","available_cents","reserved_cents","paid_cents","reversed_cents","clawed_cents","balance_cents","negative","series_30d"],"type":"object","x-order":["clicks_30d","signups","active_referrals","paying_referred","deposits_cents","earned_30d_cents","pending_cents","review_cents","matured_cents","locked_cents","available_cents","reserved_cents","paid_cents","reversed_cents","clawed_cents","balance_cents","negative","series_30d"]},"status":{"description":"State of your participation. Present once you have joined.","enum":["active","auto_review","suspended","disabled"],"type":"string"},"status_reason":{"description":"Why the status is not `active`, when it is not.","type":["string","null"]},"tos_accepted":{"description":"Whether you accepted the current terms.","type":"boolean"},"tos_accepted_at":{"description":"When you accepted the terms, or null if you have not joined. (Unix time, seconds, UTC)","type":["integer","null"]},"tos_version":{"description":"Current version of the programme terms.","type":"integer"},"window_months":{"description":"How many months after signup a referred customer keeps earning you commission (0 = unlimited).","type":"integer"}},"required":["enabled","joined","eligible","pct","hold_days","min_spend_pct","credit_after_days","window_months","cookie_days","tos_version","tos_accepted","tos_accepted_at","min_credit_cents","min_account_age_days","min_topup_cents","cash_season_days","cash"],"type":"object","x-order":["enabled","joined","eligible","pct","hold_days","min_spend_pct","credit_after_days","window_months","cookie_days","tos_version","tos_accepted","tos_accepted_at","min_credit_cents","min_account_age_days","min_topup_cents","cash_season_days","cash","code","link","status","status_reason","stats","open_payout","last_payout_at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Affiliate is not offered on this site (reseller sites). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Affiliate is not offered on this site (reseller sites)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["aff:read"]}],"summary":"Affiliate status, referral code and stats","tags":["Affiliate"],"x-cli":"aff status","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/aff\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"aff:read","x-summary-vi":"Trạng thái chương trình affiliate, mã giới thiệu và thống kê"}},"/v1/aff/commissions":{"get":{"description":"Lists the commissions generated by your referrals, with the progress each one has made towards maturing. Reversed zero-amount records are not listed.\n\n**Required scope:** `aff:read`.","operationId":"aff_commission_list","parameters":[{"description":"Return only commissions in this status.","in":"query","name":"status","required":false,"schema":{"enum":["pending","review","matured","reserved","paid","reversed","clawed"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","amount","mature_at"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"amount_cents":500,"base_cents":5000,"created_at":1760860800,"id":311,"mature_at":1766044800,"matured_at":null,"paid_via":null,"pct_bp":1000,"reason_code":null,"ref_label":"#a3f1","spend_progress_pct":40,"status":"pending"}],"page":1,"per_page":20,"sort":"created_at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/AffCommission"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field as requested (the default when omitted).","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Affiliate is not offered on this site (reseller sites). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Affiliate is not offered on this site (reseller sites)."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"aff_not_joined","message":"You have not joined the programme yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"You have not joined the programme yet. (`aff_not_joined`)","x-error-codes":[{"code":"aff_not_joined","description":"You have not joined the programme yet."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["aff:read"]}],"summary":"Commissions (paged)","tags":["Affiliate"],"x-cli":"aff commission list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/aff/commissions\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"aff:read","x-summary-vi":"Hoa hồng (phân trang)"}},"/v1/aff/events":{"get":{"description":"Lists the ledger of your affiliate account, newest first: every maturing, payment, clawback, expiry or manual adjustment of a commission. The ledger is append-only.\n\n**Required scope:** `aff:read`.","operationId":"aff_event_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"amount_cents":500,"at":1766044800,"commission_id":311,"id":90,"kind":"mature","payout_id":null,"reason_code":null}],"page":1,"per_page":20,"sort":"id","total":1},"schema":{"properties":{"dir":{"description":"Echo of the `dir` query parameter (`desc` when omitted). This list is always ordered newest first.","enum":["asc","desc"],"type":"string"},"items":{"items":{"properties":{"amount_cents":{"description":"Signed change of your balance in US cents (0 for status changes).","type":"integer"},"at":{"description":"When it happened. (Unix time, seconds, UTC)","type":"integer"},"commission_id":{"description":"Commission the event relates to.","type":["integer","null"]},"id":{"description":"Event number.","type":"integer"},"kind":{"description":"What happened.","enum":["mature","claw","pay","expire","adjust","reverse","status"],"type":"string"},"payout_id":{"description":"Payout the event relates to.","type":["integer","null"]},"reason_code":{"description":"Machine-readable reason, when there is one.","type":["string","null"]}},"required":["id","kind","amount_cents","reason_code","commission_id","payout_id","at"],"type":"object","x-order":["id","kind","amount_cents","reason_code","commission_id","payout_id","at"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Echo of the `sort` query parameter (`id` when omitted). This list is always ordered newest first.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Affiliate is not offered on this site (reseller sites). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Affiliate is not offered on this site (reseller sites)."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"aff_not_joined","message":"You have not joined the programme yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"You have not joined the programme yet. (`aff_not_joined`)","x-error-codes":[{"code":"aff_not_joined","description":"You have not joined the programme yet."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["aff:read"]}],"summary":"Affiliate ledger events (paged)","tags":["Affiliate"],"x-cli":"aff event list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/aff/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"aff:read","x-summary-vi":"Sổ cái affiliate (phân trang)"}},"/v1/aff/payouts":{"get":{"description":"Lists your payout history: conversions of commission into wallet credit and cash payout requests, newest first. Creating or cancelling a payout is only possible in the web console.\n\n**Required scope:** `aff:read`.","operationId":"aff_payout_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"admin_note":null,"amount_cents":500,"created_at":1766130000,"id":12,"method":"wallet","paid_at":1766130000,"paid_ref":null,"status":"paid"}],"page":1,"per_page":20,"sort":"id","total":1},"schema":{"properties":{"dir":{"description":"Echo of the `dir` query parameter (`desc` when omitted). This list is always ordered newest first.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/AffPayout"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Echo of the `sort` query parameter (`id` when omitted). This list is always ordered newest first.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Affiliate is not offered on this site (reseller sites). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Affiliate is not offered on this site (reseller sites)."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"aff_not_joined","message":"You have not joined the programme yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"You have not joined the programme yet. (`aff_not_joined`)","x-error-codes":[{"code":"aff_not_joined","description":"You have not joined the programme yet."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["aff:read"]}],"summary":"Payout history (paged)","tags":["Affiliate"],"x-cli":"aff payout list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/aff/payouts\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"aff:read","x-summary-vi":"Lịch sử rút / quy đổi hoa hồng (phân trang)"}},"/v1/aff/referrals":{"get":{"description":"Lists the customers who registered through your link. Customers are anonymous: you only see a stable label such as `#a3f1`, never a name or e-mail address. Requires that you joined the programme.\n\n**Required scope:** `aff:read`.","operationId":"aff_referral_list","parameters":[{"description":"Return only referrals in this state.","in":"query","name":"status","required":false,"schema":{"enum":["active","void"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","deposits","commission"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"at":1759000000,"commission_cents":500,"deposits_cents":5000,"first_topup_at":1759100000,"last_state":"pending","ref_label":"#a3f1","status":"active"}],"page":1,"per_page":20,"sort":"at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"properties":{"at":{"description":"When the customer registered. (Unix time, seconds, UTC)","type":"integer"},"commission_cents":{"description":"Commission earned from this customer, in US cents.","type":"integer"},"deposits_cents":{"description":"Total top-ups of this customer that earn commission, in US cents.","type":"integer"},"first_topup_at":{"description":"When the customer first topped up, or null. (Unix time, seconds, UTC)","type":["integer","null"]},"last_state":{"description":"Status of the latest commission from this customer.","type":["string","null"]},"ref_label":{"description":"Anonymous label of the referred customer.","type":"string"},"status":{"description":"`void` when the referral was cancelled.","enum":["active","void"],"type":"string"}},"required":["ref_label","at","status","first_topup_at","deposits_cents","commission_cents","last_state"],"type":"object","x-order":["ref_label","at","status","first_topup_at","deposits_cents","commission_cents","last_state"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field as requested (the default when omitted).","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Affiliate is not offered on this site (reseller sites). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Affiliate is not offered on this site (reseller sites)."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"aff_not_joined","message":"You have not joined the programme yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"You have not joined the programme yet. (`aff_not_joined`)","x-error-codes":[{"code":"aff_not_joined","description":"You have not joined the programme yet."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["aff:read"]}],"summary":"Referred users (anonymised, paged)","tags":["Affiliate"],"x-cli":"aff referral list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/aff/referrals\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"aff:read","x-summary-vi":"Người được giới thiệu (ẩn danh, phân trang)"}},"/v1/apikeys":{"get":{"description":"Lists all API keys of your account, newest first, including expired and revoked ones. The list is not paged. The secret key and its hash are never returned, and `hint` shows only the first characters (7 when listed through an API key) so you can tell the keys apart. Creating, editing and revoking keys is only possible from the dashboard; a key cannot manage other keys.\n\n**Required scope:** `apikey:read`.","operationId":"apikey_list","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"keys":[{"allow_ips":[],"created_at":1790000000,"expires_at":null,"hint":"vk_Ab3x","id":"ak3f9c2d1e7a","last_ip":"198.51.100.7","last_used_at":1792290000,"name":"ci-deploy","req_count":128,"revoked_at":null,"scopes":["vm:read","vm:write"],"status":"active"}]},"schema":{"properties":{"enabled":{"description":"Whether API access is switched on for the site. When false every key is rejected.","type":"boolean"},"keys":{"items":{"$ref":"#/components/schemas/AccountApiKey"},"type":"array"}},"required":["keys","enabled"],"type":"object","x-order":["keys","enabled"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["apikey:read"]}],"summary":"List the account's API keys (never the raw key)","tags":["Account"],"x-cli":"apikey list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/apikeys\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"apikey:read","x-summary-vi":"Danh sách khoá API của tài khoản (không có khoá thô)"}},"/v1/apikeys/log":{"get":{"description":"Returns the usage log of all API keys of your account, newest first by default. Only calls that change something (any method except GET) and every failed call (HTTP status 400 and above) are logged; successful reads are not. The path is logged without its query string. Entries are kept for 60 days.\n\n**Required scope:** `apikey:read`.","operationId":"apikey_log","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":200,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","status","method"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"account_id":1042,"at":1792290000,"id":9021,"ip":"198.51.100.7","key_id":"ak3f9c2d1e7a","method":"POST","path":"/v1/vm/3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10/start","reseller_id":0,"status":200}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"properties":{"account_id":{"description":"Your account identifier.","type":"integer"},"at":{"description":"When the call was made (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Log entry identifier.","type":"integer"},"ip":{"description":"IP address the call came from.","type":"string"},"key_id":{"description":"Identifier of the key that made the call (`id` in the key list).","type":"string"},"method":{"description":"HTTP method.","type":"string"},"path":{"description":"Request path, without the query string.","type":"string"},"reseller_id":{"description":"Identifier of the site the key belongs to; 0 for the main site.","type":"integer"},"status":{"description":"HTTP status returned.","type":"integer"}},"required":["id","key_id","account_id","reseller_id","at","method","path","status","ip"],"type":"object","x-order":["id","key_id","account_id","reseller_id","at","method","path","status","ip"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["apikey:read"]}],"summary":"API key usage log of the account (paged)","tags":["Account"],"x-cli":"apikey log","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/apikeys/log\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"apikey:read","x-summary-vi":"Nhật ký dùng khoá API của tài khoản (phân trang)"}},"/v1/apikeys/self":{"get":{"description":"Returns information about the API key making the call: its permissions, expiry, allowed IP addresses, usage, and how many requests it may still make in the current minute. Every key can call this operation whatever its scopes, which makes it the way to check that a key works and what it may do. It does not reveal any other key. It can only be called with an API key.\n\n**Required scope:** `apikey:self`.","operationId":"apikey_self","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"account_id":1042,"key":{"allow_ips":[],"created_at":1790000000,"expires_at":null,"hint":"vk_Ab3x","id":"ak3f9c2d1e7a","last_ip":"198.51.100.7","last_used_at":1792290000,"name":"ci-deploy","req_count":129,"revoked_at":null,"scopes":["vm:read","vm:write"],"status":"active"},"rate_limit":{"account_remaining":299,"account_reset":1792290060,"key_remaining":119,"key_reset":1792290060,"per_account_per_minute":300,"per_key_per_minute":120},"site":{"brand":"Example Cloud","url":"https://api.example.com"}},"schema":{"properties":{"account_id":{"description":"Account the key belongs to.","type":"integer"},"key":{"$ref":"#/components/schemas/AccountApiKey"},"rate_limit":{"properties":{"account_remaining":{"description":"Requests the account may still make in the current window.","type":"integer"},"account_reset":{"description":"When the account's window resets (Unix time, seconds, UTC)","type":"integer"},"key_remaining":{"description":"Requests this key may still make in the current window.","type":"integer"},"key_reset":{"description":"When the key's window resets (Unix time, seconds, UTC)","type":"integer"},"per_account_per_minute":{"description":"Requests per minute allowed for the whole account across its keys.","type":"integer"},"per_key_per_minute":{"description":"Requests per minute allowed for each key.","type":"integer"}},"required":["per_key_per_minute","per_account_per_minute","key_remaining","account_remaining","key_reset","account_reset"],"type":"object","x-order":["per_key_per_minute","per_account_per_minute","key_remaining","account_remaining","key_reset","account_reset"]},"site":{"properties":{"brand":{"description":"Name of the site.","type":"string"},"url":{"description":"Base address of the API for this site.","type":"string"}},"required":["brand","url"],"type":"object"}},"required":["key","account_id","site","rate_limit"],"type":"object","x-order":["key","account_id","site","rate_limit"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The call was made with a dashboard session instead of an API key. (`key_required`)","x-error-codes":[{"code":"key_required","description":"The call was made with a dashboard session instead of an API key."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["apikey:self"]}],"summary":"The calling key itself: scopes, expiry, allowed IPs, rate limits","tags":["Account"],"x-cli":"apikey self","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/apikeys/self\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"apikey:self","x-summary-vi":"Thông tin của chính khoá đang gọi: phạm vi, hạn, IP, hãm"}},"/v1/autoscale":{"get":{"description":"Lists the Auto Scaling configuration of all servers of your account in one call. A server is listed when its rule is enabled, when a target size was saved for it, or when it currently is not in the `base` state. Deleted servers are not listed. Read-only; use [Set Auto Scaling](#operation/vm_autoscale_set) to change a rule.\n\n**Required scope:** `vm:read`.","operationId":"autoscale_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page, at most 100. Larger values are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by: server name, rule switch, state, current vCPUs, target vCPUs or last update. Unknown values fall back to `updated_at`.","in":"query","name":"sort","required":false,"schema":{"default":"updated_at","enum":["name","enabled","state","current","target","updated_at"],"type":"string"}},{"description":"Sort direction. Anything other than `asc` means `desc`.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"base":{"cpu":2,"ram_mb":4096},"cooling_since":null,"cs_state":"Running","current":{"cpu":4,"ram_mb":8192},"cycle":"hourly","display_name":"Web frontend","enabled":true,"hostname":"web-1","last_error":null,"last_error_at":null,"last_event":{"at":1790000400,"kind":"up","source":"autoscale","to_cpu":4,"to_ram_mb":8192},"pending_revert":true,"rule":{"down_pct":30,"down_secs":900,"up_pct":80,"up_secs":300},"scaled_at":1790000400,"state":"scaled","target":{"cpu":4,"ram_mb":8192},"updated_at":1790000400,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_state":"active"}],"page":1,"per_page":25,"sort":"updated_at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/AutoscaleListItem"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Auto Scaling of all VMs in the account (paged)","tags":["Scaling"],"x-cli":"autoscale list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/autoscale\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Auto Scaling của mọi máy trong tài khoản (phân trang)"}},"/v1/backup-schedules":{"get":{"description":"Lists the servers that have Backup switched on, with the automatic schedule (if one is set) and the number of backups kept. A server with Backup on but no schedule has `has_schedule` false and null schedule fields. Servers without Backup are not listed. Use [Get the backup status of a VM](#operation/vm_backup_get) for one server.\n\n**Required scope:** `backup:read`.","operationId":"backup_schedule_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","vm","interval_type","max_backups","last_backup_at","backups"],"type":"string"}},{"description":"Sort direction. `order` is accepted as an alias.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Only return this server (UUID).","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"backups":1,"cs_state":"Running","day":null,"enabled":true,"has_schedule":true,"hostname":"web-1","hour":2,"interval_type":"DAILY","last_backup_at":1792263600,"max_backups":5,"minute":0,"schedule":"0:2","timezone":"Asia/Ho_Chi_Minh","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1","vm_state":"active"}],"meta":{"last_page":1,"max_per_vm":10,"page":1,"per_page":20,"total":1},"page":1,"per_page":20,"sort":"created_at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/BackupScheduleListItem"},"type":"array"},"meta":{"properties":{"last_page":{"description":"Number of the last page.","type":"integer"},"max_per_vm":{"description":"Maximum number of backups the site allows per server.","type":"integer"},"page":{"description":"Same as the top-level `page`.","type":"integer"},"per_page":{"description":"Same as the top-level `per_page`.","type":"integer"},"total":{"description":"Same as the top-level `total`.","type":"integer"}},"required":["total","page","per_page","last_page","max_per_vm"],"type":"object","x-order":["total","page","per_page","last_page","max_per_vm"]},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir","meta"],"type":"object","x-order":["items","total","page","per_page","sort","dir","meta"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:read"]}],"summary":"VMs with backup enabled and their schedule (paged)","tags":["Backups"],"x-cli":"backup schedule list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/backup-schedules\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"backup:read","x-summary-vi":"Máy đã bật sao lưu kèm lịch (phân trang)"}},"/v1/backups":{"get":{"description":"Lists the backups of all your servers in one paged list. Each item includes the server it belongs to. Backups that were deleted are not shown. Use `vm_id` to narrow the list to one server, or [List the backups of a VM](#operation/vm_backup_list) for the per-server variant.\n\nThe list is limited to your own servers; a `vm_id` that is not yours simply returns an empty list.\n\n**Required scope:** `backup:read`.","operationId":"backup_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","name","size_bytes","status","interval_type","vm"],"type":"string"}},{"description":"Sort direction. `order` is accepted as an alias.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Only return backups of this server (UUID).","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"auto":false,"billable":true,"created_at":1792263600,"error_code":null,"free":false,"hostname":"web-1","id":41,"interval_type":"DAILY","last_error":null,"name":"web-1-20261018-0200","paid_cents":3,"pinned":true,"rate_uusd":76,"size_bytes":2147483648,"size_gb":2.0,"status":"BackedUp","type":"FULL","uusd_per_hour":152,"virtual_size_bytes":26843545600,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1"}],"meta":{"last_page":1,"max_per_vm":10,"page":1,"per_page":20,"total":1},"page":1,"per_page":20,"sort":"created_at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/BackupListItem"},"type":"array"},"meta":{"properties":{"last_page":{"description":"Number of the last page.","type":"integer"},"max_per_vm":{"description":"Maximum number of backups the site allows per server.","type":"integer"},"page":{"description":"Same as the top-level `page`.","type":"integer"},"per_page":{"description":"Same as the top-level `per_page`.","type":"integer"},"total":{"description":"Same as the top-level `total`.","type":"integer"}},"required":["total","page","per_page","last_page","max_per_vm"],"type":"object","x-order":["total","page","per_page","last_page","max_per_vm"]},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir","meta"],"type":"object","x-order":["items","total","page","per_page","sort","dir","meta"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:read"]}],"summary":"Backups of all VMs in the account (paged)","tags":["Backups"],"x-cli":"backup list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/backups\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"backup:read","x-summary-vi":"Bản sao lưu của mọi máy trong tài khoản (phân trang)"}},"/v1/bandwidth/addons":{"get":{"description":"Lists the Add-ons you bought or were granted, for all services and all periods, newest first. Each entry shows the service it belongs to, the period it was valid for, the terabytes added and the amount charged. It is a purchase history: to see what is in force now, read `addons` in Get bandwidth of a service.\n\n**Required scope:** `billing:read`.","operationId":"bandwidth_addons","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":200,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"account_id":1042,"amount_cents":768,"created_at":1791500000,"id":18,"invoice_id":9021,"kind":"vm","period_end":1792972800,"period_start":1790380800,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","status":"active","tb":2},{"account_id":1042,"amount_cents":384,"created_at":1791500000,"id":17,"invoice_id":9021,"kind":"vm","period_end":1792972800,"period_start":1790380800,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","status":"active","tb":1}],"page":1,"per_page":20,"total":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BandwidthAddon"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Bandwidth Add-on purchase history","tags":["Bandwidth"],"x-cli":"bandwidth addons","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/bandwidth/addons\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Lịch sử mua Bandwidth Add-on"}},"/v1/bandwidth/objects":{"get":{"description":"Lists every service of your account that has a bandwidth quota (servers, container clusters, your object storage and VPN plans) with its usage in the current billing period. The list is filtered, sorted and paged on the server. `totals` always covers all your services, whatever the filters, so it can be shown next to a filtered list. Use the `kind` and `ref` of an item to call the per-service endpoints.\n\n**Required scope:** `billing:read`.","operationId":"bandwidth_list","parameters":[{"description":"Return only services of this kind. Unknown values are ignored.","example":"vm","in":"query","name":"kind","required":false,"schema":{"enum":["vm","k8s","s3","vpn"],"type":"string"}},{"description":"Case-insensitive text to look for in the service name, its secondary label (for example the public IP address) and its `ref`.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Sort key: `used` bytes used, `pct` percentage of the limit used (services without a limit sort last), `remaining` bytes left (services without a limit sort first), `name`, `reset` end of the current period, `kind`. Unknown values behave like `used`.","in":"query","name":"sort","required":false,"schema":{"default":"used","enum":["used","pct","remaining","name","reset","kind"],"type":"string"}},{"description":"Sort direction. Defaults to `desc`, except `asc` for `sort=name` and `sort=reset`. `dir` is accepted as an alias.","in":"query","name":"order","required":false,"schema":{"enum":["asc","desc"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":200,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"account_id":1042,"addon_bytes":1099511627776,"addon_tb":1,"buy_block":null,"can_buy":true,"count":"edge","kind":"vm","limit_bytes":3298534883328,"metered_frac":1.0,"name":"web-1","pct":12.5,"period":{"end":1792972800,"kind":"anchored_month","start":1790380800},"quota_bytes":2199023255552,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","remaining_bytes":2886218022912,"state":"active","sub":"203.0.113.10","total":{"in":96636764160,"out":315680096256,"total":412316860416},"unmetered":null,"used_bytes":412316860416,"workers_avg":null},{"account_id":1042,"addon_bytes":0,"addon_tb":0,"buy_block":null,"can_buy":true,"count":"download","kind":"s3","limit_bytes":107374182400,"metered_frac":1.0,"name":"Object Storage","pct":20.0,"period":{"end":1793466000,"kind":"calendar_month","start":1790787600},"quota_bytes":107374182400,"ref":"1042","remaining_bytes":85899345920,"state":"active","sub":"1 S3 account(s)","total":{"in":5368709120,"out":21474836480,"total":26843545600},"unmetered":null,"used_bytes":21474836480,"workers_avg":null}],"page":1,"per_page":20,"total":2,"totals":{"addon_bytes":1099511627776,"counts":{"s3":1,"vm":1},"limit_bytes":3405909065728,"objects":2,"over":0,"remaining_bytes":2972117368832,"used_bytes":433791696896,"warn":0}},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BandwidthObject"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"},"totals":{"$ref":"#/components/schemas/BandwidthTotals"}},"required":["items","total","page","per_page","totals"],"type":"object","x-order":["items","total","page","per_page","totals"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Bandwidth per service (paged, sortable)","tags":["Bandwidth"],"x-cli":"bandwidth list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/bandwidth/objects\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Bandwidth từng dịch vụ (phân trang, sắp xếp)"}},"/v1/bandwidth/objects/{kind}/{ref}":{"get":{"description":"Returns the bandwidth of one service: quota, Add-ons of the current period, usage, the Add-on price and the policy that applies when the quota is used up. Pass `series` to get the traffic chart data in the same call instead of calling Get the traffic series. `kind` and `ref` come from List bandwidth objects. A service that does not exist, is not active or belongs to another account answers 404.\n\n**Required scope:** `billing:read`.","operationId":"bandwidth_get","parameters":[{"description":"Kind of service the bandwidth belongs to: `vm` (server), `k8s` (container cluster), `s3` (object storage) or `vpn` (VPN plan). Taken from the `kind` field of List bandwidth objects.","in":"path","name":"kind","required":true,"schema":{"type":"string"}},{"description":"Identifier of the service within its kind: the server UUID for `vm`, the cluster UUID for `k8s`, a numeric identifier for `s3` (one per account) and the plan number for `vpn`. Taken from the `ref` field of List bandwidth objects.","in":"path","name":"ref","required":true,"schema":{"type":"string"}},{"description":"Also return the traffic series for this range in the `series` field. `24h` gives hourly points, the others daily points.","example":"7d","in":"query","name":"series","required":false,"schema":{"enum":["24h","7d","30d","period"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"account_id":1042,"addon_bytes":1099511627776,"addon_tb":1,"addons":[{"account_id":1042,"amount_cents":384,"created_at":1791500000,"id":17,"invoice_id":9021,"kind":"vm","period_end":1792972800,"period_start":1790380800,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","status":"active","tb":1}],"buy_block":null,"can_buy":true,"count":"edge","count_mode":"both","kind":"vm","limit_bytes":3298534883328,"metered_frac":1.0,"name":"web-1","pct":12.5,"period":{"end":1792972800,"kind":"anchored_month","start":1790380800},"policy":"suspend","price":{"max_tb":50,"tb_cents":384},"quota_bytes":2199023255552,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","remaining_bytes":2886218022912,"series":{"bucket":86400,"from":1791392400,"points":[{"in":6442450944,"out":21474836480,"t":1791392400,"total":27917287424},{"in":8589934592,"out":32212254720,"t":1791478800,"total":40802189312},{"in":5368709120,"out":18253611008,"t":1791565200,"total":23622320128}],"range":"7d","to":1792000000},"state":"active","sub":"203.0.113.10","suspend_active":true,"total":{"in":96636764160,"out":315680096256,"total":412316860416},"unmetered":null,"used_bytes":412316860416,"workers_avg":null},"schema":{"$ref":"#/components/schemas/BandwidthObjectDetail"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Bandwidth of one service","tags":["Bandwidth"],"x-cli":"bandwidth get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/bandwidth/objects/<kind>/<ref>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Bandwidth của 1 dịch vụ (quota, Add-on, đã dùng)"}},"/v1/bandwidth/objects/{kind}/{ref}/addons":{"post":{"description":"Buys an Add-on of `tb` terabytes for one service and charges your wallet immediately. The Add-on raises the limit of the current billing period only and expires at `period_end`; it is not refunded and does not carry over. Send `expect_cents` from Quote an Add-on: if the price or the billing period changed since, nothing is charged and the call fails with 409 `bw_price_changed`. A server or cluster that was locked because it used up its quota is unlocked automatically after the purchase. The `Idempotency-Key` for this call must be 8 to 80 characters of letters, digits, `-`, `_` and `:`; repeating a purchase with the same key and body returns the original Add-on (status 200, `replay` true) without charging again, while the same key with a different body fails with 409 `idempotency_key_reused`. Servers whose billing is still handled by another provider cannot buy Add-ons here (409). At most 10 purchases per minute are accepted.\n\n**Required scope:** `bandwidth:buy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"bandwidth_buy","parameters":[{"description":"Kind of service the bandwidth belongs to: `vm` (server), `k8s` (container cluster), `s3` (object storage) or `vpn` (VPN plan). Taken from the `kind` field of List bandwidth objects.","in":"path","name":"kind","required":true,"schema":{"type":"string"}},{"description":"Identifier of the service within its kind: the server UUID for `vm`, the cluster UUID for `k8s`, a numeric identifier for `s3` (one per account) and the plan number for `vpn`. Taken from the `ref` field of List bandwidth objects.","in":"path","name":"ref","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"expect_cents":768,"tb":2},"schema":{"properties":{"expect_cents":{"description":"The total price you expect to pay in US cents, taken from `amount_cents` of Quote an Add-on. Required: without it, or if it differs from the current price, the purchase is refused with 409 `bw_price_changed`.","type":"integer"},"tb":{"description":"Number of terabytes to add (1 TB = 2^40 bytes). An integer from 1 up to the site maximum (`price.max_tb` in Get bandwidth of a service, 50 by default).","minimum":1,"type":"integer"}},"required":["tb","expect_cents"],"type":"object","x-order":["tb","expect_cents"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"addon":{"account_id":1042,"amount_cents":768,"created_at":1791500000,"id":18,"invoice_id":9021,"kind":"vm","period_end":1792972800,"period_start":1790380800,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","status":"active","tb":2},"balance_cents":1732,"bandwidth":{"account_id":1042,"addon_bytes":2199023255552,"addon_tb":2,"buy_block":null,"can_buy":true,"count":"edge","kind":"vm","limit_bytes":4398046511104,"metered_frac":1.0,"name":"web-1","pct":9.4,"period":{"end":1792972800,"kind":"anchored_month","start":1790380800},"quota_bytes":2199023255552,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","remaining_bytes":3985729650688,"state":"active","sub":"203.0.113.10","total":{"in":96636764160,"out":315680096256,"total":412316860416},"unmetered":null,"used_bytes":412316860416,"workers_avg":null}},"schema":{"properties":{"addon":{"$ref":"#/components/schemas/BandwidthAddon"},"balance_cents":{"description":"Your wallet balance in US cents after the purchase.","type":"integer"},"bandwidth":{"anyOf":[{"$ref":"#/components/schemas/BandwidthObject"},{"type":"null"}]},"replay":{"description":"True when this is the answer to a repeated request (the response status is then 200 and `bandwidth` is absent).","type":"boolean"}},"required":["addon","balance_cents"],"type":"object","x-order":["addon","bandwidth","balance_cents","replay"]}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_invalid","message":"The `Idempotency-Key` is not 8 to 80 characters of letters, digits, `-`, `_` and `:`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`idempotency_key_invalid`: The `Idempotency-Key` is not 8 to 80 characters of letters, digits, `-`, `_` and `:`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"idempotency_key_invalid","description":"The `Idempotency-Key` is not 8 to 80 characters of letters, digits, `-`, `_` and `:`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"Your wallet balance is lower than the price. The error also carries `need_cents` and `balance_cents`; top up and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your wallet balance is lower than the price. The error also carries `need_cents` and `balance_cents`; top up and retry. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"Your wallet balance is lower than the price. The error also carries `need_cents` and `balance_cents`; top up and retry."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"bw_price_changed","message":"The price changed, or the service moved to a new billing period or changed state, since your quote. The error carries the current `amount_cents`; quote again and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bw_price_changed`: The price changed, or the service moved to a new billing period or changed state, since your quote. The error carries the current `amount_cents`; quote again and retry. `idempotency_key_reused`: This `Idempotency-Key` was already used with a different `tb` or `expect_cents`. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"bw_price_changed","description":"The price changed, or the service moved to a new billing period or changed state, since your quote. The error carries the current `amount_cents`; quote again and retry."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used with a different `tb` or `expect_cents`."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bw_bad_tb","message":"`tb` is not an integer between 1 and the site maximum."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bw_bad_tb`: `tb` is not an integer between 1 and the site maximum. `bw_addon_not_supported`: VPN plans cannot buy Add-ons; raise their bandwidth from the VPN plan itself. `bw_unmetered`: The service is unmetered, so there is no quota to extend. `bw_not_active`: The service is not in a state that allows Add-ons (for example it is still being created, or it is locked for a reason other than its quota). `fx_unavailable`: The price cannot be computed right now. Retry later. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"bw_bad_tb","description":"`tb` is not an integer between 1 and the site maximum."},{"code":"bw_addon_not_supported","description":"VPN plans cannot buy Add-ons; raise their bandwidth from the VPN plan itself."},{"code":"bw_unmetered","description":"The service is unmetered, so there is no quota to extend."},{"code":"bw_not_active","description":"The service is not in a state that allows Add-ons (for example it is still being created, or it is locked for a reason other than its quota)."},{"code":"fx_unavailable","description":"The price cannot be computed right now. Retry later."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"site_unavailable","message":"The site is temporarily not accepting new purchases."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site is temporarily not accepting new purchases. (`site_unavailable`)","x-error-codes":[{"code":"site_unavailable","description":"The site is temporarily not accepting new purchases."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"provider_unavailable","message":"The provider of this site cannot accept new purchases right now. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The provider of this site cannot accept new purchases right now. Retry later. (`provider_unavailable`)","x-error-codes":[{"code":"provider_unavailable","description":"The provider of this site cannot accept new purchases right now. Retry later."}]}},"security":[{"bearerAuth":["bandwidth:buy"]}],"summary":"Buy a Bandwidth Add-on (charges the wallet)","tags":["Bandwidth"],"x-cli":"bandwidth buy","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/bandwidth/objects/<kind>/<ref>/addons\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"expect_cents\":768,\"tb\":2}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"bandwidth:buy","x-summary-vi":"Mua Bandwidth Add-on (trừ tiền ví)"}},"/v1/bandwidth/objects/{kind}/{ref}/quote":{"get":{"description":"Prices an Add-on of `tb` terabytes for one service without buying anything. The Add-on is valid for the current billing period only (`period_end`) and the price is flat per terabyte. Take `amount_cents` from the response and send it as `expect_cents` when you buy, so a price change between the two calls cannot surprise you. Quotes are refused for services that cannot buy Add-ons: VPN plans, unmetered services and services that are not active.\n\n**Required scope:** `billing:read`.","operationId":"bandwidth_quote","parameters":[{"description":"Kind of service the bandwidth belongs to: `vm` (server), `k8s` (container cluster), `s3` (object storage) or `vpn` (VPN plan). Taken from the `kind` field of List bandwidth objects.","in":"path","name":"kind","required":true,"schema":{"type":"string"}},{"description":"Identifier of the service within its kind: the server UUID for `vm`, the cluster UUID for `k8s`, a numeric identifier for `s3` (one per account) and the plan number for `vpn`. Taken from the `ref` field of List bandwidth objects.","in":"path","name":"ref","required":true,"schema":{"type":"string"}},{"description":"Number of terabytes to price, from 1 up to the site maximum (`price.max_tb`). Defaults to 1; a value that is not an integer is replaced by 1.","example":2,"in":"query","name":"tb","required":false,"schema":{"default":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"amount_cents":768,"amount_vnd":199680,"balance_cents":2500,"limit_after_bytes":4398046511104,"period_end":1792972800,"period_start":1790380800,"remaining_after_bytes":3985729650688,"tb":2,"unit_cents":384},"schema":{"$ref":"#/components/schemas/BandwidthQuote"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bw_bad_tb","message":"`tb` is below 1 or above the site maximum (`price.max_tb`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bw_bad_tb`: `tb` is below 1 or above the site maximum (`price.max_tb`). `bw_addon_not_supported`: VPN plans cannot buy Add-ons; raise their bandwidth from the VPN plan itself. `bw_unmetered`: The service is unmetered, so there is no quota to extend. `bw_not_active`: The service is not in a state that allows Add-ons (for example it is still being created, or it is locked for a reason other than its quota). `fx_unavailable`: The price cannot be computed right now. Retry later.","x-error-codes":[{"code":"bw_bad_tb","description":"`tb` is below 1 or above the site maximum (`price.max_tb`)."},{"code":"bw_addon_not_supported","description":"VPN plans cannot buy Add-ons; raise their bandwidth from the VPN plan itself."},{"code":"bw_unmetered","description":"The service is unmetered, so there is no quota to extend."},{"code":"bw_not_active","description":"The service is not in a state that allows Add-ons (for example it is still being created, or it is locked for a reason other than its quota)."},{"code":"fx_unavailable","description":"The price cannot be computed right now. Retry later."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Quote a Bandwidth Add-on","tags":["Bandwidth"],"x-cli":"bandwidth quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/bandwidth/objects/<kind>/<ref>/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Báo giá Bandwidth Add-on"}},"/v1/bandwidth/objects/{kind}/{ref}/series":{"get":{"description":"Returns the traffic of one service over time, ready for a chart. `24h` gives hourly points for the last 24 hours; `7d` and `30d` give daily points (days start at midnight UTC+7); `period` (the default) gives daily points from the start of the current billing period. Server and cluster traffic is measured at the network edge, object storage reports uploads (`in`) and downloads (`out`), and VPN plans have no series (`points` is empty). Buckets without traffic are not returned.\n\n**Required scope:** `billing:read`.","operationId":"bandwidth_series","parameters":[{"description":"Kind of service the bandwidth belongs to: `vm` (server), `k8s` (container cluster), `s3` (object storage) or `vpn` (VPN plan). Taken from the `kind` field of List bandwidth objects.","in":"path","name":"kind","required":true,"schema":{"type":"string"}},{"description":"Identifier of the service within its kind: the server UUID for `vm`, the cluster UUID for `k8s`, a numeric identifier for `s3` (one per account) and the plan number for `vpn`. Taken from the `ref` field of List bandwidth objects.","in":"path","name":"ref","required":true,"schema":{"type":"string"}},{"description":"Window to return. Unrecognised values behave like `period`.","example":"7d","in":"query","name":"range","required":false,"schema":{"default":"period","enum":["24h","7d","30d","period"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"bucket":86400,"from":1791392400,"points":[{"in":6442450944,"out":21474836480,"t":1791392400,"total":27917287424},{"in":8589934592,"out":32212254720,"t":1791478800,"total":40802189312},{"in":5368709120,"out":18253611008,"t":1791565200,"total":23622320128}],"range":"7d","to":1792000000},"schema":{"$ref":"#/components/schemas/BandwidthSeries"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"`kind` is not one of `vm`, `k8s`, `s3`, `vpn`, or the service does not exist, is not active or belongs to another account."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Hourly/daily traffic of one service","tags":["Bandwidth"],"x-cli":"bandwidth series","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/bandwidth/objects/<kind>/<ref>/series\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Lưu lượng theo giờ/ngày của 1 dịch vụ"}},"/v1/bandwidth/summary":{"get":{"description":"Returns the traffic totals of all your services for their current billing periods, together with the Add-on price and the policy applied when a service runs out of quota. Use it for a dashboard header; call List bandwidth objects for the breakdown per service. `limit_bytes` only adds up services that have a limit, while unmetered or unlimited services still contribute to `used_bytes`. The call is free and always reflects the current period of each service.\n\n**Required scope:** `billing:read`.","operationId":"bandwidth_summary","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"count_mode":"both","now":1792000000,"policy":"suspend","price":{"max_tb":50,"tb_cents":384},"totals":{"addon_bytes":1099511627776,"counts":{"s3":1,"vm":1},"limit_bytes":3405909065728,"objects":2,"over":0,"remaining_bytes":2972117368832,"used_bytes":433791696896,"warn":0}},"schema":{"properties":{"count_mode":{"description":"Which direction counts for servers and clusters: `both` counts inbound plus outbound traffic, `out` counts outbound traffic only.","enum":["both","out"],"type":"string"},"now":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"policy":{"description":"What the site does to a service that has used its whole quota. With `suspend`, servers and clusters are locked (and object-storage access is paused) until you buy an Add-on or the next period starts; with any other value the service keeps running and you are only notified at 80% and 100% of the quota.","enum":["notify","throttle","suspend"],"type":"string"},"price":{"$ref":"#/components/schemas/BandwidthPrice"},"totals":{"$ref":"#/components/schemas/BandwidthTotals"}},"required":["totals","price","policy","count_mode","now"],"type":"object","x-order":["totals","price","policy","count_mode","now"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth reporting and Add-ons are switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth reporting and Add-ons are switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth reporting and Add-ons are switched off on this site."}]}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Bandwidth totals across services","tags":["Bandwidth"],"x-cli":"bandwidth summary","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/bandwidth/summary\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Tổng Bandwidth đã dùng / quota của mọi dịch vụ"}},"/v1/billing/invoices":{"get":{"description":"Lists your invoices: receipts for purchases, renewals, top-ups, refunds and manual invoices. The list also includes invoices issued to the previous owner of a server that was transferred to you; those are marked `previous_owner` and have their buyer details hidden. Use [Get an invoice](#operation/billing_invoice_get) for the line items.\n\n**Required scope:** `billing:read`.","operationId":"billing_invoice_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Invoices per page. Values above 100 are clamped to 100.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only invoices with this status.","in":"query","name":"status","required":false,"schema":{"enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["created_at","number","kind","status","due_at","paid_at","total_cents","vm_id","id"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"account_id":1042,"balance_after":750,"buyer_json":"{\"account_id\":1042,\"email\":\"user@example.com\",\"name\":\"Example User\"}","created_at":1792390000,"currency":"usd","due_at":null,"id":311,"kind":"receipt","ledger_ref":"vm:new:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","note":null,"number":"EX202610-000311","paid_at":1792390000,"seller_json":"{\"name\":\"Example Cloud\",\"address\":\"\",\"tax_id\":\"\",\"email\":\"billing@example.com\"}","status":"paid","subtotal_cents":250,"total_cents":250,"updated_at":1792390000,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"page":1,"per_page":25,"sort":"id","total":1},"schema":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/Invoice"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"The `sort` value you sent, or `id` when you sent none.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"List invoices","tags":["Billing"],"x-cli":"billing invoice list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/invoices\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Danh sách hoá đơn"}},"/v1/billing/invoices/{id}":{"get":{"description":"Returns one invoice with its line items and the seller and buyer details parsed into objects. An invoice that belongs to another account answers `404`, except invoices issued to the previous owner of a server that was transferred to you, which are returned with the buyer details hidden and `previous_owner` set to true.\n\n**Required scope:** `billing:read`.","operationId":"billing_invoice_get","parameters":[{"description":"Invoice identifier as returned by List invoices.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"account_id":1042,"buyer":{"account_id":1042,"email":"user@example.com","name":"Example User"},"buyer_json":"{\"account_id\":1042,\"email\":\"user@example.com\",\"name\":\"Example User\"}","created_at":1792390000,"currency":"usd","due_at":null,"fx_usd_vnd":0,"id":311,"items":[{"amount_cents":250,"description":"Server web-1 (1 vCPU, 2 GB RAM, 25 GB disk), first hour","id":411,"invoice_id":311,"period_from":null,"period_to":null,"qty":1.0,"unit_cents":250}],"kind":"receipt","ledger_ref":"vm:new:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","note":null,"number":"EX202610-000311","paid_at":1792390000,"received_vnd":null,"seller":{"address":"","email":"billing@example.com","name":"Example Cloud","tax_id":""},"seller_json":"{\"name\":\"Example Cloud\",\"address\":\"\",\"tax_id\":\"\",\"email\":\"billing@example.com\"}","status":"paid","subtotal_cents":250,"total":"$2.50","total_cents":250,"updated_at":1792390000,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Get one invoice","tags":["Billing"],"x-cli":"billing invoice get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/invoices/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Chi tiết hoá đơn"}},"/v1/billing/invoices/{id}/print":{"get":{"description":"Returns one of your invoices as a self-contained HTML page ready to print or save as PDF from a browser. The page contains the seller, buyer, line items and totals, in your account language. Amounts are shown in US dollars or Vietnamese dong according to `cur`; dong amounts use the exchange rate recorded when the invoice was issued. The response is HTML, not JSON.\n\nAn invoice that does not exist or belongs to another account returns `404 not_found`.\n\n**Required scope:** `billing:read`.","operationId":"billing_invoice_print","parameters":[{"description":"Invoice identifier (integer), as returned by the invoice list.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Currency of the printed amounts. `auto` picks dong for Vietnamese-language accounts and dollars otherwise. When omitted (or any other value) your account's display currency preference is used.","in":"query","name":"cur","required":false,"schema":{"enum":["usd","vnd","auto"],"type":"string"}}],"responses":{"200":{"content":{"text/html":{"schema":{"description":"The invoice as an HTML document.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Printable HTML invoice (?cur=usd|vnd)","tags":["Account"],"x-cli":"billing invoice-print","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/invoices/<id>/print\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Hoá đơn dạng HTML để in (?cur=usd|vnd)"}},"/v1/billing/notifications":{"get":{"description":"Returns your 50 newest notifications, newest first, with a count of unread ones. `unread` counts only the notifications in `items`, so it is at most 50. One-time credential messages are never included. Mark notifications as read with [Mark notifications as read](#operation/notification_read).\n\n**Required scope:** `account:read`.","operationId":"notification_list","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"args":{},"body":"Your wallet balance is below the amount needed for the next 3 days.","created_at":1792290000,"data":{"lang":"en","vars":{"days":3}},"dedupe_key":"low_balance:2026-10-19","id":1201,"key":null,"kind":"low_balance","read_at":null,"title":"Low balance","vm_id":null}],"unread":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountNotification"},"type":"array"},"unread":{"description":"Number of unread notifications among `items`.","type":"integer"}},"required":["items","unread"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"Latest 50 notifications and the unread count","tags":["Account"],"x-cli":"notification list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/notifications\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Thông báo mới nhất (50) và số chưa đọc"}},"/v1/billing/notifications/read":{"post":{"description":"Marks notifications as read. Send `ids` to mark specific notifications, or send an empty body (or an empty `ids`) to mark every unread notification of the account. Identifiers that do not exist, belong to another account or are already read are ignored. `updated` is the number of notifications that actually changed. This is the only call in this group that changes anything.\n\n**Required scope:** `account:write`.","operationId":"notification_read","parameters":[],"requestBody":{"content":{"application/json":{"example":{"ids":[1201]},"schema":{"properties":{"ids":{"description":"Notifications to mark as read. Empty or omitted means all.","items":{"description":"Notification identifier.","type":"integer"},"type":"array"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"updated":1},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"},"updated":{"description":"Number of notifications that were unread and are now read.","type":"integer"}},"required":["ok","updated"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON or `ids` is not a list of integers."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is not valid JSON or `ids` is not a list of integers. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON or `ids` is not a list of integers."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:write"]}],"summary":"Mark notifications as read (empty = all)","tags":["Account"],"x-cli":"notification read","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/billing/notifications/read\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ids\":[1201]}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:write","x-summary-vi":"Đánh dấu thông báo đã đọc (rỗng = tất cả)"}},"/v1/billing/orders":{"get":{"description":"Lists your orders: every invoice that is about a server (purchases, plan and cycle changes, renewals, refunds), newest first by default. Each order carries the first line of its invoice as `description` and a short summary of the server (`vm`, null once the server has been deleted). Top-ups are not orders; see [List payments](#operation/billing_payment_list).\n\n**Required scope:** `billing:read`.","operationId":"billing_order_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Orders per page. Values above 100 are clamped to 100.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only orders with this status.","in":"query","name":"status","required":false,"schema":{"enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"}},{"description":"Only orders of this kind.","in":"query","name":"kind","required":false,"schema":{"enum":["receipt","renewal","topup","manual","refund"],"type":"string"}},{"description":"Search text, matched against the invoice number, the server identifier and the note. At most 80 characters are used.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["id","number","created_at","paid_at","kind","status","total_cents","vm_id"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"created_at":1792390000,"description":"Server web-1 (1 vCPU, 2 GB RAM, 25 GB disk), first hour","id":311,"kind":"receipt","number":"EX202610-000311","paid_at":1792390000,"status":"paid","sub":"new","total_cents":250,"vm":{"cycle":"hourly","display_name":"web-1","hostname":"web-1","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","state":"active"},"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"page":1,"per_page":20,"sort":"id","total":1},"schema":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/BillingOrder"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Order history","tags":["Billing"],"x-cli":"billing order list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/orders\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Lịch sử đơn hàng"}},"/v1/billing/payments":{"get":{"description":"Lists the payments made into your wallet: top-ups (started by you or automatic) and refunds, newest first by default. A payment adds to the wallet only once its status is `completed`; `pending` ones are still waiting for the payment channel. To see what was spent, use [Get the wallet](#operation/billing_wallet) or [List orders](#operation/billing_order_list).\n\n**Required scope:** `billing:read`.","operationId":"billing_payment_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Payments per page. Values above 100 are clamped to 100.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only payments with this status.","in":"query","name":"status","required":false,"schema":{"enum":["pending","completed","failed","refunded","disputed","canceled"],"type":"string"}},{"description":"Only payments handled by this payment channel. Other values are ignored.","in":"query","name":"gateway","required":false,"schema":{"enum":["stripe","paypal","binance"],"type":"string"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["created_at","completed_at","amount_cents","credit_cents","kind","status","id","gateway","method"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"amount_cents":1030,"completed_at":1792380030,"created_at":1792380000,"credit_cents":1000,"expires_at":null,"fee_cents":30,"id":77,"kind":"topup","meta":null,"method":"card","provider":"stripe","ref":"pi_example","status":"completed"}],"page":1,"per_page":20,"sort":"id","total":1},"schema":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/PaymentRecord"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"The `sort` value you sent, or `id` when you sent none.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Payment history","tags":["Billing"],"x-cli":"billing payment list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/payments\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Lịch sử nạp tiền"}},"/v1/billing/summary":{"get":{"description":"Returns an overview of your spending: balance, what has been charged this month, what is overdue, and how fast running hourly servers burn through the wallet. It also carries the site's top-up limits, fee schedule and exchange rate, which the dashboard uses to render the top-up form; they are informational here.\n\n\"This month\" is the calendar month in UTC+7. `accruing_cents` counts wallet charges since its start; `outstanding_cents` adds unpaid invoices and any negative balance. The burn rate only counts hourly servers that are running.\n\n**Required scope:** `billing:read`.","operationId":"billing_summary","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"accruing_cents":250,"balance_cents":750,"burn_mills_per_hour":7,"burn_uusd_per_hour":7000,"cycle":{"charges_cents":250,"from":1790960400,"to":1792400000,"ym":"2026-10"},"expenses_cents":250,"fee":{"fixed_cents":30,"gross_up":false,"pct":2.9},"fees":{"card":{"fixed_cents":30,"gross_up":false,"owner":0,"pct":2.9},"gross_up":false,"sepay":{"fixed_cents":0,"pct":0.0}},"fx":{"margin_bp":0,"round_step":1000,"source":"reference","stale":false,"updated_at":1792380000,"usd_vnd":26000,"vcb_at":1792380000,"vcb_sell":26050},"max_topup_cents":500000,"min_balance_cents":500,"min_topup_cents":1000,"outstanding_cents":0,"paypal_allowed":false,"pending_sepay":[],"pending_topup_cents":0,"promo":{"promos":[],"service_credit_cents":50,"service_credits":[{"expires_at":1793000000,"id":3,"left_cents":50,"name":"VPN launch","services":["vpn"],"total_cents":500}]},"quick_amounts":[1000,2500,5000,10000,20000,40000],"quick_amounts_vnd":[100000,200000,500000,1000000,2000000,5000000],"sepay":{"expire_minutes":120,"max_vnd":200000000,"min_vnd":10000,"round_step":1000},"spending_cents":750,"trial":{"activated_at":null,"amount_cents":10000,"claimable":false,"code":"TRIAL-7K3M-9QXW","days":30,"enabled":true,"expires_at":null,"forfeit_cents":0,"left_cents":0,"min_deposit_cents":1000,"orders":[],"paypal_allowed":false,"services":["vm","vpn4","vpn6"],"status":"pending","used_cents":0},"updated_at":1792400000},"schema":{"properties":{"accruing_cents":{"description":"Wallet charges since the start of the current month, in US cents.","type":"integer"},"balance_cents":{"description":"Wallet balance in US cents; negative when you owe money.","type":"integer"},"burn_mills_per_hour":{"description":"What running hourly servers cost per hour, in thousandths of a US dollar. Rounded down; prefer `burn_uusd_per_hour`.","type":"integer"},"burn_uusd_per_hour":{"description":"What running hourly servers cost per hour, in millionths of a US dollar.","type":"integer"},"cycle":{"properties":{"charges_cents":{"description":"Wallet charges within the period, in US cents.","type":"integer"},"from":{"description":"Start of the month (Unix time, seconds, UTC)","type":"integer"},"to":{"description":"End of the measured period (now) (Unix time, seconds, UTC)","type":"integer"},"ym":{"description":"Current month as `YYYY-MM` (UTC+7).","type":"string"}},"required":["ym","from","to","charges_cents"],"type":"object","x-order":["ym","from","to","charges_cents"]},"expenses_cents":{"description":"`accruing_cents` plus `outstanding_cents`.","type":"integer"},"fee":{"additionalProperties":true,"description":"Card processing fee: `pct` (percent), `fixed_cents` and `gross_up`. Kept for older clients; see `fees`.","type":"object"},"fees":{"additionalProperties":true,"description":"Fee schedule per payment channel (`card`, `alipay`, `paypal`, `usdt`, `sepay`), each with `pct` and `fixed_cents`, plus the top-level `gross_up` flag. The set of channels depends on the site.","type":"object"},"fx":{"properties":{"margin_bp":{"description":"Margin added to the reference rate, in basis points.","type":"integer"},"round_step":{"description":"Amounts in dong are rounded to a multiple of this.","type":"integer"},"source":{"description":"Where the rate comes from.","type":"string"},"stale":{"description":"True when the rate has not been refreshed recently.","type":"boolean"},"updated_at":{"description":"Time the exchange rate was last updated (Unix time, seconds, UTC)","type":"integer"},"usd_vnd":{"description":"Exchange rate used to show Vietnamese dong prices, VND per US dollar; 0 when none is set.","type":"integer"},"vcb_at":{"description":"Time of the reference rate (Unix time, seconds, UTC)","type":"integer"},"vcb_sell":{"description":"Reference selling rate, VND per US dollar.","type":"integer"}},"required":["usd_vnd","source","vcb_sell","vcb_at","updated_at","margin_bp","stale","round_step"],"type":"object","x-order":["usd_vnd","source","vcb_sell","vcb_at","updated_at","margin_bp","stale","round_step"]},"max_topup_cents":{"description":"Largest top-up the site accepts, in US cents.","type":"integer"},"min_balance_cents":{"description":"Minimum balance a site requires to create a server, in US cents.","type":"integer"},"min_topup_cents":{"description":"Smallest top-up the site accepts, in US cents.","type":"integer"},"outstanding_cents":{"description":"Unpaid and overdue invoices plus any negative balance, in US cents.","type":"integer"},"paypal_allowed":{"description":"False until the account has a first real top-up through another channel; PayPal is then hidden and refused.","type":"boolean"},"pending_sepay":{"description":"Bank-transfer top-up requests that are still open (at most 5, newest first).","items":{"properties":{"amount_vnd":{"description":"Amount to transfer, in dong.","type":["integer","null"]},"code":{"description":"Transfer reference to write in the bank transfer.","type":["string","null"]},"created_at":{"description":"Time the request was created (Unix time, seconds, UTC)","type":"integer"},"credit_cents":{"description":"Amount that will be added to the wallet, in US cents.","type":"integer"},"expires_at":{"description":"Time the request expires (Unix time, seconds, UTC)","type":["integer","null"]},"payment_id":{"description":"Payment identifier.","type":"integer"}},"required":["payment_id","credit_cents","amount_vnd","code","expires_at","created_at"],"type":"object","x-order":["payment_id","credit_cents","amount_vnd","code","expires_at","created_at"]},"type":"array"},"pending_topup_cents":{"description":"Credit of card and PayPal top-ups that were started but are not completed yet, in US cents.","type":"integer"},"promo":{"properties":{"promos":{"items":{"properties":{"expires_at":{"description":"Unix time the discount expires.","type":"integer"},"id":{"description":"Active discount id.","type":"integer"},"max_discount_cents":{"description":"Discount cap in US cents.","type":"integer"},"min_order_cents":{"description":"Smallest charge the discount applies to, in US cents (0 = none).","type":"integer"},"name":{"description":"Campaign name.","type":"string"},"percent":{"description":"Discount percentage applied to the next eligible charge of the service.","type":"integer"},"services":{"items":{"description":"Service keys the discount applies to (empty = any service).","type":"string"},"type":"array"}},"required":["id","services","percent","max_discount_cents","min_order_cents","expires_at","name"],"type":"object","x-order":["id","services","percent","max_discount_cents","min_order_cents","expires_at","name"]},"type":"array"},"service_credit_cents":{"description":"Total promotional service credit still available, in US cents. Not part of the wallet balance.","type":"integer"},"service_credits":{"items":{"properties":{"expires_at":{"description":"Unix time the credit expires.","type":"integer"},"id":{"description":"Credit pot id.","type":"integer"},"left_cents":{"description":"Amount still available, in US cents.","type":"integer"},"name":{"description":"Campaign name.","type":"string"},"services":{"items":{"description":"Service keys this credit pays for (empty = any service).","type":"string"},"type":"array"},"total_cents":{"description":"Amount granted, in US cents.","type":"integer"}},"required":["id","services","total_cents","left_cents","expires_at","name"],"type":"object","x-order":["id","services","total_cents","left_cents","expires_at","name"]},"type":"array"}},"required":["service_credit_cents","service_credits","promos"],"type":"object","x-order":["service_credit_cents","service_credits","promos"]},"quick_amounts":{"description":"Suggested top-up amounts in US cents.","items":{"description":"Amount in US cents.","type":"integer"},"type":"array"},"quick_amounts_vnd":{"description":"Suggested bank-transfer top-up amounts in dong.","items":{"description":"Amount in dong.","type":"integer"},"type":"array"},"sepay":{"properties":{"expire_minutes":{"description":"Minutes a bank-transfer top-up request stays open.","type":"integer"},"max_vnd":{"description":"Largest bank-transfer top-up, in dong.","type":"integer"},"min_vnd":{"description":"Smallest bank-transfer top-up, in dong.","type":"integer"},"round_step":{"description":"Bank-transfer amounts are rounded to a multiple of this, in dong.","type":"integer"}},"required":["min_vnd","max_vnd","round_step","expire_minutes"],"type":"object","x-order":["min_vnd","max_vnd","round_step","expire_minutes"]},"spending_cents":{"description":"Money available to spend: the positive part of the balance plus pending top-ups, in US cents.","type":"integer"},"trial":{"additionalProperties":true,"description":"Trial credit of this account — same object as [Get trial credit](#operation/billing_trial_get) (`status`, `amount_cents`, `left_cents`, …). `null` when the account has none to show (not a new customer, or the credit is used up or expired).","type":["object","null"]},"updated_at":{"description":"Time the figures were computed (Unix time, seconds, UTC)","type":"integer"}},"required":["balance_cents","pending_topup_cents","accruing_cents","outstanding_cents","expenses_cents","spending_cents","cycle","updated_at","burn_mills_per_hour","burn_uusd_per_hour","fee","fees","min_topup_cents","max_topup_cents","quick_amounts","promo","min_balance_cents","trial","paypal_allowed","fx","sepay","quick_amounts_vnd","pending_sepay"],"type":"object","x-order":["balance_cents","pending_topup_cents","accruing_cents","outstanding_cents","expenses_cents","spending_cents","cycle","updated_at","burn_mills_per_hour","burn_uusd_per_hour","fee","fees","min_topup_cents","max_topup_cents","quick_amounts","promo","min_balance_cents","trial","paypal_allowed","fx","sepay","quick_amounts_vnd","pending_sepay"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Billing overview","tags":["Billing"],"x-cli":"billing summary","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/summary\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Tổng quan chi phí"}},"/v1/billing/trial":{"get":{"description":"Returns the trial credit of your account. New accounts get one trial credit that starts as `pending` and becomes `active` when the first real top-up of at least `min_deposit_cents` is credited and the email is verified. While `active` it pays, before the wallet, for exactly one Cloud VM billed hourly in a Vietnam zone (a plan whose 30-day (720 h) price is covered by your real top-ups; the credit never pays more per hour than that plan), one VPN / Proxy IPv4 order and one IPv6 Proxy order on the 1-day plan; any other cycle (monthly or longer) and every other service is paid from the wallet — orders are never blocked, they simply do not use the credit. If the top-up that activated it is refunded or disputed, the remaining credit is revoked. It cannot be withdrawn or transferred and expires after `days`. `status` is `none` (not claimed yet), `pending`, `active`, `used_up`, `expired`. Sites run by a reseller always return `enabled: false`.\n\n**Required scope:** `billing:read`.","operationId":"billing_trial_get","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"activated_at":1792390000,"amount_cents":10000,"claimable":false,"code":"TRIAL-7K3M-9QXW","days":30,"enabled":true,"expires_at":1794982000,"forfeit_cents":0,"left_cents":5500,"min_deposit_cents":1000,"orders":[{"order":"0b6a1d52-3c1e-4a7e-9a52-4f2f4d6e8a10","service":"vm"}],"paypal_allowed":true,"services":["vm","vpn4","vpn6"],"status":"active","used_cents":500},"schema":{"properties":{"activated_at":{"description":"Time the credit became active (Unix time, seconds, UTC)","type":["integer","null"]},"amount_cents":{"description":"Trial credit granted, in US cents.","type":"integer"},"claimable":{"description":"True when the account has no trial credit yet and can still claim one.","type":"boolean"},"code":{"description":"Private identifier of the credit (only when one exists).","type":"string"},"days":{"description":"Days the credit stays valid after activation.","type":"integer"},"enabled":{"description":"Whether the trial program is on for this site.","type":"boolean"},"expires_at":{"description":"Time the credit expires (Unix time, seconds, UTC)","type":["integer","null"]},"forfeit_cents":{"description":"Amount that expired unused, in US cents.","type":"integer"},"left_cents":{"description":"Amount still available, in US cents (0 unless `active`).","type":"integer"},"min_deposit_cents":{"description":"Smallest real top-up that activates the credit, in US cents.","type":"integer"},"orders":{"items":{"properties":{"order":{"description":"Identifier of the order that uses the credit.","type":"string"},"service":{"description":"`vm`, `vpn4` or `vpn6`.","type":"string"}},"required":["service","order"],"type":"object","x-order":["service","order"]},"type":"array"},"paypal_allowed":{"description":"False until the account has a first real top-up through another channel.","type":"boolean"},"services":{"items":{"description":"`vm` hourly Cloud VM in Vietnam, `vpn4` 1-day VPN / Proxy IPv4, `vpn6` 1-day Proxy IPv6.","enum":["vm","vpn4","vpn6"],"type":"string"},"type":"array"},"status":{"description":"State of the trial credit.","enum":["none","pending","active","used_up","expired"],"type":"string"},"used_cents":{"description":"Amount spent from the credit so far, in US cents.","type":"integer"}},"required":["enabled","claimable","status","code","amount_cents","days","min_deposit_cents","services","activated_at","expires_at","used_cents","left_cents","forfeit_cents","orders","paypal_allowed"],"type":"object","x-order":["enabled","claimable","status","code","amount_cents","days","min_deposit_cents","services","activated_at","expires_at","used_cents","left_cents","forfeit_cents","orders","paypal_allowed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Trial credit of your account","tags":["Billing"],"x-cli":"billing trial get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/trial\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Tiền thưởng dùng thử của tài khoản"}},"/v1/billing/wallet":{"get":{"description":"Returns your wallet balance and its transaction history, newest first by default. The wallet is a prepaid balance in US cents: top-ups and refunds add to it, server charges take from it. The balance can be negative after an overdraft or a correction by support.\n\nThe top-up limits and the stored-card label are informational; money can only be added from the dashboard.\n\n**Required scope:** `billing:read`.","operationId":"billing_wallet","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Entries per page. Values above 100 are clamped to 100.","in":"query","name":"per_page","required":false,"schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["at","kind","delta_cents","vm_id","id"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Only money added (`in`, positive `delta_cents`) or only money spent (`out`, negative). Omit for both.","in":"query","name":"sign","required":false,"schema":{"enum":["in","out"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"autotopup_enabled":false,"balance_cents":750,"card":null,"dir":"desc","ledger":[{"account_id":1042,"actor":"customer:1042","at":1792390000,"balance_after":750,"delta_cents":-250,"id":2,"kind":"charge","note":"New server web-1","ref":"vm:new:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},{"account_id":1042,"actor":"system:payment","at":1792380000,"balance_after":1000,"delta_cents":1000,"id":1,"kind":"deposit","note":"Top-up","ref":"dep:stripe:pi_example","vm_id":null}],"max_topup_cents":500000,"min_topup_cents":1000,"page":1,"per_page":50,"sort":"id","topup_fee_gross_up":false,"total":2},"schema":{"properties":{"autotopup_enabled":{"description":"Whether automatic top-up is switched on.","type":"boolean"},"balance_cents":{"description":"Current wallet balance in US cents.","type":"integer"},"card":{"description":"Label of the stored card, for example `Visa ending 4242`; null when none is stored.","type":["string","null"]},"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"ledger":{"items":{"$ref":"#/components/schemas/WalletEntry"},"type":"array"},"max_topup_cents":{"description":"Largest top-up the site accepts, in US cents.","type":"integer"},"min_topup_cents":{"description":"Smallest top-up the site accepts, in US cents.","type":"integer"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied.","type":"integer"},"sort":{"description":"The `sort` value you sent, or `id` when you sent none.","type":"string"},"topup_fee_gross_up":{"description":"True when the processing fee is added on top of the top-up amount instead of being deducted from it.","type":"boolean"},"total":{"description":"Total number of entries, across all pages.","type":"integer"}},"required":["balance_cents","ledger","total","page","per_page","sort","dir","min_topup_cents","max_topup_cents","topup_fee_gross_up","card","autotopup_enabled"],"type":"object","x-order":["balance_cents","ledger","total","page","per_page","sort","dir","min_topup_cents","max_topup_cents","topup_fee_gross_up","card","autotopup_enabled"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Wallet balance","tags":["Billing"],"x-cli":"billing wallet","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/billing/wallet\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Số dư ví"}},"/v1/byoip":{"get":{"description":"Lists your prefixes (ended ones stay visible for 30 days).\n\n**Required scope:** `byoip:read`.","operationId":"byoip_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","prefix","state","asn","kind"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Filter by state group.","in":"query","name":"state","required":false,"schema":{"default":"all","enum":["all","pending","active","suspended","ended"],"type":"string"}},{"description":"Filter by type.","in":"query","name":"kind","required":false,"schema":{"enum":["leased","own"],"type":"string"}},{"description":"Search in prefix or ASN.","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_create":true,"enabled":true,"items":[{"activated_at":null,"asn":213035,"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"state":"pending_verify","target_kind":"vm","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null}}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"can_create":{"description":"You may register another prefix.","type":"boolean"},"enabled":{"description":"The site sells Bring Your Own IP.","type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/Byoip"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","enabled","can_create"],"type":"object","x-order":["items","total","page","per_page","enabled","can_create"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"List your own IP prefixes","tags":["Bring Your Own IP"],"x-cli":"byoip list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Danh sách dải IP riêng"},"post":{"description":"Registers a prefix for verification. Requires `Idempotency-Key` and `agree_terms: true`. Nothing is charged now: once RPKI (ROA for the origin ASN), the IRR route object and the token pass, the monthly BGP fee of the origin ASN (if any) is taken from the wallet and the prefix is set up. Without a successful verification in 7 days the request expires.\n\n**Required scope:** `byoip:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"agree_terms":true,"asn":"AS213035","kind":"own","prefix":"45.12.34.0/24","vm_id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90"},"schema":{"properties":{"agree_terms":{"description":"You accept the IP usage terms (no spam, scans or abuse).","type":"boolean"},"asn":{"description":"Origin ASN (`AS64500` or number); use the platform ASN from the catalog if you have none.","type":"string"},"kind":{"description":"Prefix type.","enum":["leased","own"],"type":"string"},"note":{"description":"Note (≤ 500 characters).","type":"string"},"prefix":{"description":"IPv4 /24–/22 or IPv6 /48–/32 network address.","type":"string"},"target_id":{"description":"Identifier of the VM or of the Bare Metal server (`ds_…`) to attach; Bare Metal must be yours, in the Ho Chi Minh City zone with an active subscription.","type":"string"},"target_kind":{"description":"What the prefix attaches to when `usage=vm`: a VM (default) or a Bare Metal server (IPv4 prefixes only).","enum":["vm","dedicated"],"type":"string"},"usage":{"description":"Default `vm`.","enum":["vm","external"],"type":"string"},"vm_id":{"description":"Required when `usage=vm` (unless `target_kind=dedicated`): VM (Ho Chi Minh City zone, running) to attach to the prefix once active. See `GET /v1/byoip/vms/eligible`. Same as `target_id` for a VM.","type":"string"}},"required":["prefix","asn","kind","agree_terms"],"type":"object","x-order":["prefix","asn","kind","usage","vm_id","target_kind","target_id","agree_terms","note"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"terms_required","message":"`agree_terms` must be true."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`terms_required`: `agree_terms` must be true. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"terms_required","description":"`agree_terms` must be true."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Maximum number of prefixes reached. (`byoip_limit`)","x-error-codes":[{"code":"byoip_limit","description":"Maximum number of prefixes reached."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"VM not found in your account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"VM not found in your account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"VM not found in your account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"prefix_taken","message":"The prefix overlaps a prefix already verified by another account. Unverified requests of other accounts do not block you: the first request to pass verification keeps the prefix and the others are canceled."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`prefix_taken`: The prefix overlaps a prefix already verified by another account. Unverified requests of other accounts do not block you: the first request to pass verification keeps the prefix and the others are canceled. `prefix_ours`: The prefix overlaps a range of the provider. `prefix_duplicate`: You already registered this prefix or an overlapping one. `vm_not_eligible`: VM must be running. `l2_not_ready`: Own IP prefix: VM targets are not open yet; choose a Bare Metal server. Checked before anything is created. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"prefix_taken","description":"The prefix overlaps a prefix already verified by another account. Unverified requests of other accounts do not block you: the first request to pass verification keeps the prefix and the others are canceled."},{"code":"prefix_ours","description":"The prefix overlaps a range of the provider."},{"code":"prefix_duplicate","description":"You already registered this prefix or an overlapping one."},{"code":"vm_not_eligible","description":"VM must be running."},{"code":"l2_not_ready","description":"Own IP prefix: VM targets are not open yet; choose a Bare Metal server. Checked before anything is created."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"prefix_size","message":"Prefix length not accepted."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`prefix_size`: Prefix length not accepted. `prefix_bogon`: Special-use range. `asn_invalid`: Not a public ASN. `vm_required`: No VM selected (required when used on the platform). `vm_zone_not_supported`: VM is not in the Ho Chi Minh City zone. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"prefix_size","description":"Prefix length not accepted."},{"code":"prefix_bogon","description":"Special-use range."},{"code":"asn_invalid","description":"Not a public ASN."},{"code":"vm_required","description":"No VM selected (required when used on the platform)."},{"code":"vm_zone_not_supported","description":"VM is not in the Ho Chi Minh City zone."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:create"]}],"summary":"Register an own IP prefix (waits for verification, not charged yet)","tags":["Bring Your Own IP"],"x-cli":"byoip create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"agree_terms\":true,\"asn\":\"AS213035\",\"kind\":\"own\",\"prefix\":\"45.12.34.0/24\",\"vm_id\":\"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:create","x-summary-vi":"Đăng ký dải IP riêng (chờ xác minh, chưa trừ tiền)"}},"/v1/byoip/catalog":{"get":{"description":"Types, accepted prefix sizes, prices (VND list price and wallet cents), verification rules and limits of the site.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_catalog","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"bandwidth":{"addon_tb_vnd":100000,"quota_gb":2048},"enabled":true,"kinds":["leased","own"],"limits":{"per_account":5,"used":0},"mtu":1450,"platform_asn":64496,"prices":{"leased":{"month_cents":0,"month_vnd":0,"own_asn_month_cents":1147,"own_asn_month_vnd":299000},"own":{"month_cents":0,"month_vnd":0,"own_asn_month_cents":0,"own_asn_month_vnd":0}},"sizes":{"v4":{"max":24,"min":22},"v6":{"max":48,"min":32}},"usages":["vm"],"verify":{"interval_s":600,"max_days":7}},"schema":{"properties":{"bandwidth":{"additionalProperties":true,"description":"Included traffic per prefix (GB/month) and add-on price.","type":"object"},"enabled":{"description":"The site sells Bring Your Own IP.","type":"boolean"},"kinds":{"items":{"description":"`leased` or `own`.","type":"string"},"type":"array"},"limits":{"additionalProperties":true,"description":"Prefixes per account and how many you use.","type":"object"},"mtu":{"description":"MTU of the own-IP network (set it on the VM NIC).","type":"integer"},"platform_asn":{"description":"Platform ASN you may use as origin instead of your own ASN.","type":"integer"},"prices":{"additionalProperties":true,"description":"Per type: monthly BGP fee when the origin is the platform ASN (`month_*`) or your own ASN (`own_asn_month_*`), and setup fee.","type":"object"},"sizes":{"additionalProperties":true,"description":"Accepted prefix lengths per family.","type":"object"},"usages":{"items":{"description":"`vm` (on VMs of this platform) and, when enabled, `external`.","type":"string"},"type":"array"},"verify":{"additionalProperties":true,"description":"Verification interval, max days, proof mode, IRR requirement.","type":"object"}},"required":["enabled","kinds","usages","platform_asn","sizes","prices","bandwidth","verify","limits","mtu"],"type":"object","x-order":["enabled","kinds","usages","platform_asn","sizes","prices","bandwidth","verify","limits","mtu"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"BYOIP catalog: types, prefix sizes, prices and limits","tags":["Bring Your Own IP"],"x-cli":"byoip catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Danh mục BYOIP: loại, kích thước dải, giá, giới hạn"}},"/v1/byoip/check":{"post":{"description":"Checks a prefix and ASN before registering: syntax, accepted size, special-use ranges, overlap with the provider's or other customers' prefixes. No external lookup; RPKI/IRR are checked after you register. Limited to 30 checks per hour.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_check","parameters":[],"requestBody":{"content":{"application/json":{"example":{"asn":"AS213035","prefix":"45.12.34.0/24"},"schema":{"properties":{"asn":{"description":"Origin ASN; default the platform ASN.","type":"string"},"prefix":{"description":"Prefix, e.g. `45.12.34.0/24`.","type":"string"}},"required":["prefix"],"type":"object","x-order":["prefix","asn"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"asn":213035,"family":4,"gateway":"45.12.34.1","ok":true,"prefix":"45.12.34.0/24","size":256},"schema":{"properties":{"error":{"description":"Error code when `ok` is false.","type":"string"},"message":{"description":"Error message.","type":"string"},"ok":{"description":"The prefix can be registered.","type":"boolean"},"prefix":{"description":"Normalised prefix.","type":"string"}},"required":["ok"],"type":"object","x-order":["ok","prefix","error","message"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Quick check of a prefix before registering (no external lookups)","tags":["Bring Your Own IP"],"x-cli":"byoip check","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/check\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"asn\":\"AS213035\",\"prefix\":\"45.12.34.0/24\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Kiểm tra nhanh dải trước khi đăng ký (không gọi mạng ngoài)"}},"/v1/byoip/quote":{"get":{"description":"Price of registering a prefix of the given type and origin ASN. The monthly BGP fee is charged once per origin ASN and type: a second prefix with the same ASN costs nothing extra.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_quote","parameters":[{"description":"Prefix type.","in":"query","name":"kind","required":false,"schema":{"default":"leased","enum":["leased","own"],"type":"string"}},{"description":"Where the prefix is used.","in":"query","name":"usage","required":false,"schema":{"default":"vm","enum":["vm","external"],"type":"string"}},{"description":"Origin ASN (`AS64500` or `64500`). Default: the platform ASN.","in":"query","name":"asn","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"asn":213035,"balance_cents":1500,"kind":"own","quote":{"asn_covered":false,"due_cents":0,"free":true,"month_cents":0,"month_vnd":0,"setup_cents":0,"setup_vnd":0},"usage":"vm"},"schema":{"properties":{"asn":{"description":"Origin ASN.","type":"integer"},"balance_cents":{"description":"Wallet balance.","type":"integer"},"kind":{"description":"Type.","type":"string"},"quote":{"additionalProperties":true,"description":"`month_cents`, `setup_cents`, `due_cents`, `asn_covered`, `free`.","type":"object"},"usage":{"description":"Usage.","type":"string"}},"required":["kind","usage","asn","quote","balance_cents"],"type":"object","x-order":["kind","usage","asn","quote","balance_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"asn_invalid","message":"The ASN is not a public ASN."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The ASN is not a public ASN. (`asn_invalid`)","x-error-codes":[{"code":"asn_invalid","description":"The ASN is not a public ASN."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"BYOIP quote by type and ASN","tags":["Bring Your Own IP"],"x-cli":"byoip quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Báo giá BYOIP theo loại + ASN"}},"/v1/byoip/ranges":{"get":{"description":"One merged list of all your IP ranges: prefixes you bring (`type: own`, as in `GET /v1/byoip`) and subnets you rent from the platform (`type: leased`, as in `GET /v1/byoip/subnets`). A subnet routed at this platform and its BGP prefix are ONE row (the `leased` row carries `byoip_id`, `gateway` and `bgp` of its prefix). Ended ranges stay in `state=all` for 30 days; `state=ended` shows all of them.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_ranges","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","prefix","state","asn","source","expires"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Filter by state group (`suspended` includes a subnet in grace or ending at period end).","in":"query","name":"state","required":false,"schema":{"default":"all","enum":["all","pending","active","suspended","ended"],"type":"string"}},{"description":"Filter by source: `own` = prefix you bring, `leased` = subnet rented from the platform.","in":"query","name":"source","required":false,"schema":{"default":"all","enum":["all","own","leased"],"type":"string"}},{"description":"Search in prefix or ASN.","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_create":true,"enabled":true,"items":[{"asn":213035,"byoip_id":null,"expires_at":null,"id":70,"mode":null,"prefix":"45.12.34.0/24","rpki":null,"state":"active","state_group":"active","type":"own"}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"can_create":{"description":"You may register another prefix.","type":"boolean"},"enabled":{"description":"The site sells Bring Your Own IP.","type":"boolean"},"items":{"items":{"additionalProperties":true,"description":"Range row: `type`, `id`, `prefix`, `state`, `state_group`, `asn`, `gateway`, `bgp`, `rpki`, `expires_at`, `created_at`; the rest follows `GET /v1/byoip/:id` (`own`) or `GET /v1/byoip/subnets/:id` (`leased`).","type":"object"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","enabled","can_create"],"type":"object","x-order":["items","total","page","per_page","enabled","can_create"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Merged IP range list: your own prefixes and rented subnets (one row per range)","tags":["Bring Your Own IP"],"x-cli":"byoip ranges","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/ranges\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Danh sách dải IP gộp: dải tự mang + subnet thuê (một dải một dòng)"}},"/v1/byoip/subnets":{"get":{"description":"Your subnet orders, newest first.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_subnets_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"activated_at":null,"asn":213035,"asn_assigned":true,"byoip_id":null,"can":{"cancel":true},"country":"NL","created_at":1761100000,"ended_at":null,"id":7,"mode":"idc","period_from":1761100000,"period_to":1763778400,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"public_error":null,"purchased_at":null,"rir":"ripencc","setup_cents":1150,"state":"paid"}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"additionalProperties":true,"description":"Subnet order (see `GET /v1/byoip/subnets/:id`).","type":"object"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Your IPv4 subnet orders","tags":["Bring Your Own IP"],"x-cli":"byoip subnets list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/subnets\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Đơn subnet IPv4 của bạn"},"post":{"description":"Orders a subnet from the market. Requires `Idempotency-Key` and `agree_terms: true`. The first month and the setup fee are taken from the wallet now; the subnet is leased in the background and becomes `active` once its LOA is in place. `mode`: `idc` — use it at your own data center (the ASN is optional: leave it out and assign it later with `POST /v1/byoip/subnets/:id/asn`; if given, the RPKI fee is taken now); `platform` — route it at this platform (LOA for the platform ASN or your ASN; a Bring Your Own IP prefix is created for it, BGP at no extra fee).\n\n**Required scope:** `byoip:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_subnets_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"agree_terms":true,"asn":"AS213035","mode":"idc","prefix":"45.12.34.0/24"},"schema":{"properties":{"agree_terms":{"description":"You accept the IP usage terms (no spam, scans or abuse).","type":"boolean"},"asn":{"description":"Origin ASN for the LOA. Optional for `idc` (assign later; giving it now charges the one-time RPKI fee at once); default for `platform` is the platform ASN.","type":"string"},"expected_rpki_fee_cents":{"description":"Optional price guard: the RPKI fee you saw for an `idc` order with an ASN; 409 `price_changed` if it differs.","type":"integer"},"mode":{"description":"Where you use the subnet.","enum":["idc","platform"],"type":"string"},"prefix":{"description":"Subnet from the market list (`id`).","type":"string"},"target_id":{"description":"VM identifier, or Bare Metal server identifier (`ds_…`) with `target_kind=dedicated`.","type":"string"},"target_kind":{"description":"For `platform`: attach to a VM (default) or to a Bare Metal server of yours in the Ho Chi Minh City zone.","enum":["vm","dedicated"],"type":"string"},"vm_id":{"description":"Required for `platform` (unless `target_kind=dedicated`): VM (Ho Chi Minh City zone, running) to attach to the prefix once active.","type":"string"}},"required":["prefix","mode","agree_terms"],"type":"object","x-order":["prefix","mode","asn","expected_rpki_fee_cents","vm_id","target_kind","target_id","agree_terms"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"subnet":{"activated_at":null,"asn":213035,"asn_assigned":true,"byoip_id":null,"can":{"cancel":true},"country":"NL","created_at":1761100000,"ended_at":null,"id":7,"mode":"idc","period_from":1761100000,"period_to":1763778400,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"public_error":null,"purchased_at":null,"rir":"ripencc","setup_cents":1150,"state":"paid"}},"schema":{"properties":{"subnet":{"additionalProperties":true,"description":"Subnet order.","type":"object"}},"required":["subnet"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"terms_required","message":"`agree_terms` must be true."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`terms_required`: `agree_terms` must be true. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"terms_required","description":"`agree_terms` must be true."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"Not enough balance for the first month and the setup fee."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not enough balance for the first month and the setup fee. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"Not enough balance for the first month and the setup fee."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Maximum number of subnets reached. (`subnet_limit`)","x-error-codes":[{"code":"subnet_limit","description":"Maximum number of subnets reached."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"VM not found in your account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"VM not found in your account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"VM not found in your account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"subnet_taken","message":"Someone else is ordering this subnet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`subnet_taken`: Someone else is ordering this subnet. `vm_not_eligible`: VM must be running. `l2_not_ready`: Subnet with a VM target: VM targets are not open yet; choose a Bare Metal server. Checked before the wallet is charged. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"subnet_taken","description":"Someone else is ordering this subnet."},{"code":"vm_not_eligible","description":"VM must be running."},{"code":"l2_not_ready","description":"Subnet with a VM target: VM targets are not open yet; choose a Bare Metal server. Checked before the wallet is charged."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"subnet_unavailable","message":"The subnet is no longer on the market — refresh the list."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`subnet_unavailable`: The subnet is no longer on the market — refresh the list. `asn_invalid`: Not a public ASN (for `idc` use your own ASN). `asn_rejected`: The ASN cannot be used for an LOA (unknown or on a blocklist). `vm_required`: `platform` requires selecting a VM. `vm_zone_not_supported`: VM is not in the Ho Chi Minh City zone. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"subnet_unavailable","description":"The subnet is no longer on the market — refresh the list."},{"code":"asn_invalid","description":"Not a public ASN (for `idc` use your own ASN)."},{"code":"asn_rejected","description":"The ASN cannot be used for an LOA (unknown or on a blocklist)."},{"code":"vm_required","description":"`platform` requires selecting a VM."},{"code":"vm_zone_not_supported","description":"VM is not in the Ho Chi Minh City zone."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:create"]}],"summary":"Order an IPv4 subnet (charges the first month and the setup fee)","tags":["Bring Your Own IP"],"x-cli":"byoip subnets create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/subnets\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"agree_terms\":true,\"asn\":\"AS213035\",\"mode\":\"idc\",\"prefix\":\"45.12.34.0/24\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:create","x-summary-vi":"Đặt mua subnet IPv4 (trừ ví tháng đầu + phí setup)"}},"/v1/byoip/subnets/market":{"get":{"description":"Same list as the public market, priced for your account, plus your wallet balance and the platform ASN you may use for routing at this platform.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_subnets_market","parameters":[{"description":"Exactly this subnet (for example `45.12.34.0/24`).","in":"query","name":"prefix","required":false,"schema":{"type":"string"}},{"description":"Prefix length.","in":"query","name":"len","required":false,"schema":{"enum":["24","23","22"],"type":"string"}},{"description":"Registry.","in":"query","name":"rir","required":false,"schema":{"enum":["afrinic","apnic","arin","lacnic","ripencc"],"type":"string"}},{"description":"Geolocation country (ISO 3166-1 alpha-2).","in":"query","name":"country","required":false,"schema":{"type":"string"}},{"description":"Maximum monthly price in US cents.","in":"query","name":"price_max_cents","required":false,"schema":{"type":"string"}},{"description":"Sort order.","in":"query","name":"sort","required":false,"schema":{"default":"price","enum":["price","-price","address","-address","country","len"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"filters":{"countries":["NL"],"lens":[24,23,22],"rirs":["ripencc"]},"items":[{"city":"Amsterdam","country":"NL","id":"45.12.34.0/24","ips":256,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"rir":"ripencc","rpki":"automated","setup_cents":1150}],"page":1,"per_page":25,"total":1,"updated_at":1761100000},"schema":{"properties":{"available":{"description":"Subnets are on sale on this site now.","type":"boolean"},"balance_cents":{"description":"Your wallet balance (logged in only).","type":"integer"},"filters":{"additionalProperties":true,"description":"Values available for `rir`, `country`, `len`.","type":"object"},"items":{"items":{"additionalProperties":true,"description":"`id`/`prefix`, `prefix_len`, `ips`, `rir`, `country`, `city`, `price_cents` (monthly), `setup_cents`, `rpki`.","type":"object"},"type":"array"},"page":{"description":"Page.","type":"integer"},"per_page":{"description":"Page size.","type":"integer"},"platform_asn":{"description":"Platform ASN for routing at this platform (logged in only).","type":"integer"},"total":{"description":"Matching subnets.","type":"integer"},"updated_at":{"description":"When the market list was refreshed (unix seconds).","type":["integer","null"]}},"required":["available","items","total","page","per_page"],"type":"object","x-order":["available","items","total","page","per_page","updated_at","filters","balance_cents","platform_asn"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"IPv4 subnets for sale priced for your account","tags":["Bring Your Own IP"],"x-cli":"byoip subnets market","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/subnets/market\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Subnet IPv4 đang bán theo giá tài khoản"}},"/v1/byoip/subnets/{id}":{"get":{"description":"One subnet order: state, price, billing period and, for `platform`, the Bring Your Own IP prefix created for it (`byoip_id`). `asn_info` carries the assigned ASN (`null` until you assign one), the RPKI state (`none`, `processing`, `pending`, `valid`), the assignment history with LOA numbers and what you can do now (`can.assign`, `can.loa`); `events` is the milestone history, newest first.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_subnets_get","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"asn_info":{"asn":213035,"assigned":true,"can":{"assign":true,"loa":true},"fee_cents":2000,"rpki":"valid"},"events":[{"args":{},"at":1761100000,"key":"ordered"}],"subnet":{"activated_at":null,"asn":213035,"asn_assigned":true,"byoip_id":null,"can":{"cancel":true},"country":"NL","created_at":1761100000,"ended_at":null,"id":7,"mode":"idc","period_from":1761100000,"period_to":1763778400,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"public_error":null,"purchased_at":null,"rir":"ripencc","setup_cents":1150,"state":"paid"}},"schema":{"properties":{"asn_info":{"additionalProperties":true,"description":"ASN/RPKI/LOA state.","type":"object"},"events":{"items":{"additionalProperties":true,"description":"`at`, `key`, `args`.","type":"object"},"type":"array"},"subnet":{"additionalProperties":true,"description":"Subnet order.","type":"object"}},"required":["subnet","asn_info","events"],"type":"object","x-order":["subnet","asn_info","events"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Subnet order details","tags":["Bring Your Own IP"],"x-cli":"byoip subnets get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/subnets/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Chi tiết đơn subnet"}},"/v1/byoip/subnets/{id}/asn":{"post":{"description":"Assigns (or changes) the origin ASN of a subnet you use at your own data center (`mode: idc`, state `active`). A one-time RPKI fee (`asn_info.fee_cents`) is taken from the wallet for EVERY assignment or change; we then issue the Letter of Authorization (LOA) for the new ASN and publish the ROA. Changing the ASN replaces the previous LOA (the old letter is marked superseded). If the provider rejects the ASN the fee is refunded automatically. The ROA becomes valid within minutes to a few hours (`asn_info.rpki`: `processing` → `pending` → `valid`). The LOA PDF is downloaded from the console once issued. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_subnets_asn","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"asn":"AS213035","expected_fee_cents":2000},"schema":{"properties":{"asn":{"description":"Public origin ASN (`AS64500` or `64500`). Not private/documentation ASNs and not the platform ASNs.","type":"string"},"expected_fee_cents":{"description":"Optional price guard: the fee you saw; 409 `price_changed` if it differs.","type":"integer"}},"required":["asn"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"asn_info":{"asn":213035,"assigned":true,"can":{"assign":false,"loa":false},"fee_cents":2000,"rpki":"processing"},"events":[],"fee_cents":2000,"subnet":{"activated_at":null,"asn":213035,"asn_assigned":true,"byoip_id":null,"can":{"cancel":true},"country":"NL","created_at":1761100000,"ended_at":null,"id":7,"mode":"idc","period_from":1761100000,"period_to":1763778400,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"public_error":null,"purchased_at":null,"rir":"ripencc","setup_cents":1150,"state":"paid"}},"schema":{"properties":{"asn_info":{"additionalProperties":true,"description":"ASN/RPKI/LOA state: `assigned`, `asn`, `rpki`, `current`, `history[]`, `fee_cents`, `can`.","type":"object"},"events":{"items":{"additionalProperties":true,"description":"`at`, `key`, `args`.","type":"object"},"type":"array"},"fee_cents":{"description":"Fee charged now.","type":"integer"},"subnet":{"additionalProperties":true,"description":"Subnet order.","type":"object"}},"required":["subnet","asn_info","events","fee_cents"],"type":"object","x-order":["subnet","asn_info","events","fee_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"Not enough balance for the RPKI fee."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not enough balance for the RPKI fee. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"Not enough balance for the RPKI fee."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"byoip_state","message":"The subnet must be `active` (not leasing, in grace or ended)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`byoip_state`: The subnet must be `active` (not leasing, in grace or ended). `byoip_busy`: A previous assignment is still being processed. `asn_same`: This ASN is already assigned. `price_changed`: The fee changed since you looked. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"byoip_state","description":"The subnet must be `active` (not leasing, in grace or ended)."},{"code":"byoip_busy","description":"A previous assignment is still being processed."},{"code":"asn_same","description":"This ASN is already assigned."},{"code":"price_changed","description":"The fee changed since you looked."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"asn_invalid","message":"Not a public ASN."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`asn_invalid`: Not a public ASN. `asn_rejected`: The ASN cannot be used for an LOA (unknown or on a blocklist) — nothing was charged. `asn_mode`: Only `idc` subnets take an ASN (platform subnets use the platform ASN). `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"asn_invalid","description":"Not a public ASN."},{"code":"asn_rejected","description":"The ASN cannot be used for an LOA (unknown or on a blocklist) — nothing was charged."},{"code":"asn_mode","description":"Only `idc` subnets take an ASN (platform subnets use the platform ASN)."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:create"]}],"summary":"Assign or change the ASN of a subnet (one-time RPKI fee per assignment, we issue the LOA)","tags":["Bring Your Own IP"],"x-cli":"byoip subnets asn","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/subnets/<id>/asn\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"asn\":\"AS213035\",\"expected_fee_cents\":2000}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:create","x-summary-vi":"Gán/đổi ASN cho subnet (thu phí RPKI một lần mỗi lần gán, cấp LOA)"}},"/v1/byoip/subnets/{id}/cancel":{"post":{"description":"Before the subnet is leased (`paid`): cancels and refunds everything. In use (`active`, `grace`): stops renewal at the end of the paid month (no refund). Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_subnets_cancel","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"subnet":{"activated_at":null,"asn":213035,"asn_assigned":true,"byoip_id":null,"can":{"cancel":true},"country":"NL","created_at":1761100000,"ended_at":null,"id":7,"mode":"idc","period_from":1761100000,"period_to":1763778400,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"public_error":null,"purchased_at":null,"rir":"ripencc","setup_cents":1150,"state":"paid"}},"schema":{"properties":{"refund_cents":{"description":"Refunded amount (before leasing).","type":"integer"},"subnet":{"additionalProperties":true,"description":"Subnet order.","type":"object"}},"required":["subnet"],"type":"object","x-order":["subnet","refund_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"byoip_state","message":"Not possible in the current state (lease in progress)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`byoip_state`: Not possible in the current state (lease in progress). `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"byoip_state","description":"Not possible in the current state (lease in progress)."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:destroy"]}],"summary":"Cancel a subnet (before leasing: full refund; in use: stop renewal)","tags":["Bring Your Own IP"],"x-cli":"byoip subnets cancel","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/subnets/<id>/cancel\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:destroy","x-summary-vi":"Huỷ subnet (trước khi thuê: hoàn đủ; đang dùng: dừng gia hạn)"}},"/v1/byoip/subnets/{id}/rpki-check":{"post":{"description":"Checks the RPKI state of the subnet right now (RIPEstat `rpki-validation` for the assigned ASN) and returns the subnet with `asn_info.rpki_check`: `state` (`none`, `processing`, `pending` = the ROA is being created, `valid`, `invalid` = the ASN or max length does not match, `not_found` = no ROA yet, `error` = the source could not be reached and there is no earlier result), the ASN, prefix and max length checked, `checked_at`, and the ROAs seen. A failed check never overwrites an earlier result (`stale_error`). The subnet is also checked automatically (every 10 minutes while waiting for the ROA, every 6 hours once valid) and you are notified when the state changes. Limited to once per 60 seconds per subnet (429 with `retry_after`) and 30 per hour per account. Requires an assigned ASN with an issued LOA.\n\n**Required scope:** `byoip:write`.","operationId":"byoip_subnets_rpki_check","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"asn_info":{"asn":213035,"assigned":true,"can":{"assign":true,"check":true,"loa":true},"rpki":"valid","rpki_check":{"asn":213035,"checked_at":1761100000,"error":null,"max_len":24,"prefix":"45.12.34.0/24","roas":[{"max_length":24,"origin":"213035","validity":"valid"}],"stale_error":false,"state":"valid"}},"checked":true,"events":[],"subnet":{"activated_at":null,"asn":213035,"asn_assigned":true,"byoip_id":null,"can":{"cancel":true},"country":"NL","created_at":1761100000,"ended_at":null,"id":7,"mode":"idc","period_from":1761100000,"period_to":1763778400,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"public_error":null,"purchased_at":null,"rir":"ripencc","setup_cents":1150,"state":"paid"}},"schema":{"properties":{"asn_info":{"additionalProperties":true,"description":"ASN/RPKI/LOA state including `rpki_check`.","type":"object"},"checked":{"description":"`false` when the source was unreachable (the earlier state is kept).","type":"boolean"},"events":{"items":{"additionalProperties":true,"description":"`at`, `key`, `args`.","type":"object"},"type":"array"},"subnet":{"additionalProperties":true,"description":"Subnet order.","type":"object"}},"required":["subnet","asn_info","events","checked"],"type":"object","x-order":["subnet","asn_info","events","checked"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Subnet not found."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Subnet not found. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Subnet not found."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"loa_not_ready","message":"No ASN with an issued LOA yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No ASN with an issued LOA yet. (`loa_not_ready`)","x-error-codes":[{"code":"loa_not_ready","description":"No ASN with an issued LOA yet."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Once per 60 seconds per subnet (`retry_after` in seconds) and 30 per hour per account. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Once per 60 seconds per subnet (`retry_after` in seconds) and 30 per hour per account."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Check the RPKI status of a subnet now (RIPEstat)","tags":["Bring Your Own IP"],"x-cli":"byoip subnets rpki-check","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/subnets/<id>/rpki-check\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:write","x-summary-vi":"Kiểm tra RPKI của subnet ngay (RIPEstat)"}},"/v1/byoip/vms/eligible":{"get":{"description":"Your VMs eligible for own IP prefix (Ho Chi Minh City zone). `eligible=false` = VM is not running.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_vms_eligible","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"dedicated":[{"eligible":true,"id":"ds_3f9a1c2b7d4e5a60","name":"dell-105","public_ip":"23.132.252.247","state":"active"}],"items":[{"eligible":true,"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}],"l2_ready":true,"zones":["vn-hcm"]},"schema":{"properties":{"dedicated":{"items":{"additionalProperties":true,"description":"Your Bare Metal servers in the zone: `id`, `name`, `public_ip`, `state`, `eligible` (active subscription).","type":"object"},"type":"array"},"items":{"items":{"additionalProperties":true,"description":"VMs: `id`, `name`, `public_ip`, `state`, `eligible`.","type":"object"},"type":"array"},"l2_ready":{"description":"`false` = VM targets are not open for own IP prefixes yet (Bare Metal still works): VMs in `items` cannot be selected.","type":"boolean"},"zones":{"items":{"description":"Zone code with BGP.","type":"string"},"type":"array"}},"required":["items","dedicated","zones","l2_ready"],"type":"object","x-order":["items","dedicated","zones","l2_ready"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"VMs eligible for own IP prefix (Ho Chi Minh City zone)","tags":["Bring Your Own IP"],"x-cli":"byoip vms eligible","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/vms/eligible\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"VM dùng được dải IP riêng (zone TP. Hồ Chí Minh)"}},"/v1/byoip/{id}":{"get":{"description":"Prefix details: verification checks, the token to publish, ROA/IRR/LOA instructions, attachments and, once active, the VM configuration (policy routing, MTU).\n\n**Required scope:** `byoip:read`.","operationId":"byoip_get","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Prefix details: verification results, instructions, VM setup","tags":["Bring Your Own IP"],"x-cli":"byoip get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Chi tiết dải: kết quả xác minh, hướng dẫn, cấu hình VM"}},"/v1/byoip/{id}/cancel":{"post":{"description":"Cancels a prefix. Before it is charged the request simply ends; after that the setup is removed, the BGP announcement is withdrawn and VMs lose the addresses. The current month is not refunded; a setup that never became active is refunded. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_cancel","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"byoip_state","message":"The prefix already ended."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`byoip_state`: The prefix already ended. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"byoip_state","description":"The prefix already ended."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:destroy"]}],"summary":"Cancel a prefix (remove the setup, withdraw BGP)","tags":["Bring Your Own IP"],"x-cli":"byoip cancel","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/<id>/cancel\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:destroy","x-summary-vi":"Huỷ dải (gỡ cấu hình, rút BGP)"}},"/v1/byoip/{id}/events":{"get":{"description":"Activity log of a prefix (verification, charge, setup, BGP, attachments).\n\n**Required scope:** `byoip:read`.","operationId":"byoip_events","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"args":{"asn":"213035","kind":"own","prefix":"45.12.34.0/24"},"at":1761100000,"id":1,"key":"byoip.requested","kind":"requested","msg":"Requested 45.12.34.0/24 with origin AS213035 (own)","msg_key":"byoip.requested"}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"additionalProperties":true,"description":"Event: `kind`, `msg` (English, public parameters only), `key` (message code for translation, same as `msg_key`), `args`, `at`.","type":"object"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Prefix activity log","tags":["Bring Your Own IP"],"x-cli":"byoip events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/<id>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Nhật ký của dải"}},"/v1/byoip/{id}/move":{"post":{"description":"Transfer the prefix from this VM to another of your VMs (Ho Chi Minh City zone) in one step: detaches old VM and attaches new VM simultaneously. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_vms_move","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"from_id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","to_id":"ds_3f9a1c2b7d4e5a60","to_kind":"dedicated"},"schema":{"properties":{"from_id":{"description":"Currently attached VM or Bare Metal server.","type":"string"},"from_vm_id":{"description":"Same as `from_id` (older clients).","type":"string"},"to_id":{"description":"New VM or Bare Metal server.","type":"string"},"to_kind":{"description":"Kind of the new target (default `vm`); VM to Bare Metal and back are allowed.","enum":["vm","dedicated"],"type":"string"},"to_vm_id":{"description":"Same as `to_id` for a VM (older clients).","type":"string"}},"type":"object","x-order":["from_id","to_id","to_kind","from_vm_id","to_vm_id"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_bound","message":"Prefix is not attached to the old VM."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_bound`: Prefix is not attached to the old VM. `not_found`: Prefix or new VM not found in your account.","x-error-codes":[{"code":"not_bound","description":"Prefix is not attached to the old VM."},{"code":"not_found","description":"Prefix or new VM not found in your account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"already_bound","message":"Prefix is already attached to the new VM."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`already_bound`: Prefix is already attached to the new VM. `target_mixed`: The other attachments of the prefix are of a different kind. `target_busy`: A prefix attaches to one Bare Metal server only. `target_not_active`: The Bare Metal subscription is not active. `l2_not_ready`: Moving to a VM is not open yet; moving to a Bare Metal server is not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"already_bound","description":"Prefix is already attached to the new VM."},{"code":"target_mixed","description":"The other attachments of the prefix are of a different kind."},{"code":"target_busy","description":"A prefix attaches to one Bare Metal server only."},{"code":"target_not_active","description":"The Bare Metal subscription is not active."},{"code":"l2_not_ready","description":"Moving to a VM is not open yet; moving to a Bare Metal server is not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"vm_zone_not_supported","message":"New VM is not in the Ho Chi Minh City zone."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_zone_not_supported`: New VM is not in the Ho Chi Minh City zone. `target_zone_not_supported`: The Bare Metal server is not in the Ho Chi Minh City zone. `target_family_not_supported`: Bare Metal servers take IPv4 prefixes only. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"vm_zone_not_supported","description":"New VM is not in the Ho Chi Minh City zone."},{"code":"target_zone_not_supported","description":"The Bare Metal server is not in the Ho Chi Minh City zone."},{"code":"target_family_not_supported","description":"Bare Metal servers take IPv4 prefixes only."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Move prefix from one VM to another in one step","tags":["Bring Your Own IP"],"x-cli":"byoip vms move","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/<id>/move\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"from_id\":\"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90\",\"to_id\":\"ds_3f9a1c2b7d4e5a60\",\"to_kind\":\"dedicated\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Chuyển dải từ VM này sang VM khác trong một bước"}},"/v1/byoip/{id}/review-request":{"post":{"description":"Asks for a manual review when RPKI and IRR already pass but you cannot publish the token (for example a leased prefix whose whois you cannot edit). Attach the LOA reference in `note`.\n\n**Required scope:** `byoip:write`.","operationId":"byoip_review_request","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"note":"LOA 2026-10-22 issued to Example Ltd"},"schema":{"properties":{"note":{"description":"Message for the reviewer (≤ 1000 characters), e.g. the LOA reference.","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"verify_not_ready","message":"RPKI and IRR must pass first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"RPKI and IRR must pass first. (`verify_not_ready`)","x-error-codes":[{"code":"verify_not_ready","description":"RPKI and IRR must pass first."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Request a manual review (when the token cannot be published)","tags":["Bring Your Own IP"],"x-cli":"byoip review-request","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/<id>/review-request\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"note\":\"LOA 2026-10-22 issued to Example Ltd\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:write","x-summary-vi":"Gửi nhà cung cấp duyệt tay (khi không đặt được token)"}},"/v1/byoip/{id}/verify":{"post":{"description":"Runs the verification now instead of waiting for the next automatic check (every 10 minutes). Limited to once per minute per prefix and 20 per hour per account. When it passes the prefix moves on (charge + setup) immediately.\n\n**Required scope:** `byoip:write`.","operationId":"byoip_verify","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"byoip_state","message":"Only prefixes in `pending_verify` can be verified."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Only prefixes in `pending_verify` can be verified. (`byoip_state`)","x-error-codes":[{"code":"byoip_state","description":"Only prefixes in `pending_verify` can be verified."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Verify again now (RPKI, IRR, token)","tags":["Bring Your Own IP"],"x-cli":"byoip verify","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/<id>/verify\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:write","x-summary-vi":"Xác minh lại ngay (RPKI, IRR, token)"}},"/v1/byoip/{id}/vms":{"get":{"description":"Attached VMs, NIC statuses, and IP configuration commands inside each VM.\n\n**Required scope:** `byoip:read`.","operationId":"byoip_vms_list","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_bind":true,"items":[{"bound_at":1761100000,"nic":"attached","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"needs_vm":false},"schema":{"properties":{"can_bind":{"description":"Can attach, detach, or transfer VMs at this time.","type":"boolean"},"items":{"items":{"additionalProperties":true,"description":"`vm`, `nic`, `setup`, `bound_at`.","type":"object"},"type":"array"},"needs_vm":{"description":"Prefix is active, but no running VM is attached.","type":"boolean"}},"required":["items","needs_vm","can_bind"],"type":"object","x-order":["items","needs_vm","can_bind"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Attached VM + IP configuration commands","tags":["Bring Your Own IP"],"x-cli":"byoip vms list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/byoip/<id>/vms\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"VM đang gắn dải + lệnh cấu hình IP"},"post":{"description":"Attach the prefix to another VM in your Ho Chi Minh City zone (a prefix can attach to multiple VMs). A second NIC is added while the prefix is active. Requires `Idempotency-Key`; 10 attach/detach/transfer operations per minute.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_vms_bind","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"target_id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","target_kind":"vm"},"schema":{"properties":{"target_id":{"description":"VM or Bare Metal server to attach.","type":"string"},"target_kind":{"description":"VM (default) or Bare Metal server.","enum":["vm","dedicated"],"type":"string"},"vm_id":{"description":"Same as `target_id` for a VM (kept for older clients).","type":"string"}},"type":"object","x-order":["target_kind","target_id","vm_id"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Prefix or VM not found in your account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Prefix or VM not found in your account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Prefix or VM not found in your account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_eligible","message":"VM must be running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_eligible`: VM must be running. `l2_not_ready`: VM targets are not open yet; only a Bare Metal server can be attached now. `already_bound`: Prefix is already attached to this VM. `byoip_state`: Prefix has ended or is not used on a VM. `target_not_active`: The Bare Metal subscription is not active (suspended or locked). `target_mixed`: A prefix attaches to VMs or to a Bare Metal server, not both; use move. `target_busy`: A prefix attaches to one Bare Metal server only. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_eligible","description":"VM must be running."},{"code":"l2_not_ready","description":"VM targets are not open yet; only a Bare Metal server can be attached now."},{"code":"already_bound","description":"Prefix is already attached to this VM."},{"code":"byoip_state","description":"Prefix has ended or is not used on a VM."},{"code":"target_not_active","description":"The Bare Metal subscription is not active (suspended or locked)."},{"code":"target_mixed","description":"A prefix attaches to VMs or to a Bare Metal server, not both; use move."},{"code":"target_busy","description":"A prefix attaches to one Bare Metal server only."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"vm_required","message":"No VM selected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_required`: No VM selected. `vm_zone_not_supported`: VM is not in the Ho Chi Minh City zone. `target_required`: No Bare Metal server selected. `target_zone_not_supported`: The Bare Metal server is not in the Ho Chi Minh City zone. `target_family_not_supported`: Bare Metal servers take IPv4 prefixes only. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"vm_required","description":"No VM selected."},{"code":"vm_zone_not_supported","description":"VM is not in the Ho Chi Minh City zone."},{"code":"target_required","description":"No Bare Metal server selected."},{"code":"target_zone_not_supported","description":"The Bare Metal server is not in the Ho Chi Minh City zone."},{"code":"target_family_not_supported","description":"Bare Metal servers take IPv4 prefixes only."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Attach prefix to an additional VM","tags":["Bring Your Own IP"],"x-cli":"byoip vms bind","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/<id>/vms\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"target_id\":\"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90\",\"target_kind\":\"vm\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Gắn dải vào thêm một VM"}},"/v1/byoip/{id}/vms/{vm}":{"delete":{"description":"Detach prefix from a VM. Detaching the last VM ⇒ prefix waits for another VM (`needs_vm`), BGP remains active. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_vms_detach","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Identifier of the resource.","in":"path","name":"vm","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_bound","message":"Prefix is not attached to this VM."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Prefix is not attached to this VM. (`not_bound`)","x-error-codes":[{"code":"not_bound","description":"Prefix is not attached to this VM."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","message":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result. (`idempotency_in_progress`)","x-error-codes":[{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Detach prefix from VM (last VM ⇒ prefix pending attachment, BGP retained)","tags":["Bring Your Own IP"],"x-cli":"byoip vms detach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/byoip/<id>/vms/<vm>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Gỡ dải khỏi VM (VM cuối ⇒ dải chờ gắn, BGP giữ nguyên)"}},"/v1/byoip/{id}/vpc-requests":{"post":{"description":"Request to attach prefix to your Private Cloud (VPC). The network team sets it up manually within 1–2 business days and reports results in the prefix logs. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_vpc_request","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"note":"tier web","vpc_id":"9c8b7a6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"},"schema":{"properties":{"note":{"description":"Note for the network team (≤ 500 characters).","type":"string"},"vpc_id":{"description":"Your Private Cloud.","type":"string"}},"required":["vpc_id"],"type":"object","x-order":["vpc_id","note"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Prefix or Private Cloud not found in your account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Prefix or Private Cloud not found in your account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Prefix or Private Cloud not found in your account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vpc_request_open","message":"A request is already pending."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vpc_request_open`: A request is already pending. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vpc_request_open","description":"A request is already pending."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: A field is missing, malformed or out of range. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Request prefix attachment to Private Cloud (manually set up by network team)","tags":["Bring Your Own IP"],"x-cli":"byoip vpc request","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/byoip/<id>/vpc-requests\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"note\":\"tier web\",\"vpc_id\":\"9c8b7a6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Yêu cầu gắn dải vào Private Cloud (đội mạng dựng thủ công)"}},"/v1/byoip/{id}/vpc-requests/{rid}":{"delete":{"description":"Cancel a pending Private Cloud attachment request. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"byoip_vpc_request_delete","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Identifier of the resource.","in":"path","name":"rid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"byoip":{"activated_at":null,"asn":213035,"attachments":[],"bgp":{"announce":false,"propagated_at":null,"ris_peers_seeing":null,"roa":null,"withdraw_reason":null},"billing":{"charged_cents":0,"month_vnd":0,"setup_vnd":0,"subscription":null},"can":{"attach":false,"bind":true,"cancel":true,"review_request":false,"verify":true},"checks":{"blocklist":{"checked":true,"ok":true},"irr":{"ok":true,"origins":[213035],"sources":["RADB"]},"kind_hint":{"ok":true},"proof":{"ok":false,"token":"byoip-verify=0123456789abcdef","via":"none"},"routing":{"ok":true,"origins":[]},"rpki":{"ok":false,"status":"unknown"}},"created_at":1761100000,"ended_at":null,"family":4,"gateway":null,"id":12,"instructions":{"irr":{"object":"route","text":"route: 45.12.34.0/24\norigin: AS213035"},"roa":{"max_length":24,"origin_asn":213035,"prefix":"45.12.34.0/24"},"token_line":"byoip-verify=0123456789abcdef"},"kind":"own","kind_label":"Own IP","needs_vm":false,"prefix":"45.12.34.0/24","public_error":null,"setup":null,"state":"pending_verify","target_kind":"vm","token":"0123456789abcdef","updated_at":1761100000,"usage":"vm","verify":{"attempts":1,"checked_at":1761100000,"expires_at":1761704800,"next_check_at":1761100600,"verified_at":null},"vms":[{"bound_at":1761100000,"nic":"pending","setup":null,"vm":{"id":"4f1c2b7e-0d5a-4b8e-9a51-2f6c1d3e7a90","name":"web-1","public_ip":"203.0.113.10","state":"active"}}],"vpc_requests":[]}},"schema":{"properties":{"byoip":{"$ref":"#/components/schemas/Byoip"}},"required":["byoip"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Pending request not found."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Pending request not found. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Pending request not found."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","message":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result. (`idempotency_in_progress`)","x-error-codes":[{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Cancel pending Private Cloud attachment request","tags":["Bring Your Own IP"],"x-cli":"byoip vpc request delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/byoip/<id>/vpc-requests/<rid>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Huỷ yêu cầu gắn Private Cloud đang chờ"}},"/v1/chat/agent/sessions":{"get":{"description":"Lists your AI agent conversations that have at least one message, most recently active first. Filter by server with `vm_id`, and search titles and server names with `q`.\n\n**Required scope:** `vm:read`.","operationId":"agent_session_list","parameters":[{"description":"Only conversations about this server.","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}},{"description":"Text to look for in the title or the server name.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"updated_at","enum":["updated_at","created_at","title","vm","message_count","commands"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"ai_calls":2,"awaiting_confirm":false,"commands":1,"created_at":1792399000,"id":"ais_9b1d4c0a7e3f5a21c6d8","kind":"vm","message_count":2,"model":"example-model-1","title":"How much disk space is left?","updated_at":1792399012,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1"}],"page":1,"per_page":30,"total":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AiAgentSession"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"List AI SSH Agent conversations","tags":["Console and AI Agent"],"x-cli":"agent session list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/chat/agent/sessions\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Danh sách phiên AI SSH Agent"},"post":{"description":"Starts a new, empty conversation with the AI agent about one of your servers (a VM, or a Bare Metal server by its `ds_…` identifier). The conversation stays bound to that server. It is listed once it has a message; send one with [Send to the AI agent](#operation/agent_session_send). Limited to 30 per minute per account.\n\n**Required scope:** `vm:write`.","operationId":"agent_session_create","parameters":[],"requestBody":{"content":{"application/json":{"example":{"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"title":{"description":"Title, at most 80 characters. Defaults to the first request you send.","type":"string"},"vm_id":{"description":"Server the agent will work on: a VM UUID, or the `ds_…` identifier of a Bare Metal server.","type":"string"}},"required":["vm_id"],"type":"object","x-order":["vm_id","title"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"ai_calls":0,"awaiting_confirm":false,"commands":0,"created_at":1792400000,"id":"ais_5d2e8a1c7b3f9046e1a2","kind":"vm","message_count":0,"model":"example-model-1","title":"New chat","updated_at":1792400000,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1"},"schema":{"$ref":"#/components/schemas/AiAgentSession"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `impersonate_forbidden`: Bare Metal servers cannot be used from a session a reseller opened on your behalf. `scope_required`: Bare Metal servers need the `dedicated:console` scope on an API key.","x-error-codes":[{"code":"impersonate_forbidden","description":"Bare Metal servers cannot be used from a session a reseller opened on your behalf."},{"code":"scope_required","description":"Bare Metal servers need the `dedicated:console` scope on an API key."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist, or it belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist, or it belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist, or it belongs to another account."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Start an AI SSH Agent conversation for a VM","tags":["Console and AI Agent"],"x-cli":"agent session create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/chat/agent/sessions\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"vm_id\":\"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Tạo phiên AI SSH Agent cho một VM"}},"/v1/chat/agent/sessions/{sid}":{"delete":{"description":"Deletes a conversation and all its messages, including the record of the commands it ran — so it needs the same `vm:console` scope that runs commands. This cannot be undone. A conversation that is answering right now cannot be deleted (`409 session_busy`).\n\n**Required scope:** `vm:console`.","operationId":"agent_session_delete","parameters":[{"description":"AI agent conversation identifier (`ais_…`).","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: A Bare Metal conversation cannot be used from a session a reseller opened on your behalf. (`impersonate_forbidden`)","x-error-codes":[{"code":"impersonate_forbidden","description":"A Bare Metal conversation cannot be used from a session a reseller opened on your behalf."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"session_busy","message":"The agent is answering in this conversation right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The agent is answering in this conversation right now. (`session_busy`)","x-error-codes":[{"code":"session_busy","description":"The agent is answering in this conversation right now."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Delete an AI SSH Agent conversation (with its command history)","tags":["Console and AI Agent"],"x-cli":"agent session delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/chat/agent/sessions/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Xoá phiên AI SSH Agent (kèm lịch sử lệnh)"},"get":{"description":"Returns one conversation with its latest 100 messages, oldest first. Command output is stored cut to 16000 characters (stderr 8000). Limited to 120 requests per minute per account. Each answer lists the commands the agent proposed or ran in `meta.steps`; a step with `status: pending` waits for your decision (see [Send to the AI agent](#operation/agent_session_send)). `running` is true while an answer is being produced.\n\n**Required scope:** `vm:read`.","operationId":"agent_session_get","parameters":[{"description":"AI agent conversation identifier (`ais_…`).","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"messages":[{"content":"How much disk space is left?","created_at":1792399000,"id":101,"meta":null,"role":"user"},{"content":"I will check the free disk space.","created_at":1792399012,"id":102,"meta":{"awaiting_confirm":true,"model":"example-model-1","steps":[{"command":"df -h /","id":"call_1","reason":"Check free disk space","status":"pending"}]},"role":"assistant"}],"running":false,"session":{"ai_calls":1,"awaiting_confirm":true,"commands":0,"created_at":1792399000,"id":"ais_9b1d4c0a7e3f5a21c6d8","kind":"vm","message_count":2,"model":"example-model-1","title":"Disk","updated_at":1792399012,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1"}},"schema":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/AiAgentMessage"},"type":"array"},"running":{"description":"True while the agent is answering in this conversation.","type":"boolean"},"session":{"$ref":"#/components/schemas/AiAgentSession"}},"required":["session","messages","running"],"type":"object","x-order":["session","messages","running"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: A Bare Metal conversation cannot be used from a session a reseller opened on your behalf. (`impersonate_forbidden`)","x-error-codes":[{"code":"impersonate_forbidden","description":"A Bare Metal conversation cannot be used from a session a reseller opened on your behalf."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Get an AI SSH Agent conversation with messages","tags":["Console and AI Agent"],"x-cli":"agent session get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/chat/agent/sessions/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Chi tiết phiên AI SSH Agent + tin nhắn"},"patch":{"description":"Renames a conversation. Control characters are removed and the title is cut to 80 characters; an empty title fails with `422 invalid_argument`.\n\n**Required scope:** `vm:write`.","operationId":"agent_session_rename","parameters":[{"description":"AI agent conversation identifier (`ais_…`).","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"title":"Nginx setup"},"schema":{"properties":{"title":{"description":"New title, 1 to 80 characters.","type":"string"}},"required":["title"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"ai_calls":1,"awaiting_confirm":false,"commands":0,"created_at":1792399000,"id":"ais_9b1d4c0a7e3f5a21c6d8","kind":"vm","message_count":2,"model":"example-model-1","title":"Nginx setup","updated_at":1792399012,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1"},"schema":{"$ref":"#/components/schemas/AiAgentSession"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: A Bare Metal conversation cannot be used from a session a reseller opened on your behalf. (`impersonate_forbidden`)","x-error-codes":[{"code":"impersonate_forbidden","description":"A Bare Metal conversation cannot be used from a session a reseller opened on your behalf."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Rename an AI SSH Agent conversation","tags":["Console and AI Agent"],"x-cli":"agent session rename","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/chat/agent/sessions/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"Nginx setup\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Đổi tên phiên AI SSH Agent"}},"/v1/chat/agent/sessions/{sid}/messages":{"post":{"description":"Sends a request to the AI agent in a conversation, or answers a command that waits for your confirmation. The agent works on the conversation's server over SSH and the conversation history is taken from the server side, so you only send the new message. The response is a stream of server-sent events (`text/event-stream`), the same events as [Run the AI agent](#operation/vm_ai_agent_run), plus `step_skipped`.\n\nSend exactly one of:\n\n- `content`: your request (at most 4000 characters).\n- `confirm`: `{\"step_id\": \"…\", \"action\": \"run\"}` runs the command of that pending step exactly as it was proposed (you cannot change it), then the agent continues; `\"action\": \"skip\"` declines it. Only a pending step of the latest answer can be confirmed; otherwise the call fails with `409 step_not_pending`. Declining (`skip`) works even when the server is stopped or locked.\n\nWith `auto_execute: true` the agent only runs read-only commands by itself (checking status, reading logs/configuration, network diagnostics), up to 10 steps per request; all commands that modify the server stop for confirmation (`tool_request` has `read_only: false`); commands that look dangerous (deleting or overwriting files, changing accounts or keys, piping downloads into a shell, shutting down or rebooting, connecting to other machines) also carry `risk_code` (`destructive`, `files`, `exfil`, `raw_net`, `auth`, `obfuscated`, `remote_script`, `power_fw`, `pivot`) next to the human-readable `risk_reason`. The pivot check is a warning, not an isolation boundary: the agent can only ever reach this server, but commands it runs there can open connections like any shell. One request at a time per conversation (`409 session_busy`), 2 streaming conversations per account, 20 requests per minute and a daily AI call quota per account (`429 rate_limited`; the quota is shared by VMs and Bare Metal servers). The server must be active and running.\n\n**Bare Metal servers** use the same operation. Their eligibility is checked again on every request and before every command the agent runs (subscription active, server not locked, no operating system install in progress, Linux, powered on, public address valid), including for conversations created earlier; the Bare Metal errors listed below carry the reason. Commands that shut down, reboot, delete data or repartition disks always wait for your confirmation. Output is cleaned of the server's password before it is stored or shown to the AI.\n\n**Required scope:** `vm:console`.","operationId":"agent_session_send","parameters":[{"description":"AI agent conversation identifier (`ais_…`).","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_execute":false,"content":"How much disk space is left?"},"schema":{"properties":{"auto_execute":{"description":"Run read-only commands without asking. Defaults to `false`.","type":"boolean"},"confirm":{"properties":{"action":{"description":"`run` executes the proposed command, `skip` declines it.","enum":["run","skip"],"type":"string"},"step_id":{"description":"Identifier of the pending step (from `tool_request` or `meta.steps`).","type":"string"}},"required":["step_id","action"],"type":"object","x-order":["step_id","action"]},"content":{"description":"Your request to the agent.","type":"string"}},"type":"object","x-order":["content","confirm","auto_execute"]}}},"required":true},"responses":{"200":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/AiAgentEvent"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `impersonate_forbidden`: Bare Metal conversations cannot be used from a session a reseller opened on your behalf. `scope_required`: Bare Metal conversations need the `dedicated:console` scope on an API key.","x-error-codes":[{"code":"impersonate_forbidden","description":"Bare Metal conversations cannot be used from a session a reseller opened on your behalf."},{"code":"scope_required","description":"Bare Metal conversations need the `dedicated:console` scope on an API key."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_running","message":"The server is not active and running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_running`: The server is not active and running. `vm_not_agent_ready`: The server cannot be used by the agent (Windows, or no address). `dedicated_ssh_unsupported`: Bare Metal: the operating system is not Linux. `dedicated_installing`: Bare Metal: an operating system install is in progress. `dedicated_powered_off`: Bare Metal: the server is powered off. `dedicated_no_ip`: Bare Metal: the server has no usable public address. `session_busy`: The agent is already answering in this conversation. `step_not_pending`: The step is not waiting for confirmation (already run, skipped, or a newer answer exists).","x-error-codes":[{"code":"vm_not_running","description":"The server is not active and running."},{"code":"vm_not_agent_ready","description":"The server cannot be used by the agent (Windows, or no address)."},{"code":"dedicated_ssh_unsupported","description":"Bare Metal: the operating system is not Linux."},{"code":"dedicated_installing","description":"Bare Metal: an operating system install is in progress."},{"code":"dedicated_powered_off","description":"Bare Metal: the server is powered off."},{"code":"dedicated_no_ip","description":"Bare Metal: the server has no usable public address."},{"code":"session_busy","description":"The agent is already answering in this conversation."},{"code":"step_not_pending","description":"The step is not waiting for confirmation (already run, skipped, or a newer answer exists)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason`, `destroy_after` and `locked_at`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_locked`: The server is locked, for example because the wallet ran out of funds. The error carries `reason`, `destroy_after` and `locked_at`. `dedicated_server_locked`: Bare Metal: the server is locked. `dedicated_suspended`: Bare Metal: the subscription is suspended.","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason`, `destroy_after` and `locked_at`."},{"code":"dedicated_server_locked","description":"Bare Metal: the server is locked."},{"code":"dedicated_suspended","description":"Bare Metal: the subscription is suspended."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The AI agent is switched off for this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The AI agent is switched off for this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The AI agent is switched off for this site."}]}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Send to the AI SSH Agent / confirm a command (SSE stream)","tags":["Console and AI Agent"],"x-cli":"agent session send","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/chat/agent/sessions/<sid>/messages\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_execute\":false,\"content\":\"How much disk space is left?\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Gửi yêu cầu / xác nhận lệnh cho AI SSH Agent (SSE stream)"}},"/v1/chat/agent/vms":{"get":{"description":"Lists your servers (VMs first, at most 500, by name; then your Bare Metal servers) with whether the AI SSH agent can work on each one right now. `kind` tells them apart: `vm` or `dedicated` (a Bare Metal server, identified by `ds_…`). A server is `ready` when it is active, running, not locked, runs Linux and has an address; a Bare Metal server must also have an active subscription and no operating system install in progress. Otherwise `reason` says why: `locked` (billing or admin lock), `not_active` (still being created or being deleted), `stopped`, `windows` (the agent needs a Linux shell), `no_ip`, `suspended` (Bare Metal subscription suspended), `installing` (Bare Metal operating system install in progress), `impersonated` (Bare Metal server seen in a session a reseller opened on your behalf; the agent cannot run there) or `unavailable` (managed by another provider for now). Bare Metal servers are only listed on the main site (not on reseller sites) and, when you use an API key, only with the `dedicated:console` scope; in a session a reseller opened on your behalf they are listed but never ready. `last_session_at` is the time of your latest conversation with the agent on that server. The response also carries whether the agent is switched on, the model it uses and your daily quota.\n\n**Required scope:** `vm:read`.","operationId":"agent_vms","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"items":[{"cs_state":"Running","hostname":"web-1","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","kind":"vm","last_session_at":1792399012,"name":"web-1","os":"Ubuntu 24.04","public_ip":"203.0.113.10","ready":true,"reason":null,"state":"active","zone":{"city":"Hanoi","country":"VN","id":1,"name":"Hanoi 1","name_en":"Hanoi 1","slug":"hn1"}},{"cs_state":null,"hostname":"bm-1","id":"ds_3f6c1d0e8a52b57a","kind":"dedicated","last_session_at":null,"name":"bm-1","os":"Ubuntu Server 24.04 LTS","power_state":"On","public_ip":"203.0.113.50","ready":true,"reason":null,"state":"active","zone":null}],"model":"example-model-1","quota":{"limit":300,"reset_at":1792454400,"used":12}},"schema":{"properties":{"enabled":{"description":"Whether the AI agent is switched on for this site.","type":"boolean"},"items":{"items":{"properties":{"cs_state":{"description":"Power state reported by the platform (`Running`, `Stopped`…). Null for a Bare Metal server.","type":["string","null"]},"hostname":{"description":"Hostname; for a Bare Metal server, the one reported by its operating system (null until known).","type":["string","null"]},"id":{"description":"Server identifier (VM UUID, or `ds_…` for a Bare Metal server).","type":"string"},"kind":{"description":"`vm` for a virtual machine, `dedicated` for a Bare Metal server.","enum":["vm","dedicated"],"type":"string"},"last_session_at":{"description":"Time of the latest agent conversation on this server (Unix time, seconds, UTC)","type":["integer","null"]},"name":{"description":"Display name.","type":"string"},"os":{"description":"Operating system image name.","type":["string","null"]},"power_state":{"description":"Bare Metal servers only: power state (`On`, `Off`…).","type":["string","null"]},"public_ip":{"description":"Public IPv4 address.","type":["string","null"]},"ready":{"description":"True when the agent can work on the server now.","type":"boolean"},"reason":{"description":"Why the server is not ready; null when it is.","enum":["locked","not_active","stopped","windows","no_ip","suspended","installing","unavailable","impersonated",null],"type":["string","null"]},"state":{"description":"Lifecycle state (`active`, `locked`, `provisioning`…).","type":"string"},"zone":{"additionalProperties":true,"description":"Location of the server (`id`, `slug`, `name`, `name_en`, `country`, `city`). Null for a Bare Metal server.","type":["object","null"]}},"required":["kind","id","name","hostname","public_ip","os","zone","state","cs_state","ready","reason","last_session_at"],"type":"object","x-order":["kind","id","name","hostname","public_ip","os","zone","state","cs_state","power_state","ready","reason","last_session_at"]},"type":"array"},"model":{"description":"Model in use.","type":"string"},"quota":{"$ref":"#/components/schemas/AiAgentQuota"}},"required":["items","enabled","model","quota"],"type":"object","x-order":["items","enabled","model","quota"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"VMs usable by the AI SSH Agent + daily quota","tags":["Console and AI Agent"],"x-cli":"agent vms","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/chat/agent/vms\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"VM dùng được AI SSH Agent + hạn mức ngày"}},"/v1/chat/agent/vms/{id}/connect":{"post":{"description":"Checks that the agent can log in to the server over SSH, using the saved credentials (for a Bare Metal server, the login of its current operating system install unless you saved another one in its SSH tab) or the platform's operations key — you never send or receive a password. The platform runs a fixed, read-only command (login name, hostname, kernel and OS name) and does not use your AI quota. `connected: false` comes with `error_code`: `auth_failed` (log in once in the SSH console so the password is saved), `timeout`, `unreachable` (SSH not listening or blocked by a firewall) or `proxy_unavailable`. Limited to 10 checks per minute per account. The result is remembered for 60 seconds (300 seconds after a failure) so that opening the page repeatedly does not log in again and again (a wrong saved password could get the gateway banned by fail2ban); pass `force=1` to check again now. No body is needed.\n\n**Required scope:** `vm:console`.","operationId":"agent_connect","parameters":[{"description":"Server identifier: a VM UUID, or the identifier of a Bare Metal server (`ds_…`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Check again now instead of returning the remembered result.","in":"query","name":"force","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"connected":true,"error_code":null,"hostname":"web-1","ip":"203.0.113.10","kernel":"Linux 6.8.0-45-generic","kind":"vm","latency_ms":640,"os":"Ubuntu 24.04.1 LTS","username":"root","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"connected":{"description":"True when the SSH login worked.","type":"boolean"},"error_code":{"description":"Why the check failed; null when connected.","enum":["auth_failed","timeout","unreachable","proxy_unavailable",null],"type":["string","null"]},"hostname":{"description":"Hostname reported by the server; null when not connected.","type":["string","null"]},"ip":{"description":"Address the agent connects to. It is always read on the server side (the VM's public address, or the Bare Metal server's current public address on port 22); you cannot choose it.","type":["string","null"]},"kernel":{"description":"Kernel reported by the server; null when not connected.","type":["string","null"]},"kind":{"description":"`vm` or `dedicated` (Bare Metal).","enum":["vm","dedicated"],"type":"string"},"latency_ms":{"description":"How long the check took, in milliseconds.","type":"integer"},"os":{"description":"Operating system name (from the server when connected, otherwise the image name).","type":["string","null"]},"username":{"description":"Login name on the server; null when not connected.","type":["string","null"]},"vm_id":{"description":"Server identifier.","type":"string"}},"required":["connected","vm_id","kind","ip","username","hostname","kernel","os","latency_ms","error_code"],"type":"object","x-order":["connected","vm_id","kind","ip","username","hostname","kernel","os","latency_ms","error_code"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `impersonate_forbidden`: Bare Metal servers cannot be used from a session a reseller opened on your behalf. `scope_required`: Bare Metal servers need the `dedicated:console` scope on an API key.","x-error-codes":[{"code":"impersonate_forbidden","description":"Bare Metal servers cannot be used from a session a reseller opened on your behalf."},{"code":"scope_required","description":"Bare Metal servers need the `dedicated:console` scope on an API key."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_running","message":"The server is not active and running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_running`: The server is not active and running. `vm_not_agent_ready`: The server cannot be used by the agent (Windows, or no address). `dedicated_ssh_unsupported`: Bare Metal: the operating system is not Linux. `dedicated_installing`: Bare Metal: an operating system install is in progress. `dedicated_powered_off`: Bare Metal: the server is powered off. `dedicated_no_ip`: Bare Metal: the server has no usable public address.","x-error-codes":[{"code":"vm_not_running","description":"The server is not active and running."},{"code":"vm_not_agent_ready","description":"The server cannot be used by the agent (Windows, or no address)."},{"code":"dedicated_ssh_unsupported","description":"Bare Metal: the operating system is not Linux."},{"code":"dedicated_installing","description":"Bare Metal: an operating system install is in progress."},{"code":"dedicated_powered_off","description":"Bare Metal: the server is powered off."},{"code":"dedicated_no_ip","description":"Bare Metal: the server has no usable public address."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_locked`: The server is locked, for example because the wallet ran out of funds. `dedicated_server_locked`: Bare Metal: the server is locked. `dedicated_suspended`: Bare Metal: the subscription is suspended.","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds."},{"code":"dedicated_server_locked","description":"Bare Metal: the server is locked."},{"code":"dedicated_suspended","description":"Bare Metal: the subscription is suspended."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Check the agent SSH login (fixed command)","tags":["Console and AI Agent"],"x-cli":"agent connect","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/chat/agent/vms/<id>/connect\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Thăm dò đăng nhập SSH của Agent (lệnh cố định)"}},"/v1/client/quota":{"get":{"description":"Returns the resource limits of your account and how much you use. When quota is switched on for the site, limits follow the money you have really deposited (`deposited_cents`): your tier `level` (L0..L5, one scale for every service) caps the number of servers and the TOTAL vCPU, memory and disk (`caps`, `limit`), and `tier` is the largest single machine your deposits cover (`cost_hours` of running cost, default 720). Bonuses, vouchers, promotions, affiliate commission and admin credits marked as gifts do not count; refunds lower it; manual admin credits count by default. Servers you already run above a cap are never stopped or downsized: only new servers, resizes and scale-ups are refused. `max_vms_24h`, `max_vms_30d`, `is_30d_achieved` and `need_for_10_cents` are deprecated and only kept for old clients. `next` tells how much more to deposit to reach the next largest machine; `levels` and `services.table` give the tier scale.\n\n`applies` is false when quota is off for the site or lifted for your account; `limit` is then `null`, which means no limit. Also reports the OS image limits of the Images service under `images`.\n\n**Required scope:** `billing:read`.","operationId":"billing_quota","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"applies":true,"balance_cents":1850,"cost_24h_cents":11,"cost_30d_next_vm_cents":339,"cost_30d_running_cents":339,"deposited_cents":2000,"enabled":true,"funds_cents":1850,"funds_source":"wallet_ledger","images":{"count":0,"gb":0,"iso_max_gb":10,"max_count":10,"max_gb":200,"template_max_gb":50},"is_30d_achieved":false,"limit":{"cpu":2,"disk_gb":60,"ram_mb":4096,"vm":0},"max_vms":2,"max_vms_24h":2,"max_vms_30d":10,"min_hours":2,"need_for_10_cents":520,"next":null,"override":null,"services":{"applies":true,"enabled":true,"funds_cents":2000,"items":[{"default":10,"key":"vpn.ips","limit":10,"pct":30,"service":"vpn","source":"tier","unit":"ip","used":3},{"default":2000,"key":"proxy6.ips","limit":2000,"pct":0,"service":"vpn","source":"tier","unit":"ip","used":0},{"default":10,"key":"ai.keys","limit":null,"pct":null,"service":"ai","source":"override","unit":"key","used":1}],"level":1,"levels":[0,1000,5000,20000,100000],"next_level_cents":3000},"source":"balance","tier":{"cost_24h_cents":11,"cost_30d_cents":339,"cpu":2,"disk_gb":60,"hourly_uusd":4704,"month_cents":343,"name":"Standard 2/4","plan_id":3,"ram_mb":4096,"slug":"s-2c-4g"},"tier_funds_cents":2000,"tier_rule":"deposit_30d","tiers":[{"cost_24h_cents":11,"cost_30d_cents":339,"cpu":2,"disk_gb":60,"hourly_uusd":4704,"month_cents":343,"name":"Standard 2/4","plan_id":3,"ram_mb":4096,"slug":"s-2c-4g"}],"used":{"cpu":2,"disk_gb":60,"ram_mb":4096,"vm":1},"used_by":{"k8s":{"cpu":0,"disk_gb":0,"ram_mb":0,"vm":0},"vms":{"cpu":2,"disk_gb":60,"ram_mb":4096,"vm":1},"volumes_disk_gb":0},"vms":1},"schema":{"properties":{"applies":{"description":"Whether the limits apply to your account.","type":"boolean"},"balance_cents":{"description":"Wallet balance in US cents (can be negative).","type":"integer"},"caps":{"properties":{"disk_gb":{"description":"Most disk in GiB across all servers and data volumes, or null.","type":["integer","null"]},"ram_gb":{"description":"Most RAM in GiB across all servers, or null.","type":["integer","null"]},"vcpu":{"description":"Most vCPU across all servers, or null.","type":["integer","null"]},"vm_count":{"description":"Most servers (VMs + Kubernetes workers) your tier allows, or null when unlimited.","type":["integer","null"]}},"required":["vm_count","vcpu","ram_gb","disk_gb"],"type":"object","x-order":["vm_count","vcpu","ram_gb","disk_gb"]},"cost_24h_cents":{"description":"Deprecated. Cost of 24 hours of your current resource step, in US cents. Use `tier.cost_30d_cents`.","type":"integer"},"cost_30d_next_vm_cents":{"description":"Cost of 720 hours of one more server of the cheapest plan, in US cents.","type":"integer"},"cost_30d_running_cents":{"description":"Cost of 720 hours of all your running servers, in US cents.","type":"integer"},"cost_hours":{"description":"Hours of running cost a plan must be covered for (default 720 = 30 days) to count as unlocked for a single machine.","type":"integer"},"deposited_cents":{"description":"Real money you have deposited, in US cents: completed payments and bank transfers minus refunds. This decides your resource step. Bonuses, vouchers and promotions are not included.","type":"integer"},"enabled":{"description":"Whether quota is switched on for the site.","type":"boolean"},"funds_cents":{"description":"Wallet balance counted as available funds, never below 0.","type":"integer"},"funds_source":{"description":"Where funds are counted from (`wallet_ledger`).","type":"string"},"images":{"properties":{"count":{"description":"Images and ISOs you have.","type":"integer"},"gb":{"description":"Space they use, in GiB.","type":"integer"},"iso_max_gb":{"description":"Largest ISO accepted, in GiB.","type":"integer"},"max_count":{"description":"Maximum number of images and ISOs.","type":"integer"},"max_gb":{"description":"Maximum total size, in GiB.","type":"integer"},"template_max_gb":{"description":"Largest OS image accepted, in GiB.","type":"integer"}},"required":["count","gb","max_count","max_gb","iso_max_gb","template_max_gb"],"type":"object","x-order":["count","gb","max_count","max_gb","iso_max_gb","template_max_gb"]},"is_30d_achieved":{"description":"Whether your funds cover 720 hours of the fleet plus one more server.","type":"boolean"},"level":{"description":"Your tier L0..L5, decided by `deposited_cents` against `levels`. One tier scale serves every service, VMs included.","type":"integer"},"levels":{"items":{"description":"Deposit threshold of each tier L0..L5, in US cents.","type":"integer"},"type":"array"},"limit":{"anyOf":[{"$ref":"#/components/schemas/AccountQuotaResources"},{"type":"null"}]},"max_vms":{"description":"Server cap that applies to you right now (`max_vms_30d` when `is_30d_achieved`, otherwise `max_vms_24h`).","type":"integer"},"max_vms_24h":{"description":"Server cap while funds are below the 720-hour level.","type":"integer"},"max_vms_30d":{"description":"Server cap once funds cover 720 hours of the fleet.","type":"integer"},"min_hours":{"description":"Hours of the new server's price the balance must cover to create one.","type":"integer"},"need_for_10_cents":{"description":"How much more to add to the wallet to reach the 720-hour level, in US cents. 0 when already reached or at the hard cap.","type":"integer"},"next":{"properties":{"need_cents":{"description":"Amount still to deposit to unlock that step, in US cents.","type":"integer"},"need_more_cents":{"description":"Amount still to deposit to unlock that step, in US cents (same as `need_cents`).","type":"integer"},"required_deposit_cents":{"description":"Total deposits that unlock that step: its 720-hour cost, in US cents.","type":"integer"},"tier":{"$ref":"#/components/schemas/AccountQuotaTier"}},"required":["tier","need_more_cents","need_cents","required_deposit_cents"],"type":["object","null"],"x-order":["tier","need_more_cents","need_cents","required_deposit_cents"]},"override":{"properties":{"actor":{"description":"Who set the override.","type":"string"},"at":{"description":"When it was set (Unix time, seconds, UTC)","type":"integer"},"kind":{"description":"`unlimited`, `plan` (pinned to a step) or `default`.","type":"string"},"plan_id":{"description":"Plan the account is pinned to.","type":["integer","null"]},"reason":{"description":"Reason recorded for the override.","type":"string"}},"required":["kind","plan_id","reason","actor","at"],"type":["object","null"],"x-order":["kind","plan_id","reason","actor","at"]},"services":{"properties":{"applies":{"description":"Whether the per-service limits apply to your account.","type":"boolean"},"enabled":{"description":"Whether per-service quotas are switched on.","type":"boolean"},"funds_cents":{"description":"The funds figure used to pick the level.","type":"integer"},"items":{"items":{"properties":{"default":{"description":"Default limit for your level, or null when unlimited.","type":["integer","null"]},"key":{"description":"Quota key, such as `vpn.ips`, `gpu.instances`, `k8s.workers`, `s3.storage_gb`.","type":"string"},"limit":{"description":"Your limit, or null when unlimited.","type":["integer","null"]},"pct":{"description":"`used` as a percentage of `limit`, or null when unlimited.","type":["integer","null"]},"service":{"description":"Service the key belongs to.","type":"string"},"source":{"description":"`tier` (default for your level), `override` (set for your account) or `disabled`.","type":"string"},"unit":{"description":"Unit of `used` and `limit`.","type":"string"},"used":{"description":"Amount in use now, measured from live data.","type":"integer"}},"required":["key","service","unit","used","limit","pct","source","default"],"type":"object","x-order":["key","service","unit","used","limit","pct","source","default"]},"type":"array"},"level":{"description":"Your quota level (0-5). Levels follow your total real deposits; spending never lowers it, refunding a deposit does.","type":"integer"},"levels":{"items":{"description":"Funds threshold of each level, in US cents.","type":"integer"},"type":"array"},"next_level_cents":{"description":"How much more to fund to reach the next level, or null at the top.","type":["integer","null"]}},"required":["enabled","applies","level","levels","funds_cents","next_level_cents","items"],"type":"object","x-order":["enabled","applies","level","levels","funds_cents","next_level_cents","items"]},"source":{"description":"Why these limits apply: quota off, an unlimited override, a pinned step, your wallet funds, or `none` when the funds do not reach the cheapest step yet.","enum":["disabled","override_unlimited","override_plan","balance","none"],"type":"string"},"tier":{"anyOf":[{"$ref":"#/components/schemas/AccountQuotaTier"},{"type":"null"}]},"tier_funds_cents":{"description":"Deprecated. Equal to `deposited_cents`.","type":"integer"},"tier_rule":{"description":"How the largest single machine is decided: `deposit_30d` = real deposits against the cost (`cost_hours`, default 720) of each plan.","type":"string"},"tiers":{"description":"All steps, from the smallest to the largest.","items":{"$ref":"#/components/schemas/AccountQuotaTier"},"type":"array"},"used":{"$ref":"#/components/schemas/AccountQuotaResources"},"used_by":{"properties":{"k8s":{"$ref":"#/components/schemas/AccountQuotaResources"},"vms":{"$ref":"#/components/schemas/AccountQuotaResources"},"volumes_disk_gb":{"description":"Disk used by data volumes, in GiB.","type":"integer"}},"required":["vms","volumes_disk_gb","k8s"],"type":"object","x-order":["vms","volumes_disk_gb","k8s"]},"vms":{"description":"Number of servers in use.","type":"integer"}},"required":["enabled","applies","deposited_cents","balance_cents","funds_cents","tier_funds_cents","tier_rule","level","levels","caps","cost_hours","funds_source","used","used_by","vms","max_vms_24h","max_vms_30d","min_hours","max_vms","is_30d_achieved","services","cost_24h_cents","cost_30d_running_cents","cost_30d_next_vm_cents","need_for_10_cents","limit","tier","tiers","next","override","source"],"type":"object","x-order":["enabled","applies","deposited_cents","balance_cents","funds_cents","tier_funds_cents","tier_rule","level","levels","caps","cost_hours","funds_source","used","used_by","vms","max_vms_24h","max_vms_30d","min_hours","max_vms","is_30d_achieved","services","cost_24h_cents","cost_30d_running_cents","cost_30d_next_vm_cents","need_for_10_cents","limit","tier","tiers","next","override","source","images"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Resource quota of the account","tags":["Account"],"x-cli":"billing quota","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/client/quota\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Hạn mức tài nguyên của tài khoản"}},"/v1/client/usage":{"get":{"description":"Returns the resources your account uses right now: the total vCPU, memory and disk of all servers that are active, locked or being provisioned, the number of public addresses and servers, and how many attacks were blocked against your addresses in the last 30 days. `limits` holds the account limits for each resource, or null where there is no limit. The burn rate counts only running hourly servers.\n\n**Required scope:** `billing:read`.","operationId":"billing_usage","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"burn_mills_per_hour":14,"burn_uusd_per_hour":14000,"disk_gb":50,"ip":2,"limits":{"disk_gb":null,"ip":null,"ram_gb":null,"vcpu":null,"vm":null},"protected":{"attacks_30d":0,"ip":2,"vm":2},"ram_gb":4.0,"ram_mb":4096,"vcpu":2,"vm":2},"schema":{"properties":{"burn_mills_per_hour":{"description":"What running hourly servers cost per hour, in thousandths of a US dollar. Rounded down; prefer `burn_uusd_per_hour`.","type":"integer"},"burn_uusd_per_hour":{"description":"What running hourly servers cost per hour, in millionths of a US dollar.","type":"integer"},"disk_gb":{"description":"Total system disk in GiB.","type":"integer"},"ip":{"description":"Number of public IPv4 addresses in use.","type":"integer"},"limits":{"properties":{"disk_gb":{"description":"Disk limit in GiB; null when unlimited.","type":["integer","null"]},"ip":{"description":"Public address limit; null when unlimited.","type":["integer","null"]},"ram_gb":{"description":"Memory limit in GiB; null when unlimited.","type":["number","null"]},"vcpu":{"description":"vCPU limit; null when unlimited.","type":["integer","null"]},"vm":{"description":"Server limit; null when unlimited.","type":["integer","null"]}},"required":["vcpu","ram_gb","disk_gb","ip","vm"],"type":"object","x-order":["vcpu","ram_gb","disk_gb","ip","vm"]},"protected":{"properties":{"attacks_30d":{"description":"Attacks against your addresses in the last 30 days.","type":"integer"},"ip":{"description":"Public addresses protected against attacks.","type":"integer"},"vm":{"description":"Servers protected against attacks.","type":"integer"}},"required":["vm","ip","attacks_30d"],"type":"object","x-order":["vm","ip","attacks_30d"]},"ram_gb":{"description":"Total memory in GiB, rounded to two decimals.","type":"number"},"ram_mb":{"description":"Total memory in MiB.","type":"integer"},"vcpu":{"description":"Total virtual CPU cores.","type":"integer"},"vm":{"description":"Number of servers.","type":"integer"}},"required":["vcpu","ram_gb","ram_mb","disk_gb","ip","vm","limits","protected","burn_mills_per_hour","burn_uusd_per_hour"],"type":"object","x-order":["vcpu","ram_gb","ram_mb","disk_gb","ip","vm","limits","protected","burn_mills_per_hour","burn_uusd_per_hour"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Current usage","tags":["Billing"],"x-cli":"billing usage","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/client/usage\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Mức dùng hiện tại"}},"/v1/dedicated":{"get":{"description":"Lists the Dedicated Servers assigned to your account. `enabled` tells whether Dedicated Servers are shown to you at all. Each item carries the last known power state and health; `stale` is true when that status may be outdated.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"name","enum":["name","created_at","power_state","public_ip","memory_gb"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"asc","enum":["asc","desc"],"type":"string"}},{"description":"Search in the name and the public IP address.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Only servers with this power state.","in":"query","name":"power","required":false,"schema":{"enum":["on","off"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"items":[{"assigned_at":1792425000,"cpu":{"cores":40,"model":"Intel Xeon Gold 6138","sockets":2,"threads":80},"health":"OK","id":"ds_3f9a1c2b7d4e5a60","locked":true,"memory_gb":64,"model":"PowerEdge C6420","name":"dell-105","op":null,"polled_at":1792426591,"power_state":"On","public_ip":"23.132.252.247","stale":false,"status":"active","storage_bytes":1024209543168,"zone":{"country":"VN","id":1,"name":"Ho Chi Minh City","slug":"hcm"}}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"enabled":{"description":"Whether Dedicated Servers are enabled for your account.","type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/DedicatedServerBrief"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","enabled"],"type":"object","x-order":["items","total","page","per_page","enabled"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"List my Dedicated Servers","tags":["Dedicated Servers"],"x-cli":"dedicated list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Danh sách Dedicated Server của tôi"}},"/v1/dedicated/catalog":{"get":{"description":"Returns everything needed to order a Dedicated Server: locations, plans with their billing cycles (prices in VND, already discounted and rounded down to 1,000), how many servers are left per location, the operating systems that can be installed automatically and your wallet balance. While Dedicated Servers are not on sale the answer is `{\"enabled\": false, \"plans\": []}` without any price. At most 30 calls per minute per account.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_catalog","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"auto_install":true,"balance_cents":10000,"beta":false,"currency":"VND","enabled":true,"fx":{"usd_vnd":26000},"plans":[{"code":"DS-6138-128","cycles":[{"cycle":"monthly","discount_pct":0,"monthly_equiv_vnd":2990000,"months":1,"price_vnd":2990000},{"cycle":"quarterly","discount_pct":5,"monthly_equiv_vnd":2840333,"months":3,"price_vnd":8521000}],"monthly_vnd":2990000,"name":"DS-6138-128","on_sale":true,"setup_fee_vnd":500000,"spec":{"console":true,"cores":40,"cpu":"2x Intel Xeon Gold 6138","ipv4":1,"ram_gb":128,"storage":"SSD ~1 TB","threads":80},"stock":[{"backorder":false,"count":2,"count_os":2,"zone_id":1}]}],"templates":[{"family":"ubuntu","install_minutes":25,"min_disk_gb":20,"min_ram_gb":2,"name":"Ubuntu Server 24.04 LTS","slug":"ubuntu-24.04","username":"root","version":"24.04"}],"zones":[{"country":"VN","id":1,"name":"Ho Chi Minh City","slug":"hcm"}]},"schema":{"$ref":"#/components/schemas/DedicatedCatalog"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter was given; this call takes none."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter was given; this call takes none. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter was given; this call takes none."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Dedicated Servers are not sold on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Dedicated Servers are not sold on this site. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Dedicated Servers are not sold on this site."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 30 calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 30 calls in the last minute."}]}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Dedicated Server order catalog: locations, plans, cycles with VND prices, stock and auto-install operating systems","tags":["Dedicated Servers"],"x-cli":"dedicated catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Catalog đặt mua Dedicated Server: vị trí, gói, kỳ + giá VND, kho còn máy, hệ điều hành cài tự động"}},"/v1/dedicated/order":{"post":{"description":"Orders a Dedicated Server and pays it from the wallet in one step: a server is taken from stock, an IPv4 address is assigned if the server has none, the first cycle plus the setup fee is charged, a paid invoice is issued and the subscription starts. With a `template` the operating system is installed automatically (usually 15–60 minutes): the order is `installing` and `op_id` is the installation operation; if the installation fails the full amount is refunded to the wallet automatically and the order becomes `refunded`. Without a template the order is `delivered` at once and you install the system yourself through ISO/Console. The root password of an automatic install is shown once, on the server's page. `Idempotency-Key` is required: repeating the same call with the same key and body returns the first answer and never charges twice; the same key with a different body fails with `idempotency_conflict`. Nothing is charged or written when the call fails. At most 5 orders per minute per account.\n\n**Required scope:** `dedicated:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_order","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_renew":true,"cycle":"quarterly","hostname":"web-01","plan_code":"DS-6138-128","template":"ubuntu-24.04","zone_id":1},"schema":{"properties":{"auto_renew":{"description":"Renew automatically from the wallet. Defaults to true.","type":"boolean"},"cycle":{"description":"Billing cycle offered by the plan.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"hostname":{"description":"Host name: lowercase letters, digits and hyphens, not starting or ending with a hyphen (at most 15 characters for Windows). Upper case is converted to lower case.","maxLength":63,"minLength":1,"type":"string"},"plan_code":{"description":"Plan code from the catalog.","type":"string"},"template":{"description":"Template slug to install automatically; null or absent to install the system yourself through ISO/Console.","type":["string","null"]},"zone_id":{"description":"Location identifier from the catalog.","type":"integer"}},"required":["plan_code","zone_id","cycle","hostname"],"type":"object","x-order":["plan_code","zone_id","cycle","template","auto_renew","hostname"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"op_id":905,"order":{"amount_cents":34700,"created_at":1792427000,"cycle":"quarterly","delivered_at":null,"hostname":"web-01","id":17,"invoice_id":4412,"months":3,"op_id":905,"plan_code":"DS-6138-128","plan_name":"DS-6138-128","price_vnd":8522000,"public_error":null,"refund_reason":null,"refunded_cents":0,"server_id":"ds_3f9a1c2b7d4e5a60","setup_fee_vnd":500000,"status":"installing","template":"ubuntu-24.04","total_vnd":9022000,"zone_id":1},"server_id":"ds_3f9a1c2b7d4e5a60"},"schema":{"properties":{"op_id":{"description":"Installation operation; null without a template.","type":["integer","null"]},"order":{"$ref":"#/components/schemas/DedicatedOrder"},"server_id":{"description":"Identifier of the assigned Dedicated Server; null while the order waits for a server (`awaiting_stock`).","type":["string","null"]}},"required":["order","server_id","op_id"],"type":"object","x-order":["order","server_id","op_id"]}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, or it has a key this call does not know."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, or it has a key this call does not know. `idempotency_key_required`: The `Idempotency-Key` header is missing. `idempotency_key_invalid`: The `Idempotency-Key` is not 8–80 characters of letters, digits, `-`, `_` or `:`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, or it has a key this call does not know."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing."},{"code":"idempotency_key_invalid","description":"The `Idempotency-Key` is not 8–80 characters of letters, digits, `-`, `_` or `:`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is lower than the total (`need_cents`, `balance_cents`, `shortfall_cents`); top up and try again."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is lower than the total (`need_cents`, `balance_cents`, `shortfall_cents`); top up and try again. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is lower than the total (`need_cents`, `balance_cents`, `shortfall_cents`); top up and try again."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Verify your email address first. (`email_unverified`)","x-error-codes":[{"code":"email_unverified","description":"Verify your email address first."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Dedicated Servers are not sold on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Dedicated Servers are not sold on this site. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Dedicated Servers are not sold on this site."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"out_of_stock","message":"Race only: the last server was taken in the same instant; nothing was charged. Retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`out_of_stock`: Race only: the last server was taken in the same instant; nothing was charged. Retry. `os_install_unavailable`: Automatic installation is not available right now; order without a template or try again later. `ip_pool_exhausted`: No IPv4 address is available to assign right now. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"out_of_stock","description":"Race only: the last server was taken in the same instant; nothing was charged. Retry."},{"code":"os_install_unavailable","description":"Automatic installation is not available right now; order without a template or try again later."},{"code":"ip_pool_exhausted","description":"No IPv4 address is available to assign right now."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing or not valid (plan, zone, cycle, template, hostname); `field` names it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: A field is missing or not valid (plan, zone, cycle, template, hostname); `field` names it. `idempotency_conflict`: The `Idempotency-Key` was already used with a different body. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"A field is missing or not valid (plan, zone, cycle, template, hostname); `field` names it."},{"code":"idempotency_conflict","description":"The `Idempotency-Key` was already used with a different body."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"sales_disabled","message":"Dedicated Servers are not on sale, or this plan is switched off."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Dedicated Servers are not on sale, or this plan is switched off. (`sales_disabled`)","x-error-codes":[{"code":"sales_disabled","description":"Dedicated Servers are not on sale, or this plan is switched off."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 5 orders in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 5 orders in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_fx_unavailable","message":"The exchange rate is not available right now; try again in a few minutes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The exchange rate is not available right now; try again in a few minutes. (`dedicated_fx_unavailable`)","x-error-codes":[{"code":"dedicated_fx_unavailable","description":"The exchange rate is not available right now; try again in a few minutes."}]}},"security":[{"bearerAuth":["dedicated:create"]}],"summary":"Order a Dedicated Server: charges the wallet, assigns a machine and IP, installs the chosen operating system (automatic refund if the install fails)","tags":["Dedicated Servers"],"x-cli":"dedicated order","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/order\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_renew\":true,\"cycle\":\"quarterly\",\"hostname\":\"web-01\",\"plan_code\":\"DS-6138-128\",\"template\":\"ubuntu-24.04\",\"zone_id\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:create","x-summary-vi":"Đặt mua Dedicated Server: trừ ví, cấp máy + IP, cài hệ điều hành nếu chọn (hoàn tiền tự động nếu cài lỗi)"}},"/v1/dedicated/orders":{"get":{"description":"Lists your Dedicated Server orders, newest first by default.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_orders","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only orders in this state.","in":"query","name":"status","required":false,"schema":{"enum":["awaiting_stock","installing","delivered","refunded","cancelled"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"amount_cents":34700,"created_at":1792427000,"cycle":"quarterly","delivered_at":1792428800,"hostname":"web-01","id":17,"invoice_id":4412,"months":3,"op_id":905,"plan_code":"DS-6138-128","plan_name":"DS-6138-128","price_vnd":8522000,"public_error":null,"refund_reason":null,"refunded_cents":0,"server_id":"ds_3f9a1c2b7d4e5a60","setup_fee_vnd":500000,"status":"delivered","template":"ubuntu-24.04","total_vnd":9022000,"zone_id":1}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DedicatedOrder"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Dedicated Servers are not sold on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Dedicated Servers are not sold on this site. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Dedicated Servers are not sold on this site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"List my Dedicated Server orders","tags":["Dedicated Servers"],"x-cli":"dedicated orders","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/orders\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Danh sách đơn đặt mua Dedicated Server của tôi"}},"/v1/dedicated/orders/{oid}":{"get":{"description":"Returns one of your orders. Poll it while `status` is `installing`; the installation progress itself is the operation in `op_id`.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_order_get","parameters":[{"description":"Order identifier as returned by Order a Dedicated Server or List Dedicated Server orders (a positive integer).","in":"path","name":"oid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"order":{"amount_cents":34700,"created_at":1792427000,"cycle":"quarterly","delivered_at":null,"hostname":"web-01","id":17,"invoice_id":4412,"months":3,"op_id":905,"plan_code":"DS-6138-128","plan_name":"DS-6138-128","price_vnd":8522000,"public_error":null,"refund_reason":null,"refunded_cents":0,"server_id":"ds_3f9a1c2b7d4e5a60","setup_fee_vnd":500000,"status":"installing","template":"ubuntu-24.04","total_vnd":9022000,"zone_id":1}},"schema":{"properties":{"order":{"$ref":"#/components/schemas/DedicatedOrder"}},"required":["order"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The order does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_found`: The order does not exist or is not yours. `not_found`: Dedicated Servers are not sold on this site.","x-error-codes":[{"code":"not_found","description":"The order does not exist or is not yours."},{"code":"not_found","description":"Dedicated Servers are not sold on this site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Get one Dedicated Server order","tags":["Dedicated Servers"],"x-cli":"dedicated order-get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/orders/<oid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Chi tiết một đơn đặt mua Dedicated Server"}},"/v1/dedicated/orders/{oid}/cancel":{"post":{"description":"Cancels your order while it is `awaiting_stock` (no server assigned yet) and refunds the full amount to your wallet, once. Orders that already have a server cannot be cancelled here.\n\n**Required scope:** `dedicated:create`.","operationId":"dedicated_order_cancel","parameters":[{"description":"Order identifier as returned by Order a Dedicated Server or List Dedicated Server orders (a positive integer).","in":"path","name":"oid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"order":{"amount_cents":34700,"created_at":1792427000,"cycle":"quarterly","delivered_at":null,"hostname":"web-01","id":17,"invoice_id":4412,"months":3,"op_id":905,"plan_code":"DS-6138-128","plan_name":"DS-6138-128","price_vnd":8522000,"public_error":null,"refund_reason":null,"refunded_cents":0,"server_id":"ds_3f9a1c2b7d4e5a60","setup_fee_vnd":500000,"status":"cancelled","template":"ubuntu-24.04","total_vnd":9022000,"zone_id":1}},"schema":{"properties":{"order":{"$ref":"#/components/schemas/DedicatedOrder"}},"required":["order"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The order does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_found`: The order does not exist or is not yours. `not_found`: Dedicated Servers are not sold on this site.","x-error-codes":[{"code":"not_found","description":"The order does not exist or is not yours."},{"code":"not_found","description":"Dedicated Servers are not sold on this site."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"order_not_cancellable","message":"The order is not waiting for a server any more."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The order is not waiting for a server any more. (`order_not_cancellable`)","x-error-codes":[{"code":"order_not_cancellable","description":"The order is not waiting for a server any more."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 calls in the last minute."}]}},"security":[{"bearerAuth":["dedicated:create"]}],"summary":"Cancel your own Dedicated Server order while it waits for a server (full refund to the wallet)","tags":["Dedicated Servers"],"x-cli":"dedicated order-cancel","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/orders/<oid>/cancel\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"dedicated:create","x-summary-vi":"Tự huỷ đơn Dedicated Server đang chờ máy (hoàn 100% vào ví)"}},"/v1/dedicated/os-templates":{"get":{"description":"Lists the operating systems that can be installed on a Dedicated Server: only templates that are switched on and whose installation image is available. The list is the same for every server. It is empty for accounts that have no Dedicated Server.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_os","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"family":"ubuntu","min_disk_gb":20,"min_ram_gb":2,"name":"Ubuntu Server 24.04 LTS","slug":"ubuntu-24.04","username":"root","version":"24.04"},{"family":"debian","min_disk_gb":null,"min_ram_gb":null,"name":"Debian 13","slug":"debian-13","username":"root","version":"13"}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DedicatedOsTemplate"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"List the operating systems that can be installed on a Dedicated Server (enabled templates)","tags":["Dedicated Servers"],"x-cli":"dedicated os","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/os-templates\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Danh sách hệ điều hành cài được trên Dedicated Server (template đang bật)"}},"/v1/dedicated/quote":{"post":{"description":"Prices an order without placing it. The price is always computed by the server from the plan and cycle: the total in VND, the US cents that would be charged at today's exchange rate, whether your wallet is enough (`shortfall_cents`) and the stock. `can_order` is true only when `reasons` is empty. No `Idempotency-Key` is needed. At most 30 calls per minute per account.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_quote","parameters":[],"requestBody":{"content":{"application/json":{"example":{"cycle":"quarterly","hostname":"web-01","plan_code":"DS-6138-128","template":"ubuntu-24.04","zone_id":1},"schema":{"properties":{"auto_renew":{"description":"Renew automatically from the wallet. Defaults to true.","type":"boolean"},"cycle":{"description":"Billing cycle offered by the plan.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"hostname":{"description":"Optional for a quote: when sent, it is validated the same way as when ordering.","type":"string"},"plan_code":{"description":"Plan code from the catalog.","type":"string"},"template":{"description":"Template slug to install automatically; null or absent to install the system yourself through ISO/Console.","type":["string","null"]},"zone_id":{"description":"Location identifier from the catalog.","type":"integer"}},"required":["plan_code","zone_id","cycle"],"type":"object","x-order":["plan_code","zone_id","cycle","template","auto_renew","hostname"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"amount_cents":34700,"backorder":false,"balance_cents":10000,"can_order":false,"cycle":"quarterly","fx_usd_vnd":26000,"months":3,"plan_code":"DS-6138-128","price_vnd":8522000,"reasons":["insufficient_funds"],"renew_at_estimate":1800203000,"setup_fee_vnd":500000,"shortfall_cents":24700,"shortfall_vnd":642200,"stock":2,"stock_os":2,"total_vnd":9022000,"zone_id":1},"schema":{"$ref":"#/components/schemas/DedicatedQuote"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, or it has a key this call does not know."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not a JSON object, or it has a key this call does not know. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, or it has a key this call does not know."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"Dedicated Servers are not sold on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Dedicated Servers are not sold on this site. (`not_found`)","x-error-codes":[{"code":"not_found","description":"Dedicated Servers are not sold on this site."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing or not valid; `field` names it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: A field is missing or not valid; `field` names it. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before.","x-error-codes":[{"code":"invalid_argument","description":"A field is missing or not valid; `field` names it."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"sales_disabled","message":"Dedicated Servers are not on sale for your account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Dedicated Servers are not on sale for your account. (`sales_disabled`)","x-error-codes":[{"code":"sales_disabled","description":"Dedicated Servers are not on sale for your account."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 30 calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 30 calls in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_fx_unavailable","message":"The exchange rate is not available right now; try again in a few minutes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The exchange rate is not available right now; try again in a few minutes. (`dedicated_fx_unavailable`)","x-error-codes":[{"code":"dedicated_fx_unavailable","description":"The exchange rate is not available right now; try again in a few minutes."}]}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Quote a Dedicated Server order (server-side price, wallet check, stock)","tags":["Dedicated Servers"],"x-cli":"dedicated quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"quarterly\",\"hostname\":\"web-01\",\"plan_code\":\"DS-6138-128\",\"template\":\"ubuntu-24.04\",\"zone_id\":1}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Báo giá một đơn Dedicated Server (giá tính ở máy chủ, đủ ví chưa, kho)"}},"/v1/dedicated/{id}":{"get":{"description":"Returns one Dedicated Server with its hardware, network settings, subscription and which actions you can start now. The `actions` object is the only thing a client needs to decide whether a button is enabled: `reason` says why an action is unavailable.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_get","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"server":{"actions":{"console":{"allowed":false,"message":"Server control is temporarily disabled system-wide","reason":"dedicated_ops_disabled"},"power":{"allowed":false,"message":"Server control is temporarily disabled system-wide","reason":"dedicated_ops_disabled"}},"assigned_at":1792425000,"billing":{"anchor_day":31,"auto_renew":true,"balance_cents":100000,"can_renew":true,"cycle":"monthly","cycle_months":1,"cycles":[{"cycle":"monthly","discount_pct":0,"months":1,"price_vnd":2590000},{"cycle":"quarterly","discount_pct":5,"months":3,"price_vnd":7380000}],"debt":{"amount_cents":null,"grace_until":null,"invoice_id":null,"overdue":false,"suspended":false,"unpaid":false},"free":false,"last_invoice":{"created_at":1799514000,"currency":"usd","description":"Dedicated Server dell-105 — Monthly renewal","due_at":null,"id":4411,"kind":"renewal","number":"INV-2026-004411","paid_at":1799514000,"period_from":1799514000,"period_to":1802192400,"status":"paid","total_cents":99615},"max_periods":24,"next":{"amount_cents":99615,"cycle":"monthly","plan_code":"DS-6138-64","price_vnd":2590000,"scheduled_change":false},"pending_cycle":null,"pending_plan":null,"plan":{"code":"DS-6138-64","name":"Dedicated 6138 · 64 GB","spec":{}},"plan_change":null,"price_vnd":2590000,"renew_at":1802192400,"status":"active"},"capabilities":{"bandwidth":true,"console":true,"events":true,"power":true,"reinstall":false,"sensors":true},"cpu":{"cores":40,"model":"Intel Xeon Gold 6138","sockets":2,"threads":80},"hardware":{"bios":"2.24.0","boot_mode":"UEFI","cpus":[{"cores":20,"health":"OK","model":"Intel Xeon Gold 6138","socket":1,"threads":40}],"drives":[{"health":null,"media":"SSD","model":"B SSD","protocol":"SATA","size_bytes":1024209543168}],"memory":[{"health":"OK","manufacturer":"Samsung","part":"M386A8K40BM1-CRC","size_gb":64,"slot":"A5","speed_mhz":2400,"type":"DDR4"}],"nics":[{"id":"NIC.Mezzanine.3-1","link":null,"mac":"70:20:84:E1:EA:82","speed_mbps":null}],"psus":[{"health":"OK","input_v":220,"name":"PS1"}]},"health":"OK","hostname":"WIN-AG6ESNVPQ0I","id":"ds_3f9a1c2b7d4e5a60","lock":{"code":"imported","locked":true,"message":"This server is locked for control actions by the administrator.","note":null},"locked":true,"memory_gb":64,"model":"PowerEdge C6420","name":"dell-105","network":{"dns":["1.1.1.1","8.8.8.8"],"gateway":"23.132.252.1","netmask":"255.255.255.0","prefix":24,"public_ip":"23.132.252.247"},"op":null,"os":{"access":"not_installed","access_error":null,"installed_at":null,"name":null,"username":null},"polled_at":1792426591,"power_state":"On","public_ip":"23.132.252.247","sensors_at":1792426591,"service_tag":"HNCS1S2","stale":false,"status":"active","storage_bytes":1024209543168,"subscription":{"cycle":"monthly","free":true,"id":1,"plan":null,"price_vnd":0,"renew_at":null,"renewal":null,"started_at":1792425000,"status":"active"},"zone":{"country":"VN","id":1,"name":"Ho Chi Minh City","slug":"hcm"}}},"schema":{"properties":{"order":{"anyOf":[{"$ref":"#/components/schemas/DedicatedOrder"},{"type":"null"}]},"server":{"$ref":"#/components/schemas/DedicatedServer"}},"required":["server"],"type":"object","x-order":["server","order"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Get one Dedicated Server: hardware, network, status and which actions are available","tags":["Dedicated Servers"],"x-cli":"dedicated get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Chi tiết Dedicated Server: phần cứng, mạng, trạng thái, nút nào dùng được"},"patch":{"description":"Renames a Dedicated Server. Only the name changes; nothing is sent to the machine. A suspended subscription cannot rename.\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_rename","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"name":"build-server"},"schema":{"properties":{"name":{"description":"New name, 1-64 printable characters. Leading and trailing spaces are removed.","maxLength":64,"minLength":1,"type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"server":{"actions":{"console":{"allowed":false,"message":"Server control is temporarily disabled system-wide","reason":"dedicated_ops_disabled"},"power":{"allowed":false,"message":"Server control is temporarily disabled system-wide","reason":"dedicated_ops_disabled"}},"assigned_at":1792425000,"billing":{"anchor_day":31,"auto_renew":true,"balance_cents":100000,"can_renew":true,"cycle":"monthly","cycle_months":1,"cycles":[{"cycle":"monthly","discount_pct":0,"months":1,"price_vnd":2590000},{"cycle":"quarterly","discount_pct":5,"months":3,"price_vnd":7380000}],"debt":{"amount_cents":null,"grace_until":null,"invoice_id":null,"overdue":false,"suspended":false,"unpaid":false},"free":false,"last_invoice":{"created_at":1799514000,"currency":"usd","description":"Dedicated Server dell-105 — Monthly renewal","due_at":null,"id":4411,"kind":"renewal","number":"INV-2026-004411","paid_at":1799514000,"period_from":1799514000,"period_to":1802192400,"status":"paid","total_cents":99615},"max_periods":24,"next":{"amount_cents":99615,"cycle":"monthly","plan_code":"DS-6138-64","price_vnd":2590000,"scheduled_change":false},"pending_cycle":null,"pending_plan":null,"plan":{"code":"DS-6138-64","name":"Dedicated 6138 · 64 GB","spec":{}},"plan_change":null,"price_vnd":2590000,"renew_at":1802192400,"status":"active"},"capabilities":{"bandwidth":true,"console":true,"events":true,"power":true,"reinstall":false,"sensors":true},"cpu":{"cores":40,"model":"Intel Xeon Gold 6138","sockets":2,"threads":80},"hardware":{"bios":"2.24.0","boot_mode":"UEFI","cpus":[{"cores":20,"health":"OK","model":"Intel Xeon Gold 6138","socket":1,"threads":40}],"drives":[{"health":null,"media":"SSD","model":"B SSD","protocol":"SATA","size_bytes":1024209543168}],"memory":[{"health":"OK","manufacturer":"Samsung","part":"M386A8K40BM1-CRC","size_gb":64,"slot":"A5","speed_mhz":2400,"type":"DDR4"}],"nics":[{"id":"NIC.Mezzanine.3-1","link":null,"mac":"70:20:84:E1:EA:82","speed_mbps":null}],"psus":[{"health":"OK","input_v":220,"name":"PS1"}]},"health":"OK","hostname":"WIN-AG6ESNVPQ0I","id":"ds_3f9a1c2b7d4e5a60","lock":{"code":"imported","locked":true,"message":"This server is locked for control actions by the administrator.","note":null},"locked":true,"memory_gb":64,"model":"PowerEdge C6420","name":"dell-105","network":{"dns":["1.1.1.1","8.8.8.8"],"gateway":"23.132.252.1","netmask":"255.255.255.0","prefix":24,"public_ip":"23.132.252.247"},"op":null,"os":{"access":"not_installed","access_error":null,"installed_at":null,"name":null,"username":null},"polled_at":1792426591,"power_state":"On","public_ip":"23.132.252.247","sensors_at":1792426591,"service_tag":"HNCS1S2","stale":false,"status":"active","storage_bytes":1024209543168,"subscription":{"cycle":"monthly","free":true,"id":1,"plan":null,"price_vnd":0,"renew_at":null,"renewal":null,"started_at":1792425000,"status":"active"},"zone":{"country":"VN","id":1,"name":"Ho Chi Minh City","slug":"hcm"}}},"schema":{"properties":{"server":{"$ref":"#/components/schemas/DedicatedServer"}},"required":["server"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object with a valid `name`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not a JSON object with a valid `name`. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object with a valid `name`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_suspended","message":"Your subscription is suspended."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your subscription is suspended. (`dedicated_suspended`)","x-error-codes":[{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Rename a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated rename","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/dedicated/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"build-server\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Đổi tên Dedicated Server"}},"/v1/dedicated/{id}/activity":{"get":{"description":"Lists what happened on the server since it was assigned to you: power commands, console requests, renames and status changes, newest first by default.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_activity","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"actor":"you","args":{"result":"ok","what":"power.reboot"},"at":1792427060,"id":12,"key":"ded.op_done","kind":"power.reboot.done","message":"Operation completed: power.reboot (ok)"}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"properties":{"actor":{"description":"Who caused it.","enum":["you","admin","system"],"type":"string"},"args":{"additionalProperties":true,"description":"Raw values to fill into the message named by `key` (string values). An empty object when `key` is `null`.","type":"object"},"at":{"description":"When it happened (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Entry identifier.","type":"integer"},"key":{"description":"Stable message code (for example `ded.renamed`); `null` for entries written before message codes existed. With `args` it lets you show the message in your own language.","type":["string","null"]},"kind":{"description":"Event kind, e.g. `power.reboot.done`.","type":"string"},"message":{"description":"Short description in English.","type":"string"}},"required":["id","at","kind","actor","message","key","args"],"type":"object","x-order":["id","at","kind","actor","message","key","args"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Activity log of a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated activity","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/activity\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Nhật ký hoạt động của Dedicated Server"}},"/v1/dedicated/{id}/agent":{"delete":{"description":"Removes the platform agent of the server from the platform: its key stops working and a pending password change is cancelled. Run the uninstall command on the server too if you want to delete the program.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_agent_remove","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always true.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Remove the platform agent from the platform (revokes its key, cancels a pending password change)","tags":["Dedicated Servers"],"x-cli":"dedicated agent remove","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/dedicated/<id>/agent\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Gỡ agent của nền tảng khỏi hệ thống (thu hồi khoá, huỷ yêu cầu đổi mật khẩu đang chờ)"}},"/v1/dedicated/{id}/agent/install":{"post":{"description":"For a server whose operating system was installed before the agent existed (or from your own ISO): opens a 60-minute enrolment window and returns a one-line command to install the platform agent, plus the uninstall command. The token inside `install` works once, only from this server's public IP and only inside the window. The agent reports processor, memory, system disk usage, total network traffic and its version - nothing about the connections of your applications. Keep the command private until you have used it.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_agent_install","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"expires_at":1792430191,"install":"curl -4fsSL https://panel.example.com/install-bm.sh | sudo AGENT_TOKEN=<token> sh","os":"linux","uninstall":"curl -4fsSL https://panel.example.com/install-bm.sh | sudo sh -s -- --uninstall"},"schema":{"properties":{"expires_at":{"description":"When the token expires (Unix time, seconds, UTC)","type":"integer"},"install":{"description":"Command to run as root/Administrator on the server.","type":"string"},"os":{"description":"Operating system the command is for.","enum":["linux","windows"],"type":"string"},"uninstall":{"description":"Command that removes the agent from the server.","type":"string"}},"required":["os","install","uninstall","expires_at"],"type":"object","x-order":["os","install","uninstall","expires_at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_agent_unsupported","message":"The operating system is not supported for the agent yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_agent_unsupported`: The operating system is not supported for the agent yet. `dedicated_busy`: An operation is running on the server.","x-error-codes":[{"code":"dedicated_agent_unsupported","description":"The operating system is not supported for the agent yet."},{"code":"dedicated_busy","description":"An operation is running on the server."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_suspended","message":"The subscription is suspended."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The subscription is suspended. (`dedicated_suspended`)","x-error-codes":[{"code":"dedicated_suspended","description":"The subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Get the one-line install/uninstall command of the platform agent for a server whose OS was installed earlier (opens a 60-minute enrolment window, one-time token)","tags":["Dedicated Servers"],"x-cli":"dedicated agent install","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/agent/install\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Lấy lệnh một dòng cài/gỡ agent của nền tảng cho máy đã cài OS từ trước (mở cửa sổ ghi danh 60 phút, token dùng 1 lần)"}},"/v1/dedicated/{id}/ai-agent":{"post":{"description":"Sends a message to the AI agent, which can run shell commands on the server over SSH to answer. The stream and the request body are the same as for virtual machines ([Run the AI agent](#operation/vm_ai_agent_run)): server-sent events `hello`, `assistant_turn`, `tool_request`, `tool_start`, `tool_result`, `done`, `error`; send the command the user approved back as `confirmed_cmd`.\n\nThe agent logs in with the same login as the SSH terminal and never sees the password. Commands run automatically (`auto_execute: true`) only when they are on the read-only allowlist and not flagged as risky; every command that changes the server stops at `tool_request`. **A Dedicated Server is a physical machine without snapshots**: deleting data, formatting disks, shutting down or rebooting cannot be undone, so those commands always carry a `risk_reason`. Before every command the server checks again that the machine is still yours, unlocked, powered on and not being reinstalled; otherwise the step ends with an `error` and no command runs. Limits: 20 requests per minute per account, 2 conversations streaming at once, and the shared daily quota of AI calls (resets at 00:00 UTC; `429 rate_limited` with `limit`, `used`, `retry_after`).\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_ai_agent_run","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_execute":false,"messages":[{"content":"How much disk space is left?","role":"user"}],"session_id":"ais_9b1d4c0a7e3f5a21c6d8"},"schema":{"properties":{"auto_execute":{"description":"Run read-only commands automatically instead of asking first. Defaults to `false`.","type":"boolean"},"confirmed_cmd":{"description":"A command the user approved after a `tool_request`. It is executed first and its output is given to the agent.","type":"string"},"messages":{"description":"The conversation so far; the last 20 messages are used and the last `user` message is the one to answer. Required unless `confirmed_cmd` is sent.","items":{"properties":{"content":{"description":"Message text; at most 12000 characters are used.","type":"string"},"role":{"description":"Author of the message. Other roles are ignored.","enum":["user","assistant"],"type":"string"}},"required":["role","content"],"type":"object","x-order":["role","content"]},"type":"array"},"session_id":{"description":"Conversation to continue. Omit it, or send an unknown value, to start a new conversation.","type":"string"}},"type":"object","x-order":["messages","session_id","auto_execute","confirmed_cmd"]}}},"required":true},"responses":{"200":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/AiAgentEvent"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The call comes from a session a reseller opened on your behalf. (`impersonate_forbidden`)","x-error-codes":[{"code":"impersonate_forbidden","description":"The call comes from a session a reseller opened on your behalf."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `dedicated_ssh_unsupported`: The server runs Windows, which has no SSH. Use the console or RDP. `dedicated_powered_off`: The server is powered off. Power it on first. `dedicated_no_ip`: The server has no public address to connect to. `session_busy`: This conversation is already streaming.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"dedicated_ssh_unsupported","description":"The server runs Windows, which has no SSH. Use the console or RDP."},{"code":"dedicated_powered_off","description":"The server is powered off. Power it on first."},{"code":"dedicated_no_ip","description":"The server has no public address to connect to."},{"code":"session_busy","description":"This conversation is already streaming."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The AI agent is switched off for this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The AI agent is switched off for this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The AI agent is switched off for this site."}]}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Run the AI SSH Agent on a Dedicated Server (SSE stream)","tags":["Dedicated Servers"],"x-cli":"dedicated ai-agent run","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/ai-agent\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_execute\":false,\"messages\":[{\"content\":\"How much disk space is left?\",\"role\":\"user\"}],\"session_id\":\"ais_9b1d4c0a7e3f5a21c6d8\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Chạy AI SSH Agent trên Dedicated Server (SSE stream)"}},"/v1/dedicated/{id}/ai-agent/clear":{"post":{"description":"Starts a new, empty AI agent conversation for this server. The earlier conversation is kept but is no longer the one [Get AI agent status](#operation/dedicated_ai_agent_status) returns. Pass the returned `session_id` to [Run the AI agent](#operation/dedicated_ai_agent_run). No body is needed.\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_ai_agent_clear","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"session_id":"ais_5d2e8a1c7b3f9046e1a2"},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"},"session_id":{"description":"Identifier of the new conversation.","type":"string"}},"required":["ok","session_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Start a new AI SSH Agent session for a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated ai-agent clear","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/ai-agent/clear\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Tạo phiên hội thoại AI SSH Agent mới cho Dedicated Server"}},"/v1/dedicated/{id}/ai-agent/status":{"get":{"description":"Returns whether the AI agent is enabled, the model it uses, the most recent conversation you had with it about this server (up to the last 40 messages, oldest first) and `target`: whether the agent can work on the server right now. When `target.ready` is false, `target.reason` is one of `dedicated_server_locked`, `dedicated_suspended`, `dedicated_installing`, `dedicated_ssh_unsupported`, `dedicated_powered_off`, `dedicated_no_ip`. A conversation is removed when the server is reinstalled, transferred or unassigned.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_ai_agent_status","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"messages":[],"model":"example-model-1","provider":"AI Assistant","saved_credentials":false,"session_id":null,"target":{"ready":true,"reason":null}},"schema":{"properties":{"enabled":{"description":"Whether the AI agent is switched on for this site.","type":"boolean"},"messages":{"items":{"$ref":"#/components/schemas/AiAgentMessage"},"type":"array"},"model":{"description":"Name of the model in use.","type":"string"},"provider":{"description":"Name of the AI service in use.","type":"string"},"saved_credentials":{"description":"True when a password you typed in the terminal is kept for this server.","type":"boolean"},"session_id":{"description":"Identifier of the latest conversation for this server; null when there is none.","type":["string","null"]},"target":{"properties":{"message":{"description":"Human-readable text of `reason`, in your language.","type":"string"},"ready":{"description":"True when the agent can connect to the server now.","type":"boolean"},"reason":{"description":"Why not, when `ready` is false.","type":["string","null"]}},"required":["ready","reason"],"type":"object","x-order":["ready","reason","message"]}},"required":["enabled","provider","model","session_id","messages","target","saved_credentials"],"type":"object","x-order":["enabled","provider","model","session_id","messages","target","saved_credentials"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"AI SSH Agent status and history for a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated ai-agent status","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/ai-agent/status\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Trạng thái & lịch sử AI SSH Agent của Dedicated Server"}},"/v1/dedicated/{id}/auto-renew":{"patch":{"description":"Turns automatic renewal of the subscription on or off. With auto-renew on, the wallet is charged the locked price of one cycle when the renewal date arrives and the balance is enough; otherwise an invoice is issued and waits for payment. It works on a suspended subscription too, because it is about billing and does not touch the machine. Free subscriptions are never billed and cannot be changed. At most 20 calls per minute per account.\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_auto_renew","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_renew":false},"schema":{"properties":{"auto_renew":{"description":"`true` to renew automatically, `false` to renew by hand.","type":"boolean"}},"required":["auto_renew"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"changed":true,"renewal":{"amount_cents":28846,"auto_renew":true,"balance_cents":100000,"can_pay":true,"cycle":"quarterly","cycle_months":3,"grace_until":null,"invoice_id_open":null,"period_to":1810054800,"price_vnd":7500000,"renew_at":1802192400,"status":"due_soon"}},"schema":{"properties":{"changed":{"description":"False when the subscription already had that setting.","type":"boolean"},"renewal":{"$ref":"#/components/schemas/DedicatedRenewal"}},"required":["renewal","changed"],"type":"object","x-order":["renewal","changed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body must be exactly `{\"auto_renew\": true|false}`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body must be exactly `{\"auto_renew\": true|false}`. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The body must be exactly `{\"auto_renew\": true|false}`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"dedicated_free_subscription","message":"The subscription is free of charge: there is no renewal to configure."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The subscription is free of charge: there is no renewal to configure. (`dedicated_free_subscription`)","x-error-codes":[{"code":"dedicated_free_subscription","description":"The subscription is free of charge: there is no renewal to configure."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Turn auto-renew of a Dedicated Server subscription on or off","tags":["Dedicated Servers"],"x-cli":"dedicated auto-renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/dedicated/<id>/auto-renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_renew\":false}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Bật/tắt tự gia hạn của thuê bao Dedicated Server"}},"/v1/dedicated/{id}/bandwidth":{"get":{"description":"Returns the traffic of the server's public IP address: a chart for `range` and the total of a month. `in_bytes` is traffic received by your server, `out_bytes` traffic it sent. `stale` is true when the counters have not been refreshed recently.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_bandwidth","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Period of the chart.","in":"query","name":"range","required":false,"schema":{"default":"24h","enum":["24h","7d","30d"],"type":"string"}},{"description":"Month for the total, `YYYY-MM`. Defaults to the current month.","in":"query","name":"month","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ip":"23.132.252.247","month":{"in_bytes":23016451,"month":"2026-10","out_bytes":520},"range":"24h","series":[{"in_bytes":1200,"out_bytes":40,"t":1792425000}],"source_at":1792426591,"stale":false,"step":300},"schema":{"properties":{"ip":{"description":"The public IP address measured.","type":["string","null"]},"month":{"properties":{"in_bytes":{"description":"Bytes received in the month.","type":"integer"},"month":{"description":"Month of the total, `YYYY-MM`.","type":"string"},"out_bytes":{"description":"Bytes sent in the month.","type":"integer"}},"required":["month","in_bytes","out_bytes"],"type":"object","x-order":["month","in_bytes","out_bytes"]},"range":{"description":"Period of the chart.","type":"string"},"series":{"items":{"properties":{"in_bytes":{"description":"Bytes received.","type":"integer"},"out_bytes":{"description":"Bytes sent.","type":"integer"},"t":{"description":"Start of the interval (Unix time, seconds, UTC)","type":"integer"}},"required":["t","in_bytes","out_bytes"],"type":"object","x-order":["t","in_bytes","out_bytes"]},"type":"array"},"source_at":{"description":"When the counters were last refreshed (Unix time, seconds, UTC)","type":["integer","null"]},"stale":{"description":"True when the counters may be outdated.","type":"boolean"},"step":{"description":"Seconds covered by each point.","type":"integer"}},"required":["ip","month","range","step","series","source_at","stale"],"type":"object","x-order":["ip","month","range","step","series","source_at","stale"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Inbound/outbound bandwidth of a Dedicated Server (series + monthly total)","tags":["Dedicated Servers"],"x-cli":"dedicated bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Băng thông vào/ra của Dedicated Server (chuỗi + tổng tháng)"}},"/v1/dedicated/{id}/byoip":{"get":{"description":"Prefixes attached to this Bare Metal server, the commands that add their IPs to the operating system of the server (`setup`: Linux or Windows, as the server reports), and your free IPv4 prefixes that could be attached. A prefix is ROUTED to the primary IP of the server (no virtual network card). Attaching and detaching never charge anything.\n\n**Required scope:** `byoip:read`.","operationId":"dedicated_byoip","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"available":[],"can_attach":false,"can_detach":true,"eligible":true,"enabled":true,"one_machine_per_prefix":true,"prefixes":[{"asn":401617,"bgp":{"announce":true,"roa":"valid"},"id":12,"kind":"leased","prefix":"45.12.34.0/24","setup":{"commands":["ip addr add 45.12.34.1/32 dev eth0"],"example_ip":"45.12.34.1","mode":"routed","os":"linux","prefix":"45.12.34.0/24","routed_via":"23.132.252.247"},"state":"active"}],"reason":null},"schema":{"properties":{"available":{"items":{"additionalProperties":true,"description":"Free IPv4 prefixes of yours: `id`, `prefix`, `state`, `asn`.","type":"object"},"type":"array"},"can_attach":{"description":"A free prefix can be attached now.","type":"boolean"},"can_detach":{"description":"At least one prefix is attached.","type":"boolean"},"eligible":{"description":"This server can take a prefix: yours, in the Ho Chi Minh City zone, subscription active.","type":"boolean"},"enabled":{"description":"Own IP service is open for your account.","type":"boolean"},"one_machine_per_prefix":{"description":"Always true: a prefix attaches to one Bare Metal server.","type":"boolean"},"prefixes":{"items":{"additionalProperties":true,"description":"Attached prefixes: `id`, `prefix`, `state`, `asn`, `kind`, `bgp`, `setup`.","type":"object"},"type":"array"},"reason":{"description":"Why not: `not_found`, `target_zone_not_supported` or `target_not_active`.","type":["string","null"]}},"required":["enabled","eligible","prefixes","available","can_attach","can_detach","one_machine_per_prefix"],"type":"object","x-order":["enabled","eligible","reason","prefixes","available","can_attach","can_detach","one_machine_per_prefix"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Own-IP prefixes attached to this Bare Metal server + OS-specific IP commands + free prefixes","tags":["Bring Your Own IP"],"x-cli":"dedicated byoip","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/byoip\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Dải IP riêng gắn Bare Metal này + lệnh cấu hình IP theo OS + dải rảnh"}},"/v1/dedicated/{id}/byoip/attach":{"post":{"description":"Attach one of your free IPv4 prefixes to this Bare Metal server. Free of charge. A prefix attached to VMs must be moved (see [Move a prefix](#operation/byoip_vms_move)). Requires `Idempotency-Key`; 10 operations per minute.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_byoip_attach","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"prefix_id":12},"schema":{"properties":{"prefix_id":{"description":"Prefix to attach (see `available`).","type":"integer"}},"required":["prefix_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"available":[],"can_attach":false,"can_detach":false,"eligible":true,"enabled":true,"one_machine_per_prefix":true,"prefixes":[],"reason":null},"schema":{"properties":{"available":{"items":{"additionalProperties":true,"description":"Free IPv4 prefixes.","type":"object"},"type":"array"},"can_attach":{"description":"A free prefix can be attached.","type":"boolean"},"can_detach":{"description":"A prefix is attached.","type":"boolean"},"eligible":{"description":"The server can take a prefix.","type":"boolean"},"enabled":{"description":"Own IP service is open.","type":"boolean"},"one_machine_per_prefix":{"description":"Always true.","type":"boolean"},"prefixes":{"items":{"additionalProperties":true,"description":"Attached prefixes.","type":"object"},"type":"array"},"reason":{"description":"Why not.","type":["string","null"]}},"required":["enabled","eligible","prefixes","available","can_attach","can_detach","one_machine_per_prefix"],"type":"object","x-order":["enabled","eligible","reason","prefixes","available","can_attach","can_detach","one_machine_per_prefix"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server or the prefix is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server or the prefix is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server or the prefix is not yours."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"target_mixed","message":"The prefix is attached to VMs; use move."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`target_mixed`: The prefix is attached to VMs; use move. `target_busy`: The prefix is attached to another Bare Metal server. `target_not_active`: The subscription of the server is not active. `already_bound`: The prefix is already attached to this server. `byoip_state`: The prefix has ended or is not used on the platform. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"target_mixed","description":"The prefix is attached to VMs; use move."},{"code":"target_busy","description":"The prefix is attached to another Bare Metal server."},{"code":"target_not_active","description":"The subscription of the server is not active."},{"code":"already_bound","description":"The prefix is already attached to this server."},{"code":"byoip_state","description":"The prefix has ended or is not used on the platform."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"target_zone_not_supported","message":"The server is not in the Ho Chi Minh City zone."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`target_zone_not_supported`: The server is not in the Ho Chi Minh City zone. `target_family_not_supported`: Only IPv4 prefixes can be attached to Bare Metal. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"target_zone_not_supported","description":"The server is not in the Ho Chi Minh City zone."},{"code":"target_family_not_supported","description":"Only IPv4 prefixes can be attached to Bare Metal."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The service is locked by support (or the account is stopped)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The service is locked by support (or the account is stopped). (`dedicated_server_locked`)","x-error-codes":[{"code":"dedicated_server_locked","description":"The service is locked by support (or the account is stopped)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Attach a free IPv4 prefix to this Bare Metal server (free of charge)","tags":["Bring Your Own IP"],"x-cli":"dedicated byoip attach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/byoip/attach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prefix_id\":12}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Gắn một dải IPv4 rảnh vào Bare Metal này (không thu phí)"}},"/v1/dedicated/{id}/byoip/detach":{"post":{"description":"Detach a prefix from this Bare Metal server. The prefix waits for a new attachment (`needs_vm`) and BGP stays active, but traffic is no longer sent to any machine. Free of charge. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_byoip_detach","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"prefix_id":12},"schema":{"properties":{"prefix_id":{"description":"Prefix to detach.","type":"integer"}},"required":["prefix_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"available":[{"asn":401617,"id":12,"prefix":"45.12.34.0/24","state":"active"}],"can_attach":true,"can_detach":false,"eligible":true,"enabled":true,"one_machine_per_prefix":true,"prefixes":[],"reason":null},"schema":{"properties":{"available":{"items":{"additionalProperties":true,"description":"Free IPv4 prefixes.","type":"object"},"type":"array"},"can_attach":{"description":"A free prefix can be attached.","type":"boolean"},"can_detach":{"description":"A prefix is attached.","type":"boolean"},"eligible":{"description":"The server can take a prefix.","type":"boolean"},"enabled":{"description":"Own IP service is open.","type":"boolean"},"one_machine_per_prefix":{"description":"Always true.","type":"boolean"},"prefixes":{"items":{"additionalProperties":true,"description":"Attached prefixes.","type":"object"},"type":"array"},"reason":{"description":"Why not.","type":["string","null"]}},"required":["enabled","eligible","prefixes","available","can_attach","can_detach","one_machine_per_prefix"],"type":"object","x-order":["enabled","eligible","reason","prefixes","available","can_attach","can_detach","one_machine_per_prefix"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server or the prefix is not yours, or the prefix is not attached to it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server or the prefix is not yours, or the prefix is not attached to it. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server or the prefix is not yours, or the prefix is not attached to it."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"byoip_state","message":"The prefix has ended."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`byoip_state`: The prefix has ended. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"byoip_state","description":"The prefix has ended."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: A field is missing, malformed or out of range. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The service is locked by support (or the account is stopped)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The service is locked by support (or the account is stopped). (`dedicated_server_locked`)","x-error-codes":[{"code":"dedicated_server_locked","description":"The service is locked by support (or the account is stopped)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Detach a prefix from this Bare Metal server (prefix waits for attachment, BGP kept)","tags":["Bring Your Own IP"],"x-cli":"dedicated byoip detach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/byoip/detach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"prefix_id\":12}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Gỡ dải khỏi Bare Metal này (dải chờ gắn, BGP giữ)"}},"/v1/dedicated/{id}/console":{"post":{"description":"Opens a remote console session for the machine. When the session is ready the answer carries a one-time `url`; open it in a browser within 60 seconds. If it is still `preparing` (`202`), poll [Get a console session](#operation/dedicated_console_status). Calling again while a session of yours is alive returns that session instead of creating another one. At most 5 requests per minute are accepted for an account.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_console_open","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"session":{"expires_at":1792428800,"id":"dcs_8e2f0a91c4d37b65","poll_after":2,"status":"preparing"}},"schema":{"properties":{"session":{"$ref":"#/components/schemas/DedicatedConsoleSession"}},"required":["session"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_busy","message":"Another operation is still running on this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another operation is still running on this server. (`dedicated_busy`)","x-error-codes":[{"code":"dedicated_busy","description":"Another operation is still running on this server."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many console requests in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many console requests in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bmc_unavailable","message":"The server's controller is not available right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's controller is not available right now. (`dedicated_bmc_unavailable`)","x-error-codes":[{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Open a console session (a one-time URL is returned when ready)","tags":["Dedicated Servers"],"x-cli":"dedicated console open","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/console\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Mở phiên console (trả URL một lần khi sẵn sàng)"}},"/v1/dedicated/{id}/console/{sid}":{"delete":{"description":"Closes a console session. The one-time address stops working and an open console connection is cut shortly after.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_console_delete","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Console session identifier as returned by Open a console session, e.g. `dcs_8e2f0a91c4d37b65`.","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"session":{"expires_at":1792428800,"id":"dcs_8e2f0a91c4d37b65","status":"closed"}},"schema":{"properties":{"session":{"$ref":"#/components/schemas/DedicatedConsoleSession"}},"required":["session"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server or the session does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server or the session does not exist or is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server or the session does not exist or is not yours."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Close a console session","tags":["Dedicated Servers"],"x-cli":"dedicated console delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/dedicated/<id>/console/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Đóng phiên console"},"get":{"description":"Returns a console session. While it is `ready` or `active` every call issues a fresh one-time `url` (valid 60 seconds, replacing the previous one), which is also how you reopen the console after closing the browser tab. At most 30 requests per minute per session.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_console_status","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Console session identifier as returned by Open a console session, e.g. `dcs_8e2f0a91c4d37b65`.","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"session":{"expires_at":1792428800,"id":"dcs_8e2f0a91c4d37b65","status":"ready","url":"https://example.com/console/bm/0123456789abcdef0123456789abcdef","url_expires_in":60}},"schema":{"properties":{"session":{"$ref":"#/components/schemas/DedicatedConsoleSession"}},"required":["session"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server or the session does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server or the session does not exist or is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server or the session does not exist or is not yours."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests for this session in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests for this session in the last minute."}]}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Console session status; when ready, issues a fresh URL (valid 60 seconds)","tags":["Dedicated Servers"],"x-cli":"dedicated console status","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/console/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Trạng thái phiên console; khi sẵn sàng cấp URL mới (60 giây)"}},"/v1/dedicated/{id}/cycle":{"patch":{"description":"Changes the billing cycle from the NEXT renewal, at the price of that cycle in the plan's price list. Nothing is charged or refunded now and the current period is not touched. Sending the current cycle again cancels a change that was waiting. A free subscription, a subscription without a priced plan or a cycle the plan does not offer is refused. A suspended subscription must pay first.\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_cycle","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cycle":"quarterly"},"schema":{"properties":{"cycle":{"description":"The cycle wanted from the next renewal.","enum":["monthly","quarterly","semiannual","yearly","biennial"],"type":"string"},"expect_renew_at":{"description":"The `renew_at` you saw; the call fails with `dedicated_renew_stale` when it changed. (Unix time, seconds, UTC)","type":"integer"}},"required":["cycle"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"billing":{"anchor_day":31,"auto_renew":true,"balance_cents":100000,"can_renew":true,"cycle":"monthly","cycle_months":1,"cycles":[{"cycle":"monthly","discount_pct":0,"months":1,"price_vnd":2590000},{"cycle":"quarterly","discount_pct":5,"months":3,"price_vnd":7380000}],"debt":{"amount_cents":null,"grace_until":null,"invoice_id":null,"overdue":false,"suspended":false,"unpaid":false},"free":false,"last_invoice":{"created_at":1799514000,"currency":"usd","description":"Dedicated Server dell-105 — Monthly renewal","due_at":null,"id":4411,"kind":"renewal","number":"INV-2026-004411","paid_at":1799514000,"period_from":1799514000,"period_to":1802192400,"status":"paid","total_cents":99615},"max_periods":24,"next":{"amount_cents":99615,"cycle":"monthly","plan_code":"DS-6138-64","price_vnd":2590000,"scheduled_change":false},"pending_cycle":null,"pending_plan":null,"plan":{"code":"DS-6138-64","name":"Dedicated 6138 · 64 GB","spec":{}},"plan_change":null,"price_vnd":2590000,"renew_at":1802192400,"status":"active"}},"schema":{"properties":{"billing":{"$ref":"#/components/schemas/DedicatedBilling"}},"required":["billing"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body must be `{\"cycle\": ...}` with an optional integer `expect_renew_at`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body must be `{\"cycle\": ...}` with an optional integer `expect_renew_at`. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The body must be `{\"cycle\": ...}` with an optional integer `expect_renew_at`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_renew_stale","message":"The renewal date changed; reload and try again."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The renewal date changed; reload and try again. (`dedicated_renew_stale`)","x-error-codes":[{"code":"dedicated_renew_stale","description":"The renewal date changed; reload and try again."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"dedicated_free_subscription","message":"The subscription is free of charge."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_free_subscription`: The subscription is free of charge. `dedicated_cycle_unavailable`: The plan's price list does not offer this cycle. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before.","x-error-codes":[{"code":"dedicated_free_subscription","description":"The subscription is free of charge."},{"code":"dedicated_cycle_unavailable","description":"The plan's price list does not offer this cycle."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The service is locked by support (or the account is stopped)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The service is locked by support (or the account is stopped). `dedicated_suspended`: The subscription is suspended; pay the open invoice first.","x-error-codes":[{"code":"dedicated_server_locked","description":"The service is locked by support (or the account is stopped)."},{"code":"dedicated_suspended","description":"The subscription is suspended; pay the open invoice first."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many calls in the last minute."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Change the billing cycle from the next renewal (nothing charged or refunded now)","tags":["Dedicated Servers"],"x-cli":"dedicated cycle","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/dedicated/<id>/cycle\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"quarterly\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Đổi chu kỳ thanh toán từ kỳ gia hạn tới (không thu/hoàn ngay)"}},"/v1/dedicated/{id}/events":{"get":{"description":"Returns the hardware log of the machine (the most recent 50 entries) from the moment it was assigned to you. Times are corrected for the clock of the machine's controller; `at_raw` keeps the original text.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_events","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only entries of this severity.","in":"query","name":"severity","required":false,"schema":{"default":"all","enum":["all","warning","critical"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"clock_adjusted":true,"items":[{"at":1792368487,"at_raw":"2026-10-13T23:08:07-05:00","message":"C: boot completed.","severity":"OK"}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"clock_adjusted":{"description":"True when the times were corrected for a clock offset.","type":"boolean"},"items":{"items":{"properties":{"at":{"description":"When the event happened, corrected (Unix time, seconds, UTC)","type":"integer"},"at_raw":{"description":"Original time text as written by the machine.","type":"string"},"message":{"description":"Description of the event.","type":"string"},"severity":{"description":"`OK`, `Warning` or `Critical`.","type":"string"}},"required":["at","at_raw","severity","message"],"type":"object","x-order":["at","at_raw","severity","message"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","clock_adjusted"],"type":"object","x-order":["items","total","page","per_page","clock_adjusted"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Hardware log (SEL) of a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Nhật ký phần cứng (SEL) của Dedicated Server"}},"/v1/dedicated/{id}/invoices":{"get":{"description":"Lists the invoices of this server that belong to you: the order receipt, the renewal invoices and the plan upgrade receipts, newest first (at most 100).\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_invoices","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":1799514000,"currency":"usd","description":"Dedicated Server dell-105 — Monthly renewal","due_at":null,"id":4411,"kind":"renewal","number":"INV-2026-004411","paid_at":1799514000,"period_from":1799514000,"period_to":1802192400,"status":"paid","total_cents":99615}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DedicatedInvoice"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many calls in the last minute."}]}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Invoices of a Dedicated Server (order, renewals, plan upgrades)","tags":["Dedicated Servers"],"x-cli":"dedicated invoices","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/invoices\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Hoá đơn của Dedicated Server (đơn mua, gia hạn, nâng gói)"}},"/v1/dedicated/{id}/iso":{"delete":{"description":"Deletes the ISO and frees its storage. An ISO that is still attached is detached first: the call then answers `202` with `state` `detaching` and the file is removed when the detach finishes; otherwise it answers `200` with `state` `deleted` right away (the file itself is removed from storage within a minute). An ISO that is being attached or detached cannot be deleted yet (`409 iso_busy`).\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_iso_delete","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"state":"deleted"},"schema":{"properties":{"ok":{"description":"Always true.","type":"boolean"},"state":{"description":"`deleted` when it is gone, `detaching` when it will be removed after the detach.","enum":["deleted","detaching"],"type":"string"}},"required":["ok","state"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter was given; this call takes none."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter was given; this call takes none. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter was given; this call takes none."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"iso_none","message":"This server has no ISO."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_none`: This server has no ISO. `not_found`: The server does not exist or is not assigned to you.","x-error-codes":[{"code":"iso_none","description":"This server has no ISO."},{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"iso_busy","message":"The ISO is being attached or detached; try again shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_busy`: The ISO is being attached or detached; try again shortly. `dedicated_busy`: Another operation is still running on this server.","x-error-codes":[{"code":"iso_busy","description":"The ISO is being attached or detached; try again shortly."},{"code":"dedicated_busy","description":"Another operation is still running on this server."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bmc_unavailable","message":"The server's controller is not available right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's controller is not available right now. (`dedicated_bmc_unavailable`)","x-error-codes":[{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Delete the ISO early (detached first when attached)","tags":["Dedicated Servers"],"x-cli":"dedicated iso delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/dedicated/<id>/iso\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Xoá sớm ISO (đang gắn thì tháo trước)"},"get":{"description":"Returns your custom ISO for this server (null when there is none), the limits and which actions are available now. Poll this call while `state` is `queued`, `downloading`, `verifying`, `attaching` or `detaching`. The internal address the controller uses to read the image is never shown.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_iso_get","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"actions":{"attach":{"allowed":false,"message":"The ISO is not ready to attach","reason":"iso_not_ready"},"delete":{"allowed":true,"message":null,"reason":null},"detach":{"allowed":false,"message":"The ISO is not attached to the server","reason":"iso_not_attached"},"download":{"allowed":false,"message":"This server already has an ISO — delete it before downloading another","reason":"iso_exists"}},"iso":{"attached_at":null,"bytes_done":800000000,"bytes_total":2000000000,"created_at":1792427000,"error":null,"expires_at":null,"expires_in":null,"file_name":"ubuntu-24.04.1-live-server-amd64.iso","id":"iso_5c0a9d3e7b1f4a28","kind":null,"percent":40,"ready_at":null,"sha256":null,"state":"downloading","url":"https://releases.example.com/ubuntu-24.04.1-live-server-amd64.iso"},"limits":{"max_bytes":10737418240,"ports":[80,443,8080,8443],"schemes":["http","https"],"ttl_hours":24}},"schema":{"$ref":"#/components/schemas/DedicatedIsoView"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter was given; this call takes none."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter was given; this call takes none. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter was given; this call takes none."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"The server's custom ISO: state, progress, expiry and which actions are available","tags":["Dedicated Servers"],"x-cli":"dedicated iso get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/iso\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"ISO tự tải của máy: trạng thái, tiến độ %, hạn, nút nào dùng được"},"post":{"description":"Downloads an ISO from a public `http` or `https` address into temporary storage for this server. The call answers `202` and the download runs in the background: poll [Get the ISO](#operation/dedicated_iso_get). Only ports 80, 443, 8080 and 8443 are accepted, the address must not contain a user name or password, and it must resolve to a public Internet address — private, loopback, link-local and other internal addresses are refused, also after each redirect (at most 3 redirects are followed). Size is limited (see `limits.max_bytes`) and the file must be a valid ISO 9660 or disk image. One ISO per server at a time (`409 iso_exists`); it is removed automatically `limits.ttl_hours` hours after it is ready. At most 5 downloads per hour are accepted for an account (`429 rate_limited`).\n\n**Required scope:** `dedicated:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_iso_download","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"url":"https://releases.example.com/ubuntu-24.04.1-live-server-amd64.iso"},"schema":{"properties":{"url":{"description":"Public `http://` or `https://` address of the ISO file.","maxLength":2048,"minLength":8,"type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"iso":{"attached_at":null,"bytes_done":0,"bytes_total":2000000000,"created_at":1792427000,"error":null,"expires_at":null,"expires_in":null,"file_name":"ubuntu-24.04.1-live-server-amd64.iso","id":"iso_5c0a9d3e7b1f4a28","kind":null,"percent":0,"ready_at":null,"sha256":null,"state":"queued","url":"https://releases.example.com/ubuntu-24.04.1-live-server-amd64.iso"}},"schema":{"properties":{"iso":{"$ref":"#/components/schemas/DedicatedIso"}},"required":["iso"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object with only `url`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object with only `url`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object with only `url`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"iso_exists","message":"This server already has an ISO that is not over yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_exists`: This server already has an ISO that is not over yet. `not_supported`: This server cannot mount virtual media. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"iso_exists","description":"This server already has an ISO that is not over yet."},{"code":"not_supported","description":"This server cannot mount virtual media."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"iso_bad_url","message":"The address is not a valid public http(s) address on an allowed port, or contains credentials."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_bad_url`: The address is not a valid public http(s) address on an allowed port, or contains credentials. `iso_blocked_url`: The address is an internal or private network address. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"iso_bad_url","description":"The address is not a valid public http(s) address on an allowed port, or contains credentials."},{"code":"iso_blocked_url","description":"The address is an internal or private network address."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 5 downloads in the last hour. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 5 downloads in the last hour."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"iso_storage_low","message":"ISO storage is full or almost full; try again later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_storage_low`: ISO storage is full or almost full; try again later. `iso_disabled`: ISO downloads are paused. `dedicated_bmc_unavailable`: The server's controller is not available right now.","x-error-codes":[{"code":"iso_storage_low","description":"ISO storage is full or almost full; try again later."},{"code":"iso_disabled","description":"ISO downloads are paused."},{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Download an ISO from an http(s) URL into the server's temporary storage (asynchronous)","tags":["Dedicated Servers"],"x-cli":"dedicated iso download","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/iso\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\":\"https://releases.example.com/ubuntu-24.04.1-live-server-amd64.iso\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:write","x-summary-vi":"Tải một ISO từ URL http(s) về kho tạm của máy (bất đồng bộ)"}},"/v1/dedicated/{id}/iso/attach":{"post":{"description":"Attaches the ready ISO to the server as virtual media and sets the server to boot once from it. The call answers `202` with an `op`; poll [Get an operation](#operation/dedicated_op) or [Get the ISO](#operation/dedicated_iso_get) until `state` is `attached`. The server is **not** restarted: restart it (power `reboot`) and open the console to continue. `confirm` must be the exact name of the server because the next boot will start from the ISO. Only one operation runs at a time on a server (`409 dedicated_busy`).\n\n**Required scope:** `dedicated:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_iso_attach","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":"dell-105"},"schema":{"properties":{"confirm":{"description":"The exact name of the server.","type":"string"}},"required":["confirm"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"iso":{"attached_at":null,"bytes_done":2000000000,"bytes_total":2000000000,"created_at":1792427000,"error":null,"expires_at":null,"expires_in":null,"file_name":"ubuntu-24.04.1-live-server-amd64.iso","id":"iso_5c0a9d3e7b1f4a28","kind":null,"percent":100,"ready_at":null,"sha256":null,"state":"attaching","url":"https://releases.example.com/ubuntu-24.04.1-live-server-amd64.iso"},"op":{"action":"attach","created_at":1792427100,"finished_at":null,"id":882,"kind":"iso_attach","public_error":null,"requested_by":"you","result":null,"state":"queued","step":"queued"}},"schema":{"properties":{"iso":{"$ref":"#/components/schemas/DedicatedIso"},"op":{"$ref":"#/components/schemas/DedicatedOp"}},"required":["op","iso"],"type":"object","x-order":["op","iso"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body has a field other than `confirm`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body has a field other than `confirm`. `confirm_mismatch`: `confirm` does not match the name of the server. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body has a field other than `confirm`."},{"code":"confirm_mismatch","description":"`confirm` does not match the name of the server."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"iso_none","message":"This server has no ISO."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_none`: This server has no ISO. `not_found`: The server does not exist or is not assigned to you.","x-error-codes":[{"code":"iso_none","description":"This server has no ISO."},{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"iso_not_ready","message":"The ISO is not ready (still downloading, already attached, expired or failed)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_not_ready`: The ISO is not ready (still downloading, already attached, expired or failed). `not_supported`: This server cannot mount virtual media. `dedicated_busy`: Another operation is still running on this server. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"iso_not_ready","description":"The ISO is not ready (still downloading, already attached, expired or failed)."},{"code":"not_supported","description":"This server cannot mount virtual media."},{"code":"dedicated_busy","description":"Another operation is still running on this server."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many attach or detach requests in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many attach or detach requests in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bmc_unavailable","message":"The server's controller is not available right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's controller is not available right now. (`dedicated_bmc_unavailable`)","x-error-codes":[{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Attach the ISO to the server as virtual media and set a one-time CD boot (asynchronous, returns an op)","tags":["Dedicated Servers"],"x-cli":"dedicated iso attach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/iso/attach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":\"dell-105\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:write","x-summary-vi":"Gắn ISO vào máy qua Virtual Media và đặt boot một lần từ CD (bất đồng bộ, trả op)"}},"/v1/dedicated/{id}/iso/detach":{"post":{"description":"Detaches the ISO from the server and clears the one-time CD boot. The ISO stays available (`ready`) until it expires, so it can be attached again. The call answers `202` with an `op`.\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_iso_detach","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"iso":{"attached_at":null,"bytes_done":2000000000,"bytes_total":2000000000,"created_at":1792427000,"error":null,"expires_at":null,"expires_in":null,"file_name":"ubuntu-24.04.1-live-server-amd64.iso","id":"iso_5c0a9d3e7b1f4a28","kind":null,"percent":100,"ready_at":null,"sha256":null,"state":"detaching","url":"https://releases.example.com/ubuntu-24.04.1-live-server-amd64.iso"},"op":{"action":"detach","created_at":1792428100,"finished_at":null,"id":883,"kind":"iso_detach","public_error":null,"requested_by":"you","result":null,"state":"queued","step":"queued"}},"schema":{"properties":{"iso":{"$ref":"#/components/schemas/DedicatedIso"},"op":{"$ref":"#/components/schemas/DedicatedOp"}},"required":["op","iso"],"type":"object","x-order":["op","iso"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not empty."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not empty. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The body is not empty."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"iso_none","message":"This server has no ISO."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_none`: This server has no ISO. `not_found`: The server does not exist or is not assigned to you.","x-error-codes":[{"code":"iso_none","description":"This server has no ISO."},{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"iso_not_attached","message":"The ISO is not attached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`iso_not_attached`: The ISO is not attached. `dedicated_busy`: Another operation is still running on this server.","x-error-codes":[{"code":"iso_not_attached","description":"The ISO is not attached."},{"code":"dedicated_busy","description":"Another operation is still running on this server."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many attach or detach requests in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many attach or detach requests in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bmc_unavailable","message":"The server's controller is not available right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's controller is not available right now. (`dedicated_bmc_unavailable`)","x-error-codes":[{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Detach the ISO from the server (asynchronous, returns an op)","tags":["Dedicated Servers"],"x-cli":"dedicated iso detach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/iso/detach\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Tháo ISO khỏi máy (bất đồng bộ, trả op)"}},"/v1/dedicated/{id}/ops":{"get":{"description":"Lists the operations (power commands and console requests) on a server since it was assigned to you, newest first by default.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_ops","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"action":"reboot","created_at":1792427000,"finished_at":1792427060,"id":881,"kind":"power","public_error":null,"requested_by":"you","result":"ok","state":"done","step":"done"}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DedicatedOp"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Operation history of a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated ops","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/ops\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Lịch sử thao tác của Dedicated Server"}},"/v1/dedicated/{id}/ops/{op}":{"get":{"description":"Returns one operation of the server. Poll it after a power command until `state` is `done`, `failed` or `cancelled`.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_op","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Operation identifier as returned by a power command or List operations.","in":"path","name":"op","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"op":{"action":"reboot","created_at":1792427000,"finished_at":1792427060,"id":881,"kind":"power","public_error":null,"requested_by":"you","result":"ok","state":"done","step":"done"}},"schema":{"properties":{"op":{"$ref":"#/components/schemas/DedicatedOp"}},"required":["op"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server or the operation does not exist, or the operation belongs to another server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server or the operation does not exist, or the operation belongs to another server. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server or the operation does not exist, or the operation belongs to another server."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Get one operation (poll its progress)","tags":["Dedicated Servers"],"x-cli":"dedicated op","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/ops/<op>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Một thao tác (poll tiến độ)"}},"/v1/dedicated/{id}/os-password":{"post":{"description":"Changes the password of the operating-system account (`root` on Linux, `Administrator` on Windows) through the platform agent running inside the server. The call answers `202` with a `change`; poll [Get a password change](#operation/dedicated_os_password_get) until `state` is `applied`, `failed`, `unconfirmed` or `cancelled`. The password is sent encrypted to that one agent and is never returned or logged; after `applied` it is the password shown in Credentials. The agent must be `online` (see `agent` in [Get a server](#operation/dedicated_get)). A change that was not confirmed in 5 minutes becomes `unconfirmed`: submit it again. At most 5 requests per 10 minutes per account. Not available while an operation is running or when the subscription is suspended.\n\n**Required scope:** `dedicated:console`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_os_password","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"password":"Tr0ng-Matkhau#2026"},"schema":{"properties":{"password":{"description":"New password. Linux: 10-64 characters, at least 2 of upper/lower/digit/symbol. Windows: 12-64 characters, at least 3 of 4, not containing `Administrator`. Allowed: letters, digits and ! @ # % ^ * ( ) - _ = + [ ] { } . , : ; ? ~","type":"string"}},"required":["password"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"change":{"code":null,"created_at":1792426591,"done_at":null,"expires_at":1792426891,"id":"pw_k3j9x0a1b2c3d4e5","state":"pending"}},"schema":{"properties":{"change":{"$ref":"#/components/schemas/DedicatedPwChange"}},"required":["change"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not valid JSON or has unknown fields."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not valid JSON or has unknown fields. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not valid JSON or has unknown fields."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_agent_missing","message":"No platform agent is registered for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_agent_missing`: No platform agent is registered for this server. `dedicated_agent_offline`: The agent did not report in the last minute. `dedicated_agent_outdated`: The agent is too old to change passwords. `dedicated_agent_unsupported`: The operating system is not supported for this feature. `dedicated_busy`: An operation is running on the server. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"dedicated_agent_missing","description":"No platform agent is registered for this server."},{"code":"dedicated_agent_offline","description":"The agent did not report in the last minute."},{"code":"dedicated_agent_outdated","description":"The agent is too old to change passwords."},{"code":"dedicated_agent_unsupported","description":"The operating system is not supported for this feature."},{"code":"dedicated_busy","description":"An operation is running on the server."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"dedicated_password_invalid","message":"The password does not meet the requirements (`reason`: `too_short`, `too_long`, `bad_char`, `weak`, `contains_user`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_password_invalid`: The password does not meet the requirements (`reason`: `too_short`, `too_long`, `bad_char`, `weak`, `contains_user`). `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"dedicated_password_invalid","description":"The password does not meet the requirements (`reason`: `too_short`, `too_long`, `bad_char`, `weak`, `contains_user`)."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_suspended","message":"The subscription is suspended."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The subscription is suspended. (`dedicated_suspended`)","x-error-codes":[{"code":"dedicated_suspended","description":"The subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Change the OS root/Administrator password through the platform agent inside the server (asynchronous: poll GET os-password/:cid; offline agent ⇒ 409)","tags":["Dedicated Servers"],"x-cli":"dedicated os password","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/os-password\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"password\":\"Tr0ng-Matkhau#2026\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:console","x-summary-vi":"Đổi mật khẩu root/Administrator của OS qua agent của nền tảng trong máy (bất đồng bộ: theo dõi bằng GET os-password/:cid; agent offline ⇒ 409)"}},"/v1/dedicated/{id}/os-password/{cid}":{"get":{"description":"Returns one password change of the server so you can poll it. It never contains the password.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_os_password_get","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Identifier of the resource.","in":"path","name":"cid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"change":{"code":null,"created_at":1792426591,"done_at":1792426600,"expires_at":1792426891,"id":"pw_k3j9x0a1b2c3d4e5","state":"applied"}},"schema":{"properties":{"change":{"$ref":"#/components/schemas/DedicatedPwChange"}},"required":["change"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server or the change does not exist, or it belongs to another server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server or the change does not exist, or it belongs to another server. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server or the change does not exist, or it belongs to another server."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"State of one OS password change (pending/applied/failed/unconfirmed/cancelled)","tags":["Dedicated Servers"],"x-cli":"dedicated os password get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/os-password/<cid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Trạng thái một lần đổi mật khẩu OS (pending/applied/failed/unconfirmed/cancelled)"}},"/v1/dedicated/{id}/plan-change":{"delete":{"description":"Cancels your pending plan change request. Nothing was charged, so nothing is refunded.\n\n**Required scope:** `dedicated:write`.","operationId":"dedicated_plan_change_delete","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cancelled":true},"schema":{"properties":{"cancelled":{"description":"Always true.","type":"boolean"}},"required":["cancelled"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server is not yours or there is no pending request."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is not yours or there is no pending request. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server is not yours or there is no pending request."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The service is locked by support (or the account is stopped)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The service is locked by support (or the account is stopped). (`dedicated_server_locked`)","x-error-codes":[{"code":"dedicated_server_locked","description":"The service is locked by support (or the account is stopped)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Cancel the pending plan change request","tags":["Dedicated Servers"],"x-cli":"dedicated plan change delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/dedicated/<id>/plan-change\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"dedicated:write","x-summary-vi":"Huỷ yêu cầu đổi gói đang chờ"},"post":{"description":"Asks for another plan. A physical machine cannot change its hardware by itself, so this only records a request and tells the operator; NOTHING is charged. When the hardware has been upgraded or the service moved, the operator approves it: an upgrade then charges the difference in proportion to the time left in the period you already paid for (never more than the list price difference, and based on what you actually paid) and switches the plan at once, with the new price from the next renewal; a downgrade charges and refunds nothing and applies from the next renewal. A declined or cancelled request costs nothing. One pending request per server. At most 10 calls per minute per account.\n\n**Required scope:** `dedicated:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_plan_change","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"plan_code":"DS-6138-128"},"schema":{"properties":{"note":{"description":"Optional message for the operator, up to 500 characters.","type":"string"},"plan_code":{"description":"Plan code from [List the plans you can switch to](#operation/dedicated_plans).","type":"string"}},"required":["plan_code"],"type":"object","x-order":["plan_code","note"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"plan_change":{"charged_cents":null,"charged_vnd":null,"decided_at":null,"effective":null,"from_plan":{"code":"DS-6138-64","name":"Dedicated 6138 · 64 GB"},"id":7,"invoice_id":null,"kind":"upgrade","note":null,"reason":null,"requested_at":1799514000,"status":"pending","to_plan":{"code":"DS-6138-128","name":"Dedicated 6138 · 128 GB"}}},"schema":{"properties":{"plan_change":{"$ref":"#/components/schemas/DedicatedPlanChange"}},"required":["plan_change"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body must contain `plan_code` and an optional `note`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body must contain `plan_code` and an optional `note`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body must contain `plan_code` and an optional `note`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_plan_change_pending","message":"A request is already waiting; cancel it first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_plan_change_pending`: A request is already waiting; cancel it first. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"dedicated_plan_change_pending","description":"A request is already waiting; cancel it first."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"dedicated_plan_unavailable","message":"The plan is not on sale here, is your current plan or does not offer your current cycle."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_plan_unavailable`: The plan is not on sale here, is your current plan or does not offer your current cycle. `dedicated_free_subscription`: The subscription is free of charge. `idempotency_key_reused`: The Idempotency-Key was used with a different body. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"dedicated_plan_unavailable","description":"The plan is not on sale here, is your current plan or does not offer your current cycle."},{"code":"dedicated_free_subscription","description":"The subscription is free of charge."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was used with a different body."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The service is locked by support (or the account is stopped)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The service is locked by support (or the account is stopped). `dedicated_suspended`: The subscription is suspended; pay the open invoice first.","x-error-codes":[{"code":"dedicated_server_locked","description":"The service is locked by support (or the account is stopped)."},{"code":"dedicated_suspended","description":"The subscription is suspended; pay the open invoice first."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Request a Dedicated Server plan change (nothing charged; approved by the operator once the hardware is ready)","tags":["Dedicated Servers"],"x-cli":"dedicated plan change","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/plan-change\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"plan_code\":\"DS-6138-128\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:write","x-summary-vi":"Yêu cầu đổi gói Dedicated Server (chưa trừ tiền; nhân viên duyệt sau khi nâng phần cứng)"}},"/v1/dedicated/{id}/plans":{"get":{"description":"Lists the other plans offered in the location of this server, priced for your current billing cycle, with the difference from your locked price and, for an upgrade, an estimate of what would be charged if the change were approved now (computed from what you have already paid for the current period, in proportion to the time left). A physical machine cannot change its hardware by itself, so a plan change is a request: see [Request a plan change](#operation/dedicated_plan_change).\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_plans","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"current":{"cycle":"monthly","plan":{"code":"DS-6138-64","name":"Dedicated 6138 · 64 GB"},"price_vnd":2590000,"renew_at":1802192400},"plan_change":null,"plans":[{"code":"DS-6138-128","diff_vnd":400000,"kind":"upgrade","monthly_vnd":2990000,"name":"Dedicated 6138 · 128 GB","price_vnd":2990000,"quote":{"basis_source":"renewal","basis_vnd":2590000,"charge_cents":7961,"charge_vnd":207000,"new_price_vnd":2990000,"period_from":1799514000,"period_to":1802192400,"remaining_secs":1339200},"spec":{}}]},"schema":{"properties":{"current":{"properties":{"cycle":{"description":"Current billing cycle.","type":"string"},"plan":{"properties":{"code":{"description":"Plan code.","type":"string"},"name":{"description":"Plan display name.","type":"string"}},"required":["code","name"],"type":["object","null"]},"price_vnd":{"description":"Locked price of one cycle in VND.","type":"integer"},"renew_at":{"description":"Renewal date. (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["plan","cycle","price_vnd","renew_at"],"type":"object","x-order":["plan","cycle","price_vnd","renew_at"]},"plan_change":{"anyOf":[{"$ref":"#/components/schemas/DedicatedPlanChange"},{"type":"null"}]},"plans":{"items":{"$ref":"#/components/schemas/DedicatedPlanOption"},"type":"array"}},"required":["current","plans","plan_change"],"type":"object","x-order":["current","plans","plan_change"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many calls in the last minute."}]}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Other plans you can ask for: price at the current cycle, difference and the estimated charge of an upgrade","tags":["Dedicated Servers"],"x-cli":"dedicated plans","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/plans\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Gói khác có thể xin đổi cho Dedicated Server: giá theo chu kỳ hiện tại, chênh lệch, ước tính phần thu khi nâng"}},"/v1/dedicated/{id}/power":{"post":{"description":"Changes the power state of the machine: `on`, `off` (immediate power cut), `shutdown` (ask the operating system to shut down), `reboot` (ask the operating system to restart) or `reset` (immediate hard restart). The call answers `202` with an `op` and the machine follows in the background; poll [Get an operation](#operation/dedicated_op). Every action except `on` needs `confirm` set to the exact name of the server. Asking for the state the machine is already in fails with `409 dedicated_power_noop`. At most 6 power commands per minute are accepted for an account (`429 rate_limited`).\n\n**Required scope:** `dedicated:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_power","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"action":"reboot","confirm":"dell-105"},"schema":{"properties":{"action":{"description":"What to do.","enum":["on","off","shutdown","reboot","reset"],"type":"string"},"confirm":{"description":"The exact name of the server. Required for every action except `on`.","type":"string"}},"required":["action"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"op":{"action":"reboot","created_at":1792427000,"finished_at":null,"id":881,"kind":"power","public_error":null,"requested_by":"you","result":null,"state":"queued","step":"queued"}},"schema":{"properties":{"op":{"$ref":"#/components/schemas/DedicatedOp"}},"required":["op"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`action` is missing or not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: `action` is missing or not valid. `confirm_mismatch`: `confirm` does not match the name of the server. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"`action` is missing or not valid."},{"code":"confirm_mismatch","description":"`confirm` does not match the name of the server."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_power_noop","message":"The machine is already in the requested power state."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_power_noop`: The machine is already in the requested power state. `dedicated_busy`: Another operation is still running on this server. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"dedicated_power_noop","description":"The machine is already in the requested power state."},{"code":"dedicated_busy","description":"Another operation is still running on this server."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many power commands in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many power commands in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bmc_unavailable","message":"The server's controller is not available right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's controller is not available right now. (`dedicated_bmc_unavailable`)","x-error-codes":[{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Power on/off/reboot a Dedicated Server (asynchronous, returns an op)","tags":["Dedicated Servers"],"x-cli":"dedicated power","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/power\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\":\"reboot\",\"confirm\":\"dell-105\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:write","x-summary-vi":"Bật/tắt/khởi động lại Dedicated Server (bất đồng bộ, trả op)"}},"/v1/dedicated/{id}/proxy-app":{"get":{"description":"Returns whether Proxy App can run on this server and why not, the state of the platform agent inside the server, the subnets attached to the server with the number of proxies on each, and totals. Proxy App opens one SOCKS5 proxy per address of a subnet routed to this server; the proxies run inside your server through the platform agent. It is free of charge. No passwords are returned here.\n\n**Required scope:** `dedicated:proxy`.","operationId":"dedicated_proxy_app_status","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"agent":{"needs":null,"state":"online","version":"1.4.0-bm"},"limits":{"default_port":65001,"max":1022},"prefixes":[{"cidr":"203.0.113.0/24","eligible":true,"hosts":254,"id":12,"proxies":254,"reason":null,"refused":null,"truncated":false}],"provisioned_by_admin":false,"ready":true,"reason":"ready","src_allow":[],"summary":{"error":2,"pending":1,"running":250,"rx":1234,"stopped":1,"total":254,"tx":5678}},"schema":{"properties":{"agent":{"properties":{"needs":{"description":"What to do about the agent, if anything.","enum":["install","upgrade",null],"type":["string","null"]},"state":{"description":"State of the platform agent inside the server.","enum":["none","outdated","offline","online"],"type":"string"},"version":{"description":"Agent version.","type":["string","null"]}},"required":["state","version","needs"],"type":"object","x-order":["state","version","needs"]},"limits":{"properties":{"default_port":{"description":"Default port (65001).","type":"integer"},"max":{"description":"Maximum proxies per server (1022).","type":"integer"}},"required":["max","default_port"],"type":"object","x-order":["max","default_port"]},"prefixes":{"items":{"properties":{"cidr":{"description":"The subnet.","type":"string"},"eligible":{"description":"False when the subnet cannot be used; see `reason`.","type":"boolean"},"hosts":{"description":"Host addresses in the subnet (network and broadcast addresses excluded).","type":"integer"},"id":{"description":"Subnet identifier.","type":"integer"},"proxies":{"description":"Proxies already created on this subnet.","type":"integer"},"reason":{"description":"Why the subnet cannot be used.","enum":["not_active","ipv6","contains_main_ip","contains_gateway",null],"type":["string","null"]},"refused":{"description":"Code the agent reported when it refused the whole subnet, e.g. `connected_overlap`; null when not refused.","type":["string","null"]},"truncated":{"description":"True when the subnet has more hosts than one server can proxy (1022); create proxies in blocks with `from_host` and `to_host`.","type":"boolean"}},"required":["id","cidr","hosts","proxies","eligible","reason","refused","truncated"],"type":"object","x-order":["id","cidr","hosts","proxies","eligible","reason","refused","truncated"]},"type":"array"},"provisioned_by_admin":{"description":"True when an administrator prepared the proxies for you.","type":"boolean"},"ready":{"description":"True when proxies can be created now.","type":"boolean"},"reason":{"description":"Why Proxy App cannot be used yet, or `ready`.","enum":["ready","windows","no_agent","agent_outdated","no_subnet","locked","suspended","installing"],"type":"string"},"src_allow":{"items":{"description":"Source IPv4 address or CIDR allowed to use the proxies; empty means any source (credentials are always required).","type":"string"},"type":"array"},"summary":{"properties":{"error":{"description":"Failed to start; see each proxy.","type":"integer"},"pending":{"description":"Waiting for the agent to apply the change.","type":"integer"},"running":{"description":"Running.","type":"integer"},"rx":{"description":"Bytes received from the Internet through all proxies.","type":"integer"},"stopped":{"description":"Turned off or stopped by the platform.","type":"integer"},"total":{"description":"Proxies on the server.","type":"integer"},"tx":{"description":"Bytes sent to the Internet through all proxies.","type":"integer"}},"required":["total","running","error","stopped","pending","rx","tx"],"type":"object","x-order":["total","running","error","stopped","pending","rx","tx"]}},"required":["ready","reason","agent","prefixes","summary","src_allow","limits","provisioned_by_admin"],"type":"object","x-order":["ready","reason","agent","prefixes","summary","src_allow","limits","provisioned_by_admin"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"Proxy App status: readiness, agent, subnets and proxy totals","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app status","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/proxy-app\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:proxy","x-summary-vi":"Trạng thái Proxy App: điều kiện, agent, subnet, tổng số proxy"}},"/v1/dedicated/{id}/proxy-app/clear":{"post":{"description":"Deletes every proxy and the Proxy App settings of the server. The agent removes the listeners and the local route of the subnet within about ten seconds. Does not touch addresses you configured yourself.\n\n**Required scope:** `dedicated:proxy`.","operationId":"dedicated_proxy_app_clear","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":true},"schema":{"properties":{"confirm":{"description":"Must be `true`.","type":"boolean"}},"required":["confirm"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"deleted":254},"schema":{"properties":{"deleted":{"description":"Proxies deleted.","type":"integer"}},"required":["deleted"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`confirm` is not `true`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`confirm` is not `true`. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`confirm` is not `true`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `proxy_app_unsupported`: The server runs Windows, which Proxy App does not support.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"proxy_app_unsupported","description":"The server runs Windows, which Proxy App does not support."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"Remove all proxies and the Proxy App settings of the server","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app clear","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/proxy-app/clear\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":true}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:proxy","x-summary-vi":"Xoá hết proxy và cấu hình Proxy App của máy"}},"/v1/dedicated/{id}/proxy-app/export":{"post":{"description":"Returns the chosen proxies as text including their passwords: `ip_port_user_pass` (`ip:port:user:pass`), `url` (`socks5://user:pass@ip:port`) or `csv`. The response is not cached and the export is recorded in the activity log (without passwords).\n\n**Required scope:** `dedicated:proxy`.","operationId":"dedicated_proxy_app_export","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"all":true,"format":"url"},"schema":{"properties":{"all":{"description":"True to export every proxy matching `filter`.","type":"boolean"},"filter":{"properties":{"q":{"description":"IP or user text, up to 64 characters.","type":"string"},"status":{"description":"State.","enum":["pending","running","error","stopped"],"type":"string"}},"type":"object"},"format":{"description":"Output format.","enum":["ip_port_user_pass","url","csv"],"type":"string"},"ids":{"items":{"description":"Proxy identifiers.","type":"string"},"type":"array"}},"required":["format"],"type":"object","x-order":["format","ids","all","filter"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"count":1,"format":"url","text":"socks5://k3j9x0a1bc:Zx81mQp0aa9L2cT7uVwE@203.0.113.1:65001\n"},"schema":{"properties":{"count":{"description":"Proxies in the text.","type":"integer"},"format":{"description":"The format.","type":"string"},"text":{"description":"The list, one proxy per line. A secret: it contains passwords.","type":"string"}},"required":["format","count","text"],"type":"object","x-order":["format","count","text"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The request is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The request is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `proxy_app_unsupported`: The server runs Windows, which Proxy App does not support.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"proxy_app_unsupported","description":"The server runs Windows, which Proxy App does not support."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"Export proxies with passwords (ip:port:user:pass, socks5://, CSV)","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app export","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/proxy-app/export\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"all\":true,\"format\":\"url\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:proxy","x-summary-vi":"Xuất danh sách proxy kèm mật khẩu (ip:port:user:pass, socks5://, CSV)"}},"/v1/dedicated/{id}/proxy-app/proxies":{"get":{"description":"Lists the proxies of the server with their real state as reported by the agent. Passwords are never returned here; use [Export proxies](#operation/dedicated_proxy_app_export).\n\n**Required scope:** `dedicated:proxy`.","operationId":"dedicated_proxy_app_list","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":50,"maximum":254,"minimum":1,"type":"integer"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"asc","enum":["asc","desc"],"type":"string"}},{"description":"Sort column.","in":"query","name":"sort","required":false,"schema":{"default":"ip","enum":["ip","port","user","status","traffic","created"],"type":"string"}},{"description":"Only proxies in this state.","in":"query","name":"status","required":false,"schema":{"enum":["pending","running","error","stopped"],"type":"string"}},{"description":"Only proxies whose IP or user name contains this text.","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"cidr":"203.0.113.0/24","conns":1,"enabled":true,"has_password":true,"id":"px_3f9a1c2b7d4e","ip":"203.0.113.1","port":65001,"reason":null,"rx":10,"status":"running","status_code":null,"tx":20,"user":"k3j9x0a1bc"}],"page":1,"per_page":50,"total":254},"schema":{"properties":{"items":{"items":{"properties":{"cidr":{"description":"Subnet the address belongs to.","type":"string"},"conns":{"description":"Connections open now.","type":"integer"},"enabled":{"description":"False when you turned it off.","type":"boolean"},"has_password":{"description":"Always true; read it with Export proxies.","type":"boolean"},"id":{"description":"Proxy identifier, e.g. `px_3f9a1c2b7d4e`.","type":"string"},"ip":{"description":"Proxy address.","type":"string"},"port":{"description":"SOCKS5 port.","type":"integer"},"reason":{"description":"Same as `status_code`.","type":["string","null"]},"rx":{"description":"Bytes received from the Internet.","type":"integer"},"status":{"description":"Real state reported by the agent.","enum":["pending","running","error","stopped"],"type":"string"},"status_code":{"description":"Why it is not running: `ip_in_use`, `port_in_use`, `bind_failed`, a subnet refusal code, `prefix_detached` or `server_locked`.","type":["string","null"]},"tx":{"description":"Bytes sent to the Internet.","type":"integer"},"user":{"description":"User name.","type":"string"}},"required":["id","ip","port","user","has_password","enabled","status","status_code","reason","rx","tx","conns","cidr"],"type":"object","x-order":["id","ip","port","user","has_password","enabled","status","status_code","reason","rx","tx","conns","cidr"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A query parameter is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A query parameter is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A query parameter is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"List proxies (sorted, filtered, paged; no passwords)","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/proxy-app/proxies\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:proxy","x-summary-vi":"Danh sách proxy (sắp xếp, lọc, phân trang; không có mật khẩu)"},"post":{"description":"Creates one SOCKS5 proxy for every host address of the subnet (`.1` to `.254` of a /24) that has none yet, skipping the server's main address and its gateway. By default each proxy gets its own random user name and password and port 65001; `mode: shared` gives the whole range one user and password. Requires a current platform agent inside the server. Repeating the call creates only what is missing. Free of charge.\n\n**Required scope:** `dedicated:proxy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_proxy_app_create","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"mode":"random","port":65001,"prefix_id":12},"schema":{"properties":{"from_host":{"description":"First host number to create (1 = first host address). For subnets larger than 1022 hosts.","type":"integer"},"mode":{"description":"`random` (default): own user and password per proxy. `shared`: one user and password for all.","enum":["random","shared"],"type":"string"},"password":{"description":"`shared` only: password, 12-64 characters of letters, digits and . _ ~ -. Generated when omitted.","type":"string"},"port":{"description":"Port 1024-65535. Defaults to 65001.","type":"integer"},"prefix_id":{"description":"Subnet identifier from [Get Proxy App](#operation/dedicated_proxy_app_status).","type":"integer"},"to_host":{"description":"Last host number to create.","type":"integer"},"user":{"description":"`shared` only: user name, 3-32 characters of a-z 0-9 . _ -. Generated when omitted.","type":"string"}},"required":["prefix_id"],"type":"object","x-order":["prefix_id","mode","port","user","password","from_host","to_host"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"created":254,"existing":0,"skipped":{"gateway":0,"main_ip":0}},"schema":{"properties":{"created":{"description":"Proxies created.","type":"integer"},"existing":{"description":"Addresses that already had a proxy.","type":"integer"},"skipped":{"properties":{"gateway":{"description":"1 when the gateway was skipped.","type":"integer"},"main_ip":{"description":"1 when the main address of the server was skipped.","type":"integer"}},"required":["main_ip","gateway"],"type":"object","x-order":["main_ip","gateway"]}},"required":["created","existing","skipped"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `proxy_app_unsupported`: The server runs Windows, which Proxy App does not support. `proxy_app_not_ready`: The agent is missing or too old (`reason`: `no_agent`, `agent_outdated`). `prefix_not_eligible`: The subnet cannot be used (`reason`). `proxy_limit`: A server holds at most 1022 proxies. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"proxy_app_unsupported","description":"The server runs Windows, which Proxy App does not support."},{"code":"proxy_app_not_ready","description":"The agent is missing or too old (`reason`: `no_agent`, `agent_outdated`)."},{"code":"prefix_not_eligible","description":"The subnet cannot be used (`reason`)."},{"code":"proxy_limit","description":"A server holds at most 1022 proxies."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bad_port","message":"The port is not between 1024 and 65535."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_port`: The port is not between 1024 and 65535. `weak_password`: The password does not meet the rules. `bad_user`: The user name does not meet the rules. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"bad_port","description":"The port is not between 1024 and 65535."},{"code":"weak_password","description":"The password does not meet the rules."},{"code":"bad_user","description":"The user name does not meet the rules."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"Create a SOCKS5 proxy for every host address of the subnet (free of charge)","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/proxy-app/proxies\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"mode\":\"random\",\"port\":65001,\"prefix_id\":12}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:proxy","x-summary-vi":"Tạo proxy SOCKS5 cho mọi địa chỉ host của subnet (không tính phí)"}},"/v1/dedicated/{id}/proxy-app/proxies/bulk":{"post":{"description":"Applies one action to chosen proxies (`ids`) or to all proxies matching a filter (`all` with `filter`; an unknown filter key, a bad `status` or a `q` over 64 characters is rejected with 400, it never widens to all proxies): turn on, turn off, delete, change password or change port. One proxy is `ids` with one entry. Changes reach the agent within about ten seconds; each proxy shows `pending` until then.\n\n**Required scope:** `dedicated:proxy`.","operationId":"dedicated_proxy_app_bulk","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"action":"set_port","all":true,"port":65002},"schema":{"properties":{"action":{"description":"What to do.","enum":["enable","disable","delete","set_password","set_port"],"type":"string"},"all":{"description":"True to act on every proxy matching `filter` (or all when no filter).","type":"boolean"},"filter":{"properties":{"q":{"description":"IP or user text, up to 64 characters.","type":"string"},"status":{"description":"State.","enum":["pending","running","error","stopped"],"type":"string"}},"type":"object"},"ids":{"items":{"description":"Proxy identifiers.","type":"string"},"type":"array"},"mode":{"description":"`set_password`: new random password for each proxy, or one shared password.","enum":["random","shared"],"type":"string"},"password":{"description":"`set_password`: the password to use for all chosen proxies, 12-64 characters of letters, digits and . _ ~ -; it must differ from the user name.","type":"string"},"port":{"description":"`set_port`: new port 1024-65535.","type":"integer"}},"required":["action"],"type":"object","x-order":["action","ids","all","filter","mode","password","port"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"affected":254},"schema":{"properties":{"affected":{"description":"Proxies changed.","type":"integer"}},"required":["affected"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The request is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The request is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `proxy_app_unsupported`: The server runs Windows, which Proxy App does not support.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"proxy_app_unsupported","description":"The server runs Windows, which Proxy App does not support."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bad_port","message":"The port is not between 1024 and 65535."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_port`: The port is not between 1024 and 65535. `weak_password`: The password does not meet the rules.","x-error-codes":[{"code":"bad_port","description":"The port is not between 1024 and 65535."},{"code":"weak_password","description":"The password does not meet the rules."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"Turn on, off, delete, change password or port of many proxies","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app bulk","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/proxy-app/proxies/bulk\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\":\"set_port\",\"all\":true,\"port\":65002}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:proxy","x-summary-vi":"Bật/tắt/xoá/đổi mật khẩu/đổi cổng nhiều proxy"}},"/v1/dedicated/{id}/proxy-app/settings":{"put":{"description":"Sets the source addresses allowed to connect to the proxies. An empty list allows any source; the user name and password are always required.\n\n**Required scope:** `dedicated:proxy`.","operationId":"dedicated_proxy_app_settings","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"src_allow":["198.51.100.7","198.51.101.0/24"]},"schema":{"properties":{"src_allow":{"items":{"description":"IPv4 address or CIDR (/8 to /32). At most 64.","type":"string"},"type":"array"}},"required":["src_allow"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"src_allow":["198.51.100.7","198.51.101.0/24"]},"schema":{"properties":{"src_allow":{"items":{"description":"The list as stored.","type":"string"},"type":"array"}},"required":["src_allow"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `proxy_app_unsupported`: The server runs Windows, which Proxy App does not support.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"proxy_app_unsupported","description":"The server runs Windows, which Proxy App does not support."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bad_src_allow","message":"An entry is not a valid IPv4 address or CIDR."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An entry is not a valid IPv4 address or CIDR. (`bad_src_allow`)","x-error-codes":[{"code":"bad_src_allow","description":"An entry is not a valid IPv4 address or CIDR."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:proxy"]}],"summary":"Set the source addresses allowed to use the proxies","tags":["Dedicated Servers"],"x-cli":"dedicated proxy-app settings","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/dedicated/<id>/proxy-app/settings\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"src_allow\":[\"198.51.100.7\",\"198.51.101.0/24\"]}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:proxy","x-summary-vi":"Đặt danh sách IP nguồn được dùng proxy"}},"/v1/dedicated/{id}/reinstall":{"post":{"description":"Reinstalls the operating system from an automatic template ([List OS templates](#operation/dedicated_os_templates)). **Every disk partition is erased.** The call answers `202` with an `op` (Linux 15–25 minutes, Windows about 60 minutes); poll [Get an operation](#operation/dedicated_op). Set `confirm_hostname` to the same value as `hostname`. When the operation is done a new password for the OS account is shown once on the server page of the web panel. At most 3 reinstalls per hour for a server.\n\n**Required scope:** `dedicated:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_reinstall","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm_hostname":"web-01","hostname":"web-01","template":"ubuntu-24.04"},"schema":{"properties":{"confirm_hostname":{"description":"Type the hostname again to confirm that the disks will be erased.","type":"string"},"hostname":{"description":"New hostname: 1–63 characters a-z 0-9 and hyphen (Windows at most 15, not all digits).","type":"string"},"template":{"description":"Template slug, e.g. `ubuntu-24.04`.","type":"string"}},"required":["template","hostname","confirm_hostname"],"type":"object","x-order":["template","hostname","confirm_hostname"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"op":{"action":"reboot","created_at":1792427000,"finished_at":null,"id":881,"kind":"power","public_error":null,"requested_by":"you","result":null,"state":"queued","step":"queued"}},"schema":{"properties":{"op":{"$ref":"#/components/schemas/DedicatedOp"}},"required":["op"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not valid JSON or has unknown fields."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not valid JSON or has unknown fields. `confirm_mismatch`: `confirm_hostname` does not match `hostname`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not valid JSON or has unknown fields."},{"code":"confirm_mismatch","description":"`confirm_hostname` does not match `hostname`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported","message":"Automatic reinstall is not available for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_supported`: Automatic reinstall is not available for this server. `dedicated_busy`: Another operation is still running on this server. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_supported","description":"Automatic reinstall is not available for this server."},{"code":"dedicated_busy","description":"Another operation is still running on this server."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The template is unknown or disabled, the hostname is not valid, or the template is Debian and the server does not boot in UEFI mode."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The template is unknown or disabled, the hostname is not valid, or the template is Debian and the server does not boot in UEFI mode. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"The template is unknown or disabled, the hostname is not valid, or the template is Debian and the server does not boot in UEFI mode."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_ops_disabled","message":"Server control is switched off system-wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_ops_disabled`: Server control is switched off system-wide. `dedicated_server_locked`: The server is locked for control actions. `dedicated_suspended`: Your subscription is suspended; the server is read-only.","x-error-codes":[{"code":"dedicated_ops_disabled","description":"Server control is switched off system-wide."},{"code":"dedicated_server_locked","description":"The server is locked for control actions."},{"code":"dedicated_suspended","description":"Your subscription is suspended; the server is read-only."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many reinstalls for this server in the last hour. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many reinstalls for this server in the last hour."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bmc_unavailable","message":"The server's controller is not available right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's controller is not available right now. (`dedicated_bmc_unavailable`)","x-error-codes":[{"code":"dedicated_bmc_unavailable","description":"The server's controller is not available right now."}]}},"security":[{"bearerAuth":["dedicated:destroy"]}],"summary":"Reinstall the OS of a Dedicated Server (erases the disks, asynchronous, returns an op)","tags":["Dedicated Servers"],"x-cli":"dedicated reinstall","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/reinstall\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm_hostname\":\"web-01\",\"hostname\":\"web-01\",\"template\":\"ubuntu-24.04\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:destroy","x-summary-vi":"Cài lại hệ điều hành Dedicated Server (XOÁ SẠCH ổ, bất đồng bộ, trả op)"}},"/v1/dedicated/{id}/renew":{"post":{"description":"Pays the renewal of the subscription from your wallet. If an invoice is open it is paid; otherwise one cycle is renewed early, which is allowed in the last 14 days before `renew_at`. The price is always the locked price of your subscription converted to US cents at the exchange rate of the moment (rounded down); the free subscriptions are never charged. A suspended subscription becomes active again right after payment. Send `expect_renew_at` with the `renew_at` you saw: if it changed in between, nothing is charged (`409 dedicated_renew_stale`). Pressing twice does not charge twice. At most 10 calls per minute per account.\n\n**Required scope:** `dedicated:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"dedicated_renew","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"expect_renew_at":1802192400,"periods":3},"schema":{"properties":{"expect_renew_at":{"description":"The `renew_at` you are paying for; the call fails with `dedicated_renew_stale` if the subscription's date is no longer this one. (Unix time, seconds, UTC)","type":"integer"},"expect_total_cents":{"description":"The total in US cents you saw (cycles x amount). If the amount computed when paying differs (cycle change waiting for the next renewal, price or exchange rate), the call fails with `dedicated_renew_total_changed` and nothing is charged.","type":"integer"},"periods":{"description":"Number of cycles to pay in advance, added one after the other from the current renewal date (31 Oct → 30 Nov → 31 Dec). When sent, early payment is allowed at any time; the open invoice, if any, is paid first as the first cycle and no second invoice is issued for it. At most `billing.max_periods`: the total is capped at 24 REAL months of the cycle that will apply (a cycle change waiting for the next renewal counts). Not sent: one cycle, only in the last 14 days.","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"billing":{"anchor_day":31,"auto_renew":true,"balance_cents":100000,"can_renew":true,"cycle":"monthly","cycle_months":1,"cycles":[{"cycle":"monthly","discount_pct":0,"months":1,"price_vnd":2590000},{"cycle":"quarterly","discount_pct":5,"months":3,"price_vnd":7380000}],"debt":{"amount_cents":null,"grace_until":null,"invoice_id":null,"overdue":false,"suspended":false,"unpaid":false},"free":false,"last_invoice":{"created_at":1799514000,"currency":"usd","description":"Dedicated Server dell-105 — Monthly renewal","due_at":null,"id":4411,"kind":"renewal","number":"INV-2026-004411","paid_at":1799514000,"period_from":1799514000,"period_to":1802192400,"status":"paid","total_cents":99615},"max_periods":24,"next":{"amount_cents":99615,"cycle":"monthly","plan_code":"DS-6138-64","price_vnd":2590000,"scheduled_change":false},"pending_cycle":null,"pending_plan":null,"plan":{"code":"DS-6138-64","name":"Dedicated 6138 · 64 GB","spec":{}},"plan_change":null,"price_vnd":2590000,"renew_at":1802192400,"status":"active"},"charged_cents":28846,"invoice_id":4411,"invoice_ids":[4411],"periods":1,"renewal":{"amount_cents":28846,"auto_renew":true,"balance_cents":100000,"can_pay":true,"cycle":"quarterly","cycle_months":3,"grace_until":null,"invoice_id_open":null,"period_to":1810054800,"price_vnd":7500000,"renew_at":1802192400,"status":"due_soon"},"resumed":false},"schema":{"properties":{"billing":{"$ref":"#/components/schemas/DedicatedBilling"},"charged_cents":{"description":"US cents charged from the wallet by this call.","type":"integer"},"invoice_id":{"description":"Identifier of the paid renewal invoice.","type":"integer"},"invoice_ids":{"items":{"description":"Identifier of a paid invoice, one per cycle.","type":"integer"},"type":"array"},"periods":{"description":"Cycles paid by this call.","type":"integer"},"renewal":{"$ref":"#/components/schemas/DedicatedRenewal"},"resumed":{"description":"True when the subscription was suspended and is active again.","type":"boolean"}},"required":["renewal","charged_cents","invoice_id","resumed","periods","invoice_ids","billing"],"type":"object","x-order":["renewal","charged_cents","invoice_id","resumed","periods","invoice_ids","billing"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object with an optional integer `expect_renew_at`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object with an optional integer `expect_renew_at`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object with an optional integer `expect_renew_at`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is lower than the amount to pay; top up and try again (`need_cents` is the total of all cycles, `balance_cents` your balance before the call; nothing is charged)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is lower than the amount to pay; top up and try again (`need_cents` is the total of all cycles, `balance_cents` your balance before the call; nothing is charged). (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is lower than the amount to pay; top up and try again (`need_cents` is the total of all cycles, `balance_cents` your balance before the call; nothing is charged)."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_renew_too_early","message":"`periods` was not sent, no invoice is open and the renewal date is more than 14 days away."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_renew_too_early`: `periods` was not sent, no invoice is open and the renewal date is more than 14 days away. `dedicated_renew_stale`: The renewal date changed; reload and try again. `dedicated_renew_total_changed`: `expect_total_cents` does not match the amount computed now; nothing was charged (`total_cents` is the new amount). `dedicated_renew_in_progress`: The subscription was renewed a moment ago. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"dedicated_renew_too_early","description":"`periods` was not sent, no invoice is open and the renewal date is more than 14 days away."},{"code":"dedicated_renew_stale","description":"The renewal date changed; reload and try again."},{"code":"dedicated_renew_total_changed","description":"`expect_total_cents` does not match the amount computed now; nothing was charged (`total_cents` is the new amount)."},{"code":"dedicated_renew_in_progress","description":"The subscription was renewed a moment ago."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"dedicated_bad_periods","message":"`periods` is below 1 or makes the total exceed 24 months of the cycle that will apply (see `billing.max_periods`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_bad_periods`: `periods` is below 1 or makes the total exceed 24 months of the cycle that will apply (see `billing.max_periods`). `dedicated_free_subscription`: The subscription is free of charge: there is nothing to renew. `dedicated_no_price`: The subscription has no renewal price; contact support. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"dedicated_bad_periods","description":"`periods` is below 1 or makes the total exceed 24 months of the cycle that will apply (see `billing.max_periods`)."},{"code":"dedicated_free_subscription","description":"The subscription is free of charge: there is nothing to renew."},{"code":"dedicated_no_price","description":"The subscription has no renewal price; contact support."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The service is locked by support (or the account is stopped); paying by hand is not possible while the lock lasts. The server keeps running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The service is locked by support (or the account is stopped); paying by hand is not possible while the lock lasts. The server keeps running. (`dedicated_server_locked`)","x-error-codes":[{"code":"dedicated_server_locked","description":"The service is locked by support (or the account is stopped); paying by hand is not possible while the lock lasts. The server keeps running."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many renew calls in the last minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many renew calls in the last minute."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"dedicated_fx_unavailable","message":"The exchange rate is not available right now; try again in a few minutes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The exchange rate is not available right now; try again in a few minutes. (`dedicated_fx_unavailable`)","x-error-codes":[{"code":"dedicated_fx_unavailable","description":"The exchange rate is not available right now; try again in a few minutes."}]}},"security":[{"bearerAuth":["dedicated:write"]}],"summary":"Pay the open renewal invoice or renew several cycles early (periods; charged from the wallet at the subscription's locked price)","tags":["Dedicated Servers"],"x-cli":"dedicated renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"expect_renew_at\":1802192400,\"periods\":3}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"dedicated:write","x-summary-vi":"Thanh toán hoá đơn gia hạn đang mở hoặc gia hạn sớm nhiều kỳ (periods; trừ ví theo giá chốt của thuê bao)"}},"/v1/dedicated/{id}/sensors":{"get":{"description":"Returns the last sensor reading: power draw, temperatures, fan speeds and power supplies, plus the processor, memory and input/output usage (`usage`), the current network rate and monthly total (`network`) and the drive capacity (`storage`). A number that cannot be measured is `null` with a `reason`, never 0. With `range` it also returns a time series (`24h` every 2 minutes, `7d` every 30 minutes). `stale` is true when the reading may be outdated.\n\n**Required scope:** `dedicated:read`.","operationId":"dedicated_sensors","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Include a time series covering this period.","in":"query","name":"range","required":false,"schema":{"enum":["24h","7d"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792426591,"fans":[{"health":"OK","name":"Fan1A","rpm":15394}],"health":"OK","network":{"at":1792426500,"in_bps":52000,"month":{"in_bytes":23016451,"month":"2026-10","out_bytes":520},"out_bps":1200000,"reason":null},"power":{"avg":64,"capacity":483,"max":89,"min":61,"watts":64},"psus":[{"health":"OK","input_v":220,"name":"PS1"}],"series":{"points":[{"cpu_max_c":30,"cpu_pct":9,"inlet_c":25,"io_pct":0,"mem_pct":30,"t":1792420000,"watts":63}],"step":120},"stale":false,"storage":{"drives":2,"total_bytes":1024209543168},"temps":[{"c":25,"health":"OK","name":"Inlet Temp"}],"usage":{"at":1792426591,"cpu":10,"io":0,"mem":30,"reason":null}},"schema":{"$ref":"#/components/schemas/DedicatedSensors"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`range` is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`range` is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`range` is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:read"]}],"summary":"Power, temperatures, fans, PSUs, CPU/memory/I-O usage, current network rate (+ 24h/7d series)","tags":["Dedicated Servers"],"x-cli":"dedicated sensors","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/dedicated/<id>/sensors\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:read","x-summary-vi":"Công suất, nhiệt độ, quạt, PSU, mức dùng CPU/RAM/I-O, tốc độ mạng hiện tại (+ chuỗi 24h/7d)"}},"/v1/dedicated/{id}/ssh-credentials":{"delete":{"description":"Forgets the SSH password you typed in the terminal and chose to keep. The next terminal then uses the user name and password of the current operating system installation, or asks again if there is none. It never touches the installation login or the server itself. Works even when the server is off or locked.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_ssh_credentials_delete","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cleared":true,"ok":true},"schema":{"properties":{"cleared":{"description":"True when a saved login existed and was removed.","type":"boolean"},"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok","cleared"],"type":"object","x-order":["ok","cleared"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Forget the SSH password you typed and kept for a Dedicated Server","tags":["Dedicated Servers"],"x-cli":"dedicated ssh-credentials delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/dedicated/<id>/ssh-credentials\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Xoá mật khẩu SSH khách đã nhập và lưu của Dedicated Server"}},"/v1/dedicated/{id}/ssh-token":{"post":{"description":"Issues a one-time ticket for the SSH web terminal of a Dedicated Server. Open a WebSocket to `websocket_url` with the ticket as the `token` query parameter (`<websocket_url>?token=<token>`) within `expires_in` seconds (120). The ticket works for one connection; reconnecting needs a new ticket. The frames are the same as for virtual machines: send `{\"type\":\"input\",\"data\":\"ls\\n\"}`, `{\"type\":\"resize\",\"cols\":120,\"rows\":30}` and, when the gateway asks for credentials (`auth_required`), `{\"type\":\"auth\",\"username\":\"...\",\"password\":\"...\"}`; output arrives as `{\"type\":\"output\",\"data\":\"...\"}` frames.\n\nThe gateway always connects to the current public address of this server, on port 22; you cannot choose another target. It logs in by itself with the user name and password of the current operating system installation (`credentials_source` = `install`), or with a password you typed in the terminal earlier and chose to keep (`saved`). The password is never sent to you. When neither exists, `credentials_source` is `none` and the gateway asks for the password. Requests are limited to 20 per minute per client address and per account. Sessions that were started by an administrator on your behalf cannot use this operation.\n\n**Required scope:** `dedicated:console`.","operationId":"dedicated_ssh_token","parameters":[{"description":"Dedicated Server identifier as returned by List Dedicated Servers, e.g. `ds_3f9a1c2b7d4e5a60`.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"credentials_source":"install","default_username":"root","expires_in":120,"has_credentials":true,"ip_address":"203.0.113.10","port":22,"saved_credentials":false,"token":"ofw_ssh_ds_9f3c1b7a5d2e4f60718293a4b5c6d7e8","vm_id":"ds_3f9a1c2b7d4e5a60","vm_name":"dell-1","websocket_url":"wss://cloud.example.com/ssh-ws"},"schema":{"properties":{"credentials_source":{"description":"Where the login comes from: the current operating system installation, a password you kept, or nowhere (the gateway asks).","enum":["install","saved","none"],"type":"string"},"default_username":{"description":"Login name the terminal uses or proposes.","type":"string"},"expires_in":{"description":"Seconds the ticket stays valid (120).","type":"integer"},"has_credentials":{"description":"True when the gateway can log in without asking for a password.","type":"boolean"},"ip_address":{"description":"Public address the terminal connects to.","type":"string"},"port":{"description":"SSH port the gateway connects to (always 22).","type":"integer"},"saved_credentials":{"description":"True when a password you typed is kept; remove it with [Forget the saved SSH login](#operation/dedicated_ssh_credentials_delete).","type":"boolean"},"token":{"description":"One-time ticket. A secret: it opens a terminal on the server.","type":"string"},"vm_id":{"description":"Identifier of the Dedicated Server.","type":"string"},"vm_name":{"description":"Display name of the server.","type":["string","null"]},"websocket_url":{"description":"WebSocket address of the terminal gateway.","type":"string"}},"required":["token","expires_in","websocket_url","default_username","port","vm_id","vm_name","ip_address","has_credentials","credentials_source","saved_credentials"],"type":"object","x-order":["token","expires_in","websocket_url","default_username","port","vm_id","vm_name","ip_address","has_credentials","credentials_source","saved_credentials"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The call comes from a session a reseller opened on your behalf. (`impersonate_forbidden`)","x-error-codes":[{"code":"impersonate_forbidden","description":"The call comes from a session a reseller opened on your behalf."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not assigned to you."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not assigned to you. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not assigned to you."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"dedicated_installing","message":"An operating system installation is running. Wait until it finishes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_installing`: An operating system installation is running. Wait until it finishes. `dedicated_ssh_unsupported`: The server runs Windows, which has no SSH. Use the console or RDP. `dedicated_powered_off`: The server is powered off. Power it on first. `dedicated_no_ip`: The server has no public address to connect to.","x-error-codes":[{"code":"dedicated_installing","description":"An operating system installation is running. Wait until it finishes."},{"code":"dedicated_ssh_unsupported","description":"The server runs Windows, which has no SSH. Use the console or RDP."},{"code":"dedicated_powered_off","description":"The server is powered off. Power it on first."},{"code":"dedicated_no_ip","description":"The server has no public address to connect to."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"dedicated_server_locked","message":"The server is locked by an administrator or your account's services are stopped."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`dedicated_server_locked`: The server is locked by an administrator or your account's services are stopped. `dedicated_suspended`: Your subscription is suspended.","x-error-codes":[{"code":"dedicated_server_locked","description":"The server is locked by an administrator or your account's services are stopped."},{"code":"dedicated_suspended","description":"Your subscription is suspended."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many requests. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many requests."}]}},"security":[{"bearerAuth":["dedicated:console"]}],"summary":"Get a one-time SSH WebSocket ticket for a Dedicated Server (logs in with the installation's login)","tags":["Dedicated Servers"],"x-cli":"dedicated ssh-token","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/dedicated/<id>/ssh-token\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"dedicated:console","x-summary-vi":"Xin vé SSH WebSocket cho Dedicated Server (dùng một lần, tự đăng nhập bằng tài khoản của lượt cài)"}},"/v1/ext/iap/apple/token":{"get":{"description":"For the VPN app for iPhone. Returns the fixed `app_account_token` of your account and the wallet top-up products sold through Apple In-App Purchase. Pass the token to StoreKit (`purchase(options: [.appAccountToken(uuid)])`) so the signed transaction is bound to your account; it never changes and does not reveal your account id.\n\n`credit_cents` is what one unit of the product adds to the wallet (US cents). `enabled` tells the app whether to offer purchases; transactions already paid are still credited when it is `false`. Only available on the main site (`403 iap_unavailable` on reseller sites).\n\n**Required scope:** `wallet:iap`.","operationId":"vpn_iap_token","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"app_account_token":"3f2b8c1e-7d4a-4b9e-a6c2-91d0e5f4b7a3","enabled":true,"products":[{"credit_cents":1000,"id":"net.example.vpn.topup.10"},{"credit_cents":2000,"id":"net.example.vpn.topup.20"},{"credit_cents":5000,"id":"net.example.vpn.topup.50"},{"credit_cents":10000,"id":"net.example.vpn.topup.100"}]},"schema":{"properties":{"app_account_token":{"description":"UUID to pass to StoreKit as appAccountToken (lower case).","type":"string"},"enabled":{"description":"Whether the app should offer Apple In-App Purchase top-ups.","type":"boolean"},"products":{"items":{"properties":{"credit_cents":{"description":"Wallet credit per unit, in US cents.","type":"integer"},"id":{"description":"App Store product id (consumable).","type":"string"}},"required":["id","credit_cents"],"type":"object","x-order":["id","credit_cents"]},"type":"array"}},"required":["app_account_token","products","enabled"],"type":"object","x-order":["app_account_token","products","enabled"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: In-App Purchase is not available on this site. (`iap_unavailable`)","x-error-codes":[{"code":"iap_unavailable","description":"In-App Purchase is not available on this site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["wallet:iap"]}],"summary":"Account token (appAccountToken) + Apple In-App Purchase top-up products","tags":["VPN and Proxy"],"x-cli":"vpn iap token","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/ext/iap/apple/token\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"wallet:iap","x-summary-vi":"Mã gắn tài khoản (appAccountToken) + gói nạp Apple In-App Purchase"}},"/v1/ext/iap/apple/transactions":{"post":{"description":"For the VPN app for iPhone. Submit a StoreKit 2 transaction (`Transaction.jwsRepresentation`) after an Apple In-App Purchase to credit the wallet. The server verifies the Apple signature offline (certificate chain up to Apple Root CA - G3), the bundle id, the product, the `appAccountToken` (must be yours) and that the transaction was not refunded. Call `finish()` on the transaction after a `200`.\n\nIdempotent per Apple `transactionId`: submitting the same transaction again returns `200` with `replayed: true` and `credited_cents: 0`. A real top-up runs exactly like a card top-up (invoice, receipt e-mail, and it activates the trial credit when it qualifies — see `trial`). Sandbox transactions (TestFlight, App Review) are credited only for accounts the site owner allowed and never count as a real top-up.\n\n**Required scope:** `wallet:iap`.","operationId":"vpn_iap_submit","parameters":[],"requestBody":{"content":{"application/json":{"example":{"signed_transaction":"eyJhbGciOiJFUzI1NiIsIng1YyI6WyJNSUlF...In0.eyJ0cmFuc2FjdGlvbklkIjoi...In0.MEUCIQ..."},"schema":{"properties":{"signed_transaction":{"description":"JWS from StoreKit 2 `Transaction.jwsRepresentation`.","type":"string"}},"required":["signed_transaction"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"balance_cents":1000,"credited_cents":1000,"environment":"Production","replayed":false,"transaction_id":"2000000812345678","trial":{"amount_cents":10000,"expires_at":1795000000,"left_cents":10000,"status":"active"}},"schema":{"properties":{"balance_cents":{"description":"Wallet balance after the call, in US cents.","type":"integer"},"credited_cents":{"description":"Amount added to the wallet by this call, in US cents (0 when replayed).","type":"integer"},"environment":{"description":"App Store environment of the transaction.","enum":["Production","Sandbox"],"type":"string"},"replayed":{"description":"True when this transaction had already been credited.","type":"boolean"},"transaction_id":{"description":"Apple transactionId.","type":"string"},"trial":{"properties":{"amount_cents":{"description":"Trial credit granted, in US cents.","type":"integer"},"expires_at":{"description":"Time the trial credit expires (Unix time, seconds, UTC)","type":["integer","null"]},"left_cents":{"description":"Trial credit still available, in US cents.","type":"integer"},"status":{"description":"State of the trial credit (see `GET /v1/billing/trial`).","enum":["none","pending","active","used_up","expired"],"type":"string"}},"required":["status","amount_cents","left_cents","expires_at"],"type":["object","null"],"x-order":["status","amount_cents","left_cents","expires_at"]}},"required":["credited_cents","balance_cents","replayed","environment","transaction_id","trial"],"type":"object","x-order":["credited_cents","balance_cents","replayed","environment","transaction_id","trial"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_signature","message":"The transaction is not signed by Apple (bad chain, expired certificate, wrong OID or signature)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The transaction is not signed by Apple (bad chain, expired certificate, wrong OID or signature). (`invalid_signature`)","x-error-codes":[{"code":"invalid_signature","description":"The transaction is not signed by Apple (bad chain, expired certificate, wrong OID or signature)."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `account_mismatch`: The transaction's appAccountToken belongs to another account. `sandbox_not_allowed`: Sandbox purchase from an account that is not allowed to use Sandbox.","x-error-codes":[{"code":"account_mismatch","description":"The transaction's appAccountToken belongs to another account."},{"code":"sandbox_not_allowed","description":"Sandbox purchase from an account that is not allowed to use Sandbox."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"transaction_revoked","message":"Apple refunded or revoked the transaction."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Apple refunded or revoked the transaction. (`transaction_revoked`)","x-error-codes":[{"code":"transaction_revoked","description":"Apple refunded or revoked the transaction."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"unknown_product","message":"The product is not a wallet top-up product of this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`unknown_product`: The product is not a wallet top-up product of this site. `bundle_mismatch`: The transaction belongs to another app.","x-error-codes":[{"code":"unknown_product","description":"The product is not a wallet top-up product of this site."},{"code":"bundle_mismatch","description":"The transaction belongs to another app."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["wallet:iap"]}],"summary":"Submit a signed Apple In-App Purchase transaction to credit the wallet (idempotent per transactionId)","tags":["VPN and Proxy"],"x-cli":"vpn iap submit","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/ext/iap/apple/transactions\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"signed_transaction\":\"eyJhbGciOiJFUzI1NiIsIng1YyI6WyJNSUlF...In0.eyJ0cmFuc2FjdGlvbklkIjoi...In0.MEUCIQ...\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"wallet:iap","x-summary-vi":"Nộp giao dịch Apple In-App Purchase đã ký để cộng ví (idempotent theo transactionId)"}},"/v1/ext/session":{"delete":{"description":"Revokes the API key that makes the call, immediately and permanently. Apps use it as a \"log out\" button: the next request with the same key fails with `401`. Only the calling key is affected; other keys and dashboard sessions stay valid, and the revoked key stays listed as revoked on the API Keys page.\n\nCall it with an API key. A dashboard session is refused with `403 key_required`.\n\n**Required scope:** `vpn:read`.","operationId":"vpn_session_revoke","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The call was not made with an API key (for example it used a dashboard session). (`key_required`)","x-error-codes":[{"code":"key_required","description":"The call was not made with an API key (for example it used a dashboard session)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"The key revokes itself (app log out)","tags":["VPN and Proxy"],"x-cli":"vpn session revoke","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/ext/session\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Khoá tự thu hồi chính nó (Đăng xuất app)"}},"/v1/gpu":{"get":{"description":"Lists the GPU instances of your account, newest first. Deleted instances are not listed; an instance whose order failed stays in the list with state `failed` and an `error_msg`. The list is not paginated.\n\n`sales_enabled` is false when the site is not taking new GPU orders; instances you already have keep working and can still be managed. `counts` gives quick totals: `running` counts `active` instances whose machine reports `running`, `stopped` counts `stopped` and `locked` instances, and `error` counts `failed` instances plus `active` ones whose machine is not running.\n\n**Required scope:** `gpu:read`.","operationId":"gpu_list","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"counts":{"all":1,"error":0,"running":1,"stopped":0},"items":[{"billed_until":1792414110,"charged_cents":120,"cpu":16,"created_at":1792400000,"cuda_max":12.8,"cycle":"hourly","cycle_cents":0,"disk_gb":100,"display_name":"train-01","error_msg":null,"geolocation":"Texas, US","gpu_count":1,"gpu_name":"RTX 4090","hostname":"train-01","hourly_uusd":400000,"id":"gpu-3f6c1d0e8a524b57","intent":null,"jupyter_url":null,"paid_until":null,"ports":{"22/tcp":[{"HostIp":"0.0.0.0","HostPort":"40122"}]},"public_ip":"203.0.113.45","ram_gb":64,"refunded_cents":0,"reliability":0.9871,"runtime_status":"running","runtype":"ssh","ssh_host":"gw5.example.net","ssh_port":22846,"state":"active","storage_hourly_uusd":2400,"template_id":3,"template_name":"Ubuntu 24.04 CUDA 12.9 Devel (Pure SSH)","updated_at":1792400310,"vram_gb":24}],"sales_enabled":true,"total":1},"schema":{"properties":{"counts":{"properties":{"all":{"description":"Number of instances in `items`.","type":"integer"},"error":{"description":"Instances that are `failed`, plus `active` instances whose machine is not running.","type":"integer"},"running":{"description":"Instances that are `active` and running.","type":"integer"},"stopped":{"description":"Instances that are `stopped` or `locked`.","type":"integer"}},"required":["all","running","stopped","error"],"type":"object","x-order":["all","running","stopped","error"]},"items":{"items":{"$ref":"#/components/schemas/GpuInstance"},"type":"array"},"sales_enabled":{"description":"Whether the site currently accepts new GPU orders.","type":"boolean"},"total":{"description":"Number of instances in `items`.","type":"integer"}},"required":["items","sales_enabled","total","counts"],"type":"object","x-order":["items","sales_enabled","total","counts"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:read"]}],"summary":"List GPU instances","tags":["GPU Cloud"],"x-cli":"gpu list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/gpu\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:read","x-summary-vi":"Danh sách máy GPU"},"post":{"description":"Rents the machine from a quote. The first period is charged to your wallet immediately (one hour of compute for `hourly`, the whole cycle price for the other cycles) and the instance is created in state `queued`. The platform then rents the machine in the background: follow [Get a GPU instance](#operation/gpu_get) until `state` is `active`, which can take several minutes, then connect over SSH with the key you chose.\n\nThe wallet must hold at least the site's minimum balance and at least the quote's `charge_cents`, otherwise the call fails with `402 insufficient_funds` and nothing is charged. If the machine cannot be started within about 15 minutes, the provider refuses the order, or the machine became more than 5% more expensive since the quote, the instance ends in state `failed` with an `error_msg` and the full amount is refunded.\n\nUse a new `request_id` for every order and keep it when you retry: repeating the call with a `request_id` you already used returns the order created the first time and charges nothing more. Like every call that spends money it also needs the `Idempotency-Key` header.\n\n**Required scope:** `gpu:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"gpu_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"hostname":"train-01","quote_id":"gq-9a7c3e5b1d2f4a60b8c4d6e8f0a1b2c3","request_id":"8d5f2a1c-7b3e-4c90-a1d6-5e2f9b0c4d73","ssh_key_id":12},"schema":{"properties":{"hostname":{"description":"Host name of the instance: 2 to 63 characters, letters, digits and hyphens, not starting or ending with a hyphen. Letters are lowercased.","maxLength":63,"minLength":2,"type":"string"},"quote_id":{"description":"Quote returned by Quote a GPU rental. It is valid for 180 seconds and can be used for one order only.","type":"string"},"request_id":{"description":"Identifier you invent for this order: 8 to 100 characters, letters, digits and hyphens. Retrying with the same value returns the existing order instead of creating a second one.","maxLength":100,"minLength":8,"type":"string"},"ssh_key_id":{"description":"Identifier of one of your stored SSH keys (see List SSH keys). Its public key is installed on the instance for the `root` user.","type":"integer"}},"required":["quote_id","request_id","hostname","ssh_key_id"],"type":"object","x-order":["quote_id","request_id","hostname","ssh_key_id"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"id":"gpu-3f6c1d0e8a524b57","instance":{"billed_until":null,"charged_cents":40,"cpu":16,"created_at":1792400000,"cuda_max":12.8,"cycle":"hourly","cycle_cents":0,"disk_gb":100,"display_name":"train-01","error_msg":null,"geolocation":"Texas, US","gpu_count":1,"gpu_name":"RTX 4090","hostname":"train-01","hourly_uusd":400000,"id":"gpu-3f6c1d0e8a524b57","intent":null,"jupyter_url":null,"paid_until":null,"ports":{},"public_ip":null,"ram_gb":64,"refunded_cents":0,"reliability":0.9871,"runtime_status":"loading","runtype":"ssh","ssh_host":null,"ssh_port":null,"state":"queued","storage_hourly_uusd":2400,"template_id":3,"template_name":"Ubuntu 24.04 CUDA 12.9 Devel (Pure SSH)","updated_at":1792400000,"vram_gb":24}},"schema":{"properties":{"id":{"description":"Identifier of the new instance.","type":"string"},"instance":{"$ref":"#/components/schemas/GpuInstance"}},"required":["id","instance"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is too low. The error carries `need_cents` (the required balance) and `balance_cents` (what you have)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is too low. The error carries `need_cents` (the required balance) and `balance_cents` (what you have). (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is too low. The error carries `need_cents` (the required balance) and `balance_cents` (what you have)."}]},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"example":{"error":{"code":"quote_expired","message":"The quote is unknown, belongs to another account, is older than 180 seconds, or the site's GPU pricing changed since it was issued. Request a new quote."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`quote_expired`: The quote is unknown, belongs to another account, is older than 180 seconds, or the site's GPU pricing changed since it was issued. Request a new quote. `quote_used`: The quote was already used for an order. Request a new quote. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"quote_expired","description":"The quote is unknown, belongs to another account, is older than 180 seconds, or the site's GPU pricing changed since it was issued. Request a new quote."},{"code":"quote_used","description":"The quote was already used for an order. Request a new quote."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`hostname` or `request_id` is malformed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `hostname` or `request_id` is malformed. `ssh_key_required`: `ssh_key_id` is missing or is not one of your stored SSH keys. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`hostname` or `request_id` is malformed."},{"code":"ssh_key_required","description":"`ssh_key_id` is missing or is not one of your stored SSH keys."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"sales_disabled","message":"The site is not taking new GPU orders."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site is not taking new GPU orders. (`sales_disabled`)","x-error-codes":[{"code":"sales_disabled","description":"The site is not taking new GPU orders."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:create"]}],"summary":"Rent a GPU instance from a quote (charges the wallet)","tags":["GPU Cloud"],"x-cli":"gpu create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hostname\":\"train-01\",\"quote_id\":\"gq-9a7c3e5b1d2f4a60b8c4d6e8f0a1b2c3\",\"request_id\":\"8d5f2a1c-7b3e-4c90-a1d6-5e2f9b0c4d73\",\"ssh_key_id\":12}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"gpu:create","x-summary-vi":"Thuê máy GPU theo báo giá (trừ tiền ví)"}},"/v1/gpu/catalog":{"get":{"description":"Returns the live GPU catalog: the configurations that can be ordered with their prices and stock, the software templates, and which configurations each template can run on. The list follows the live market, so prices and stock change; the server keeps a snapshot that is refreshed in the background (at most about once every 45 seconds), and `stale` is true when the market could not be reached recently. The price you pay is fixed by the quote you take when ordering, not by this list.\n\nPrices are computed for the disk size in `disk_gb` (default 32 GB, never below a template minimum). `sales_enabled` is false when your site does not take new GPU orders.\n\n**Required scope:** `catalog:read`.","operationId":"gpu_catalog","parameters":[{"description":"Disk size in GB to compute prices for. Clamped to 8-2000.","example":64,"in":"query","name":"disk_gb","required":false,"schema":{"default":32,"maximum":2000,"minimum":8,"type":"integer"}},{"description":"Set to 1 to ask for a fresh snapshot instead of the cached one. Honoured only when the cached snapshot is more than 20 seconds old, and at most 6 times a minute per account; otherwise ignored.","example":1,"in":"query","name":"refresh","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"age_secs":12,"at":1760000000,"availability":[{"disk_gb":32,"plans":[],"template_id":1}],"compatibility_version":1,"cycles":[{"discount_pct":0.0,"months":0,"name":"Hourly","slug":"hourly"},{"discount_pct":5.0,"months":1,"name":"Monthly","slug":"monthly"}],"fetched_at":1760000000,"hours_per_month":730,"min_balance_cents":100,"plans":[{"cpu":16,"cuda_max":12.8,"disk_gb":32,"gpu_count":1,"gpu_name":"RTX 4090","hot":true,"hot_rank":2,"hourly_uusd":410000,"id":"1x-rtx-4090","is_5090":false,"max_disk_gb":800,"monthly_cents":28400,"name":"RTX 4090 - 24 GB","ram_mb":65536,"slug":"1x-rtx-4090","stock":14,"storage_uusd_gb_h":120,"tier":"prosumer","top_locations":["US","DE"],"vram_gb":24}],"rtx5090_offers":[],"rtx5090_plans":[],"sales_enabled":true,"stale":false,"templates":[{"category":"Machine learning","compatible_plan_ids":["1x-rtx-4090"],"default_disk_gb":32,"description":"PyTorch with CUDA","id":1,"is_vm":false,"min_cuda":12.0,"min_vram_mb":8000,"name":"PyTorch","slug":"pytorch","stock":14}],"templates_checked_at":1759999000,"total_offers":214},"schema":{"properties":{"age_secs":{"description":"Age of the snapshot in seconds.","type":"integer"},"at":{"description":"When the market snapshot was taken (Unix time, seconds, UTC)","type":"integer"},"availability":{"description":"Per template, the configurations it can run on.","items":{"properties":{"disk_gb":{"description":"Disk size the prices were computed for, in GB.","type":"integer"},"plans":{"description":"Configurations this template can run on, with prices for that disk size.","items":{"$ref":"#/components/schemas/GpuCatalogPlan"},"type":"array"},"template_id":{"description":"Template identifier.","type":"integer"}},"required":["template_id","disk_gb","plans"],"type":"object","x-order":["template_id","disk_gb","plans"]},"type":"array"},"compatibility_version":{"description":"Version of the availability format (currently 1).","type":"integer"},"cycles":{"description":"Billing cycles. GPU servers are billed by the hour; the other cycles are prepaid with the discount shown.","items":{"properties":{"discount_pct":{"description":"Discount applied for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"},"slug":{"description":"Billing cycle identifier.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"type":"array"},"fetched_at":{"description":"Same as `at` (Unix time, seconds, UTC)","type":"integer"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"min_balance_cents":{"description":"Minimum wallet balance needed to order, in US cents.","type":"integer"},"plans":{"items":{"$ref":"#/components/schemas/GpuCatalogPlan"},"type":"array"},"rtx5090_offers":{"description":"Up to 36 individual RTX 5090 listings, cheapest first. Provided for dashboards; use `plans` to order.","items":{"additionalProperties":true,"description":"One RTX 5090 machine listing.","type":"object"},"type":"array"},"rtx5090_plans":{"description":"The configurations of `plans` that use an RTX 5090.","items":{"$ref":"#/components/schemas/GpuCatalogPlan"},"type":"array"},"sales_enabled":{"description":"Whether your site takes new GPU orders.","type":"boolean"},"stale":{"description":"True when the snapshot could not be refreshed recently and may be out of date.","type":"boolean"},"templates":{"items":{"properties":{"category":{"description":"Template category.","type":"string"},"compatible_plan_ids":{"description":"Configurations this template can run on.","items":{"description":"Plan `id`.","type":"string"},"type":"array"},"default_disk_gb":{"description":"Default (and minimum) disk size in GB.","type":"integer"},"description":{"description":"Description.","type":"string"},"id":{"description":"Template identifier. Pass it as `template_id` when quoting or ordering.","type":"integer"},"is_vm":{"description":"True for a full virtual machine, false for a container.","type":"boolean"},"min_cuda":{"description":"Lowest CUDA version the template needs.","type":"number"},"min_vram_mb":{"description":"Lowest GPU memory the template needs, in MB.","type":"integer"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Stable short name.","type":"string"},"stock":{"description":"Number of machines that can run this template.","type":"integer"}},"required":["id","slug","name","category","is_vm","default_disk_gb","min_cuda","min_vram_mb","description","compatible_plan_ids","stock"],"type":"object","x-order":["id","slug","name","category","is_vm","default_disk_gb","min_cuda","min_vram_mb","description","compatible_plan_ids","stock"]},"type":"array"},"templates_checked_at":{"description":"When the template list was last checked; 0 when never (Unix time, seconds, UTC)","type":"integer"},"total_offers":{"description":"Number of machines in the market that can run at least one template.","type":"integer"}},"required":["at","fetched_at","age_secs","stale","sales_enabled","total_offers","plans","rtx5090_plans","rtx5090_offers","templates","availability","compatibility_version","templates_checked_at","cycles","hours_per_month","min_balance_cents"],"type":"object","x-order":["at","fetched_at","age_secs","stale","sales_enabled","total_offers","plans","rtx5090_plans","rtx5090_offers","templates","availability","compatibility_version","templates_checked_at","cycles","hours_per_month","min_balance_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"internal","message":"The market list could not be loaded. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The market list could not be loaded. Retry shortly. (`internal`)","x-error-codes":[{"code":"internal","description":"The market list could not be loaded. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"GPU catalog: configurations, templates and sale prices","tags":["Catalog"],"x-cli":"gpu catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/gpu/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục GPU: cấu hình, template, giá bán"}},"/v1/gpu/quote":{"post":{"description":"Finds the cheapest available machine that matches a GPU model, GPU count, template and disk size, and prices it. Nothing is charged and nothing is reserved on the machine: the returned `quote_id` only fixes the price for 180 seconds, and you pass it to [Create a GPU instance](#operation/gpu_create) to rent that machine.\n\nTake `gpu_name`, `template_id` and the disk limits from the GPU catalog. Pass `offer_id` to price one specific machine from the catalog instead of the cheapest match. `charge_cents` is what Create takes from the wallet at once: one hour of compute for `hourly`, or the whole discounted cycle price for the other cycles (5% off monthly, 7% quarterly, 8% semiannual, 10% yearly, 15% for 2 years, 20% for 3 years). The price is checked again when the machine is rented, and the order is cancelled and refunded if the machine became more than 5% more expensive in between.\n\nThe call looks up live availability, so each account may make 15 quotes per minute.\n\n**Required scope:** `gpu:read`.","operationId":"gpu_quote","parameters":[],"requestBody":{"content":{"application/json":{"example":{"cycle":"hourly","disk_gb":100,"gpu_count":1,"gpu_name":"RTX 4090","template_id":3},"schema":{"properties":{"cycle":{"description":"Billing cycle. Defaults to `hourly`.","enum":["hourly","monthly","quarterly","semiannual","yearly","2y","3y"],"type":"string"},"disk_gb":{"description":"Disk size in GiB. At least the template's minimum disk and at most 2000.","maximum":2000,"minimum":1,"type":"integer"},"gpu_count":{"description":"Number of GPUs, from 1 to 64. Only counts the catalog lists for the model are available.","maximum":64,"minimum":1,"type":"integer"},"gpu_name":{"description":"GPU model exactly as listed in the catalog, for example `RTX 4090`.","maxLength":100,"minLength":1,"type":"string"},"offer_id":{"description":"Price one specific machine offer from the catalog instead of the cheapest match.","type":"integer"},"template_id":{"description":"Template (operating system image) to start. Taken from the GPU catalog.","type":"integer"}},"required":["gpu_name","gpu_count","template_id","disk_gb"],"type":"object","x-order":["gpu_name","gpu_count","template_id","disk_gb","offer_id","cycle"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"charge_cents":40,"cycle":"hourly","disk_gb":100,"expires_at":1792400180,"offer":{"country_code":"US","cpu":16,"cuda_max":12.8,"disk_gb":450,"geolocation":"Texas, US","gpu_count":1,"gpu_name":"RTX 4090","hourly_uusd":400000,"inet_down":940,"inet_up":880,"monthly_cents":27740,"offer_id":31872645,"ram_gb":64,"reliability":0.9871,"sell_usd_h":0.4,"storage_uusd_gb_h":24,"verified":true,"vms_enabled":false,"vram_gb":24},"quote_id":"gq-9a7c3e5b1d2f4a60b8c4d6e8f0a1b2c3","storage_hourly_uusd":2400},"schema":{"properties":{"charge_cents":{"description":"Amount Create charges to the wallet immediately, in US cents.","type":"integer"},"cycle":{"description":"Billing cycle the quote is for.","enum":["hourly","monthly","quarterly","semiannual","yearly","2y","3y"],"type":"string"},"disk_gb":{"description":"Disk size the quote is for, in GiB.","type":"integer"},"expires_at":{"description":"Time the quote stops being valid (Unix time, seconds, UTC)","type":"integer"},"offer":{"$ref":"#/components/schemas/GpuOffer"},"quote_id":{"description":"Quote identifier. Pass it to Create within 180 seconds.","type":"string"},"storage_hourly_uusd":{"description":"Disk price per hour while the instance is stopped, in millionths of a US dollar.","type":"integer"}},"required":["quote_id","expires_at","offer","charge_cents","storage_hourly_uusd","disk_gb","cycle"],"type":"object","x-order":["quote_id","expires_at","offer","charge_cents","storage_hourly_uusd","disk_gb","cycle"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"example":{"error":{"code":"out_of_stock","message":"No available machine matches the GPU model, count, template and disk size. Choose another configuration or try again later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No available machine matches the GPU model, count, template and disk size. Choose another configuration or try again later. (`out_of_stock`)","x-error-codes":[{"code":"out_of_stock","description":"No available machine matches the GPU model, count, template and disk size. Choose another configuration or try again later."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`gpu_name` is empty, `gpu_count` is outside 1 to 64, `disk_gb` is below the template's minimum or above 2000, `cycle` is not one of the listed values, or `template_id` is not an available template."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `gpu_name` is empty, `gpu_count` is outside 1 to 64, `disk_gb` is below the template's minimum or above 2000, `cycle` is not one of the listed values, or `template_id` is not an available template. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before.","x-error-codes":[{"code":"invalid_argument","description":"`gpu_name` is empty, `gpu_count` is outside 1 to 64, `disk_gb` is below the template's minimum or above 2000, `cycle` is not one of the listed values, or `template_id` is not an available template."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"sales_disabled","message":"The site is not taking new GPU orders."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site is not taking new GPU orders. (`sales_disabled`)","x-error-codes":[{"code":"sales_disabled","description":"The site is not taking new GPU orders."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"market_unavailable","message":"Live availability could not be read. Try again shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Live availability could not be read. Try again shortly. (`market_unavailable`)","x-error-codes":[{"code":"market_unavailable","description":"Live availability could not be read. Try again shortly."}]}},"security":[{"bearerAuth":["gpu:read"]}],"summary":"Quote a GPU rental (no charge; use the quote_id to rent)","tags":["GPU Cloud"],"x-cli":"gpu quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"hourly\",\"disk_gb\":100,\"gpu_count\":1,\"gpu_name\":\"RTX 4090\",\"template_id\":3}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:read","x-summary-vi":"Báo giá thuê GPU (không trừ tiền; quote_id dùng khi thuê)"}},"/v1/gpu/{id}":{"delete":{"description":"Deletes the instance for good: the machine is released and everything on its disk is lost. The call answers at once and the deletion continues in the background; `state` becomes `destroying` and then the instance disappears from the list (Get answers `404`). Billing stops once the machine is released.\n\nMoney back: an instance that never became active is refunded in full, a fixed-cycle instance gets the unused part of the paid cycle back pro rata, and an hourly instance is not refunded for the hour it already started.\n\nAn instance that is still being rented (`renting`), is already being deleted, or has another command running cannot be deleted yet.\n\n**Required scope:** `gpu:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"gpu_delete","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"pending":true},"schema":{"$ref":"#/components/schemas/GpuActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"invalid_state","message":"The instance is `renting` or `destroying`, or another command is still running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_state`: The instance is `renting` or `destroying`, or another command is still running. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"invalid_state","description":"The instance is `renting` or `destroying`, or another command is still running."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:destroy"]}],"summary":"Delete the GPU instance (data is lost)","tags":["GPU Cloud"],"x-cli":"gpu delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/gpu/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"gpu:destroy","x-summary-vi":"Xoá máy GPU (mất dữ liệu)"},"get":{"description":"Returns one GPU instance. This is the call to poll after Create and after every command: `state` is the lifecycle state, `intent` names the command still being carried out (null when the instance is idle), and `public_ip` with `ports` tells you where to connect once the instance is `active`. A deleted instance answers `404`.\n\n**Required scope:** `gpu:read`.","operationId":"gpu_get","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"instance":{"billed_until":1792414110,"charged_cents":120,"cpu":16,"created_at":1792400000,"cuda_max":12.8,"cycle":"hourly","cycle_cents":0,"disk_gb":100,"display_name":"train-01","error_msg":null,"geolocation":"Texas, US","gpu_count":1,"gpu_name":"RTX 4090","hostname":"train-01","hourly_uusd":400000,"id":"gpu-3f6c1d0e8a524b57","intent":null,"jupyter_url":null,"paid_until":null,"ports":{"22/tcp":[{"HostIp":"0.0.0.0","HostPort":"40122"}]},"public_ip":"203.0.113.45","ram_gb":64,"refunded_cents":0,"reliability":0.9871,"runtime_status":"running","runtype":"ssh","ssh_host":"gw5.example.net","ssh_port":22846,"state":"active","storage_hourly_uusd":2400,"template_id":3,"template_name":"Ubuntu 24.04 CUDA 12.9 Devel (Pure SSH)","updated_at":1792400310,"vram_gb":24}},"schema":{"properties":{"instance":{"$ref":"#/components/schemas/GpuInstance"}},"required":["instance"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:read"]}],"summary":"Get one GPU instance","tags":["GPU Cloud"],"x-cli":"gpu get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/gpu/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:read","x-summary-vi":"Chi tiết máy GPU"}},"/v1/gpu/{id}/diagnostics":{"get":{"description":"Returns the latest usage readings reported by the machine and the recent activity of the instance. `metrics` only contains the readings the machine reported, so it can be empty or partial for a while after a start; `metrics_at` says when they were taken. `events` lists up to 100 events, newest first: the commands you sent (`actor` is `customer`) and everything the platform did on its own or through support (`actor` is `support`).\n\nIt is available as soon as a machine has been assigned to the instance; before that it answers `409 not_deployed`.\n\n**Required scope:** `gpu:read`.","operationId":"gpu_diagnostics","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"events":[{"actor":"support","args":{"from":"provisioning","to":"active"},"at":1792400310,"key":"gpu.state_changed","kind":"gpu.state","message":"provisioning → active"},{"actor":"customer","args":{},"at":1792400000,"key":"gpu.order_accepted","kind":"gpu.create","message":"GPU order accepted"}],"metrics":{"cpu_util":12.5,"disk_space":100,"disk_usage":21.4,"gpu_temp":64,"gpu_util":87,"uptime_mins":95},"metrics_at":1792405900},"schema":{"properties":{"events":{"items":{"$ref":"#/components/schemas/GpuEvent"},"type":"array"},"metrics":{"properties":{"cpu_util":{"description":"CPU utilisation, in percent.","type":"number"},"disk_space":{"description":"Disk size, in GB.","type":"number"},"disk_usage":{"description":"Disk space in use, in GB.","type":"number"},"disk_util":{"description":"Disk utilisation, in percent.","type":"number"},"gpu_ram":{"description":"GPU memory per GPU.","type":"number"},"gpu_temp":{"description":"GPU temperature, in degrees Celsius.","type":"number"},"gpu_totalram":{"description":"Total GPU memory.","type":"number"},"gpu_util":{"description":"GPU utilisation, in percent.","type":"number"},"mem_limit":{"description":"System memory limit.","type":"number"},"mem_usage":{"description":"System memory in use.","type":"number"},"uptime_mins":{"description":"Minutes the machine has been up.","type":"number"},"vmem_usage":{"description":"GPU memory in use.","type":"number"}},"type":"object","x-order":["cpu_util","gpu_util","gpu_temp","mem_usage","mem_limit","vmem_usage","disk_usage","disk_space","disk_util","gpu_totalram","gpu_ram","uptime_mins"]},"metrics_at":{"description":"Time the readings were taken. Null while the machine has not reported any (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["metrics","metrics_at","events"],"type":"object","x-order":["metrics","metrics_at","events"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_deployed","message":"No machine has been assigned to the instance yet (it is still `queued` or `renting`, or it failed before getting one)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No machine has been assigned to the instance yet (it is still `queued` or `renting`, or it failed before getting one). (`not_deployed`)","x-error-codes":[{"code":"not_deployed","description":"No machine has been assigned to the instance yet (it is still `queued` or `renting`, or it failed before getting one)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:read"]}],"summary":"Metrics and events of the GPU instance","tags":["GPU Cloud"],"x-cli":"gpu diagnostics","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/gpu/<id>/diagnostics\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:read","x-summary-vi":"Chỉ số và sự kiện của máy GPU"}},"/v1/gpu/{id}/logs":{"get":{"description":"Reads the start-up log you asked for with [Request GPU instance logs](#operation/gpu_logs_request). Nothing is fetched until you ask: without a request in the last 5 minutes the answer is `requested: false` with empty `logs`. While the machine is still preparing the log, `pending` is true, so call again after a few seconds. When it is ready, `logs` holds the last 500 lines up to 1 MiB with secrets masked, and `truncated` is true if it had to be cut.\n\n**Required scope:** `gpu:read`.","operationId":"gpu_logs_get","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"logs":"Starting container...\nsshd: listening on 0.0.0.0 port 22\nReady.\n","pending":false,"requested":true,"truncated":false},"schema":{"$ref":"#/components/schemas/GpuLogs"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_deployed","message":"No machine has been assigned to the instance yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No machine has been assigned to the instance yet. (`not_deployed`)","x-error-codes":[{"code":"not_deployed","description":"No machine has been assigned to the instance yet."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"logs_unavailable","message":"The log could not be read from the machine. Try again shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The log could not be read from the machine. Try again shortly. (`logs_unavailable`)","x-error-codes":[{"code":"logs_unavailable","description":"The log could not be read from the machine. Try again shortly."}]}},"security":[{"bearerAuth":["gpu:read"]}],"summary":"Read the requested startup log","tags":["GPU Cloud"],"x-cli":"gpu logs get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/gpu/<id>/logs\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:read","x-summary-vi":"Đọc log khởi tạo đã yêu cầu"},"post":{"description":"Asks the machine to publish the last 500 lines of its start-up log. The answer has the same shape as [Read GPU instance logs](#operation/gpu_logs_get) and is usually `pending: true` at first; poll that call every few seconds until `pending` is false. The log stays readable for 5 minutes after the request. Use it to find out why an instance is slow to start or does not accept SSH connections.\n\nEach account may request logs 6 times per minute.\n\n**Required scope:** `gpu:write`.","operationId":"gpu_logs_request","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"logs":"","pending":true,"requested":true},"schema":{"$ref":"#/components/schemas/GpuLogs"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_deployed","message":"No machine has been assigned to the instance yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No machine has been assigned to the instance yet. (`not_deployed`)","x-error-codes":[{"code":"not_deployed","description":"No machine has been assigned to the instance yet."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"logs_unavailable","message":"The machine could not be asked for its log. Try again shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The machine could not be asked for its log. Try again shortly. (`logs_unavailable`)","x-error-codes":[{"code":"logs_unavailable","description":"The machine could not be asked for its log. Try again shortly."}]}},"security":[{"bearerAuth":["gpu:write"]}],"summary":"Request a fresh startup log","tags":["GPU Cloud"],"x-cli":"gpu logs request","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/<id>/logs\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:write","x-summary-vi":"Yêu cầu kéo log khởi tạo mới"}},"/v1/gpu/{id}/reboot":{"post":{"description":"Restarts an `active` instance without losing its disk. The call answers at once; `state` is `rebooting` until the instance is back, which normally takes a minute or two. There is no extra charge. Repeating `reboot` while a reboot is already running just answers the same acknowledgement.\n\n**Required scope:** `gpu:write`.","operationId":"gpu_reboot","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"pending":true},"schema":{"$ref":"#/components/schemas/GpuActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"invalid_state","message":"The instance is not `active`, or another command is still running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The instance is not `active`, or another command is still running. (`invalid_state`)","x-error-codes":[{"code":"invalid_state","description":"The instance is not `active`, or another command is still running."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:write"]}],"summary":"Reboot the GPU instance","tags":["GPU Cloud"],"x-cli":"gpu reboot","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/<id>/reboot\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:write","x-summary-vi":"Khởi động lại máy GPU"}},"/v1/gpu/{id}/recycle":{"post":{"description":"Rebuilds an `active` instance from its template in place: the container or virtual machine is recreated from the original image on the same host and everything on the disk is erased, including every file you added. The instance keeps its id and billing and there is no extra charge. Use it to get back to a clean system.\n\nThe call answers at once; `state` is `recycling` until the instance is back. Read `public_ip` and `ports` again when it is `active` again, because they can change. Because data is lost the call needs an `Idempotency-Key`. Repeating `recycle` while one is already running just answers the same acknowledgement.\n\n**Required scope:** `gpu:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"gpu_recycle","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"pending":true},"schema":{"$ref":"#/components/schemas/GpuActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"invalid_state","message":"The instance is not `active`, or another command is still running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_state`: The instance is not `active`, or another command is still running. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"invalid_state","description":"The instance is not `active`, or another command is still running."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:destroy"]}],"summary":"Recycle the GPU instance from its template (data is lost)","tags":["GPU Cloud"],"x-cli":"gpu recycle","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/<id>/recycle\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"gpu:destroy","x-summary-vi":"Cài lại máy GPU từ template (mất dữ liệu)"}},"/v1/gpu/{id}/ssh-token":{"post":{"description":"Issues a one-time ticket for the web SSH terminal of a running instance. Open a WebSocket to `websocket_url` with the ticket as the `token` query parameter (`<websocket_url>?token=<token>`) within `expires_in` seconds. The ticket opens one connection only; reconnecting needs a new ticket. Send JSON text frames such as `{\"type\":\"input\",\"data\":\"nvidia-smi\\n\"}` and `{\"type\":\"resize\",\"cols\":120,\"rows\":30}`; output arrives as `{\"type\":\"output\",\"data\":\"...\"}` frames. The terminal logs in as `root` automatically with a key managed by the platform, so it never asks for a password.\n\nThe instance must be `active`, report a running machine, have no command in progress and already have its public SSH address. Each account may request 10 tickets per minute. To use your own SSH client instead, connect to `public_ip` on the host port of `ports[\"22/tcp\"]` with the key you chose when you ordered.\n\n**Required scope:** `gpu:console`.","operationId":"gpu_ssh_token","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"default_username":"root","expires_in":90,"has_credentials":true,"ip_address":"203.0.113.45","port":40122,"token":"ofw_ssh_gpu_9f3c1b7a5d2e4f60718293a4b5c6d7e89f3c1b7a5d2e4f60","websocket_url":"wss://cloud.example.com/ssh-ws"},"schema":{"properties":{"default_username":{"description":"Login name the terminal uses (`root`).","type":"string"},"expires_in":{"description":"Seconds the ticket stays valid (90).","type":"integer"},"has_credentials":{"description":"Always `true`: the gateway logs in with a key, no password is asked.","type":"boolean"},"ip_address":{"description":"Public address the terminal connects to.","type":"string"},"port":{"description":"SSH port the terminal connects to on the instance's public address.","type":"integer"},"token":{"description":"One-time ticket. A secret: it opens a terminal on the instance.","type":"string"},"websocket_url":{"description":"WebSocket address of the terminal gateway.","type":"string"}},"required":["token","expires_in","websocket_url","default_username","port","ip_address","has_credentials"],"type":"object","x-order":["token","expires_in","websocket_url","default_username","port","ip_address","has_credentials"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_running","message":"The instance is not `active` and running, or a command is in progress."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_running`: The instance is not `active` and running, or a command is in progress. `vm_not_ready`: The instance has no public SSH address yet. Try again in a few seconds.","x-error-codes":[{"code":"vm_not_running","description":"The instance is not `active` and running, or a command is in progress."},{"code":"vm_not_ready","description":"The instance has no public SSH address yet. Try again in a few seconds."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"terminal_unavailable","message":"The terminal key could not be installed on the instance. Try again shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The terminal key could not be installed on the instance. Try again shortly. (`terminal_unavailable`)","x-error-codes":[{"code":"terminal_unavailable","description":"The terminal key could not be installed on the instance. Try again shortly."}]}},"security":[{"bearerAuth":["gpu:console"]}],"summary":"Get a one-time SSH WebSocket ticket for the GPU instance","tags":["GPU Cloud"],"x-cli":"gpu ssh-token","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/<id>/ssh-token\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:console","x-summary-vi":"Xin vé SSH WebSocket cho máy GPU (dùng một lần)"}},"/v1/gpu/{id}/start":{"post":{"description":"Powers a `stopped` or `locked` instance back on. The call answers at once; follow `state` (`starting`, then `active`).\n\nStarting can charge the wallet first. An hourly instance pays for up to one new hour of compute, unless you stopped it inside an hour that was already paid at the compute rate. A fixed-cycle instance pays the cycle price only if the paid cycle has ended. If the wallet cannot cover it the call fails with `402 insufficient_funds` and the instance stays as it was. If the machine cannot be started (for example it cannot supply the GPUs right now) the instance falls back to `stopped` after a while with an `error_msg`, and the start charge is refunded.\n\nEach instance accepts at most 6 start and stop commands per hour; further ones answer `429 rate_limited`. Repeating `start` while a start is already running just answers the same acknowledgement.\n\n**Required scope:** `gpu:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"gpu_start","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"pending":true},"schema":{"$ref":"#/components/schemas/GpuActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot pay the restart charge. The error carries `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot pay the restart charge. The error carries `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot pay the restart charge. The error carries `need_cents` and `balance_cents`."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"invalid_state","message":"The instance is not `stopped` or `locked`, has never been started, or another command is still running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_state`: The instance is not `stopped` or `locked`, has never been started, or another command is still running. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"invalid_state","description":"The instance is not `stopped` or `locked`, has never been started, or another command is still running."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:write"]}],"summary":"Start the GPU instance (can charge a new billing period)","tags":["GPU Cloud"],"x-cli":"gpu start","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/<id>/start\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"gpu:write","x-summary-vi":"Bật máy GPU (có thể trừ tiền kỳ mới)"}},"/v1/gpu/{id}/stop":{"post":{"description":"Powers an `active` instance off and keeps its disk. The call answers at once; `state` becomes `stopping` and then `stopped`. GPU charges stop. An hourly instance keeps paying the disk rate (`storage_hourly_uusd`) every hour, and a fixed-cycle instance keeps its prepaid cycle and renews it until you delete the instance. Use [Delete a GPU instance](#operation/gpu_delete) to stop all charges.\n\nEach instance accepts at most 6 start and stop commands per hour; further ones answer `429 rate_limited`. Repeating `stop` while a stop is already running just answers the same acknowledgement.\n\n**Required scope:** `gpu:write`.","operationId":"gpu_stop","parameters":[{"description":"GPU instance identifier as returned by List GPU instances (for example `gpu-3f6c1d0e8a524b57`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"pending":true},"schema":{"$ref":"#/components/schemas/GpuActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"invalid_state","message":"The instance is not `active`, or another command is still running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The instance is not `active`, or another command is still running. (`invalid_state`)","x-error-codes":[{"code":"invalid_state","description":"The instance is not `active`, or another command is still running."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["gpu:write"]}],"summary":"Stop the GPU instance","tags":["GPU Cloud"],"x-cli":"gpu stop","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/gpu/<id>/stop\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"gpu:write","x-summary-vi":"Tắt máy GPU"}},"/v1/images":{"get":{"description":"Lists the OS images and ISO images stored in your account, newest first by default. A new image moves from `Queued` through `Downloading` (or `Creating` when made from a server) to `Ready`; `Error` means it failed and `error_code` tells why, and `Deleting` is shown while removal is in progress. Besides the page of items the response returns your limits and the unit price, so one call is enough to show usage bars and cost estimates. Note that the pagination fields are inside `meta`, not at the top level.\n\n**Required scope:** `image:read`.","operationId":"image_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","name","size_bytes","state","kind","paid_cents"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Return only images of this kind. Other values are ignored.","example":"iso","in":"query","name":"kind","required":false,"schema":{"enum":["template","iso"],"type":"string"}},{"description":"Return only images in this state. Other values are ignored.","in":"query","name":"state","required":false,"schema":{"enum":["Queued","Downloading","Creating","Ready","Error","Deleting"],"type":"string"}},{"description":"Text to look for in the image name (case-insensitive substring, first 64 characters used).","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"bootable":true,"busy":false,"cents_per_month":4,"checksum":"{SHA-256}e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","created_at":1791800000,"debt_since":null,"declared_bytes":2362232832,"description":"Hardened base image","error_code":null,"format":"QCOW2","hours_per_month":730,"id":12,"kind":"template","last_error":null,"lock_reason":null,"locked":false,"locked_at":null,"name":"Ubuntu 24.04 golden","os_type_id":"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097","os_type_name":"Other Linux (64-bit)","paid_cents":2,"password_enabled":true,"progress":100,"rate_uusd_gb_hour":17,"ready_at":1791800900,"size_bytes":2362232832,"size_gb":3,"source":"url","src_vm_id":null,"state":"Ready","template_id":57,"updated_at":1791800900,"url":"https://images.example.com/ubuntu-24.04.qcow2","username":null,"uusd_per_hour":51,"virtual_size_bytes":10737418240,"vm_count":1,"zone_id":1}],"limits":{"count":1,"gb":3,"iso_max_gb":10,"max_count":10,"max_gb":200,"template_max_gb":50},"meta":{"dir":"desc","last_page":1,"page":1,"per_page":20,"sort":"created_at","total":1},"price":{"cents_per_hour":0,"cents_per_month":1,"hours_per_month":730,"rate_uusd_gb_hour":17,"size_gb":1,"uusd_per_hour":17}},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Image"},"type":"array"},"limits":{"$ref":"#/components/schemas/ImageLimits"},"meta":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"last_page":{"description":"Number of the last page (0 when there are no matches).","type":"integer"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size applied (clamped to 100).","type":"integer"},"sort":{"description":"Sort key applied.","enum":["created_at","name","size_bytes","state","kind","paid_cents"],"type":"string"},"total":{"description":"Number of images matching the filters, across all pages.","type":"integer"}},"required":["total","page","per_page","last_page","sort","dir"],"type":"object","x-order":["total","page","per_page","last_page","sort","dir"]},"price":{"$ref":"#/components/schemas/ImagePrice"}},"required":["items","meta","limits","price"],"type":"object","x-order":["items","meta","limits","price"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["image:read"]}],"summary":"List your images and ISOs (paged, sortable)","tags":["Images"],"x-cli":"image list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/images\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"image:read","x-summary-vi":"Danh sách My Images + ISO (phân trang, sắp xếp)"},"post":{"description":"Imports an operating system image (a QCOW2 disk) or an ISO from a public URL into your account. The call returns 202 at once with the image in state `Queued` and a `job_id`; the file is then downloaded and checked in the background. Poll Get an image until `state` is `Ready` or `Error` (see `error_code`). Nothing is charged while the file downloads; storage billing per GB-hour starts when the image is `Ready`. You need a positive wallet balance to start an import.\n\nThe URL must be a direct download link: `http` or `https`, port 80 or 443, no credentials or fragment, at most 2048 ASCII characters, a full domain name or a public IP address, and a path ending in `.iso` for ISOs or `.qcow2` / `.img` for templates. Compressed files are rejected. The server resolves and checks the address before anything is fetched: private, internal and provider addresses fail with `blocked_url`, redirects are never followed (`url_redirect`, use the final link), and the first bytes of the file must be a QCOW2 header or an ISO 9660 / UDF descriptor (`invalid_image`).\n\nSize limits are set per site (by default 50 GB for templates and 10 GB for ISOs; see `limits` in List images): a larger file fails with `too_large`, and when the source does not announce its size the maximum is reserved against your limits until the real size is known. An account can have at most 2 images downloading or being created at a time. Repeating the call with the same `Idempotency-Key` (8 to 80 characters of letters, digits, `-`, `_` and `:`) returns the original image with status 200 and `idempotent_replay` true instead of importing it twice.\n\n**Required scope:** `image:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"image_import","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"checksum":"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","description":"Hardened base image","kind":"template","name":"Ubuntu 24.04 golden","os_type_id":"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097","url":"https://images.example.com/ubuntu-24.04.qcow2"},"schema":{"properties":{"bootable":{"description":"ISO only: whether the ISO can be booted. Defaults to true; always true for templates.","type":"boolean"},"checksum":{"description":"Optional hex digest (MD5, SHA-1, SHA-256, SHA-384 or SHA-512, detected from its length) of the file, optionally prefixed with the algorithm as `sha256:<hex>`. The download fails with `checksum_mismatch` if it differs.","type":"string"},"description":{"description":"Optional description, up to 500 characters.","type":"string"},"format":{"description":"Templates only: disk format. `QCOW2` is the only accepted value and the default; ignored for ISOs.","enum":["QCOW2"],"type":"string"},"kind":{"description":"`template` imports a QCOW2 disk that servers can be created from; `iso` imports an installation or rescue disc.","enum":["template","iso"],"type":"string"},"name":{"description":"Name of the image: 1 to 64 characters. Letters, digits, spaces and `-`, `_`, `.`, `(`, `)` are kept; any other character is silently dropped.","type":"string"},"os_type_id":{"description":"Operating system type, an `id` from List OS types.","type":"string"},"password_enabled":{"description":"Templates only: whether servers created from the image support password reset. Defaults to true; false for ISOs.","type":"boolean"},"url":{"description":"Direct download link of the file (see the rules above).","type":"string"},"zone_id":{"description":"Region to store the image in. Defaults to the default region of the site.","type":"integer"}},"required":["kind","name","url","os_type_id"],"type":"object","x-order":["kind","name","url","os_type_id","description","format","zone_id","checksum","bootable","password_enabled"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"image":{"bootable":true,"busy":true,"cents_per_month":0,"checksum":null,"created_at":1791800000,"debt_since":null,"declared_bytes":1048576,"description":null,"error_code":null,"format":"QCOW2","hours_per_month":730,"id":13,"kind":"template","last_error":null,"lock_reason":null,"locked":false,"locked_at":null,"name":"Ubuntu 24.04 golden","os_type_id":"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097","os_type_name":"Other Linux (64-bit)","paid_cents":0,"password_enabled":true,"progress":0,"rate_uusd_gb_hour":17,"ready_at":null,"size_bytes":0,"size_gb":0,"source":"url","src_vm_id":null,"state":"Queued","template_id":null,"updated_at":1791800900,"url":"https://images.example.com/ubuntu-24.04.qcow2","username":null,"uusd_per_hour":0,"virtual_size_bytes":0,"zone_id":1},"job_id":4821},"schema":{"properties":{"idempotent_replay":{"description":"True when this is the answer to a repeated request (the response status is then 200).","type":"boolean"},"image":{"$ref":"#/components/schemas/Image"},"job_id":{"description":"Identifier of the background job. Null in a repeated (idempotent) answer.","type":["integer","null"]}},"required":["image","job_id"],"type":"object","x-order":["image","job_id","idempotent_replay"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The request body is not valid JSON. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"Your wallet balance is zero or negative. Top up and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your wallet balance is zero or negative. Top up and retry. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"Your wallet balance is zero or negative. Top up and retry."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"zone_not_found","message":"`zone_id` is not a region available on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`zone_id` is not a region available on this site. (`zone_not_found`)","x-error-codes":[{"code":"zone_not_found","description":"`zone_id` is not a region available on this site."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"image_limit","message":"You reached the maximum number of images per account (`limit`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`image_limit`: You reached the maximum number of images per account (`limit`). `image_gb_limit`: The new image would exceed your total storage limit (`limit_gb`, `used_gb`). `image_concurrent`: You already have 2 images downloading or being created. Wait for one to finish. `zone_not_supported`: Images are not available in the chosen (or default) region. `job_running`: A background job for this image is already running. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"image_limit","description":"You reached the maximum number of images per account (`limit`)."},{"code":"image_gb_limit","description":"The new image would exceed your total storage limit (`limit_gb`, `used_gb`)."},{"code":"image_concurrent","description":"You already have 2 images downloading or being created. Wait for one to finish."},{"code":"zone_not_supported","description":"Images are not available in the chosen (or default) region."},{"code":"job_running","description":"A background job for this image is already running."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`kind`, `name` or `format` is missing or not allowed. The `field` of the error names it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `kind`, `name` or `format` is missing or not allowed. The `field` of the error names it. `invalid_url`: The URL does not follow the rules above (scheme, port, credentials, length, file extension, host name). `blocked_url`: The address of the URL is not allowed (private network or provider infrastructure). `resolve_failed`: The host name in the URL could not be resolved. `url_redirect`: The URL answers with a redirect. Use the direct download link of the file. `url_unreachable`: The server did not answer the URL with a success status. `too_large`: The file is larger than the maximum for this kind of image (`max_gb`). `invalid_image`: The first bytes of the file are not a QCOW2 disk (templates) or an ISO 9660 / UDF disc (ISOs), or the file is compressed. `invalid_checksum`: `checksum` is not a hex digest of 32, 40, 64, 96 or 128 digits, or its algorithm prefix does not match its length. `invalid_os_type`: `os_type_id` is not an identifier from List OS types. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`kind`, `name` or `format` is missing or not allowed. The `field` of the error names it."},{"code":"invalid_url","description":"The URL does not follow the rules above (scheme, port, credentials, length, file extension, host name)."},{"code":"blocked_url","description":"The address of the URL is not allowed (private network or provider infrastructure)."},{"code":"resolve_failed","description":"The host name in the URL could not be resolved."},{"code":"url_redirect","description":"The URL answers with a redirect. Use the direct download link of the file."},{"code":"url_unreachable","description":"The server did not answer the URL with a success status."},{"code":"too_large","description":"The file is larger than the maximum for this kind of image (`max_gb`)."},{"code":"invalid_image","description":"The first bytes of the file are not a QCOW2 disk (templates) or an ISO 9660 / UDF disc (ISOs), or the file is compressed."},{"code":"invalid_checksum","description":"`checksum` is not a hex digest of 32, 40, 64, 96 or 128 digits, or its algorithm prefix does not match its length."},{"code":"invalid_os_type","description":"`os_type_id` is not an identifier from List OS types."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The list of operating system types could not be fetched from the platform right now. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The list of operating system types could not be fetched from the platform right now. Retry later. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The list of operating system types could not be fetched from the platform right now. Retry later."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"image_capacity","message":"Image storage is temporarily full. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image storage is temporarily full. Retry later. (`image_capacity`)","x-error-codes":[{"code":"image_capacity","description":"Image storage is temporarily full. Retry later."}]}},"security":[{"bearerAuth":["image:write"]}],"summary":"Import an image/ISO from URL (storage billed hourly)","tags":["Images"],"x-cli":"image import","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/images\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"checksum\":\"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"description\":\"Hardened base image\",\"kind\":\"template\",\"name\":\"Ubuntu 24.04 golden\",\"os_type_id\":\"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097\",\"url\":\"https://images.example.com/ubuntu-24.04.qcow2\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"image:write","x-summary-vi":"Nhập image/ISO từ URL (lưu trữ tính tiền theo giờ)"}},"/v1/images/from-vm":{"post":{"description":"Creates a template image from the system disk of one of your servers. The server must be stopped (power state `Stopped`) and not locked or busy with another operation; it is not modified. The call returns 202 with the new image in state `Queued` and a `job_id`; follow it with Get an image until it is `Ready`. The image is stored in the region of the server and inherits its login user name. Its real size is measured when the copy completes and billing per GB-hour starts then; until that moment your limits reserve the disk size of the server. You need a positive wallet balance to start. At most 2 images per account can be downloading or being created at a time, and the whole site runs only a few copies at once (503 `image_capacity` when it is busy). Repeating the call with the same `Idempotency-Key` returns the original image with status 200 and `idempotent_replay` true.\n\n**Required scope:** `image:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"image_from_vm","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"description":"Before the Ubuntu upgrade","name":"web-1 golden","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"description":{"description":"Optional description, up to 500 characters.","type":"string"},"name":{"description":"Name of the image: 1 to 64 characters. Letters, digits, spaces and `-`, `_`, `.`, `(`, `)` are kept; any other character is silently dropped.","type":"string"},"vm_id":{"description":"UUID of the stopped server to copy.","type":"string"}},"required":["vm_id","name"],"type":"object","x-order":["vm_id","name","description"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"image":{"bootable":true,"busy":true,"cents_per_month":0,"checksum":null,"created_at":1791800000,"debt_since":null,"declared_bytes":26843545600,"description":null,"error_code":null,"format":"QCOW2","hours_per_month":730,"id":13,"kind":"template","last_error":null,"lock_reason":null,"locked":false,"locked_at":null,"name":"web-1 golden","os_type_id":null,"os_type_name":null,"paid_cents":0,"password_enabled":true,"progress":0,"rate_uusd_gb_hour":17,"ready_at":null,"size_bytes":0,"size_gb":0,"source":"vm","src_vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","state":"Queued","template_id":null,"updated_at":1791800900,"url":null,"username":"ubuntu","uusd_per_hour":0,"virtual_size_bytes":0,"zone_id":1},"job_id":4822},"schema":{"properties":{"idempotent_replay":{"description":"True when this is the answer to a repeated request (the response status is then 200).","type":"boolean"},"image":{"$ref":"#/components/schemas/Image"},"job_id":{"description":"Identifier of the background job. Null in a repeated (idempotent) answer.","type":["integer","null"]}},"required":["image","job_id"],"type":"object","x-order":["image","job_id","idempotent_replay"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The request body is not valid JSON. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"Your wallet balance is zero or negative. Top up and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your wallet balance is zero or negative. Top up and retry. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"Your wallet balance is zero or negative. Top up and retry."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"`vm_id` does not exist or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_id` does not exist or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"`vm_id` does not exist or belongs to another account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in a state that allows operations (the error carries its `state`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in a state that allows operations (the error carries its `state`). `job_running`: Another operation is running on the server. Wait for it to finish. `vm_must_be_stopped`: The server is not stopped. Stop it first (the error carries its `cs_state`). `image_limit`: You reached the maximum number of images per account (`limit`). `image_gb_limit`: The copy would exceed your total storage limit (`limit_gb`, `used_gb`). `image_concurrent`: You already have 2 images downloading or being created. Wait for one to finish. `image_busy`: An image with the same idempotency key is being created. `zone_not_supported`: Images are not available in the region of this server. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in a state that allows operations (the error carries its `state`)."},{"code":"job_running","description":"Another operation is running on the server. Wait for it to finish."},{"code":"vm_must_be_stopped","description":"The server is not stopped. Stop it first (the error carries its `cs_state`)."},{"code":"image_limit","description":"You reached the maximum number of images per account (`limit`)."},{"code":"image_gb_limit","description":"The copy would exceed your total storage limit (`limit_gb`, `used_gb`)."},{"code":"image_concurrent","description":"You already have 2 images downloading or being created. Wait for one to finish."},{"code":"image_busy","description":"An image with the same idempotency key is being created."},{"code":"zone_not_supported","description":"Images are not available in the region of this server."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`name` is missing or empty after dropping unsupported characters. The `field` of the error names it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `name` is missing or empty after dropping unsupported characters. The `field` of the error names it. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`name` is missing or empty after dropping unsupported characters. The `field` of the error names it."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked. The error carries the lock `reason`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked. The error carries the lock `reason`. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked. The error carries the lock `reason`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"image_capacity","message":"Image storage or the copy capacity of the site is temporarily full. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image storage or the copy capacity of the site is temporarily full. Retry later. (`image_capacity`)","x-error-codes":[{"code":"image_capacity","description":"Image storage or the copy capacity of the site is temporarily full. Retry later."}]}},"security":[{"bearerAuth":["image:write"]}],"summary":"Create an image from a stopped instance","tags":["Images"],"x-cli":"image from-vm","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/images/from-vm\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"description\":\"Before the Ubuntu upgrade\",\"name\":\"web-1 golden\",\"vm_id\":\"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"image:write","x-summary-vi":"Tạo image từ máy ảo đã tắt"}},"/v1/images/os-types":{"get":{"description":"Lists the operating system types you can choose when importing an image. Pass the `id` of one entry as `os_type_id` to Import an image; it selects the virtual hardware profile used for the image, so pick the closest match to the guest system. The list is sorted by name and cached for up to an hour. If it cannot be fetched right now the call fails with 502 and can be retried.\n\n**Required scope:** `catalog:read`.","operationId":"image_os_types","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"id":"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097","name":"Other Linux (64-bit)"},{"id":"5a3f7c80-bf73-11f0-8c3a-00163eb1d097","name":"Windows Server 2022"}]},"schema":{"properties":{"items":{"items":{"properties":{"id":{"description":"Identifier to pass as `os_type_id`.","type":"string"},"name":{"description":"Name of the operating system type, for example `Other Linux (64-bit)`.","type":"string"}},"required":["id","name"],"type":"object"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The list of operating system types could not be fetched from the platform right now. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The list of operating system types could not be fetched from the platform right now. Retry later. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The list of operating system types could not be fetched from the platform right now. Retry later."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"OS types","tags":["Images"],"x-cli":"image os-types","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/images/os-types\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh sách OS type"}},"/v1/images/public":{"get":{"description":"Lists the operating system images that the site provides to everybody, with the regions where each one is available. They are the same images as `templates` in the VM catalog, in a lighter form meant for pickers shown next to your own images. Your private images are not included; see List images. The list is not paged: `total` is the number of entries returned.\n\n**Required scope:** `catalog:read`.","operationId":"image_public","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"id":11,"name":"Ubuntu 24.04 LTS","os_family":"linux","os_version":"24.04","size_gb":10,"username":"ubuntu","zones":[{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]}],"total":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ImagePublicOs"},"type":"array"},"total":{"description":"Number of entries in `items`.","type":"integer"}},"required":["items","total"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public OS images on sale","tags":["Images"],"x-cli":"image public","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/images/public\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"OS Images hệ thống đang bán (Public)"}},"/v1/images/quote":{"get":{"description":"Prices the storage of an image of a given size without creating anything. Images are billed hourly from the moment they are `Ready`: the size is rounded up to whole GB (1 GB = 2^30 bytes) and multiplied by the hourly rate. Rates are given in millionths of a US dollar so that small amounts stay exact; `cents_per_hour` and `cents_per_month` are the same prices rounded to whole cents for display. ISO images and templates are priced the same way.\n\n**Required scope:** `catalog:read`.","operationId":"image_quote","parameters":[{"description":"Size to price in GB, from 1 to 1024. Defaults to 1; values outside the range are clamped.","example":20,"in":"query","name":"size_gb","required":false,"schema":{"default":1,"maximum":1024,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"cents_per_hour":0,"cents_per_month":25,"hours_per_month":730,"rate_uusd_gb_hour":17,"size_gb":20,"uusd_per_hour":340},"schema":{"$ref":"#/components/schemas/ImagePrice"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Image storage price per GB","tags":["Images"],"x-cli":"image quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/images/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Đơn giá lưu trữ image theo GB"}},"/v1/images/{iid}":{"delete":{"description":"Deletes an image. The request is accepted with 202 and the image moves to `Deleting`; it disappears from List images when the removal finishes, and billing stops. An image cannot be deleted while it is being processed (409 `image_busy`) or while it is in use (409 `image_in_use`): a template that existing servers were created from, or an ISO attached to a server. Delete those servers or detach the ISO first. An image that never reached storage, for example a failed import, is removed immediately: the response then has `deleted` true and no `job_id`. At most 10 deletions per minute are accepted.\n\n**Required scope:** `image:write`.","operationId":"image_delete","parameters":[{"description":"Numeric image identifier, as returned in the `id` field of List images.","in":"path","name":"iid","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"deleted":false,"job_id":4830},"schema":{"properties":{"deleted":{"description":"True when the image was removed immediately and no job was needed.","type":"boolean"},"job_id":{"description":"Identifier of the background job removing the image; null when it was removed immediately.","type":["integer","null"]}},"required":["job_id","deleted"],"type":"object","x-order":["job_id","deleted"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"image_busy","message":"The image is being processed (`state` is `Queued`, `Downloading`, `Creating` or `Deleting`). Wait until it settles."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`image_busy`: The image is being processed (`state` is `Queued`, `Downloading`, `Creating` or `Deleting`). Wait until it settles. `image_in_use`: The image is in use. The error carries the number of servers (`vm_count`).","x-error-codes":[{"code":"image_busy","description":"The image is being processed (`state` is `Queued`, `Downloading`, `Creating` or `Deleting`). Wait until it settles."},{"code":"image_in_use","description":"The image is in use. The error carries the number of servers (`vm_count`)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"Whether the image is in use could not be checked on the platform right now. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Whether the image is in use could not be checked on the platform right now. Retry later. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"Whether the image is in use could not be checked on the platform right now. Retry later."}]}},"security":[{"bearerAuth":["image:write"]}],"summary":"Delete an image (not in use)","tags":["Images"],"x-cli":"image delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/images/<iid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"image:write","x-summary-vi":"Xoá image (không còn máy dùng)"},"get":{"description":"Returns one image with its state, progress, size, cost, region, the number of servers using it and, for images made from a server, the name of the source server. Use it to follow an image after Import an image or Create an image from a server: poll until `state` is `Ready` or `Error`. An image that does not exist or belongs to another account answers 404.\n\n**Required scope:** `image:read`.","operationId":"image_get","parameters":[{"description":"Numeric image identifier, as returned in the `id` field of List images.","in":"path","name":"iid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"bootable":true,"busy":false,"cents_per_month":4,"checksum":"{SHA-256}e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","created_at":1791800000,"debt_since":null,"declared_bytes":2362232832,"description":"Hardened base image","error_code":null,"format":"QCOW2","hours_per_month":730,"id":12,"kind":"template","last_error":null,"lock_reason":null,"locked":false,"locked_at":null,"name":"Ubuntu 24.04 golden","os_type_id":"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097","os_type_name":"Other Linux (64-bit)","paid_cents":2,"password_enabled":true,"progress":100,"rate_uusd_gb_hour":17,"ready_at":1791800900,"size_bytes":2362232832,"size_gb":3,"source":"url","src_vm_id":null,"state":"Ready","template_id":57,"updated_at":1791800900,"url":"https://images.example.com/ubuntu-24.04.qcow2","username":null,"uusd_per_hour":51,"virtual_size_bytes":10737418240,"vm_count":1,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"},"zone_id":1},"schema":{"$ref":"#/components/schemas/ImageDetail"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["image:read"]}],"summary":"Get one image","tags":["Images"],"x-cli":"image get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/images/<iid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"image:read","x-summary-vi":"Chi tiết image"},"patch":{"description":"Renames an image and/or changes its description. Only these display fields change; the image itself, its billing and the servers using it are not affected, and the call works in any state. Omit a field to keep it; send an empty `description` to clear it. Names are limited to 64 characters of letters, digits, spaces and `-`, `_`, `.`, `(`, `)`: other characters are silently dropped, and a name that ends up empty is rejected.\n\n**Required scope:** `image:write`.","operationId":"image_update","parameters":[{"description":"Numeric image identifier, as returned in the `id` field of List images.","in":"path","name":"iid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"description":"Hardened, patched in October","name":"Ubuntu 24.04 golden v2"},"schema":{"properties":{"description":{"description":"New description, up to 500 characters. An empty string removes it.","type":"string"},"name":{"description":"New name of the image.","type":"string"}},"type":"object","x-order":["name","description"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"image":{"bootable":true,"busy":false,"cents_per_month":4,"checksum":"{SHA-256}e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","created_at":1791800000,"debt_since":null,"declared_bytes":2362232832,"description":"Hardened base image","error_code":null,"format":"QCOW2","hours_per_month":730,"id":12,"kind":"template","last_error":null,"lock_reason":null,"locked":false,"locked_at":null,"name":"Ubuntu 24.04 golden","os_type_id":"5a3f6ae4-bf73-11f0-8c3a-00163eb1d097","os_type_name":"Other Linux (64-bit)","paid_cents":2,"password_enabled":true,"progress":100,"rate_uusd_gb_hour":17,"ready_at":1791800900,"size_bytes":2362232832,"size_gb":3,"source":"url","src_vm_id":null,"state":"Ready","template_id":57,"updated_at":1791800900,"url":"https://images.example.com/ubuntu-24.04.qcow2","username":null,"uusd_per_hour":51,"virtual_size_bytes":10737418240,"vm_count":1,"zone_id":1}},"schema":{"properties":{"image":{"$ref":"#/components/schemas/Image"}},"required":["image"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`name` is empty after dropping unsupported characters. The `field` of the error names it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`name` is empty after dropping unsupported characters. The `field` of the error names it. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`name` is empty after dropping unsupported characters. The `field` of the error names it."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["image:write"]}],"summary":"Rename / describe an image","tags":["Images"],"x-cli":"image update","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/images/<iid>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"description\":\"Hardened, patched in October\",\"name\":\"Ubuntu 24.04 golden v2\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"image:write","x-summary-vi":"Đổi tên / mô tả image"}},"/v1/images/{iid}/attach":{"post":{"description":"Attaches one of your ISO images to a server so that it can boot from it. The server can be running or stopped; reboot it to boot from the ISO. The ISO must be `Ready`, not locked, and in the same region as the server, and a server can have only one ISO attached at a time. The call returns 200 with the `job_id` of the background operation; follow it with the jobs of the server (`GET /v1/vm/{id}/jobs`). At most 10 attach calls per minute are accepted.\n\n**Required scope:** `image:write`.","operationId":"image_attach","parameters":[{"description":"Numeric image identifier, as returned in the `id` field of List images.","in":"path","name":"iid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"vm_id":{"description":"UUID of the server to attach the ISO to.","type":"string"}},"required":["vm_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":4840},"schema":{"properties":{"job_id":{"description":"Identifier of the background job that attaches the ISO.","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The image or the server does not exist, or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The image or the server does not exist, or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The image or the server does not exist, or belongs to another account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in a state that allows operations (the error carries its `state`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in a state that allows operations (the error carries its `state`). `job_running`: Another operation is running on the server. Wait for it to finish. `image_not_ready`: The ISO is not `Ready` yet (the error carries its `state`). `image_zone_mismatch`: The ISO and the server are in different regions.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in a state that allows operations (the error carries its `state`)."},{"code":"job_running","description":"Another operation is running on the server. Wait for it to finish."},{"code":"image_not_ready","description":"The ISO is not `Ready` yet (the error carries its `state`)."},{"code":"image_zone_mismatch","description":"The ISO and the server are in different regions."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"not_iso","message":"The image is a template; only ISO images can be attached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The image is a template; only ISO images can be attached. (`not_iso`)","x-error-codes":[{"code":"not_iso","description":"The image is a template; only ISO images can be attached."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"image_locked","message":"The ISO was locked by support and cannot be attached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`image_locked`: The ISO was locked by support and cannot be attached. `vm_locked`: The server is locked. The error carries the lock `reason`.","x-error-codes":[{"code":"image_locked","description":"The ISO was locked by support and cannot be attached."},{"code":"vm_locked","description":"The server is locked. The error carries the lock `reason`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["image:write"]}],"summary":"Attach an ISO to an instance","tags":["Images"],"x-cli":"image attach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/images/<iid>/attach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"vm_id\":\"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"image:write","x-summary-vi":"Gắn ISO vào máy ảo"}},"/v1/images/{iid}/detach":{"post":{"description":"Detaches the ISO that is currently attached to a server. `iid` must be one of your ISO images, but it is not compared with the ISO that is actually attached: whatever ISO is attached is removed, and the call succeeds without effect when there is none. It works on running and stopped servers and returns the `job_id` of the background operation (see `GET /v1/vm/{id}/jobs`). At most 10 detach calls per minute are accepted.\n\n**Required scope:** `image:write`.","operationId":"image_detach","parameters":[{"description":"Numeric image identifier, as returned in the `id` field of List images.","in":"path","name":"iid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"vm_id":{"description":"UUID of the server to detach the ISO from.","type":"string"}},"required":["vm_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":4841},"schema":{"properties":{"job_id":{"description":"Identifier of the background job that detaches the ISO.","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The image or the server does not exist, or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The image or the server does not exist, or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The image or the server does not exist, or belongs to another account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in a state that allows operations (the error carries its `state`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in a state that allows operations (the error carries its `state`). `job_running`: Another operation is running on the server. Wait for it to finish.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in a state that allows operations (the error carries its `state`)."},{"code":"job_running","description":"Another operation is running on the server. Wait for it to finish."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"not_iso","message":"The image is a template; only ISO images can be detached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The image is a template; only ISO images can be detached. (`not_iso`)","x-error-codes":[{"code":"not_iso","description":"The image is a template; only ISO images can be detached."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked. The error carries the lock `reason`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked. The error carries the lock `reason`. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked. The error carries the lock `reason`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["image:write"]}],"summary":"Detach an ISO from an instance","tags":["Images"],"x-cli":"image detach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/images/<iid>/detach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"vm_id\":\"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"image:write","x-summary-vi":"Tháo ISO khỏi máy ảo"}},"/v1/k8s/catalog":{"get":{"description":"Returns everything needed to order a cluster: the regions that offer Kubernetes, the versions you can choose, the fixed worker plans with their price per hour and for each billing cycle, the billing cycles, the specification of the free control plane and the limits that apply to your account. Call it before [Get a quote](#operation/k8s_quote) or [Create a cluster](#operation/k8s_cluster_create).\n\nPass `zone_id` to see the versions of one region; without it the default region of the site is used. `enabled` is false when no region currently sells Kubernetes. When Kubernetes is switched off for the site the call fails with `403 k8s_disabled`.\n\n**Required scope:** `catalog:read`.","operationId":"k8s_catalog","parameters":[{"description":"Region whose versions to list, taken from `zones[].id`. Defaults to the default region of the site.","example":1,"in":"query","name":"zone_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"cycles":[{"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"},{"discount_pct":10.0,"months":12,"name":"Yearly","slug":"yearly"}],"enabled":true,"hours_per_month":730,"limits":{"clusters_max":2,"clusters_used":0,"min_hours_to_create":24,"workers_max":9,"workers_min":1},"versions":[{"eol_at":null,"id":2,"is_default":true,"min_cpu":2,"min_ram_mb":2048,"name":"v1.35.0","semver":"1.35.0","status":"supported","supports_autoscaling":false,"supports_ha":false,"zone":null}],"worker_disk_gb":70,"worker_plans":[{"code":"K8S-1","cycles":[{"cycle":"monthly","cycle_cents":818,"discount_pct":0.0,"months":1},{"cycle":"yearly","cycle_cents":8834,"discount_pct":10.0,"months":12}],"disk_gb":70,"hourly_uusd":11200,"monthly_cents":818,"ram_gb":4,"ram_mb":4096,"vcpu":2},{"code":"K8S-3","cycles":[{"cycle":"monthly","cycle_cents":1635,"discount_pct":0.0,"months":1},{"cycle":"yearly","cycle_cents":17658,"discount_pct":10.0,"months":12}],"disk_gb":70,"hourly_uusd":22400,"monthly_cents":1635,"ram_gb":8,"ram_mb":8192,"vcpu":4}],"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"},"zones":[{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]},"schema":{"$ref":"#/components/schemas/K8sCatalog"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`zone_id` is not an integer."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`zone_id` is not an integer. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`zone_id` is not an integer."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Kubernetes is not sold on this site. (`k8s_disabled`)","x-error-codes":[{"code":"k8s_disabled","description":"Kubernetes is not sold on this site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Kubernetes catalog: zones, versions, worker plans, cycles","tags":["Kubernetes"],"x-cli":"k8s catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục Kubernetes: vùng, version, gói worker, chu kỳ"}},"/v1/k8s/clusters":{"get":{"description":"Lists your clusters with the state, size and price of each. By default deleted clusters are hidden; filter with `state=deleted` to see the ones deleted in the last 30 days. The items do not include `note`; fetch a single cluster to read it. `counts` always describes your live clusters, whatever the filter. Clusters are sorted by creation time, oldest first, unless you pass `sort` and `dir`.\n\nThis call works even when the site no longer sells Kubernetes, so existing clusters stay visible.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. `workers` is the worker count, `hourly` and `hourly_uusd` the price per hour, `version` and `semver` the Kubernetes version, `zone` the region name.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["name","state","created_at","workers","hourly","hourly_uusd","version","semver","public_ip","zone"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"asc","enum":["asc","desc"],"type":"string"}},{"description":"Only clusters in this state. `running` and `active` are the same. Omit or use `all` for every live cluster.","in":"query","name":"state","required":false,"schema":{"enum":["all","running","active","stopped","locked","provisioning","failed","deleted"],"type":"string"}},{"description":"Only clusters whose name or public IP contains this text (case-insensitive).","example":"prod","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Only your clusters in this region (`zones[].id` from the catalog). A region where you have no cluster gives an empty list; `total` and the paging apply after the filter.","in":"query","name":"zone_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"counts":{"active":1,"all":1,"locked":0,"running":1,"stopped":0},"items":[{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":true,"kubeconfig":true,"scale":true,"start":false,"stop":true,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":"Running","endpoint":"https://203.0.113.10:6443","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","op":null,"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":"203.0.113.10","ready_at":1760000540,"state":"active","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":3,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":3},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"counts":{"description":"Number of your live clusters per state.","properties":{"active":{"description":"Same as `running`.","type":"integer"},"all":{"description":"Live clusters.","type":"integer"},"locked":{"description":"Clusters in state `locked`.","type":"integer"},"running":{"description":"Clusters in state `active`.","type":"integer"},"stopped":{"description":"Clusters in state `stopped`.","type":"integer"}},"required":["all","running","active","stopped","locked"],"type":"object","x-order":["all","running","active","stopped","locked"]},"items":{"items":{"$ref":"#/components/schemas/K8sCluster"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","counts"],"type":"object","x-order":["items","total","page","per_page","counts"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page`, `per_page` or `zone_id` is not an integer, or `sort`, `dir` or `state` is not one of the listed values."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page`, `per_page` or `zone_id` is not an integer, or `sort`, `dir` or `state` is not one of the listed values. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page`, `per_page` or `zone_id` is not an integer, or `sort`, `dir` or `state` is not one of the listed values."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"List clusters","tags":["Kubernetes"],"x-cli":"k8s cluster list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Danh sách cụm"},"post":{"description":"Orders a new cluster. The request is validated and priced at once; the cluster itself is built in the background, so the call returns `202 Accepted` with the cluster in state `provisioning` and the queued operation. Poll [Get a cluster](#operation/k8s_cluster_get) (or follow the operation with [List operations](#operation/k8s_cluster_ops)) until `state` is `active`; this normally takes a few minutes.\n\n**Billing.** The control plane is free. With `cycle` set to `hourly` (the default) nothing is charged now and running workers are billed every hour. With a monthly or longer cycle the first cycle for all workers is charged to the wallet immediately and refunded in full if the build fails. Your wallet balance must reach `funds.need_cents` as reported by [Get a quote](#operation/k8s_quote) (at least the up-front charge, and enough to run the new workers for the minimum number of hours).\n\n**Limits.** The name must be unique among your live clusters. A limit on clusters per account, a daily creation limit and a cool-down after deleting a cluster apply, and your account's resource quota covers the workers and the control plane. Call the quote first to see them all. When Kubernetes is switched off for the site the call fails with `403 k8s_disabled`. Retry safely with the same `Idempotency-Key`.\n\n**Required scope:** `k8s:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"k8s_cluster_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cycle":"hourly","name":"prod-cluster","version_id":2,"worker_count":3,"worker_plan":"K8S-3","zone_id":1},"schema":{"properties":{"cycle":{"description":"Billing cycle identifier from the catalog. `hourly` (default) bills by the hour; a monthly or longer cycle is paid up front.","type":"string"},"name":{"description":"Cluster name: 3 to 40 characters, lowercase letters, digits and hyphens, starting with a letter and not ending with a hyphen. Upper-case letters are converted to lower case. Must be unique among your live clusters.","type":"string"},"ssh_key_id":{"description":"One of your SSH keys, installed on every node so you can log in to them.","type":"integer"},"version_id":{"description":"Kubernetes version, from List versions. Defaults to the default version.","type":"integer"},"worker_count":{"description":"Number of workers, within the catalog `limits` (1 to 9 by default).","type":"integer"},"worker_plan":{"description":"Worker plan code from the catalog, e.g. `K8S-3`.","type":"string"},"zone_id":{"description":"Region to build the cluster in. Defaults to the default region of the site.","type":"integer"}},"required":["name","worker_plan","worker_count"],"type":"object","x-order":["name","worker_plan","worker_count","zone_id","version_id","cycle","ssh_key_id"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"cluster":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":false,"kubeconfig":false,"scale":false,"start":false,"stop":false,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":null,"endpoint":null,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","note":null,"op":{"created_at":1760003700,"finished_at":null,"id":41,"kind":"create","public_error":null,"state":"queued","step":"queued"},"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":null,"ready_at":null,"state":"provisioning","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":0,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":0},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"op":{"id":41,"kind":"create","state":"queued"}},"schema":{"properties":{"cluster":{"$ref":"#/components/schemas/K8sCluster"},"op":{"$ref":"#/components/schemas/K8sOpQueued"}},"required":["cluster","op"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, `name`, `worker_plan` or `worker_count` is missing or has the wrong type, `cycle` is not an available billing cycle, or `ssh_key_id` is not one of your keys. The error carries `field` or `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, `name`, `worker_plan` or `worker_count` is missing or has the wrong type, `cycle` is not an available billing cycle, or `ssh_key_id` is not one of your keys. The error carries `field` or `detail`. `name_invalid`: `name` is not 3 to 40 characters of lowercase letters, digits and hyphens starting with a letter and not ending with a hyphen. `worker_custom_removed`: The legacy `worker` object (custom worker size) was sent. Custom sizes are no longer sold; send `worker_plan`. `worker_plan_invalid`: `worker_plan` is not a plan on sale, or it is smaller than the chosen version requires (`reason` is then `version_min`, with `min_cpu` and `min_ram_mb`). The error lists the plans on sale in `plans`. `version_unavailable`: `version_id` is not a version that can be ordered in this region. `workers_out_of_range`: `worker_count` is outside the allowed range. The error carries `min` and `max`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, `name`, `worker_plan` or `worker_count` is missing or has the wrong type, `cycle` is not an available billing cycle, or `ssh_key_id` is not one of your keys. The error carries `field` or `detail`."},{"code":"name_invalid","description":"`name` is not 3 to 40 characters of lowercase letters, digits and hyphens starting with a letter and not ending with a hyphen."},{"code":"worker_custom_removed","description":"The legacy `worker` object (custom worker size) was sent. Custom sizes are no longer sold; send `worker_plan`."},{"code":"worker_plan_invalid","description":"`worker_plan` is not a plan on sale, or it is smaller than the chosen version requires (`reason` is then `version_min`, with `min_cpu` and `min_ram_mb`). The error lists the plans on sale in `plans`."},{"code":"version_unavailable","description":"`version_id` is not a version that can be ordered in this region."},{"code":"workers_out_of_range","description":"`worker_count` is outside the allowed range. The error carries `min` and `max`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is below the amount required. The error carries `need_cents` (the balance required) and `balance_cents` (your balance), both in US cents. Top up and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is below the amount required. The error carries `need_cents` (the balance required) and `balance_cents` (your balance), both in US cents. Top up and retry. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is below the amount required. The error carries `need_cents` (the balance required) and `balance_cents` (your balance), both in US cents. Top up and retry."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `k8s_disabled`: Kubernetes is not sold on this site. `email_unverified`: The account e-mail address must be verified first. `cluster_limit`: You reached the maximum number of clusters. The error carries `scope` (`account`, with `max`, or `site`). `quota_exceeded`: The workers and control plane would exceed your account's resource quota. The error carries `reason`, `used`, `requested`, `limit` and `need_more_cents` (US cents still to deposit to raise the quota). `limit_reached`: The site's overall resource limit has been reached. Contact support.","x-error-codes":[{"code":"k8s_disabled","description":"Kubernetes is not sold on this site."},{"code":"email_unverified","description":"The account e-mail address must be verified first."},{"code":"cluster_limit","description":"You reached the maximum number of clusters. The error carries `scope` (`account`, with `max`, or `site`)."},{"code":"quota_exceeded","description":"The workers and control plane would exceed your account's resource quota. The error carries `reason`, `used`, `requested`, `limit` and `need_more_cents` (US cents still to deposit to raise the quota)."},{"code":"limit_reached","description":"The site's overall resource limit has been reached. Contact support."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"zone_not_k8s","message":"`zone_id` is not a region that offers Kubernetes, or no region is available."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`zone_not_k8s`: `zone_id` is not a region that offers Kubernetes, or no region is available. `name_taken`: You already have a live cluster with this name. `idempotency_conflict`: The same `Idempotency-Key` was already used on this account with a different request body. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"zone_not_k8s","description":"`zone_id` is not a region that offers Kubernetes, or no region is available."},{"code":"name_taken","description":"You already have a live cluster with this name."},{"code":"idempotency_conflict","description":"The same `Idempotency-Key` was already used on this account with a different request body."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"cycle_unavailable","message":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"sales_disabled","message":"The site is not taking new orders."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`sales_disabled`: The site is not taking new orders. `site_unavailable`: The site is temporarily not accepting new orders.","x-error-codes":[{"code":"sales_disabled","description":"The site is not taking new orders."},{"code":"site_unavailable","description":"The site is temporarily not accepting new orders."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: `cooldown`: A cluster was deleted recently and creating a new one is paused. The error carries `retry_after` in seconds. `rate_limited`: The daily limit of cluster creations was reached. The error carries `retry_after` in seconds.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"cooldown","description":"A cluster was deleted recently and creating a new one is paused. The error carries `retry_after` in seconds."},{"code":"rate_limited","description":"The daily limit of cluster creations was reached. The error carries `retry_after` in seconds."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"capacity","message":"The platform-wide cluster limit has been reached. Try again later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`capacity`: The platform-wide cluster limit has been reached. Try again later. `quota_unavailable`: The resource quota could not be verified. Try again later. `provider_unavailable`: The site cannot take new resources right now. Try again later. `tenant_unavailable`: Your account could not be matched to this site. Try again in a few minutes.","x-error-codes":[{"code":"capacity","description":"The platform-wide cluster limit has been reached. Try again later."},{"code":"quota_unavailable","description":"The resource quota could not be verified. Try again later."},{"code":"provider_unavailable","description":"The site cannot take new resources right now. Try again later."},{"code":"tenant_unavailable","description":"Your account could not be matched to this site. Try again in a few minutes."}]}},"security":[{"bearerAuth":["k8s:create"]}],"summary":"Create a cluster (prepaid cycles charge the wallet)","tags":["Kubernetes"],"x-cli":"k8s cluster create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/k8s/clusters\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"hourly\",\"name\":\"prod-cluster\",\"version_id\":2,\"worker_count\":3,\"worker_plan\":\"K8S-3\",\"zone_id\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"k8s:create","x-summary-vi":"Tạo cụm (trả trước kỳ thì trừ tiền ví ngay)"}},"/v1/k8s/clusters/{id}":{"delete":{"description":"Deletes the cluster with all its nodes and disks, its stored data and its public IP address. **This cannot be undone.** Send the exact cluster name in `confirm`; call [Preview a deletion](#operation/k8s_cluster_delete_preview) first to see what will be lost and the expected refund.\n\nThe call returns `202 Accepted`: the cluster goes to `deleting` and an operation removes it in the background, after which it becomes `deleted`. For a prepaid cluster the unused part of the paid period is refunded to the wallet when the operation finishes; `refund_cents` is that amount as estimated now. Hourly clusters have nothing to refund and stop being billed. Clusters locked for a policy violation are not refunded.\n\nAllowed while the cluster is `active`, `stopped`, `locked` or `failed` and no other operation is running. This call works even when the site no longer sells Kubernetes. Retry safely with the same `Idempotency-Key`.\n\n**Required scope:** `k8s:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"k8s_cluster_delete","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":"prod-cluster"},"schema":{"properties":{"confirm":{"description":"The exact name of the cluster (case-insensitive), as a guard against deleting the wrong one.","type":"string"}},"required":["confirm"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"op":{"id":44,"kind":"delete","state":"queued"},"refund_cents":0},"schema":{"properties":{"op":{"$ref":"#/components/schemas/K8sOpQueued"},"refund_cents":{"description":"Expected refund of the unused prepaid period in US cents, as estimated now. 0 for hourly clusters.","type":"integer"}},"required":["op","refund_cents"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object. `confirm_mismatch`: `confirm` is missing or does not match the cluster name. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object."},{"code":"confirm_mismatch","description":"`confirm` is missing or does not match the cluster name."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"cluster_busy","message":"The cluster is provisioning, already being deleted or deleted, or another operation is running. Wait for it to finish."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cluster_busy`: The cluster is provisioning, already being deleted or deleted, or another operation is running. Wait for it to finish. `idempotency_conflict`: The same `Idempotency-Key` was already used on this account with a different request body. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"cluster_busy","description":"The cluster is provisioning, already being deleted or deleted, or another operation is running. Wait for it to finish."},{"code":"idempotency_conflict","description":"The same `Idempotency-Key` was already used on this account with a different request body."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:destroy"]}],"summary":"Delete the cluster (data is lost)","tags":["Kubernetes"],"x-cli":"k8s cluster delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/k8s/clusters/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":\"prod-cluster\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"k8s:destroy","x-summary-vi":"Xoá cụm (mất dữ liệu)"},"get":{"description":"Returns one cluster with its configuration, state, price, billing terms, any lock and any operation in progress. `can` tells which actions are possible right now. A deleted cluster stays readable for 30 days after deletion; after that it answers `404`.\n\nThis call works even when the site no longer sells Kubernetes.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_get","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cluster":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":true,"kubeconfig":true,"scale":true,"start":false,"stop":true,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":"Running","endpoint":"https://203.0.113.10:6443","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","note":"Production workloads","op":null,"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":"203.0.113.10","ready_at":1760000540,"state":"active","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":3,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":3},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"cluster":{"$ref":"#/components/schemas/K8sCluster"}},"required":["cluster"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Get one cluster","tags":["Kubernetes"],"x-cli":"k8s cluster get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Chi tiết cụm"},"patch":{"description":"Changes the display name, the note or the auto-renew setting of a cluster. Only the fields you send change; an empty object changes nothing. Renaming only changes the label: the cluster keeps running and existing kubeconfig files stay valid. `auto_renew` applies to prepaid cycles: when it is off, the cluster is locked at the end of the paid period instead of being renewed, so turn it back on before then. Hourly clusters have no renewal and reject `auto_renew`.\n\nThe cluster must not be locked, being deleted, deleted or failed. Costs nothing.\n\n**Required scope:** `k8s:write`.","operationId":"k8s_cluster_update","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"name":"prod-cluster","note":"Production workloads"},"schema":{"properties":{"auto_renew":{"description":"Whether a prepaid cluster renews at the end of its paid period.","type":"boolean"},"name":{"description":"New name: 3 to 40 characters, lowercase letters, digits and hyphens, starting with a letter and not ending with a hyphen. Upper-case letters are converted to lower case. Must be unique among your live clusters.","type":"string"},"note":{"description":"Free-form note, at most 500 characters (longer text is cut). An empty string or null removes the note.","type":["string","null"]}},"type":"object","x-order":["name","note","auto_renew"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"cluster":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":true,"kubeconfig":true,"scale":true,"start":false,"stop":true,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":"Running","endpoint":"https://203.0.113.10:6443","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","note":"Production workloads","op":null,"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":"203.0.113.10","ready_at":1760000540,"state":"active","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":3,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":3},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"cluster":{"$ref":"#/components/schemas/K8sCluster"}},"required":["cluster"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, `note` is not a string or null, `auto_renew` is not a boolean, or `auto_renew` was sent for an hourly cluster (the error carries `field`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, `note` is not a string or null, `auto_renew` is not a boolean, or `auto_renew` was sent for an hourly cluster (the error carries `field`). `name_invalid`: `name` is not 3 to 40 characters of lowercase letters, digits and hyphens starting with a letter and not ending with a hyphen.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, `note` is not a string or null, `auto_renew` is not a boolean, or `auto_renew` was sent for an hourly cluster (the error carries `field`)."},{"code":"name_invalid","description":"`name` is not 3 to 40 characters of lowercase letters, digits and hyphens starting with a letter and not ending with a hyphen."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"name_taken","message":"You already have another live cluster with this name."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`name_taken`: You already have another live cluster with this name. `cluster_busy`: The cluster is being deleted, or is deleted or failed, and cannot be changed.","x-error-codes":[{"code":"name_taken","description":"You already have another live cluster with this name."},{"code":"cluster_busy","description":"The cluster is being deleted, or is deleted or failed, and cannot be changed."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"cluster_locked","message":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`. (`cluster_locked`)","x-error-codes":[{"code":"cluster_locked","description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:write"]}],"summary":"Rename / notes / auto-renew","tags":["Kubernetes"],"x-cli":"k8s cluster update","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/k8s/clusters/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"prod-cluster\",\"note\":\"Production workloads\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:write","x-summary-vi":"Đổi tên / ghi chú / tự gia hạn"}},"/v1/k8s/clusters/{id}/bandwidth":{"get":{"description":"Returns the traffic allowance and usage of the cluster for the current monthly period: the included quota (which grows with the average number of workers over the period), Add-ons bought for the period, traffic used so far, what happens when the allowance runs out, and a usage series. It is the cluster view of the Bandwidth tag: use that tag to compare services or to buy an Add-on (`kind` is `k8s` and `ref` is the cluster `id`). Deleted or failed clusters answer `404`.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_bandwidth","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Time range of the usage series: hourly points for `24h`, daily points otherwise. Other values behave as `period`, the current monthly period.","in":"query","name":"series","required":false,"schema":{"default":"period","enum":["24h","7d","30d","period"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"account_id":1042,"addon_bytes":0,"addon_tb":0,"addons":[],"buy_block":null,"can_buy":true,"count":"edge","count_mode":"both","kind":"k8s","limit_bytes":6597069766656,"metered_frac":1.0,"name":"prod-cluster","pct":0.8,"period":{"end":1761955200,"kind":"anchored_month","start":1759276800},"policy":"notify","price":{"max_tb":50,"tb_cents":400},"quota_bytes":6597069766656,"ref":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","remaining_bytes":6543382675456,"series":{"bucket":86400,"from":1759276800,"points":[{"in":10737418240,"out":16106127360,"t":1759881600,"total":26843545600}],"range":"period","to":1760007200},"state":"active","sub":"203.0.113.10","suspend_active":false,"total":{"in":21474836480,"out":32212254720,"total":53687091200},"unmetered":null,"used_bytes":53687091200,"workers_avg":3.0},"schema":{"$ref":"#/components/schemas/K8sBandwidth"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Bandwidth metering is switched off on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bandwidth metering is switched off on this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Bandwidth metering is switched off on this site."}]}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Cluster Bandwidth (per-worker quota, Add-ons, usage)","tags":["Kubernetes"],"x-cli":"k8s cluster bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Bandwidth của cụm (quota theo worker, Add-on, đã dùng)"}},"/v1/k8s/clusters/{id}/billing":{"get":{"description":"Shows what the cluster costs and has cost: its current price and billing terms, what it spent this calendar month (UTC) and in total, and the wallet entries that belong to it, newest first by default. Entries have a `kind`: `hour` (hourly charge of a worker), `new` (up-front charge at creation), `cycle` (renewal of a prepaid period), `scale` (prorated charge for added workers) and `refund`. `amount_cents` is in US cents and is negative for charges and positive for refunds, while `spent_month_cents` and `spent_total_cents` are positive totals of the charges net of refunds. The control plane never appears because it is free.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_billing","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","amount_cents"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"items":[{"amount_cents":-2,"at":1760007200,"id":1207,"kind":"hour","memo":"Kubernetes prod-cluster - hourly worker charge"},{"amount_cents":-2,"at":1760003600,"id":1190,"kind":"hour","memo":"Kubernetes prod-cluster - hourly worker charge"}],"page":1,"per_page":25,"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"spent_month_cents":4,"spent_total_cents":4,"total":2},"schema":{"properties":{"billing":{"$ref":"#/components/schemas/K8sCycleBilling"},"items":{"items":{"properties":{"amount_cents":{"description":"Amount in US cents: negative for a charge, positive for a refund.","type":"integer"},"at":{"description":"When the entry was booked (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Wallet entry identifier.","type":"integer"},"kind":{"description":"What the entry is for: `hour`, `new`, `cycle`, `scale` or `refund`.","type":"string"},"memo":{"description":"Description of the entry.","type":["string","null"]}},"required":["id","at","kind","amount_cents","memo"],"type":"object","x-order":["id","at","kind","amount_cents","memo"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"pricing":{"$ref":"#/components/schemas/K8sPricing"},"spent_month_cents":{"description":"Net amount charged for this cluster since the start of the current calendar month (UTC), in US cents.","type":"integer"},"spent_total_cents":{"description":"Net amount charged for this cluster since it was created, in US cents.","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","pricing","billing","spent_month_cents","spent_total_cents"],"type":"object","x-order":["items","total","page","per_page","pricing","billing","spent_month_cents","spent_total_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Cluster billing","tags":["Kubernetes"],"x-cli":"k8s cluster billing","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/billing\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Chi phí cụm"}},"/v1/k8s/clusters/{id}/delete-preview":{"get":{"description":"Shows what [Delete a cluster](#operation/k8s_cluster_delete) would remove and refund, without deleting anything: the number of nodes, the data that would be lost, the expected refund of the unused prepaid period and the exact text to send as `confirm`. `data_loss` is a list of human-readable sentences in the language of the account. Costs nothing.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_delete_preview","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"confirm":"prod-cluster","cycle":"hourly","data_loss":["4 node(s) (control + workers) and all their disks","All workloads, PersistentVolumes and Secrets in the cluster","Public IP 203.0.113.10 (quarantined 72 h, cannot be kept)","The current kubeconfig stops working"],"name":"prod-cluster","nodes":4,"paid_until":null,"public_ip":"203.0.113.10","refund_cents":0,"workers":3},"schema":{"properties":{"confirm":{"description":"Text to send as `confirm` in the delete call: the cluster name.","type":"string"},"cycle":{"description":"Billing cycle identifier of the cluster.","type":"string"},"data_loss":{"description":"What would be lost.","items":{"description":"One consequence of deleting the cluster.","type":"string"},"type":"array"},"name":{"description":"Cluster name.","type":"string"},"nodes":{"description":"Number of nodes that would be removed (control plane and workers).","type":"integer"},"paid_until":{"description":"End of the paid period of a prepaid cluster, or null (Unix time, seconds, UTC)","type":["integer","null"]},"public_ip":{"description":"Public IP address that would be released and cannot be kept.","type":["string","null"]},"refund_cents":{"description":"Expected refund of the unused prepaid period in US cents, as estimated now. 0 for hourly clusters.","type":"integer"},"workers":{"description":"Number of workers.","type":"integer"}},"required":["name","nodes","workers","refund_cents","confirm","public_ip","data_loss","cycle","paid_until"],"type":"object","x-order":["name","nodes","workers","refund_cents","confirm","public_ip","data_loss","cycle","paid_until"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Preview before deleting the cluster","tags":["Kubernetes"],"x-cli":"k8s cluster delete-preview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/delete-preview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Xem trước khi xoá cụm"}},"/v1/k8s/clusters/{id}/events":{"get":{"description":"Returns the event log of the cluster, newest first by default: what was ordered, started, scaled, renamed, locked or deleted, when the cluster became ready, and every kubeconfig download. `actor` tells who caused the event: `you`, `admin` (the site operator) or `system` (automatic action). `msg` is a short human-readable sentence in English; branch on `kind`, not on the text.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_events","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","kind","actor"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"actor":"system","args":{"from":"3","to":"5"},"at":1760003820,"id":93,"key":"k8s.scaled","kind":"scaled","msg":"Workers 3 → 5"},{"actor":"you","args":{"from":"3","to":"5"},"at":1760003700,"id":92,"key":"k8s.scale_requested","kind":"scale","msg":"Scale workers 3 → 5"}],"page":1,"per_page":25,"total":2},"schema":{"properties":{"items":{"items":{"properties":{"actor":{"description":"Who caused the event.","enum":["you","admin","system"],"type":"string"},"args":{"additionalProperties":true,"description":"Raw values to fill into the message named by `key` (string values). An empty object when `key` is `null`.","type":"object"},"at":{"description":"When the event happened (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Event identifier.","type":"integer"},"key":{"description":"Stable message code (for example `k8s.ready`); `null` for entries written before message codes existed. With `args` it lets you show the message in your own language.","type":["string","null"]},"kind":{"description":"Event type, e.g. `create`, `ready`, `scale`, `scaled`, `start`, `stop`, `rename`, `auto_renew`, `lock`, `unlock`, `renewal`, `destroy`, `deleted`, `kubeconfig_download`. New types may be added.","type":"string"},"msg":{"description":"Short description of the event in English.","type":"string"}},"required":["id","at","kind","actor","msg","key","args"],"type":"object","x-order":["id","at","kind","actor","msg","key","args"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Cluster event log","tags":["Kubernetes"],"x-cli":"k8s cluster events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Nhật ký cụm"}},"/v1/k8s/clusters/{id}/kubeconfig":{"get":{"description":"Downloads the kubeconfig file (YAML) of the cluster. **It grants cluster-admin rights**: anyone holding the file has full control of the cluster and everything running in it, so treat it like a root password and give the dedicated `k8s:kubeconfig` scope only to keys that need it. The file is generated on every request, is never stored by the API and is not written to logs; the response carries `Cache-Control: no-store` and a `Content-Disposition` header with the file name `<cluster name>-kubeconfig.yaml`. Every download is recorded in the cluster's events, and downloads are limited per account (10 per hour by default).\n\nThe cluster must be running (`can.kubeconfig` is true). Save the response body to a file and point `KUBECONFIG` at it. This call works even when the site no longer sells Kubernetes.\n\n**Required scope:** `k8s:kubeconfig`.","operationId":"k8s_cluster_kubeconfig","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/yaml":{"example":"apiVersion: v1\nkind: Config\nclusters:\n- name: prod-cluster\n  cluster:\n    server: https://203.0.113.10:6443\n    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t...\nusers:\n- name: prod-cluster-admin\n  user:\n    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t...\n    client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQ...\ncontexts:\n- name: prod-cluster\n  context:\n    cluster: prod-cluster\n    user: prod-cluster-admin\ncurrent-context: prod-cluster\n","schema":{"description":"The kubeconfig file in YAML.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"cluster_not_running","message":"The cluster is not running, so there is no kubeconfig to download."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The cluster is not running, so there is no kubeconfig to download. (`cluster_not_running`)","x-error-codes":[{"code":"cluster_not_running","description":"The cluster is not running, so there is no kubeconfig to download."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"cluster_locked","message":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`. (`cluster_locked`)","x-error-codes":[{"code":"cluster_locked","description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many kubeconfig downloads in the last hour. The error carries `retry_after` in seconds and the response has a `Retry-After` header. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many kubeconfig downloads in the last hour. The error carries `retry_after` in seconds and the response has a `Retry-After` header."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"cloud_unavailable","message":"The kubeconfig could not be produced right now. Try again in a minute."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The kubeconfig could not be produced right now. Try again in a minute. (`cloud_unavailable`)","x-error-codes":[{"code":"cloud_unavailable","description":"The kubeconfig could not be produced right now. Try again in a minute."}]}},"security":[{"bearerAuth":["k8s:kubeconfig"]}],"summary":"Download kubeconfig (cluster-admin)","tags":["Kubernetes"],"x-cli":"k8s cluster kubeconfig","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/kubeconfig\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:kubeconfig","x-summary-vi":"Tải kubeconfig (cluster-admin)"}},"/v1/k8s/clusters/{id}/networking":{"get":{"description":"Shows how to reach the cluster: the API server endpoint, the public IP address, and the ports that are open on that address. Port 6443 is the Kubernetes API; ports 80 and 443 reach the cluster's ingress (node ports 30080 and 30443) once `ingress_ready` is true; the SSH ports starting at 2222 map to port 22 of each node in order. `cidrs` lists the source ranges allowed on a rule; an empty list means any address.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_networking","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"endpoint":"https://203.0.113.10:6443","ingress":[{"node_port":30080,"protocol":"tcp","public_port":80},{"node_port":30443,"protocol":"tcp","public_port":443}],"ingress_ready":true,"load_balancer_service":false,"public_ip":"203.0.113.10","rules":[{"cidrs":[],"kind":"api","private_port":6443,"protocol":"tcp","public_port":6443},{"cidrs":[],"kind":"ingress","private_port":30080,"protocol":"tcp","public_port":80},{"cidrs":[],"kind":"ingress","private_port":30443,"protocol":"tcp","public_port":443},{"cidrs":[],"kind":"port_forward","private_port":22,"protocol":"tcp","public_port":2222}]},"schema":{"properties":{"endpoint":{"description":"URL of the Kubernetes API server. Null until the cluster is ready.","type":["string","null"]},"ingress":{"description":"Web ports forwarded to the nodes.","items":{"properties":{"node_port":{"description":"Node port the traffic is forwarded to. Expose your ingress controller on it.","type":"integer"},"protocol":{"description":"`tcp`.","type":"string"},"public_port":{"description":"Port on the public IP address.","type":"integer"}},"required":["public_port","node_port","protocol"],"type":"object","x-order":["public_port","node_port","protocol"]},"type":"array"},"ingress_ready":{"description":"Whether ports 80 and 443 are set up.","type":"boolean"},"load_balancer_service":{"description":"Whether Kubernetes `LoadBalancer` services are supported. Currently always false: expose workloads through the ingress ports instead.","type":"boolean"},"public_ip":{"description":"Public IP address of the cluster. Null until the cluster is ready.","type":["string","null"]},"rules":{"description":"Rules open on the public IP address.","items":{"properties":{"cidrs":{"description":"Allowed source ranges. Empty means any address.","items":{"description":"Allowed source range in CIDR notation.","type":"string"},"type":"array"},"kind":{"description":"`api`: Kubernetes API. `ingress`: web traffic. `port_forward`: SSH to a node.","enum":["api","ingress","port_forward"],"type":"string"},"private_port":{"description":"Port the traffic is forwarded to.","type":"integer"},"protocol":{"description":"`tcp`.","type":"string"},"public_port":{"description":"Port on the public IP address.","type":"integer"}},"required":["kind","protocol","public_port","private_port","cidrs"],"type":"object","x-order":["kind","protocol","public_port","private_port","cidrs"]},"type":"array"}},"required":["endpoint","public_ip","ingress","ingress_ready","rules","load_balancer_service"],"type":"object","x-order":["endpoint","public_ip","ingress","ingress_ready","rules","load_balancer_service"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Endpoint, IP, open ports","tags":["Kubernetes"],"x-cli":"k8s cluster networking","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/networking\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Endpoint, IP, cổng mở"}},"/v1/k8s/clusters/{id}/nodes":{"get":{"description":"Lists the nodes that currently make up the cluster: the free control plane node first, then the workers, with their size, status and hourly price. Nodes that were removed are not listed. The list is not paginated.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_nodes","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"billable":false,"cpu":2,"cs_state":"Running","disk_gb":70,"hourly_uusd":0,"id":"9b1f3c52-4e7a-4d0b-8c13-2a6e5f7d8c90","name":"prod-cluster-control-1","private_ip":"10.1.1.10","ram_mb":2048,"role":"control","since":1760000100,"source":"op","state":"active"},{"billable":true,"cpu":4,"cs_state":"Running","disk_gb":70,"hourly_uusd":22400,"id":"5d2e8a47-1b3c-4f69-9e0a-7c4b6d8e1f23","name":"prod-cluster-node-1","private_ip":"10.1.1.11","ram_mb":8192,"role":"worker","since":1760000300,"source":"op","state":"active"}],"total":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/K8sNode"},"type":"array"},"total":{"description":"Number of nodes returned.","type":"integer"}},"required":["items","total"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Cluster nodes (free control + workers)","tags":["Kubernetes"],"x-cli":"k8s cluster nodes","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/nodes\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Node của cụm (control miễn phí + worker)"}},"/v1/k8s/clusters/{id}/ops":{"get":{"description":"Lists the background operations of the cluster (creation, scaling, start, stop, deletion and maintenance), newest first by default. Use it to follow a `202 Accepted` call: find the operation by the `op.id` you received and wait until `state` is `done`, or `failed` with a `public_error` reason code.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_cluster_ops","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. `created_at` and `id` give the same order.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","id","kind","state"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":1760003700,"finished_at":1760003820,"id":41,"kind":"scale","public_error":null,"state":"done","step":"done"},{"created_at":1760000000,"finished_at":1760000540,"id":38,"kind":"create","public_error":null,"state":"done","step":"done"}],"page":1,"per_page":25,"total":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/K8sOp"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page` or `per_page` is not an integer, or `dir` or `sort` is not one of the listed values."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Cluster operations","tags":["Kubernetes"],"x-cli":"k8s cluster ops","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/clusters/<id>/ops\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Thao tác của cụm"}},"/v1/k8s/clusters/{id}/scale":{"post":{"description":"Changes the number of workers. The call returns `202 Accepted` and an operation adds or removes workers in the background; `workers.desired` keeps the old number until it finishes. Only a running cluster (`state` `active`, `cs_state` `Running`) with no operation in progress can be scaled, and at most 6 scale operations per hour are allowed per cluster.\n\n**Adding workers** charges money. On an hourly cluster nothing is charged now, but your balance must cover the minimum number of hours of the added workers. On a prepaid cluster the added workers are charged immediately for the rest of the paid period (`charged_cents`), and refunded if the operation fails; a prepaid cluster whose paid period has ended cannot be scaled until it renews. Your resource quota and the site limits also apply. **Removing workers** deletes nodes (and anything stored only on them); for a prepaid cluster the unused part of the paid period is refunded when the operation finishes.\n\nWhen Kubernetes is switched off for the site the call fails with `403 k8s_disabled`. Retry safely with the same `Idempotency-Key`.\n\n**Required scope:** `k8s:scale`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"k8s_cluster_scale","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"worker_count":5},"schema":{"properties":{"worker_count":{"description":"New number of workers, within the catalog `limits` (1 to 9 by default) and different from the current number.","type":"integer"}},"required":["worker_count"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"charged_cents":0,"cluster":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":false,"kubeconfig":true,"scale":false,"start":false,"stop":false,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":"Running","endpoint":"https://203.0.113.10:6443","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","note":"Production workloads","op":{"created_at":1760003700,"finished_at":null,"id":41,"kind":"scale","public_error":null,"state":"queued","step":"queued"},"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":"203.0.113.10","ready_at":1760000540,"state":"active","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":3,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":3},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"op":{"id":41,"kind":"scale","state":"queued"}},"schema":{"properties":{"charged_cents":{"description":"Amount charged to the wallet now in US cents: the prorated price of the added workers on a prepaid cluster, otherwise 0.","type":"integer"},"cluster":{"$ref":"#/components/schemas/K8sCluster"},"op":{"$ref":"#/components/schemas/K8sOpQueued"}},"required":["cluster","op","charged_cents"],"type":"object","x-order":["cluster","op","charged_cents"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, `worker_count` is missing or not an integer, or it equals the current number of workers."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, `worker_count` is missing or not an integer, or it equals the current number of workers. `workers_out_of_range`: `worker_count` is outside the allowed range. The error carries `min` and `max`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, `worker_count` is missing or not an integer, or it equals the current number of workers."},{"code":"workers_out_of_range","description":"`worker_count` is outside the allowed range. The error carries `min` and `max`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is below the amount required. The error carries `need_cents` (the balance required) and `balance_cents` (your balance), both in US cents."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is below the amount required. The error carries `need_cents` (the balance required) and `balance_cents` (your balance), both in US cents. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is below the amount required. The error carries `need_cents` (the balance required) and `balance_cents` (your balance), both in US cents."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `k8s_disabled`: Kubernetes is not sold on this site. `quota_exceeded`: The added workers would exceed your account's resource quota. The error carries `reason`, `used`, `requested`, `limit` and `need_more_cents`. `limit_reached`: The site's overall resource limit has been reached. Contact support.","x-error-codes":[{"code":"k8s_disabled","description":"Kubernetes is not sold on this site."},{"code":"quota_exceeded","description":"The added workers would exceed your account's resource quota. The error carries `reason`, `used`, `requested`, `limit` and `need_more_cents`."},{"code":"limit_reached","description":"The site's overall resource limit has been reached. Contact support."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"cluster_busy","message":"Another operation is running, or the prepaid period has ended and the cluster is waiting for renewal."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cluster_busy`: Another operation is running, or the prepaid period has ended and the cluster is waiting for renewal. `cluster_not_running`: The cluster is not running (`state` is not `active` or `cs_state` is not `Running`). `idempotency_conflict`: The same `Idempotency-Key` was already used on this account with a different request body. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"cluster_busy","description":"Another operation is running, or the prepaid period has ended and the cluster is waiting for renewal."},{"code":"cluster_not_running","description":"The cluster is not running (`state` is not `active` or `cs_state` is not `Running`)."},{"code":"idempotency_conflict","description":"The same `Idempotency-Key` was already used on this account with a different request body."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"cluster_locked","message":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cluster_locked`: The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`. `site_unavailable`: The site is temporarily not accepting new resources.","x-error-codes":[{"code":"cluster_locked","description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."},{"code":"site_unavailable","description":"The site is temporarily not accepting new resources."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many scale operations on this cluster in the last hour. The error carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many scale operations on this cluster in the last hour. The error carries `retry_after` in seconds."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"quota_unavailable","message":"The resource quota could not be verified. Try again later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`quota_unavailable`: The resource quota could not be verified. Try again later. `provider_unavailable`: The site cannot take new resources right now. Try again later.","x-error-codes":[{"code":"quota_unavailable","description":"The resource quota could not be verified. Try again later."},{"code":"provider_unavailable","description":"The site cannot take new resources right now. Try again later."}]}},"security":[{"bearerAuth":["k8s:scale"]}],"summary":"Change worker count (costs money)","tags":["Kubernetes"],"x-cli":"k8s cluster scale","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/k8s/clusters/<id>/scale\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"worker_count\":5}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"k8s:scale","x-summary-vi":"Đổi số worker (tốn tiền)"}},"/v1/k8s/clusters/{id}/start":{"post":{"description":"Starts a stopped cluster. The call returns `202 Accepted` and an operation starts the nodes in the background; the cluster becomes `active` and `can.kubeconfig` turns true when it is running. Workers of an hourly cluster are billed again once they run; a prepaid cluster simply continues its paid period. The cluster must be `stopped` with no operation in progress; at most 12 start and stop operations per hour are allowed per cluster. Costs nothing by itself. This call works even when the site no longer sells Kubernetes.\n\n**Required scope:** `k8s:write`.","operationId":"k8s_cluster_start","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"cluster":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":false,"kubeconfig":false,"scale":false,"start":false,"stop":false,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":"Stopped","endpoint":"https://203.0.113.10:6443","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","note":"Production workloads","op":{"created_at":1760003700,"finished_at":null,"id":41,"kind":"start","public_error":null,"state":"queued","step":"queued"},"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":"203.0.113.10","ready_at":1760000540,"state":"stopped","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":3,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":0},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"op":{"id":41,"kind":"start","state":"queued"}},"schema":{"properties":{"cluster":{"$ref":"#/components/schemas/K8sCluster"},"op":{"$ref":"#/components/schemas/K8sOpQueued"}},"required":["cluster","op"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"cluster_busy","message":"Another operation is running on the cluster."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cluster_busy`: Another operation is running on the cluster. `cluster_not_running`: The cluster is not `stopped`, so it cannot be started.","x-error-codes":[{"code":"cluster_busy","description":"Another operation is running on the cluster."},{"code":"cluster_not_running","description":"The cluster is not `stopped`, so it cannot be started."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"cluster_locked","message":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`. (`cluster_locked`)","x-error-codes":[{"code":"cluster_locked","description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many start and stop operations on this cluster in the last hour. The error carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many start and stop operations on this cluster in the last hour. The error carries `retry_after` in seconds."}]}},"security":[{"bearerAuth":["k8s:write"]}],"summary":"Start the cluster","tags":["Kubernetes"],"x-cli":"k8s cluster start","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/k8s/clusters/<id>/start\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:write","x-summary-vi":"Bật cụm"}},"/v1/k8s/clusters/{id}/stop":{"post":{"description":"Stops a running cluster: the nodes are shut down, workloads stop and the Kubernetes API becomes unreachable until you start the cluster again. The call returns `202 Accepted` and an operation stops the nodes in the background. Workers of an hourly cluster are not billed while they are stopped; a prepaid period is not refunded by stopping. Disks and the public IP address are kept. A cluster left stopped for a long time (30 days by default) is deleted automatically after warnings by e-mail.\n\nThe cluster must be `active` with no operation in progress; at most 12 start and stop operations per hour are allowed per cluster. This call works even when the site no longer sells Kubernetes.\n\n**Required scope:** `k8s:write`.","operationId":"k8s_cluster_stop","parameters":[{"description":"Cluster identifier (UUID), taken from the `id` field of Create a cluster or List clusters.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"cluster":{"billing":{"auto_renew":true,"cycle":"hourly","cycle_cents":0,"months":0,"paid_until":null,"worker_cycle_cents":0},"can":{"delete":false,"kubeconfig":true,"scale":false,"start":false,"stop":false,"upgrade":false},"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"created_at":1760000000,"cs_state":"Running","endpoint":"https://203.0.113.10:6443","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","lock":null,"name":"prod-cluster","note":"Production workloads","op":{"created_at":1760003700,"finished_at":null,"id":41,"kind":"stop","public_error":null,"state":"queued","step":"queued"},"pricing":{"control_plane_cents":0,"hourly_uusd":67200,"monthly_cents":4906,"worker_hourly_uusd":22400},"public_error":null,"public_ip":"203.0.113.10","ready_at":1760000540,"state":"active","updated_at":1760003600,"version":{"eol_at":null,"id":2,"name":"v1.35.0","semver":"1.35.0"},"workers":{"cpu":4,"custom":false,"desired":3,"disk_gb":70,"observed":3,"plan":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan_code":"K8S-3","ram_mb":8192,"running":3},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"op":{"id":41,"kind":"stop","state":"queued"}},"schema":{"properties":{"cluster":{"$ref":"#/components/schemas/K8sCluster"},"op":{"$ref":"#/components/schemas/K8sOpQueued"}},"required":["cluster","op"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"cluster_busy","message":"Another operation is running on the cluster."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cluster_busy`: Another operation is running on the cluster. `cluster_not_running`: The cluster is not `active`, so it cannot be stopped.","x-error-codes":[{"code":"cluster_busy","description":"Another operation is running on the cluster."},{"code":"cluster_not_running","description":"The cluster is not `active`, so it cannot be stopped."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"cluster_locked","message":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`. (`cluster_locked`)","x-error-codes":[{"code":"cluster_locked","description":"The cluster is locked. The error carries `reason`, `locked_at` and `destroy_after`."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many start and stop operations on this cluster in the last hour. The error carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many start and stop operations on this cluster in the last hour. The error carries `retry_after` in seconds."}]}},"security":[{"bearerAuth":["k8s:write"]}],"summary":"Stop the cluster","tags":["Kubernetes"],"x-cli":"k8s cluster stop","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/k8s/clusters/<id>/stop\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:write","x-summary-vi":"Tắt cụm"}},"/v1/k8s/quote":{"get":{"description":"Prices a cluster and checks whether you could create it right now, without creating anything and without charging. The response gives the price per hour and per month, the amount charged up front for a prepaid cycle, the wallet balance you need (`funds.need_cents`) next to your current balance, and every pre-flight check that [Create a cluster](#operation/k8s_cluster_create) applies: resource quota, cluster count limits, e-mail verification and whether the site takes orders. `can_create` is true only when all of them pass. A failed check does not fail the call: the status stays `200` and the failing item says why. Mistakes in the parameters (unknown plan, worker count out of range) are errors.\n\nAll money is in US cents, except prices per hour, which are in millionths of a US dollar. The control plane is free. When Kubernetes is switched off for the site the call fails with `403 k8s_disabled`.\n\n**Required scope:** `k8s:read`.","operationId":"k8s_quote","parameters":[{"description":"Worker plan code from the catalog, e.g. `K8S-3`.","example":"K8S-3","in":"query","name":"worker_plan","required":true,"schema":{"type":"string"}},{"description":"Number of workers. Must be within `limits.workers_min` and `limits.workers_max` of the catalog.","example":3,"in":"query","name":"worker_count","required":true,"schema":{"type":"integer"}},{"description":"Region to build the cluster in. Defaults to the default region of the site.","in":"query","name":"zone_id","required":false,"schema":{"type":"integer"}},{"description":"Kubernetes version, from List versions. Defaults to the default version.","in":"query","name":"version_id","required":false,"schema":{"type":"integer"}},{"description":"Billing cycle identifier from the catalog: `hourly`, or a prepaid cycle such as `monthly`.","in":"query","name":"cycle","required":false,"schema":{"default":"hourly","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_create":true,"checks":{"clusters":{"max":2,"site_ok":true,"total_ok":true,"used":0},"email_verified":true,"provider_ok":true,"quota":null,"quota_request":{"cpu":14,"disk_gb":280,"ram_mb":26624,"vm":3},"sales_enabled":true},"control_plane":{"count":1,"cpu":2,"free":true,"hourly_uusd":0,"monthly_cents":0,"ram_mb":2048},"funds":{"balance_cents":2500,"enough":true,"first_charge_cents":0,"min_hours":24,"need_cents":162},"pricing":{"control_plane_cents":0,"cycle":"hourly","cycle_cents":0,"cycle_name":"Hourly","discount_pct":0.0,"first_charge_cents":0,"hourly_uusd":67200,"hours_per_month":730,"monthly_cents":4906,"months":0,"worker_cycle_cents":0,"worker_hourly_uusd":22400,"worker_monthly_cents":1635},"version":{"eol_at":null,"id":2,"is_default":true,"min_cpu":2,"min_ram_mb":2048,"name":"v1.35.0","semver":"1.35.0","status":"supported","supports_autoscaling":false,"supports_ha":false,"zone":null},"worker":{"disk_gb":70,"name":"K8S-3 (4 vCPU / 8 GB / 70 GB NVMe)","plan":"K8S-3","ram_gb":8,"ram_mb":8192,"vcpu":4},"worker_count":3,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"schema":{"$ref":"#/components/schemas/K8sQuote"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`worker_plan` or `worker_count` is missing, `worker_count`, `zone_id` or `version_id` is not an integer, or `cycle` is not an available billing cycle. The error carries `field`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: `worker_plan` or `worker_count` is missing, `worker_count`, `zone_id` or `version_id` is not an integer, or `cycle` is not an available billing cycle. The error carries `field`. `worker_custom_removed`: The legacy parameters `vcpu`, `ram_gb` or `disk_gb` were sent. Custom worker sizes are no longer sold; choose a `worker_plan`. `worker_plan_invalid`: `worker_plan` is not a plan on sale, or it is smaller than the chosen version requires (`reason` is then `version_min`, with `min_cpu` and `min_ram_mb`). The error lists the plans on sale in `plans`. `version_unavailable`: `version_id` is not a version that can be ordered in this region. `workers_out_of_range`: `worker_count` is outside the allowed range. The error carries `min` and `max`.","x-error-codes":[{"code":"bad_input","description":"`worker_plan` or `worker_count` is missing, `worker_count`, `zone_id` or `version_id` is not an integer, or `cycle` is not an available billing cycle. The error carries `field`."},{"code":"worker_custom_removed","description":"The legacy parameters `vcpu`, `ram_gb` or `disk_gb` were sent. Custom worker sizes are no longer sold; choose a `worker_plan`."},{"code":"worker_plan_invalid","description":"`worker_plan` is not a plan on sale, or it is smaller than the chosen version requires (`reason` is then `version_min`, with `min_cpu` and `min_ram_mb`). The error lists the plans on sale in `plans`."},{"code":"version_unavailable","description":"`version_id` is not a version that can be ordered in this region."},{"code":"workers_out_of_range","description":"`worker_count` is outside the allowed range. The error carries `min` and `max`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Kubernetes is not sold on this site. (`k8s_disabled`)","x-error-codes":[{"code":"k8s_disabled","description":"Kubernetes is not sold on this site."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"zone_not_k8s","message":"`zone_id` is not a region that offers Kubernetes, or no region is available."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`zone_id` is not a region that offers Kubernetes, or no region is available. (`zone_not_k8s`)","x-error-codes":[{"code":"zone_not_k8s","description":"`zone_id` is not a region that offers Kubernetes, or no region is available."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"cycle_unavailable","message":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. (`cycle_unavailable`)","x-error-codes":[{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["k8s:read"]}],"summary":"Quote a cluster + required balance (no charge)","tags":["Kubernetes"],"x-cli":"k8s quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/quote?worker_plan=<worker_plan>&worker_count=<worker_count>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"k8s:read","x-summary-vi":"Báo giá cụm + số dư cần (không trừ tiền)"}},"/v1/k8s/versions":{"get":{"description":"Lists the Kubernetes versions that can be ordered, one entry per region and version, with the smallest worker size each version accepts. Versions that are disabled, withdrawn or past their end-of-life date are not listed. Use an entry's `id` as `version_id` when creating a cluster, or omit `version_id` to get the default version.\n\nResults are sorted by the order the site chose (default version first) unless you pass `sort`. When Kubernetes is switched off for the site the call fails with `403 k8s_disabled`.\n\n**Required scope:** `catalog:read`.","operationId":"k8s_versions","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. `sort` is the order chosen by the site.","in":"query","name":"sort","required":false,"schema":{"default":"sort","enum":["sort","name","semver","eol_at"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"asc","enum":["asc","desc"],"type":"string"}},{"description":"Only versions offered in this region, taken from the catalog `zones[].id`.","in":"query","name":"zone_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"eol_at":null,"id":2,"is_default":true,"min_cpu":2,"min_ram_mb":2048,"name":"v1.35.0","semver":"1.35.0","status":"supported","supports_autoscaling":false,"supports_ha":false,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/K8sVersion"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page`, `per_page` or `zone_id` is not an integer, `dir` is not `asc` or `desc`, or `sort` is not one of the listed fields."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page`, `per_page` or `zone_id` is not an integer, `dir` is not `asc` or `desc`, or `sort` is not one of the listed fields. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page`, `per_page` or `zone_id` is not an integer, `dir` is not `asc` or `desc`, or `sort` is not one of the listed fields."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Kubernetes is not sold on this site. (`k8s_disabled`)","x-error-codes":[{"code":"k8s_disabled","description":"Kubernetes is not sold on this site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Kubernetes images (sellable versions)","tags":["Kubernetes"],"x-cli":"k8s versions","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/k8s/versions\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Kubernetes Images (version bán được)"}},"/v1/orders":{"get":{"description":"Lists your orders across every service in one place: purchases, renewals, upgrades, add-ons, top-ups, refunds and usage. Orders come from your invoices, from wallet charges that have no invoice, and from metered hourly usage grouped per service and UTC day. Filtering, sorting and paging run on the server over the whole list. Invalid parameters are rejected with 422 and `field` naming the parameter.\n\n**Required scope:** `billing:read`.","operationId":"order_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Orders per page, 1 to 100.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only orders of this product line.","in":"query","name":"service","required":false,"schema":{"enum":["vm","gpu","vpn","proxy6","dedicated","blackfriday","s3","k8s","vpc","volume","backup","images","bandwidth","ai","byoip","llc","wallet","other"],"type":"string"}},{"description":"Only orders of this type.","in":"query","name":"type","required":false,"schema":{"enum":["new","renew","upgrade","addon","topup","refund","usage","manual"],"type":"string"}},{"description":"Only orders with this status.","in":"query","name":"status","required":false,"schema":{"enum":["paid","unpaid","overdue","cancelled","refunded"],"type":"string"}},{"description":"Search text (at most 80 characters), matched against the invoice number, the server identifier and the description.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Only orders created at or after this Unix time (seconds).","in":"query","name":"from","required":false,"schema":{"type":"integer"}},{"description":"Only orders created at or before this Unix time (seconds). Must not be before `from`.","in":"query","name":"to","required":false,"schema":{"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","paid_at","total_cents","service","type","status","number"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"count":1,"created_at":1792390000,"description":"Server web-1, first hour","id":"i311","invoice_id":311,"number":"EX202610-000311","paid_at":1792390000,"service":"vm","source":"invoice","status":"paid","total_cents":250,"type":"new","vm":{"display_name":"web-1","hostname":"web-1","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},{"count":24,"created_at":1792450000,"description":"Usage (24 charges)","id":"u42:volume:2026-10-21","invoice_id":null,"number":null,"paid_at":1792450000,"service":"volume","source":"usage","status":"paid","total_cents":12,"type":"usage","vm":null,"vm_id":null}],"page":1,"per_page":20,"sort":"created_at","total":2},"schema":{"properties":{"dir":{"description":"Sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A parameter is not valid (unknown `service`, `type`, `status` or `sort`, `dir` not asc/desc, `page`/`per_page` out of range, `from` after `to`, `q` too long); `field` names it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A parameter is not valid (unknown `service`, `type`, `status` or `sort`, `dir` not asc/desc, `page`/`per_page` out of range, `from` after `to`, `q` too long); `field` names it. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A parameter is not valid (unknown `service`, `type`, `status` or `sort`, `dir` not asc/desc, `page`/`per_page` out of range, `from` after `to`, `q` too long); `field` names it."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Orders across all services","tags":["Billing"],"x-cli":"order list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/orders\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Đơn hàng mọi dịch vụ"}},"/v1/portal/activity":{"get":{"description":"Returns one timeline of what happened on your account, newest first: server events (create, start, stop, reboot, reinstall, destroy, lock, plan change, renewal), wallet deposits and refunds, important notifications and blocked attacks. Paging is done by the server. Entries carry a translation key in `i18n` and its values in `params` instead of a finished sentence, so render the text on your side.\n\nPages above 100 are rejected. `total`, `pages` and `unread` (unread notifications of the account) describe the filtered result; `group` narrows the timeline to one category.\n\n**Required scope:** `account:read`.","operationId":"account_activity","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Only return one category: server events, billing (wallet, renewals, price changes, balance warnings), security (blocked attacks) or account (support replies, e-mail and password events). An unknown value is ignored.","in":"query","name":"group","required":false,"schema":{"enum":["vm","billing","security","account"],"type":"string"}},{"description":"Only return events of this server (UUID). Wallet entries and notifications are left out when it is set.","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792300000,"items":[{"amount_cents":null,"at":1792290000,"group":"vm","i18n":"act.vm.start","id":"e:5120","invoice_id":null,"level":"info","params":{"hostname":"web-1"},"read_at":null,"source":"vm_event","vm_hostname":"web-1","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"page":1,"pages":1,"per_page":20,"total":1,"unread":0},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/AccountActivityItem"},"type":"array"},"page":{"description":"Current page (1-based).","type":"integer"},"pages":{"description":"Number of pages.","type":"integer"},"per_page":{"description":"Page size applied (clamped to 100).","type":"integer"},"total":{"description":"Total number of entries matching the filters.","type":"integer"},"unread":{"description":"Number of unread notifications of the account.","type":"integer"}},"required":["items","total","page","per_page","pages","unread","at"],"type":"object","x-order":["items","total","page","per_page","pages","unread","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`page` is above 100. The response includes `field` (`page`) and `max` (100)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page` is above 100. The response includes `field` (`page`) and `max` (100). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`page` is above 100. The response includes `field` (`page`) and `max` (100)."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"Account activity timeline (paged)","tags":["Account"],"x-cli":"account activity","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/activity\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Dòng thời gian hoạt động của tài khoản (phân trang)"}},"/v1/portal/ai-analyses":{"get":{"description":"Returns the latest automatic analyses of attacks against your IP addresses: what the attack looked like, the verdict, a confidence figure and a short summary. Only analyses of addresses that belong to you are returned. The list is empty when you have no server with an IP address or nothing has been analysed yet.\n\nThis call needs the scope `shield:read` (the DDoS Shield scope), not `account:read`. It is rate limited to 20 requests per minute per account.\n\n**Required scope:** `shield:read`.","operationId":"account_ai_analyses","parameters":[{"description":"Number of analyses to return, 1 to 20 (values outside the range are clamped).","in":"query","name":"limit","required":false,"schema":{"default":5,"maximum":20,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792300000,"items":[{"at":1792250000,"confidence":0.93,"event_id":"ev-20261017-0412","evidence":["Sharp rise in SYN packets without matching ACKs","Many sources from one network range"],"id":"ai-7f3a91c2","ip":"203.0.113.10","kind":"syn_flood","severity":"medium","summary":"SYN flood against port 443 lasting about 6 minutes; filtered at the edge.","verdict":"attack"}]},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"items":{"items":{"properties":{"at":{"description":"When the analysis was produced (Unix time, seconds, UTC)","type":"integer"},"confidence":{"description":"Confidence of the verdict, from 0 to 1.","type":["number","null"]},"event_id":{"description":"Identifier of the attack event the analysis belongs to.","type":["string","null"]},"evidence":{"description":"Up to 3 lines of supporting evidence.","items":{"description":"One line of evidence.","type":"string"},"type":"array"},"id":{"description":"Analysis identifier.","type":"string"},"ip":{"description":"The IP address of yours that was attacked.","type":"string"},"kind":{"description":"Type of attack, for example `syn_flood` or `udp_flood`.","type":["string","null"]},"severity":{"description":"Severity, for example `low`, `medium` or `high`.","type":["string","null"]},"summary":{"description":"Short human-readable summary.","type":"string"},"verdict":{"description":"Outcome of the analysis, for example `attack` or `false_positive`.","type":["string","null"]}},"required":["id","at","ip","event_id","verdict","confidence","kind","severity","summary","evidence"],"type":"object","x-order":["id","at","ip","event_id","verdict","confidence","kind","severity","summary","evidence"]},"type":"array"}},"required":["items","at"],"type":"object","x-order":["items","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"AI analyses of attacks on your IPs","tags":["Account"],"x-cli":"account ai-analyses","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/ai-analyses\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Phân tích AI các đợt tấn công vào IP của bạn"}},"/v1/portal/ai-analyses/{id}":{"get":{"description":"Returns ONE automatic analysis of an attack on your IP addresses in full: the verdict, confidence, the complete conclusion, up to 8 lines of evidence and the recommended actions, if any. Text is plain text, never HTML. Internal and private addresses, and addresses protected for other customers, are replaced with `x.x.x.x`.\n\n`reanalysis` tells whether you may ask for a fresh analysis of the same address right now (see `POST /v1/portal/ai-analyses/{id}/reanalyze`) and, after you did, whether the new one is `queued`, `done` (its id is `task_id`) or `error`.\n\nThis call needs the scope `shield:read`. It is rate limited to 60 requests per minute per account.\n\n**Required scope:** `shield:read`.","operationId":"account_ai_analysis","parameters":[{"description":"Analysis identifier, as returned by the analysis list or in `params.task_id` of an activity entry.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792300000,"item":{"actions":[{"reason":"All attacking sources are in this range","type":"block","value":"198.51.100.0/24"}],"at":1792250000,"confidence":0.93,"event_id":"ev-20261017-0412","evidence":["Sharp rise in SYN packets without matching ACKs","Many sources from one network range"],"id":"t-1792250000-a1b2c3","ip":"203.0.113.10","kind":"SYN flood on tcp/443","own":false,"severity":"medium","summary":"SYN flood against port 443 lasting about 6 minutes from many sources of one network range; filtered at the edge, no impact on the service.","verdict":"attack"},"reanalysis":{"allowed":true,"quota":{"account_max":10,"account_used":0,"ip_max":3,"ip_used":0},"request_id":null,"retry_after_secs":0,"status":"idle","task_id":null}},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"item":{"properties":{"actions":{"description":"Recommended actions. They are advice only; nothing is applied by reading this.","items":{"properties":{"reason":{"description":"Why the action is recommended.","type":"string"},"type":{"description":"Kind of action, for example `block`.","type":"string"},"value":{"description":"What to apply it to, for example an attacking address.","type":"string"}},"required":["type","value","reason"],"type":"object","x-order":["type","value","reason"]},"type":"array"},"at":{"description":"When the analysis was produced (Unix time, seconds, UTC)","type":"integer"},"confidence":{"description":"Confidence of the verdict, from 0 to 1.","type":["number","null"]},"event_id":{"description":"Identifier of the attack event the analysis belongs to.","type":["string","null"]},"evidence":{"description":"Up to 8 lines of supporting evidence.","items":{"description":"One line of evidence.","type":"string"},"type":"array"},"id":{"description":"Analysis identifier.","type":"string"},"ip":{"description":"The IP address of yours that was analysed.","type":"string"},"kind":{"description":"Type of attack in a few words.","type":["string","null"]},"own":{"description":"True when this analysis was produced because you asked for it.","type":"boolean"},"severity":{"description":"Severity, for example `low`, `medium` or `high`.","type":["string","null"]},"summary":{"description":"The full conclusion, plain text.","type":"string"},"verdict":{"description":"Outcome: `attack`, `suspicious` or `normal`.","type":["string","null"]}},"required":["id","at","ip","event_id","verdict","confidence","kind","severity","summary","evidence","actions","own"],"type":"object","x-order":["id","at","ip","event_id","verdict","confidence","kind","severity","summary","evidence","actions","own"]},"reanalysis":{"properties":{"allowed":{"description":"Whether a new analysis can be requested right now.","type":"boolean"},"quota":{"properties":{"account_max":{"description":"Daily limit per account.","type":"integer"},"account_used":{"description":"Requests you made today (UTC) in total.","type":"integer"},"ip_max":{"description":"Daily limit per address.","type":"integer"},"ip_used":{"description":"Requests you made today (UTC) for this address.","type":"integer"}},"required":["ip_used","ip_max","account_used","account_max"],"type":"object","x-order":["ip_used","ip_max","account_used","account_max"]},"request_id":{"description":"Id of the pending request when `status` is `queued`.","type":["string","null"]},"retry_after_secs":{"description":"Seconds before you may ask again for this address, 0 when you may.","type":"integer"},"status":{"description":"`idle`, `queued` (waiting for the result), `done` (a newer analysis exists, see `task_id`) or `error` (the last request failed).","type":"string"},"task_id":{"description":"Id of the newer analysis when `status` is `done`.","type":["string","null"]}},"required":["status","task_id","request_id","retry_after_secs","allowed","quota"],"type":"object","x-order":["status","task_id","request_id","retry_after_secs","allowed","quota"]}},"required":["item","reanalysis","at"],"type":"object","x-order":["item","reanalysis","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"One AI analysis in full (conclusion, evidence, recommended actions)","tags":["Account"],"x-cli":"account ai-analysis","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/ai-analyses/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Chi tiết một tin AI phân tích (kết luận đầy đủ, bằng chứng, hành động khuyến nghị)"}},"/v1/portal/ai-analyses/{id}/reanalyze":{"post":{"description":"Asks the AI for a fresh analysis of the address (and attack event) that analysis `{id}` is about. The request is queued and takes a minute or two; poll `GET /v1/portal/ai-analyses/{id}` and read `reanalysis.status` until it is `done`, then open the analysis named by `reanalysis.task_id`.\n\nOnly addresses that belong to you can be analysed (`404 not_found` otherwise, indistinguishable from an unknown id). Limits: one request per address every 10 minutes, no new request while one is waiting, and 3 requests per address and 10 per account per UTC day. A refused request returns `429 rate_limited`; the `error` object also carries `retry_after_secs`, `reason` (`cooldown`, `pending` or `daily_quota`) and `quota`.\n\nThis call needs the scope `shield:write`. It sends no body.\n\n**Required scope:** `shield:write`.","operationId":"account_ai_reanalyze","parameters":[{"description":"Identifier of the analysis to repeat.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"reanalysis":{"allowed":false,"quota":{"account_max":10,"account_used":1,"ip_max":3,"ip_used":1},"request_id":"q-1792300000-a1b2c3","retry_after_secs":600,"status":"queued","task_id":null},"request_id":"q-1792300000-a1b2c3","retry_after_secs":600},"schema":{"properties":{"ok":{"description":"Always true when the request was queued.","type":"boolean"},"reanalysis":{"properties":{"allowed":{"description":"Whether a new analysis can be requested right now (false right after the call).","type":"boolean"},"quota":{"properties":{"account_max":{"description":"Daily limit per account.","type":"integer"},"account_used":{"description":"Requests you made today (UTC) in total.","type":"integer"},"ip_max":{"description":"Daily limit per address.","type":"integer"},"ip_used":{"description":"Requests you made today (UTC) for this address.","type":"integer"}},"required":["ip_used","ip_max","account_used","account_max"],"type":"object","x-order":["ip_used","ip_max","account_used","account_max"]},"request_id":{"description":"Identifier of the pending request.","type":["string","null"]},"retry_after_secs":{"description":"Seconds before you may ask again for this address.","type":"integer"},"status":{"description":"`queued` right after the call.","type":"string"},"task_id":{"description":"Always null right after the call.","type":["string","null"]}},"required":["status","task_id","request_id","retry_after_secs","allowed","quota"],"type":"object","x-order":["status","task_id","request_id","retry_after_secs","allowed","quota"]},"request_id":{"description":"Identifier of the queued request.","type":"string"},"retry_after_secs":{"description":"Seconds until you may ask again for this address.","type":"integer"}},"required":["ok","request_id","retry_after_secs","reanalysis"],"type":"object","x-order":["ok","request_id","retry_after_secs","reanalysis"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too soon after the previous request for this address, a request is still waiting, or today's limit is used up. See `retry_after_secs` and `reason`. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too soon after the previous request for this address, a request is still waiting, or today's limit is used up. See `retry_after_secs` and `reason`."}]}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Ask the AI to analyse this IP again (10 min per IP, daily quota)","tags":["Account"],"x-cli":"account ai-reanalyze","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/portal/ai-analyses/<id>/reanalyze\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Nhờ AI phân tích lại IP của tin này (hãm 10 phút/IP, hạn mức ngày)"}},"/v1/portal/bandwidth":{"get":{"description":"Returns the traffic of all your servers and VPN addresses added together: live rates, a time series of the chosen range, the attacks seen in that range and totals. With `live=1` only the `live` block is returned, which is cheap enough to poll every 5 seconds. Rates are bits per second and packets per second; `live` values are averaged over the last minute, so they do not flicker to zero between samples.\n\nThis call is rate limited per account: 10 full requests or 30 `live=1` requests per minute, then `429 rate_limited`.\n\n**Required scope:** `account:read`.","operationId":"account_bandwidth","parameters":[{"description":"Time range of `series`, `attacks` and `totals`. An unknown value falls back to `24h`. Buckets are 1 minute for `1h`, 1 hour for `6h`, `12h`, `24h` and `7d`, and 1 day for `30d`.","in":"query","name":"range","required":false,"schema":{"default":"24h","enum":["1h","6h","12h","24h","7d","30d"],"type":"string"}},{"description":"Set to `1` to return only the `live` block (and `at`).","example":1,"in":"query","name":"live","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792300000,"attacks":[],"bucket_secs":3600,"from":1792213600,"live":{"attack_ips":0,"by_ip":{"203.0.113.10":{"attack":false,"in_bps":5200.0,"in_pps":9.5,"out_bps":8100.0,"out_pps":11.0}},"has_any":true,"in_bps":5200.0,"in_pps":9.5,"ips":1,"out_bps":8100.0,"out_pps":11.0,"vms":[{"attack":false,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in_bps":5200.0,"in_pps":9.5,"out_bps":8100.0,"out_pps":11.0}]},"port_speed":"10 Gbps","range":"24h","series":[{"bytes_in":2160000,"bytes_out":3420000,"in_bps":4800.0,"out_bps":7600.0,"t":1792292400}],"source":"edge_counter","to":1792300000,"totals":{"bytes_in":2160000,"bytes_out":3420000,"peak_in_bps":4800.0,"peak_out_bps":7600.0}},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"attacks":{"description":"Attacks against your addresses in the range. Absent with `live=1`.","items":{"properties":{"ended":{"description":"When it ended, `null` while it is still going on (Unix time, seconds, UTC)","type":["integer","null"]},"ips":{"description":"Number of addresses involved (1 per entry).","type":"integer"},"peak_pps":{"description":"Peak packets per second, `null` if not measured.","type":["integer","null"]},"severity":{"description":"Attack severity, for example `low`, `medium` or `high`.","type":"string"},"t":{"description":"When the attack started (Unix time, seconds, UTC)","type":"integer"}},"required":["t","ended","severity","ips","peak_pps"],"type":"object","x-order":["t","ended","severity","ips","peak_pps"]},"type":"array"},"bucket_secs":{"description":"Length of one `series` bucket in seconds. Absent with `live=1`.","type":"integer"},"from":{"description":"Start of the range. Absent with `live=1` (Unix time, seconds, UTC)","type":"integer"},"live":{"properties":{"attack_ips":{"description":"How many of those IP addresses are under an attack right now.","type":"integer"},"by_ip":{"additionalProperties":{"properties":{"attack":{"description":"Whether this address is under attack right now.","type":"boolean"},"in_bps":{"description":"Inbound bits per second.","type":"number"},"in_pps":{"description":"Inbound packets per second.","type":"number"},"out_bps":{"description":"Outbound bits per second.","type":"number"},"out_pps":{"description":"Outbound packets per second.","type":"number"}},"required":["in_bps","out_bps","in_pps","out_pps","attack"],"type":"object","x-order":["in_bps","out_bps","in_pps","out_pps","attack"]},"description":"The same rates for every IP address you own (servers and VPN), keyed by address.","type":"object"},"has_any":{"description":"Whether there is anything to measure (at least one server or active VPN address).","type":"boolean"},"in_bps":{"description":"Inbound traffic of all your servers and VPN addresses, in bits per second (average of the last minute).","type":"number"},"in_pps":{"description":"Inbound packets per second.","type":"number"},"ips":{"description":"Number of IP addresses measured.","type":"integer"},"out_bps":{"description":"Outbound traffic, in bits per second.","type":"number"},"out_pps":{"description":"Outbound packets per second.","type":"number"},"vms":{"description":"Per-server rates. Servers with no measurement yet are left out.","items":{"properties":{"attack":{"description":"Whether the server's IP address is under attack right now.","type":"boolean"},"id":{"description":"Server UUID.","type":"string"},"in_bps":{"description":"Inbound bits per second.","type":"number"},"in_pps":{"description":"Inbound packets per second.","type":"number"},"out_bps":{"description":"Outbound bits per second.","type":"number"},"out_pps":{"description":"Outbound packets per second.","type":"number"}},"required":["id","in_bps","out_bps","in_pps","out_pps","attack"],"type":"object","x-order":["id","in_bps","out_bps","in_pps","out_pps","attack"]},"type":"array"}},"required":["in_bps","out_bps","in_pps","out_pps","ips","attack_ips","vms","has_any","by_ip"],"type":"object","x-order":["in_bps","out_bps","in_pps","out_pps","ips","attack_ips","vms","has_any","by_ip"]},"port_speed":{"description":"Port speed of the site, for example `10 Gbps`. Absent with `live=1`.","type":"string"},"range":{"description":"Range applied. Absent with `live=1`.","enum":["1h","6h","12h","24h","7d","30d"],"type":"string"},"series":{"description":"Traffic over time, only buckets that have data. Absent with `live=1`.","items":{"properties":{"bytes_in":{"description":"Bytes received in the bucket.","type":"integer"},"bytes_out":{"description":"Bytes sent in the bucket.","type":"integer"},"in_bps":{"description":"Average inbound bits per second in the bucket.","type":"number"},"out_bps":{"description":"Average outbound bits per second in the bucket.","type":"number"},"t":{"description":"Start of the bucket (Unix time, seconds, UTC)","type":"integer"}},"required":["t","in_bps","out_bps","bytes_in","bytes_out"],"type":"object","x-order":["t","in_bps","out_bps","bytes_in","bytes_out"]},"type":"array"},"source":{"description":"Where the figures come from (`edge_counter`). Absent with `live=1`.","type":"string"},"to":{"description":"End of the range. Absent with `live=1` (Unix time, seconds, UTC)","type":"integer"},"totals":{"properties":{"bytes_in":{"description":"Total bytes received in the range.","type":"integer"},"bytes_out":{"description":"Total bytes sent in the range.","type":"integer"},"peak_in_bps":{"description":"Highest inbound bits per second of any bucket.","type":"number"},"peak_out_bps":{"description":"Highest outbound bits per second of any bucket.","type":"number"}},"required":["bytes_in","bytes_out","peak_in_bps","peak_out_bps"],"type":"object"}},"required":["at","live"],"type":"object","x-order":["at","live","range","bucket_secs","from","to","series","attacks","totals","port_speed","source"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"Bandwidth used by the account","tags":["Account"],"x-cli":"account bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Băng thông đã dùng của tài khoản"}},"/v1/portal/bootstrap":{"get":{"description":"Returns, in ONE call, the data an app needs when it opens: the profile, the catalog rules and prices, notifications, how many services of each kind the account has and, optionally, the dashboard overview. Instead of 15 or more separate requests you make one.\n\nEvery entry of `parts` is **exactly the body** of the call named in the table below, so you can reuse the same parsing code. Each part is checked on its own with the rules of that call: a part you may not read with your API key (the call is not public, or the key lacks its scope) is simply **absent**, as is a service that is switched off for the site. A part that fails on the server does not fail the response; it is listed in `errors` with its HTTP status and error code and the other parts are still returned. Only the data of your own account is ever returned.\n\n| Part | Same as | Group |\n|---|---|---|\n| `me` | `GET /v1/portal/me` | `shell` |\n| `catalog_lite` | `GET /v1/vm/catalog?view=shell` (the rules and feature flags only: `cycles`, `settings`, `account`) | `shell` |\n| `catalog` | `GET /v1/vm/catalog` (every plan, operating system and region — about 340 KB, so it is only returned when you ask for it) | `catalog` |\n| `prices` | `GET /v1/vm/prices` | `shell` |\n| `notifications` | `GET /v1/billing/notifications` | `shell` |\n| `promos` | `GET /v1/portal/promos` (dashboard only) | `shell` |\n| `nav_counts` | `GET /v1/portal/nav-counts` (how many services of each kind; used for the menu badges) | `shell` |\n| `vm`, `gpu`, `s3`, `vpn`, `k8s`, `dedicated`, `ai_keys` | the first page of the matching service list, exactly as that service's own list call returns it (used for the counters). A service that is switched off for the site is absent. | `shell` |\n| `overview` | `GET /v1/portal/overview` | `dashboard` |\n| `bandwidth_live` | `GET /v1/portal/bandwidth?live=1` | `dashboard` |\n| `bandwidth_range` | `GET /v1/portal/bandwidth?range=<bw_range>` | `dashboard` |\n| `activity` | `GET /v1/portal/activity?page=1&per_page=8` | `dashboard` |\n| `ai_analyses` | `GET /v1/portal/ai-analyses?limit=5` | `dashboard` |\n\nThe time each part took is in the `Server-Timing` response header. With an API key every part counts as one request for the rate limit.\n\n**Required scope:** `account:read`.","operationId":"account_bootstrap","parameters":[{"description":"Comma-separated groups of parts to return: `shell` (default), `dashboard` and/or `catalog` (the full catalog of plans, operating systems and regions). An unknown group is rejected with `400`.","example":"shell,dashboard","in":"query","name":"include","required":false,"schema":{"type":"string"}},{"description":"Range of the `bandwidth_range` part (default `24h`).","in":"query","name":"bw_range","required":false,"schema":{"enum":["1h","6h","12h","24h","7d","30d"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792300000,"errors":{},"parts":{"gpu":{"items":[],"total":0},"vm":{"counts":{"all":0},"items":[],"page":1,"per_page":1,"total":0}}},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"errors":{"additionalProperties":{"properties":{"code":{"description":"Error code of the part, for example `internal` or `timeout`.","type":"string"},"status":{"description":"HTTP status the part failed with.","type":"integer"}},"required":["status","code"],"type":"object","x-order":["status","code"]},"description":"Parts that failed on the server, by name. Empty when everything succeeded.","type":"object"},"parts":{"additionalProperties":true,"description":"Map of part name to the body of the matching call. Parts you may not read, or that do not exist on this site, are absent.","type":"object"}},"required":["at","parts","errors"],"type":"object","x-order":["at","parts","errors"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"One call for profile, catalog, notifications, service counts and overview (each part follows the key's own scopes)","tags":["Account"],"x-cli":"account bootstrap","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/bootstrap\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Gộp một lần: hồ sơ, danh mục, thông báo, số dịch vụ và tổng quan (mỗi phần theo quyền của khoá)"}},"/v1/portal/me":{"get":{"description":"Returns the profile of the account the API key belongs to: identity, status, preferred language and display currency, whether a password is set, and the DDoS protection workspace. It is read-only; changing the profile, password, e-mail or two-factor settings is only possible from the dashboard.\n\n**Required scope:** `account:read`.","operationId":"account_get","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"account":{"blocked_reason":null,"created_at":1786000000,"currency":"auto","email":"alex@example.com","email_verified_at":1786000600,"has_password":true,"id":1042,"lang":"en","last_login":1792200000,"name":"Alex Nguyen","status":"active","tenant":{"id":"acc-4f9c2a1b","name":"Alex Nguyen","status":"active","targets":2}}},"schema":{"properties":{"account":{"$ref":"#/components/schemas/AccountProfile"}},"required":["account"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"Account profile (read-only)","tags":["Account"],"x-cli":"account get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/me\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Hồ sơ tài khoản (chỉ đọc)"}},"/v1/portal/nav-counts":{"get":{"description":"Returns how many services of each kind the account has right now, in one call. The dashboard uses it for the small number next to each menu item. A number is what the matching list page would show by default: deleted, cancelled, expired and hidden items are not counted (a VPN or IPv6 proxy plan counts while it is pending or active and not past its end date; a bandwidth add-on while it is paid or granted and its period has not ended).\n\n`s3` and `dedicated` are only present on the operator's own site. `snapshots` is `null` when the infrastructure could not be read in time (do not treat it as zero). `ddos` is the number of distinct public IPs the DDoS shield lists for you: servers, rented bare-metal machines and active VPN addresses. Only your own account is counted.\n\n**Required scope:** `account:read`.","operationId":"account_service_counts","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"at":1792300000,"counts":{"autoscale":0,"backup_schedules":1,"backups":2,"bandwidth":0,"byoip":0,"ddos":2,"dedicated":0,"gpu":0,"iso_images":0,"k8s":0,"os_images":0,"proxy6":0,"s3":1,"snapshot_schedules":1,"snapshots":4,"ssh_keys":1,"tickets_answered":0,"vm":2,"volumes":3,"vpc":0,"vpn":1}},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"counts":{"properties":{"autoscale":{"description":"Servers with an auto-scaling rule set up.","type":"integer"},"backup_schedules":{"description":"Backup schedules of your servers.","type":"integer"},"backups":{"description":"Backups of your servers.","type":"integer"},"bandwidth":{"description":"Bandwidth add-ons whose period has not ended.","type":"integer"},"byoip":{"description":"Bring-your-own-IP ranges that are still held (pending, active or suspended).","type":"integer"},"ddos":{"description":"Public IPs listed by the DDoS shield.","type":"integer"},"dedicated":{"description":"Bare-metal servers you rent. Operator's own site only.","type":"integer"},"gpu":{"description":"GPU instances (not deleted).","type":"integer"},"iso_images":{"description":"Your own ISO images.","type":"integer"},"k8s":{"description":"Managed container clusters (not deleted).","type":"integer"},"os_images":{"description":"Your own OS images.","type":"integer"},"proxy6":{"description":"IPv6 proxy plans that are pending or active.","type":"integer"},"s3":{"description":"S3 accounts. Operator's own site only.","type":"integer"},"snapshot_schedules":{"description":"Snapshot schedules of your servers.","type":"integer"},"snapshots":{"description":"VM snapshots; `null` when they could not be read.","type":["integer","null"]},"ssh_keys":{"description":"SSH keys.","type":"integer"},"tickets_answered":{"description":"Support tickets that staff has answered and you have not replied to or closed yet.","type":"integer"},"vm":{"description":"Virtual machines (not deleted).","type":"integer"},"volumes":{"description":"Block-storage volumes.","type":"integer"},"vpc":{"description":"Private cloud networks (not deleted).","type":"integer"},"vpn":{"description":"VPN plans that are pending or active.","type":"integer"}},"required":["vm","gpu","k8s","vpc","autoscale","ssh_keys","volumes","snapshots","snapshot_schedules","backups","backup_schedules","os_images","iso_images","byoip","bandwidth","ddos","vpn","proxy6","tickets_answered","s3","dedicated"],"type":"object","x-order":["vm","gpu","k8s","vpc","autoscale","ssh_keys","volumes","snapshots","snapshot_schedules","backups","backup_schedules","os_images","iso_images","byoip","bandwidth","ddos","vpn","proxy6","tickets_answered","s3","dedicated"]}},"required":["at","counts"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"How many services of each kind the account has (VMs, GPU, volumes, snapshots, backups, VPN…) — for menu badges","tags":["Account"],"x-cli":"account service counts","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/nav-counts\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Số dịch vụ của tài khoản theo từng loại (máy ảo, GPU, volume, snapshot, backup, VPN…) — dùng cho huy hiệu menu"}},"/v1/portal/overview":{"get":{"description":"Returns everything the dashboard home page shows, in one call: the wallet balance, how long it will last at the current spend (`runway`), spend this month with a forecast, your servers, a getting-started checklist, the current announcement and the number of attacks blocked in the last 7 days. Money is in US cents unless a field name says otherwise (`*_uusd` is millionths of a dollar).\n\nOnly the 6 most urgent servers are included (`vms.shown` of `vms.total`): servers being built first, then locked or failed ones, then busy ones, then the newest; use the VM list call for all of them. `runway` is `null` when nothing is billed by the hour or due for renewal.\n\n**Required scope:** `account:read`.","operationId":"account_overview","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"account":{"currency":"auto","email_verified":true,"lang":"en","name":"Alex Nguyen","site":"master"},"announcement":null,"at":1792300000,"balance_cents":1850,"checklist":{"complete":false,"done":3,"items":[{"done":true,"key":"create_vm"},{"done":true,"key":"ssh_key"},{"done":true,"key":"topup"},{"done":false,"key":"autotopup"},{"done":false,"key":"verify_email"}],"total":5},"fx":{"margin_bp":40,"round_step":1000,"source":"bank","stale":false,"updated_at":1792290000,"usd_vnd":26200,"vcb_at":1792290000,"vcb_sell":26100},"greeting":"morning","region":{"code":"HCM","i18n":"region.HCM","status":"ok"},"runway":{"autotopup_enabled":false,"burn_cents_per_day":11,"burn_cents_per_month":343,"burn_uusd_per_hour":4704,"days":168.1,"hours":4034,"hours_per_month":730,"low":false,"low_threshold_days":3.0,"renewals_cents_window":0,"vms_charged":1},"shield":{"attacks_7d":0,"enabled":true,"protected_ips":1},"spend":{"forecast_cents":350,"forecast_parts":{"burn_cents":152,"renewals_cents":0,"spent_cents":198},"hours_left":324,"month_end":1793466000,"month_start":1790787600,"sparkline":[{"cents":11,"d":"2026-10-01","t":1790787600},{"cents":11,"d":"2026-10-02","t":1790874000}],"spent_cents":198},"tz_offset_secs":25200,"vms":{"counts":{"active":1,"locked":0,"provisioning":0,"running":1,"stopped":0},"items":[{"autoscale_enabled":false,"autoscale_state":null,"autoscale_target_cpu":null,"autoscale_target_ram_mb":null,"bw":{"in_bps":5200.0,"out_bps":8100.0},"charged_hourly":true,"cpu":2,"created_at":1790000000,"cycle":"hourly","disk_gb":60,"display_name":null,"hostname":"web-1","hourly_uusd":4704,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ip":"203.0.113.10","locked":false,"metrics":{"at":1792299990,"cpu_pct":12.5,"ram_pct":41.0},"monthly_cents":343,"os_family":"ubuntu","os_label":"Ubuntu 24.04 LTS","paid_until":null,"power":"running","progress":null,"ram_mb":4096,"state":"active"}],"limit":6,"shown":1,"total":1}},"schema":{"properties":{"account":{"properties":{"currency":{"description":"Display currency preference: `auto`, `usd` or `vnd`.","type":"string"},"email_verified":{"description":"Whether the e-mail address is verified.","type":"boolean"},"lang":{"description":"Preferred language code.","type":"string"},"name":{"description":"Display name.","type":"string"},"site":{"description":"`master` on the operator's own site, `reseller` on a partner-run site.","enum":["master","reseller"],"type":"string"}},"required":["name","email_verified","lang","currency","site"],"type":"object","x-order":["name","email_verified","lang","currency","site"]},"announcement":{"properties":{"body":{"description":"Text in your language.","type":"string"},"ends_at":{"description":"When it stops being visible, `null` for no end (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Announcement identifier.","type":"integer"},"level":{"description":"Severity.","enum":["info","warn"],"type":"string"},"scope":{"description":"Whether it was published for every site or only yours.","enum":["all_sites","site"],"type":"string"},"starts_at":{"description":"When it becomes visible, `null` for immediately (Unix time, seconds, UTC)","type":["integer","null"]},"title":{"description":"Title in your language.","type":"string"},"updated_at":{"description":"When it was last changed (Unix time, seconds, UTC)","type":"integer"}},"required":["id","level","title","body","starts_at","ends_at","scope","updated_at"],"type":["object","null"],"x-order":["id","level","title","body","starts_at","ends_at","scope","updated_at"]},"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"balance_cents":{"description":"Wallet balance in US cents. Negative when the account is in debt.","type":"integer"},"checklist":{"properties":{"complete":{"description":"Whether every step is done.","type":"boolean"},"done":{"description":"Steps completed.","type":"integer"},"items":{"items":{"properties":{"done":{"description":"Whether the step is done.","type":"boolean"},"key":{"description":"Step: create a server, add an SSH key, top up the wallet, turn on automatic top-up, verify the e-mail.","enum":["create_vm","ssh_key","topup","autotopup","verify_email"],"type":"string"}},"required":["key","done"],"type":"object","x-order":["key","done"]},"type":"array"},"total":{"description":"Number of steps.","type":"integer"}},"required":["done","total","complete","items"],"type":"object","x-order":["done","total","complete","items"]},"fx":{"properties":{"margin_bp":{"description":"Margin added to the bank rate, in basis points.","type":"integer"},"round_step":{"description":"Dong amounts are rounded to this step.","type":"integer"},"source":{"description":"Where the rate comes from.","type":"string"},"stale":{"description":"Whether the rate is out of date.","type":"boolean"},"updated_at":{"description":"When the displayed rate was last updated (Unix time).","type":"integer"},"usd_vnd":{"description":"Dong per US dollar used to display dong prices, 0 if unset.","type":"integer"},"vcb_at":{"description":"When that bank rate was published (Unix time), 0 if unknown.","type":"integer"},"vcb_sell":{"description":"Bank selling rate the price is based on, 0 if unknown.","type":"integer"}},"required":["usd_vnd","source","vcb_sell","vcb_at","updated_at","margin_bp","stale","round_step"],"type":"object","x-order":["usd_vnd","source","vcb_sell","vcb_at","updated_at","margin_bp","stale","round_step"]},"greeting":{"description":"Part of the day in the billing time zone (UTC+7), for a greeting.","enum":["morning","afternoon","evening","night"],"type":"string"},"region":{"properties":{"code":{"description":"Region code.","type":"string"},"i18n":{"description":"Translation key of the region name.","type":"string"},"status":{"description":"Region status.","enum":["ok","degraded","maintenance"],"type":"string"}},"required":["code","i18n","status"],"type":"object"},"runway":{"properties":{"autotopup_enabled":{"description":"Whether automatic top-up is on for the account.","type":"boolean"},"burn_cents_per_day":{"description":"The same per day, in US cents.","type":"integer"},"burn_cents_per_month":{"description":"The same per billing month, in US cents.","type":"integer"},"burn_uusd_per_hour":{"description":"What running servers cost now, in millionths of a dollar per hour.","type":"integer"},"days":{"description":"How many days the balance lasts at the current spend, including those renewals. Capped at 3650.","type":"number"},"hours":{"description":"The same in hours.","type":"integer"},"hours_per_month":{"description":"Hours in a billing month used for the monthly figure (730 by default).","type":"integer"},"low":{"description":"Whether `days` is below `low_threshold_days`.","type":"boolean"},"low_threshold_days":{"description":"Threshold for a low-balance warning, in days.","type":"number"},"renewals_cents_window":{"description":"Prepaid renewals due in the next 30 days that the wallet must also cover, in US cents.","type":"integer"},"vms_charged":{"description":"Number of servers billed by the hour that are running.","type":"integer"}},"required":["burn_uusd_per_hour","burn_cents_per_day","burn_cents_per_month","hours_per_month","vms_charged","renewals_cents_window","days","hours","low","low_threshold_days","autotopup_enabled"],"type":["object","null"],"x-order":["burn_uusd_per_hour","burn_cents_per_day","burn_cents_per_month","hours_per_month","vms_charged","renewals_cents_window","days","hours","low","low_threshold_days","autotopup_enabled"]},"shield":{"properties":{"attacks_7d":{"description":"Attacks against your IP addresses in the last 7 days.","type":"integer"},"enabled":{"description":"Always `true`.","type":"boolean"},"protected_ips":{"description":"Number of your IP addresses under protection.","type":"integer"}},"required":["attacks_7d","protected_ips","enabled"],"type":"object","x-order":["attacks_7d","protected_ips","enabled"]},"spend":{"properties":{"forecast_cents":{"description":"Expected total for the month in US cents: spent so far plus the running servers for the rest of the month plus renewals due.","type":"integer"},"forecast_parts":{"properties":{"burn_cents":{"description":"Expected cost of running servers for the rest of the month.","type":"integer"},"renewals_cents":{"description":"Prepaid renewals due before the month ends.","type":"integer"},"spent_cents":{"description":"Spent so far.","type":"integer"}},"required":["spent_cents","burn_cents","renewals_cents"],"type":"object","x-order":["spent_cents","burn_cents","renewals_cents"]},"hours_left":{"description":"Hours remaining in the month.","type":"integer"},"month_end":{"description":"Start of the next billing month (Unix time, seconds, UTC)","type":"integer"},"month_start":{"description":"Start of the current billing month (Unix time, seconds, UTC)","type":"integer"},"sparkline":{"description":"Spend per day since the start of the month.","items":{"properties":{"cents":{"description":"Spent that day in US cents.","type":"integer"},"d":{"description":"Day, `YYYY-MM-DD` in the billing time zone.","type":"string"},"t":{"description":"Start of that day (Unix time, seconds, UTC)","type":"integer"}},"required":["d","t","cents"],"type":"object","x-order":["d","t","cents"]},"type":"array"},"spent_cents":{"description":"Spent so far this month in US cents (charges minus refunds).","type":"integer"}},"required":["month_start","month_end","hours_left","spent_cents","forecast_cents","forecast_parts","sparkline"],"type":"object","x-order":["month_start","month_end","hours_left","spent_cents","forecast_cents","forecast_parts","sparkline"]},"tz_offset_secs":{"description":"Offset of the billing time zone from UTC, in seconds (25200). Month boundaries in this response follow it.","type":"integer"},"vms":{"properties":{"counts":{"properties":{"active":{"description":"Servers in the `active` state.","type":"integer"},"locked":{"description":"Locked servers.","type":"integer"},"provisioning":{"description":"Servers still being created.","type":"integer"},"running":{"description":"Active servers that are powered on.","type":"integer"},"stopped":{"description":"Active servers that are powered off.","type":"integer"}},"required":["active","running","stopped","provisioning","locked"],"type":"object","x-order":["active","running","stopped","provisioning","locked"]},"items":{"items":{"properties":{"autoscale_enabled":{"description":"Whether Auto Scaling is on.","type":"boolean"},"autoscale_state":{"description":"Auto Scaling state, `null` when no rule exists.","type":["string","null"]},"autoscale_target_cpu":{"description":"CPU ceiling of the Auto Scaling rule.","type":["integer","null"]},"autoscale_target_ram_mb":{"description":"Memory ceiling of the Auto Scaling rule in MiB.","type":["integer","null"]},"bw":{"properties":{"in_bps":{"description":"Inbound bits per second (last minute).","type":"number"},"out_bps":{"description":"Outbound bits per second (last minute).","type":"number"}},"required":["in_bps","out_bps"],"type":["object","null"]},"charged_hourly":{"description":"Whether the server is being billed by the hour right now (hourly, active and running).","type":"boolean"},"cpu":{"description":"vCPU cores.","type":"integer"},"created_at":{"description":"When the server was ordered (Unix time, seconds, UTC)","type":"integer"},"cycle":{"description":"Billing cycle, `hourly` or a prepaid cycle name.","type":"string"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"display_name":{"description":"Display name, `null` when not set.","type":["string","null"]},"hostname":{"description":"Hostname.","type":"string"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"id":{"description":"Server UUID.","type":"string"},"ip":{"description":"Public IP address, `null` until one is assigned.","type":["string","null"]},"locked":{"description":"Whether the server is locked.","type":"boolean"},"metrics":{"properties":{"at":{"description":"When the figures were read (Unix time, seconds, UTC)","type":"integer"},"cpu_pct":{"description":"CPU usage in percent.","type":["number","null"]},"ram_pct":{"description":"Memory usage in percent.","type":["number","null"]}},"required":["cpu_pct","ram_pct","at"],"type":["object","null"],"x-order":["cpu_pct","ram_pct","at"]},"monthly_cents":{"description":"Price per billing month in US cents.","type":"integer"},"os_family":{"description":"Operating system family, `other` when unknown.","type":"string"},"os_label":{"description":"Operating system name.","type":["string","null"]},"paid_until":{"description":"End of the prepaid period, `null` for hourly servers (Unix time, seconds, UTC)","type":["integer","null"]},"power":{"description":"Power state. `null` when unknown or not recently confirmed.","enum":["running","stopped",null],"type":["string","null"]},"progress":{"properties":{"attempt":{"description":"Attempt number, starting at 1.","type":"integer"},"elapsed_secs":{"description":"Seconds since the operation started.","type":"integer"},"eta_secs":{"description":"Estimated seconds left, `null` when unknown.","type":["integer","null"]},"i18n":{"description":"Translation key of the current step.","type":"string"},"pct":{"description":"Progress in percent, `null` when it has no steps.","type":["integer","null"]},"step":{"description":"Current step of the running operation, 0 when it has no steps.","type":"integer"},"steps":{"description":"Total steps, 0 when it has no steps.","type":"integer"}},"required":["step","steps","pct","i18n","eta_secs","elapsed_secs","attempt"],"type":["object","null"],"x-order":["step","steps","pct","i18n","eta_secs","elapsed_secs","attempt"]},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"state":{"description":"Lifecycle state, for example `active`, `provisioning` or `locked`.","type":"string"}},"required":["id","hostname","display_name","os_family","os_label","ip","state","power","locked","cycle","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents","paid_until","created_at","charged_hourly","autoscale_enabled","autoscale_state","autoscale_target_cpu","autoscale_target_ram_mb","progress","metrics","bw"],"type":"object","x-order":["id","hostname","display_name","os_family","os_label","ip","state","power","locked","cycle","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents","paid_until","created_at","charged_hourly","autoscale_enabled","autoscale_state","autoscale_target_cpu","autoscale_target_ram_mb","progress","metrics","bw"]},"type":"array"},"limit":{"description":"Maximum number of servers returned (6).","type":"integer"},"shown":{"description":"Number of servers in `items`.","type":"integer"},"total":{"description":"Number of servers (deleted ones excluded).","type":"integer"}},"required":["total","shown","limit","counts","items"],"type":"object","x-order":["total","shown","limit","counts","items"]}},"required":["at","greeting","tz_offset_secs","account","fx","balance_cents","runway","spend","vms","checklist","announcement","region","shield"],"type":"object","x-order":["at","greeting","tz_offset_secs","account","fx","balance_cents","runway","spend","vms","checklist","announcement","region","shield"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["account:read"]}],"summary":"Overview: balance, burn rate, VMs, checklist","tags":["Account"],"x-cli":"account overview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/overview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"account:read","x-summary-vi":"Tổng quan: số dư, tốc độ tiêu, máy ảo, danh sách việc"}},"/v1/portal/tickets":{"get":{"description":"Returns the tickets of your account, newest activity first by default. Filter by `status` or search the subject with `q`. Only your own tickets are ever listed.\n\n**Required scope:** `ticket:read`.","operationId":"ticket_list","parameters":[{"description":"Case-insensitive text to look for in the subject. Only the first 120 characters are used.","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Return only tickets in this status.","in":"query","name":"status","required":false,"schema":{"enum":["open","answered","closed"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"last_msg_at","enum":["last_msg_at","created_at","updated_at","status","subject","id"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"created_at":1760860800,"id":1042,"last_author":"customer","last_msg_at":1760860800,"messages":1,"status":"open","subject":"Cannot reach my server on port 443","updated_at":1760860800}],"page":1,"per_page":20,"sort":"last_msg_at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/Ticket"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["ticket:read"]}],"summary":"List support tickets (filter, paged)","tags":["Support Tickets"],"x-cli":"ticket list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/tickets\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"ticket:read","x-summary-vi":"Danh sách ticket (lọc, phân trang)"},"post":{"description":"Opens a ticket with its first message and returns both. The support team is notified. At most 5 tickets can be opened per hour per account; the sixth is rejected with `rate_limited`. Send the same `Idempotency-Key` again to receive the original ticket instead of opening a duplicate.\n\n**Required scope:** `ticket:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"ticket_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"body":"Port 443 times out since this morning. The server itself is running.","subject":"Cannot reach my server on port 443"},"schema":{"properties":{"body":{"description":"First message, 1 to 4000 characters.","type":"string"},"subject":{"description":"Subject line, 1 to 120 characters, no control characters.","type":"string"}},"required":["subject","body"],"type":"object","x-order":["subject","body"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"message":{"attachments":[],"author":"customer","author_name":"Alex Nguyen","body":"Port 443 times out since this morning. The server itself is running.","created_at":1760860800,"id":5310},"ticket":{"created_at":1760860800,"id":1042,"last_author":"customer","last_msg_at":1760860800,"messages":1,"status":"open","subject":"Cannot reach my server on port 443","updated_at":1760860800}},"schema":{"properties":{"message":{"$ref":"#/components/schemas/TicketMessage"},"ticket":{"$ref":"#/components/schemas/Ticket"}},"required":["ticket","message"],"type":"object","x-order":["ticket","message"]}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The site operator has turned support tickets off. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site operator has turned support tickets off."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","message":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result. (`idempotency_in_progress`)","x-error-codes":[{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`subject` or `body` is empty or too long. The error carries `field` (`subject` or `body`) and `max`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `subject` or `body` is empty or too long. The error carries `field` (`subject` or `body`) and `max`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`subject` or `body` is empty or too long. The error carries `field` (`subject` or `body`) and `max`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 5 tickets were opened in the last hour. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 5 tickets were opened in the last hour."}]}},"security":[{"bearerAuth":["ticket:write"]}],"summary":"Open a support ticket","tags":["Support Tickets"],"x-cli":"ticket create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/portal/tickets\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"body\":\"Port 443 times out since this morning. The server itself is running.\",\"subject\":\"Cannot reach my server on port 443\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"ticket:write","x-summary-vi":"Tạo ticket hỗ trợ"}},"/v1/portal/tickets/{id}":{"get":{"description":"Returns one ticket with all of its messages in chronological order. Internal notes written by the support team are never included.\n\n**Required scope:** `ticket:read`.","operationId":"ticket_get","parameters":[{"description":"Ticket number as returned by List support tickets.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"messages":[{"attachments":[],"author":"customer","author_name":"Alex Nguyen","body":"Port 443 times out since this morning. The server itself is running.","created_at":1760860800,"id":5310},{"attachments":[],"author":"admin","author_name":"Support","body":"A firewall rule was blocking the port. It is fixed now, please try again.","created_at":1760864400,"id":5311}],"ticket":{"created_at":1760860800,"id":1042,"last_author":"admin","last_msg_at":1760864400,"messages":2,"status":"answered","subject":"Cannot reach my server on port 443","updated_at":1760864400}},"schema":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/TicketMessage"},"type":"array"},"ticket":{"$ref":"#/components/schemas/Ticket"}},"required":["ticket","messages"],"type":"object","x-order":["ticket","messages"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["ticket:read"]}],"summary":"Get one ticket with its messages","tags":["Support Tickets"],"x-cli":"ticket get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/portal/tickets/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"ticket:read","x-summary-vi":"Chi tiết ticket và tin nhắn"}},"/v1/portal/tickets/{id}/close":{"post":{"description":"Closes one of your tickets. Closing a ticket that is already closed succeeds and changes nothing. Closed tickets stay readable.\n\n**Required scope:** `ticket:write`.","operationId":"ticket_close","parameters":[{"description":"Ticket number as returned by List support tickets.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ticket":{"created_at":1760860800,"id":1042,"last_author":"admin","last_msg_at":1760864400,"messages":2,"status":"closed","subject":"Cannot reach my server on port 443","updated_at":1760868000}},"schema":{"properties":{"ticket":{"$ref":"#/components/schemas/Ticket"}},"required":["ticket"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["ticket:write"]}],"summary":"Close a ticket","tags":["Support Tickets"],"x-cli":"ticket close","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/portal/tickets/<id>/close\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"ticket:write","x-summary-vi":"Đóng ticket"}},"/v1/portal/tickets/{id}/messages":{"post":{"description":"Adds a message to one of your tickets and sets its status back to `open`. A closed ticket cannot be replied to: open a new ticket instead. Replies sent with an API key are limited to 30 per hour per account.\n\n**Required scope:** `ticket:write`.","operationId":"ticket_reply","parameters":[{"description":"Ticket number as returned by List support tickets.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"body":"Still failing after the change, here is the traceroute output."},"schema":{"properties":{"body":{"description":"Message text, 1 to 4000 characters.","type":"string"}},"required":["body"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"message":{"attachments":[],"author":"customer","author_name":"Alex Nguyen","body":"Port 443 times out since this morning. The server itself is running.","created_at":1760860800,"id":5310}},"schema":{"properties":{"message":{"$ref":"#/components/schemas/TicketMessage"}},"required":["message"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"ticket_closed","message":"The ticket is closed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The ticket is closed. (`ticket_closed`)","x-error-codes":[{"code":"ticket_closed","description":"The ticket is closed."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`body` is empty or longer than 4000 characters. The error carries `field` and `max`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`body` is empty or longer than 4000 characters. The error carries `field` and `max`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`body` is empty or longer than 4000 characters. The error carries `field` and `max`."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 30 replies were sent in the last hour. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 30 replies were sent in the last hour."}]}},"security":[{"bearerAuth":["ticket:write"]}],"summary":"Reply to a ticket","tags":["Support Tickets"],"x-cli":"ticket reply","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/portal/tickets/<id>/messages\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"body\":\"Still failing after the change, here is the traceroute output.\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"ticket:write","x-summary-vi":"Trả lời ticket"}},"/v1/proxy6/catalog":{"get":{"description":"Returns the IPv6 proxy catalog for your site: the fixed plans with the price of each billing period, the bandwidth and device add-ons, the regions with their availability, and the connection details (gateway host, ports, rotation interval limits, blocked ports). All prices are in millionths of a US dollar.\n\nThe call works even when your site does not sell IPv6 proxies; `enabled` tells you whether ordering is possible. Price an order with [Quote an IPv6 proxy order](#operation/proxy6_quote).\n\n**Required scope:** `catalog:read`.","operationId":"proxy6_catalog","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"blocked_ports":[25,465,587,2525],"catalog":{"device_addon":{"max":20,"prices":{"daily":192000,"monthly":3837000,"weekly":1200000,"yearly":32230000}},"mbps_addon":{"max":20,"prices":{"daily":192000,"monthly":3837000,"weekly":1200000,"yearly":32230000}},"mbps_step":50,"plans":[{"count":100,"enabled":true,"kind":"static","prices":{"daily":288000,"monthly":5755000,"weekly":1800000,"yearly":48342000},"slug":"static-100"}],"std_mbps_rotate":50,"std_mbps_static":50,"std_mbps_unlimited":100},"cycles":[{"days":1,"months":0,"slug":"daily"},{"days":7,"months":0,"slug":"weekly"},{"days":0,"months":1,"slug":"monthly"},{"days":0,"months":12,"slug":"yearly"}],"default_zone_id":1,"egress":"ipv6_only","enabled":true,"gw4":"","gw6":"","hostname":"proxy.example.com","ports":{"http":80,"https":443,"socks5":443,"static_from":60001,"static_to":65535},"rotate_interval":{"max_s":600,"min_s":30},"zones":[{"available":true,"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]},"schema":{"properties":{"available":{"description":"Whether proxies can be ordered right now. False means capacity is temporarily out.","type":"boolean"},"blocked_ports":{"items":{"description":"TCP port that is blocked.","type":"integer"},"type":"array"},"catalog":{"properties":{"device_addon":{"properties":{"max":{"description":"Most units per order.","type":"integer"},"prices":{"$ref":"#/components/schemas/Proxy6PriceSet"}},"required":["prices","max"],"type":"object","x-order":["prices","max"]},"mbps_addon":{"properties":{"max":{"description":"Most units per order.","type":"integer"},"prices":{"$ref":"#/components/schemas/Proxy6PriceSet"}},"required":["prices","max"],"type":"object","x-order":["prices","max"]},"mbps_step":{"description":"Each bandwidth add-on unit adds this many Mbps.","type":"integer"},"plans":{"items":{"properties":{"count":{"description":"Static plans: number of IPs. Rotating plans: rotations per period. Unlimited plans: 0.","type":"integer"},"enabled":{"description":"Whether the plan is on sale. Quotes for a plan that is off report an error.","type":"boolean"},"kind":{"description":"`static` keeps fixed IPs, `rotate` changes IP on request with a limited number of rotations, `unlimited` rotates without a limit.","enum":["static","rotate","unlimited"],"type":"string"},"prices":{"$ref":"#/components/schemas/Proxy6PriceSet"},"slug":{"description":"Plan identifier, e.g. `static-100`. Pass it as `plan` when quoting or ordering.","type":"string"}},"required":["slug","kind","count","prices","enabled"],"type":"object","x-order":["slug","kind","count","prices","enabled"]},"type":"array"},"std_mbps_rotate":{"description":"Standard speed of rotating plans in Mbps.","type":"integer"},"std_mbps_static":{"description":"Standard speed of static plans in Mbps.","type":"integer"},"std_mbps_unlimited":{"description":"Standard speed of unlimited plans in Mbps.","type":"integer"}},"required":["plans","mbps_addon","mbps_step","device_addon","std_mbps_static","std_mbps_rotate","std_mbps_unlimited"],"type":"object","x-order":["plans","mbps_addon","mbps_step","device_addon","std_mbps_static","std_mbps_rotate","std_mbps_unlimited"]},"cycles":{"items":{"properties":{"days":{"description":"Length in days (0 for monthly and yearly).","type":"integer"},"months":{"description":"Length in months (0 for daily and weekly).","type":"integer"},"slug":{"description":"Billing period identifier: `daily`, `weekly`, `monthly` or `yearly`.","type":"string"}},"required":["slug","months","days"],"type":"object","x-order":["slug","months","days"]},"type":"array"},"default_zone_id":{"description":"Region used when an order omits `zone_id`.","type":"integer"},"egress":{"description":"Address family of outbound traffic: always `ipv6_only`.","type":"string"},"enabled":{"description":"Whether IPv6 proxies can be ordered at your site.","type":"boolean"},"gw4":{"description":"Gateway IPv4 address; empty when not set.","type":"string"},"gw6":{"description":"Gateway IPv6 address; empty when not set.","type":"string"},"hostname":{"description":"Gateway host name that proxies are reached through.","type":"string"},"ports":{"properties":{"http":{"description":"Port for HTTP proxy connections.","type":"integer"},"https":{"description":"Port for HTTPS proxy connections.","type":"integer"},"socks5":{"description":"Port for SOCKS5 connections.","type":"integer"},"static_from":{"description":"Advanced, optional: first port of the range that maps to individual IPs of a static plan. Normal use is ports 80/443 with the `user-N` user name.","type":"integer"},"static_to":{"description":"Last port of that range.","type":"integer"}},"required":["http","https","socks5","static_from","static_to"],"type":"object"},"rotate_interval":{"properties":{"max_s":{"description":"Longest automatic rotation interval in seconds.","type":"integer"},"min_s":{"description":"Shortest automatic rotation interval in seconds.","type":"integer"}},"required":["min_s","max_s"],"type":"object","x-order":["min_s","max_s"]},"zones":{"items":{"properties":{"available":{"description":"Whether the region can take new orders right now.","type":"boolean"},"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"id":{"description":"Region identifier. Pass it as `zone_id` when ordering.","type":"integer"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"}},"required":["id","slug","name","name_en","country","city","available"],"type":"object","x-order":["id","slug","name","name_en","country","city","available"]},"type":"array"}},"required":["zones","default_zone_id","enabled","catalog","cycles","hostname","gw4","gw6","ports","rotate_interval","available","egress","blocked_ports"],"type":"object","x-order":["zones","default_zone_id","enabled","catalog","cycles","hostname","gw4","gw6","ports","rotate_interval","available","egress","blocked_ports"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"423":{"content":{"application/json":{"example":{"error":{"code":"site_unavailable","message":"Your reseller site is currently unavailable."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your reseller site is currently unavailable. (`site_unavailable`)","x-error-codes":[{"code":"site_unavailable","description":"Your reseller site is currently unavailable."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Proxy IPv6 catalog: plans, cycles and zones","tags":["Catalog"],"x-cli":"proxy6 catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục Proxy IPv6: gói, chu kỳ, vùng"}},"/v1/proxy6/quote":{"post":{"description":"Prices an IPv6 proxy order at your site's price without creating anything and without charging. The response lists the price lines (plan and add-ons) in millionths of a US dollar and `amount_cents`, the amount an order would take from your wallet. If the order is not valid (unknown or disabled plan, unknown period, add-on count out of range, device add-on on a plan that does not take it) the call still returns `200`: `errors` lists the problems and `amount_cents` is null.\n\nThe quote works even when your site does not currently sell IPv6 proxies (see `enabled` in [Get the IPv6 proxy catalog](#operation/proxy6_catalog)); ordering is what is blocked then.\n\n**Required scope:** `catalog:read`.","operationId":"proxy6_quote","parameters":[],"requestBody":{"content":{"application/json":{"example":{"cycle":"weekly","mbps_addons":1,"plan":"static-100"},"schema":{"properties":{"auto_renew":{"description":"Accepted for symmetry with ordering and ignored by the quote.","type":"boolean"},"cycle":{"description":"Billing period.","enum":["daily","weekly","monthly","yearly"],"type":"string"},"device_addons":{"description":"Number of extra device units. Default 0; only valid for `unlimited` plans; at most the catalog `device_addon.max`.","type":"integer"},"mbps_addons":{"description":"Number of bandwidth add-on units, each adding `mbps_step` Mbps. Default 0; at most the catalog `mbps_addon.max`.","type":"integer"},"plan":{"description":"Plan `slug` from the catalog, e.g. `static-100`.","type":"string"},"zone_id":{"description":"Region to order from. Does not change the price and is not checked by the quote.","type":"integer"}},"required":["plan","cycle"],"type":"object","x-order":["plan","cycle","mbps_addons","device_addons","zone_id","auto_renew"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"amount_cents":300,"count":100,"cycle":"weekly","days":7,"device_addons":0,"devices":0,"errors":[],"kind":"static","lines":[{"amount_uusd":1800000,"key":"plan","qty":1,"unit_uusd":1800000},{"amount_uusd":1200000,"key":"mbps","qty":1,"unit_uusd":1200000}],"mbps":100,"mbps_addons":1,"monthly_uusd":9592000,"months":0,"plan":"static-100","total_uusd":3000000,"trial":{"applies":false,"deduct_cents":0,"reason":"cycle"}},"schema":{"properties":{"amount_cents":{"description":"Amount the order would take from the wallet, in US cents. Null when `errors` is not empty.","type":["integer","null"]},"count":{"description":"Static plans: number of IPs. Rotating plans: rotations per period. Unlimited plans: 0.","type":"integer"},"cycle":{"description":"Billing period that was priced.","type":"string"},"days":{"description":"Length of the period in days (0 for monthly and yearly).","type":"integer"},"device_addons":{"description":"Device add-on units priced (clamped to 0-100).","type":"integer"},"devices":{"description":"Devices allowed with the add-ons.","type":"integer"},"errors":{"items":{"description":"Reason the order is not valid. Empty when the quote is valid. The wording may change; do not parse it.","type":"string"},"type":"array"},"kind":{"description":"Plan kind: `static`, `rotate` or `unlimited`; empty when the plan was not found.","type":"string"},"lines":{"items":{"properties":{"amount_uusd":{"description":"`qty` x `unit_uusd`.","type":"integer"},"key":{"description":"What the line is for.","enum":["plan","mbps","device"],"type":"string"},"qty":{"description":"Quantity.","type":"integer"},"unit_uusd":{"description":"Price of one unit for the period, in millionths of a US dollar.","type":"integer"}},"required":["key","qty","unit_uusd","amount_uusd"],"type":"object","x-order":["key","qty","unit_uusd","amount_uusd"]},"type":"array"},"mbps":{"description":"Speed of the proxy with the add-ons, in Mbps.","type":"integer"},"mbps_addons":{"description":"Bandwidth add-on units priced (clamped to 0-100).","type":"integer"},"monthly_uusd":{"description":"The same configuration priced per month, for display only, in millionths of a US dollar.","type":"integer"},"months":{"description":"Length of the period in months (0 for daily and weekly).","type":"integer"},"plan":{"description":"Plan slug that was priced.","type":"string"},"total_uusd":{"description":"Total for one period, in millionths of a US dollar.","type":"integer"},"trial":{"description":"Trial credit for this order. The trial pays for one 1-day order per service (VPN / Proxy IPv4 and Proxy IPv6) while it is active.","properties":{"applies":{"description":"True when the order would be paid (fully or partly) from your active trial credit.","type":"boolean"},"deduct_cents":{"description":"Part of `amount_cents` the trial credit would pay, in US cents; the rest comes from the wallet.","type":"integer"},"left_cents":{"description":"Trial credit still available, in US cents (only when the credit is active and the order qualifies).","type":"integer"},"reason":{"description":"Why the credit does not apply: `inactive` no active trial credit, `used` this service already used its trial order, `cycle` only the 1-day plan is covered, `off` not offered on this site, `invalid` the quote has errors.","enum":["invalid","off","inactive","used","plan","cycle"],"type":"string"}},"required":["applies","deduct_cents"],"type":"object"}},"required":["plan","kind","count","cycle","months","days","mbps","devices","mbps_addons","device_addons","lines","total_uusd","monthly_uusd","errors","amount_cents","trial"],"type":"object","x-order":["plan","kind","count","cycle","months","days","mbps","devices","mbps_addons","device_addons","lines","total_uusd","monthly_uusd","errors","amount_cents","trial"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or a required field (`plan`, `cycle`) is missing (`detail` says which)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or a required field (`plan`, `cycle`) is missing (`detail` says which). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or a required field (`plan`, `cycle`) is missing (`detail` says which)."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"content":{"application/json":{"example":{"error":{"code":"cycle_unavailable","message":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. (`cycle_unavailable`)","x-error-codes":[{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"site_unavailable","message":"Your reseller site is currently unavailable."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your reseller site is currently unavailable. (`site_unavailable`)","x-error-codes":[{"code":"site_unavailable","description":"Your reseller site is currently unavailable."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Quote a Proxy IPv6 order at your site's price (nothing is purchased)","tags":["Catalog"],"x-cli":"proxy6 quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"weekly\",\"mbps_addons\":1,\"plan\":\"static-100\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Báo giá Proxy IPv6 theo giá của site (không đặt mua)"}},"/v1/proxy6/subscriptions":{"get":{"description":"Lists your Proxy IPv6 plans, newest first. Each plan shows its type and size, the host and ports to connect to, the user name and the rotation state. The password is **not** included in the list (`proxy6.password` is `null`); fetch it with [Get a Proxy IPv6 plan](#operation/proxy6_subscription_get). The list is not paginated.\n\nPlans you removed from your list and orders that were rejected before any payment are left out. VPN IPv4 plans are listed by [List VPN plans](#operation/vpn_subscription_list).\n\n**Required scope:** `vpn:read`.","operationId":"proxy6_subscription_list","parameters":[{"description":"Set to `true` (or `1`) to also list plans that you removed from your list in the dashboard.","in":"query","name":"include_hidden","required":false,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"activated_at":1791000008,"addons":[],"auto_renew":true,"bandwidth_gb":0,"canceled_at":null,"created_at":1791000000,"cycle":"weekly","expires_at":1791604800,"fail_reason":null,"hidden_at":null,"id":2087,"ip_count":100,"ip_released_at":null,"ip_version":"ipv6","monthly_uusd":5769230,"months":0,"period_days":7,"proxy6":{"addresses":100,"count":100,"current_addr":null,"device_addons":0,"devices":0,"devices_locked":[],"exhausted":false,"exhausted_at":null,"host":"proxy.example.com","kind":"static","last_rotated_at":null,"mbps":100,"mbps_addons":0,"next_rotate_at":null,"password":null,"plan":"static-100","ports":{"http":80,"https":443,"socks5":443,"static_from":60001,"static_to":60100},"rotate_interval_s":0,"rotate_path":null,"turns_left":0,"turns_total":0,"turns_used":0,"username":"p6k3m9x2pq"},"renew_cents":180,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":1802884}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Proxy6Subscription"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"List Proxy IPv6 plans","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Danh sách gói Proxy IPv6"},"post":{"description":"Buys a Proxy IPv6 plan. The price is charged to the wallet and the proxy is set up at once; if setup fails after payment the amount is refunded automatically. Get plans, speeds and cycles from the Proxy IPv6 catalog first. Send an `Idempotency-Key` header: calling again with the same key returns the original purchase instead of buying twice. A `202 Accepted` answer means the payment is still being finalized; the plan appears in your list when done. When called with an API key, the answer carries no secrets (`password` and `rotate_path` are null): read the connection details with `GET /v1/proxy6/subscriptions/{id}` or `GET /v1/proxy6/subscriptions/{id}/export`.\n\n**Required scope:** `vpn:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"proxy6_subscription_buy","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_renew":false,"cycle":"daily","plan":"rotate-5"},"schema":{"properties":{"auto_renew":{"description":"Pass `false` to start with auto-renew off. Default: on.","type":"boolean"},"cycle":{"description":"Billing cycle.","enum":["daily","weekly","monthly","yearly"],"type":"string"},"device_addons":{"description":"Extra device slots, default 0.","type":"integer"},"mbps_addons":{"description":"Extra 100 Mbps speed steps, default 0.","type":"integer"},"plan":{"description":"Plan slug from the catalog, e.g. `static-100` or `rotate-5`.","type":"string"},"zone_id":{"description":"Location to buy in; omit for the default.","type":"integer"}},"required":["plan","cycle"],"type":"object","x-order":["plan","cycle","zone_id","mbps_addons","device_addons","auto_renew"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"charged_cents":20,"invoice_id":78,"invoice_number":"INV-000078","subscription":{"activated_at":1760000010,"addons":[],"auto_renew":false,"bandwidth_gb":0,"canceled_at":null,"created_at":1760000000,"cycle":"daily","expires_at":1760086400,"fail_reason":null,"hidden_at":null,"id":21,"ip_count":5,"ip_released_at":null,"ip_version":"ipv6","monthly_uusd":4000000,"months":0,"period_days":1,"proxy6":{"addresses":1,"count":5,"current_addr":"2001:db8:1234:5678::a1","device_addons":0,"devices":1,"devices_locked":[],"exhausted":false,"exhausted_at":null,"host":"ipv6.example.com","kind":"rotate","last_rotated_at":null,"mbps":100,"mbps_addons":0,"next_rotate_at":null,"password":null,"plan":"rotate-5","ports":{"http":80,"https":443,"socks5":443,"static_from":60001,"static_to":60001},"rotate_interval_s":0,"rotate_path":null,"turns_left":4,"turns_total":5,"turns_used":1,"username":"p6u8c2d1"},"renew_cents":20,"renew_max_periods":30,"renewable":true,"status":"active","tier":"dedicated","total_uusd":200000}},"schema":{"properties":{"charged_cents":{"description":"Amount charged in US cents.","type":"integer"},"invoice_id":{"description":"Invoice identifier.","type":["integer","null"]},"invoice_number":{"description":"Invoice number.","type":["string","null"]},"pending":{"description":"True when the answer is 202 and the payment is still being finalized.","type":"boolean"},"replayed":{"description":"True when this is the stored result of an earlier call with the same Idempotency-Key.","type":"boolean"},"subscription":{"$ref":"#/components/schemas/Proxy6PlanSummary"}},"required":["subscription","charged_cents","invoice_id","invoice_number"],"type":"object","x-order":["subscription","charged_cents","invoice_id","invoice_number","pending","replayed"]}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This site does not sell Proxy IPv6. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"This site does not sell Proxy IPv6."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"pool_exhausted","message":"No capacity in that location; the body says whether you were charged and refunded."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`pool_exhausted`: No capacity in that location; the body says whether you were charged and refunded. `idempotency_key_reused`: The Idempotency-Key was already used for a different order in the last 24 hours. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"pool_exhausted","description":"No capacity in that location; the body says whether you were charged and refunded."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was already used for a different order in the last 24 hours."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"cycle_unavailable","message":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"refund_pending","message":"The payment was taken and the automatic refund failed; do not retry, contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The payment was taken and the automatic refund failed; do not retry, contact support. (`refund_pending`)","x-error-codes":[{"code":"refund_pending","description":"The payment was taken and the automatic refund failed; do not retry, contact support."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"maintenance","message":"Orders are paused for maintenance."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Orders are paused for maintenance. (`maintenance`)","x-error-codes":[{"code":"maintenance","description":"Orders are paused for maintenance."}]}},"security":[{"bearerAuth":["vpn:create"]}],"summary":"Buy a Proxy IPv6 plan (charges the wallet)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription buy","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_renew\":false,\"cycle\":\"daily\",\"plan\":\"rotate-5\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:create","x-summary-vi":"Mua gói Proxy IPv6 (trừ tiền ví)"}},"/v1/proxy6/subscriptions/{id}":{"delete":{"description":"Removes a finished plan from your list. Only plans that are canceled, expired or failed and whose addresses have been released can be removed. The plan and its invoices are kept for the records. Repeating the call succeeds with `already: true`.\n\n**Required scope:** `vpn:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"proxy6_subscription_delete","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"already":false,"hidden_at":1760100000,"id":21,"ok":true},"schema":{"properties":{"already":{"description":"True when the plan had been removed before this call.","type":"boolean"},"hidden_at":{"description":"When the plan was hidden (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Plan identifier.","type":"integer"},"ok":{"description":"Always `true`.","type":"boolean"}},"required":["ok","id","hidden_at","already"],"type":"object","x-order":["ok","id","hidden_at","already"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_hideable","message":"The plan is still active or still holds addresses."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_hideable`: The plan is still active or still holds addresses. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_hideable","description":"The plan is still active or still holds addresses."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:destroy"]}],"summary":"Remove a canceled or expired Proxy IPv6 plan from your list","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/proxy6/subscriptions/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:destroy","x-summary-vi":"Xoá gói Proxy IPv6 đã huỷ/hết hạn khỏi danh sách"},"get":{"description":"Returns one Proxy IPv6 plan including the connection **password** (`proxy6.password`), so this response is sensitive. With `proxy6.host`, `proxy6.ports`, `proxy6.username` and the password you can configure any HTTP or SOCKS5 client; traffic leaves over IPv6 only, destinations must have an IPv6 address and outgoing connections to the mail ports 25, 465, 587 and 2525 are refused. The 50 most recent renewals are included.\n\nA static plan gives a fixed set of addresses, listed by [List Proxy IPv6 addresses](#operation/proxy6_ip_list). A rotating plan exposes its current address in `proxy6.current_addr`. `proxy6.rotate_path` is always `null` in responses to API keys. An id that belongs to another account, or to a VPN IPv4 plan, returns `404`.\n\n**Required scope:** `vpn:read`.","operationId":"proxy6_subscription_get","parameters":[{"description":"Plan identifier, as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"renewals":[],"subscription":{"activated_at":1791000008,"addons":[],"auto_renew":true,"bandwidth_gb":0,"canceled_at":null,"created_at":1791000000,"cycle":"weekly","expires_at":1791604800,"fail_reason":null,"hidden_at":null,"id":2087,"ip_count":100,"ip_released_at":null,"ip_version":"ipv6","keep_until":null,"monthly_uusd":5769230,"months":0,"period_days":7,"proxy6":{"addresses":100,"count":100,"current_addr":null,"device_addons":0,"devices":0,"devices_locked":[],"exhausted":false,"exhausted_at":null,"host":"proxy.example.com","kind":"static","last_rotated_at":null,"mbps":100,"mbps_addons":0,"next_rotate_at":null,"password":"Qm7xT3vRb8LkP2nZ","plan":"static-100","ports":{"http":80,"https":443,"socks5":443,"static_from":60001,"static_to":60100},"rotate_interval_s":0,"rotate_path":null,"turns_left":0,"turns_total":0,"turns_used":0,"username":"p6k3m9x2pq"},"renew_cents":180,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":1802884}},"schema":{"properties":{"renewals":{"items":{"$ref":"#/components/schemas/VpnPlanRenewal"},"type":"array"},"subscription":{"$ref":"#/components/schemas/Proxy6Subscription"}},"required":["subscription","renewals"],"type":"object","x-order":["subscription","renewals"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"Get one Proxy IPv6 plan (with password)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Chi tiết gói Proxy IPv6 (có mật khẩu)"}},"/v1/proxy6/subscriptions/{id}/auto-renew":{"put":{"description":"Turns auto-renew on or off. When on, the plan renews itself from the wallet shortly before it expires. Turning it on for a plan that is already due renews it immediately; `renew` then reports what happened. Turning it off always works.\n\n**Required scope:** `vpn:write`.","operationId":"proxy6_subscription_set_auto_renew","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"enabled":false},"schema":{"properties":{"enabled":{"description":"`true` to renew automatically, `false` to stop.","type":"boolean"}},"required":["enabled"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"changed":false,"renew":null,"subscription":{"activated_at":1760000010,"addons":[],"auto_renew":false,"bandwidth_gb":0,"canceled_at":null,"created_at":1760000000,"cycle":"daily","expires_at":1760086400,"fail_reason":null,"hidden_at":null,"id":21,"ip_count":5,"ip_released_at":null,"monthly_uusd":4000000,"months":0,"period_days":1,"renew_cents":20,"renew_max_periods":30,"renewable":true,"status":"active","tier":"dedicated","total_uusd":200000}},"schema":{"properties":{"changed":{"description":"Whether the setting was different from before.","type":"boolean"},"renew":{"description":"Outcome of the immediate renewal, or null when none was attempted.","enum":["renewed","replayed","no_funds","skipped","failed",null],"type":["string","null"]},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","changed","renew"],"type":"object","x-order":["subscription","changed","renew"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_renewable","message":"Auto-renew cannot be turned on for a plan that can no longer be renewed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Auto-renew cannot be turned on for a plan that can no longer be renewed. (`not_renewable`)","x-error-codes":[{"code":"not_renewable","description":"Auto-renew cannot be turned on for a plan that can no longer be renewed."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Turn auto-renew on or off (turning it on can renew from the wallet at once)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription set-auto-renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/proxy6/subscriptions/<id>/auto-renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\":false}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Bật/tắt tự gia hạn (bật có thể gia hạn ngay từ ví)"}},"/v1/proxy6/subscriptions/{id}/billing":{"get":{"description":"Lists every invoice that belongs to the plan (purchase and renewals), newest first. Invoices issued to a previous owner (after a transfer) are marked `previous_owner` and their buyer details are redacted.\n\n**Required scope:** `billing:read`.","operationId":"proxy6_subscription_billing","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"invoices":[{"account_id":5,"buyer_json":"{}","created_at":1760000010,"currency":"USD","due_at":null,"id":78,"kind":"receipt","ledger_ref":"vpn-buy-21","note":null,"number":"INV-000078","paid_at":1760000010,"seller_json":"{}","status":"paid","subtotal_cents":20,"total_cents":20,"updated_at":1760000010,"vm_id":null}]},"schema":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/VpnPlanInvoice"},"type":"array"}},"required":["invoices"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Invoices that belong to a Proxy IPv6 plan","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription billing","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>/billing\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Hoá đơn thuộc gói Proxy IPv6"}},"/v1/proxy6/subscriptions/{id}/cancel":{"post":{"description":"Cancels the plan immediately. The proxy stops working and the addresses are released. **Nothing is refunded**, even if time remains. To prevent accidents you must repeat the plan id in `confirm`. Canceling an already canceled plan succeeds and reports `already: true`.\n\n**Required scope:** `vpn:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"proxy6_subscription_cancel","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":21},"schema":{"properties":{"confirm":{"description":"The plan id, as a number or a string such as `21` or `#21`. Must match the id in the path."}},"required":["confirm"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"already":false,"endpoints_revoked":0,"ips_released":0,"refund_cents":0,"subscription":{"activated_at":1760000010,"addons":[],"auto_renew":false,"bandwidth_gb":0,"canceled_at":1760050000,"created_at":1760000000,"cycle":"daily","expires_at":1760086400,"fail_reason":null,"hidden_at":null,"id":21,"ip_count":5,"ip_released_at":1760050000,"monthly_uusd":4000000,"months":0,"period_days":1,"renew_cents":20,"renew_max_periods":0,"renewable":false,"status":"canceled","tier":"dedicated","total_uusd":200000}},"schema":{"properties":{"already":{"description":"True when the plan had been canceled before this call.","type":"boolean"},"endpoints_revoked":{"description":"Number of endpoints that were switched off.","type":"integer"},"ips_released":{"description":"Number of addresses returned to the pool.","type":"integer"},"refund_cents":{"description":"Always 0.","type":"integer"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","already","endpoints_revoked","ips_released","refund_cents"],"type":"object","x-order":["subscription","already","endpoints_revoked","ips_released","refund_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_cancelable","message":"The plan is in a state that cannot be canceled (for example a failed order)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_cancelable`: The plan is in a state that cannot be canceled (for example a failed order). `in_progress`: A renewal is still being processed; try again shortly. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_cancelable","description":"The plan is in a state that cannot be canceled (for example a failed order)."},{"code":"in_progress","description":"A renewal is still being processed; try again shortly."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"confirm_mismatch","message":"`confirm` does not match the plan id."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`confirm_mismatch`: `confirm` does not match the plan id. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"confirm_mismatch","description":"`confirm` does not match the plan id."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:destroy"]}],"summary":"Cancel a Proxy IPv6 plan now (no refund; addresses are released)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription cancel","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions/<id>/cancel\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":21}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:destroy","x-summary-vi":"Huỷ ngay gói Proxy IPv6 (không hoàn tiền; địa chỉ được nhả)"}},"/v1/proxy6/subscriptions/{id}/cancel-preview":{"get":{"description":"Shows what canceling the plan would do, without changing anything: whether it can be canceled, how many addresses would be released, and that no refund is given.\n\n**Required scope:** `vpn:detail`.","operationId":"proxy6_subscription_cancel_preview","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_cancel":true,"can_hide":false,"expires_at":1760086400,"ips_released":5,"keep_until":null,"reason":null,"refund_cents":0,"status":"active"},"schema":{"$ref":"#/components/schemas/VpnCancelPreview"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Preview of canceling a Proxy IPv6 plan","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription cancel-preview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>/cancel-preview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Xem trước khi huỷ gói Proxy IPv6"}},"/v1/proxy6/subscriptions/{id}/export":{"get":{"description":"Downloads the proxies of the plan as a text file in the chosen format. Every line carries the proxy password, so treat the file as a secret. For static plans there is one line per address (the user name carries the address number); rotating plans export their single current entry. Every format connects on the shared ports 80 (HTTP) and 443 (HTTPS and SOCKS5) and selects the address through the user name (`user-N`). Formats: `hostport` and `userpass` (`host:80:user:pass`), `socks5` and `http` (URL lines), `ips` (the IPv6 addresses only), `clash` and `singbox`, and the advanced `perport` (static plans only, one dedicated port per address, `host:port:user:pass`).\n\n**Required scope:** `vpn:detail`.","operationId":"proxy6_subscription_export","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Output format.","in":"query","name":"format","required":false,"schema":{"default":"hostport","enum":["hostport","perport","userpass","socks5","http","ips","clash","singbox"],"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"description":"The exported proxy list. Clash is returned as `text/yaml` and sing-box as `application/json`.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`format` is not one of the supported formats; the body lists them in `allowed`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`format` is not one of the supported formats; the body lists them in `allowed`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`format` is not one of the supported formats; the body lists them in `allowed`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Download the proxy list of a Proxy IPv6 plan (with password)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription export","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>/export\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Tải danh sách proxy của gói Proxy IPv6 (có mật khẩu)"}},"/v1/proxy6/subscriptions/{id}/ips":{"get":{"description":"Returns the IPv6 addresses currently assigned to a Proxy IPv6 plan, ordered by `slot`, together with the user name (and, on static plans, the dedicated port) that selects each address. A static plan has one address per slot; a rotating plan has a single address in slot 1.\n\n`history` lists the latest address changes of a rotating plan (up to 50, newest first) and is empty for static plans. A page number beyond the last page returns an empty `items` array.\n\n**Required scope:** `vpn:read`.","operationId":"proxy6_ip_list","parameters":[{"description":"Plan identifier, as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"history":[{"created_at":1791300100,"new_addr":"2001:db8:5a1:7c3::1f","old_addr":"2001:db8:5a1:1b2::9","reason":"manual","slot":1},{"created_at":1791299800,"new_addr":"2001:db8:5a1:1b2::9","old_addr":"2001:db8:5a1:44d::3","reason":"interval","slot":1}],"items":[{"addr":"2001:db8:5a1:7c3::1f","net64":"2001:db8:5a1:7c3::/64","port":null,"since":1791300100,"slot":1,"user":"p6k3m9x2pq"}],"page":1,"per_page":50,"total":1},"schema":{"properties":{"history":{"items":{"$ref":"#/components/schemas/Proxy6Rotation"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/Proxy6Address"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","history"],"type":"object","x-order":["items","total","page","per_page","history"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"IPv6 addresses of the plan (paged)","tags":["VPN and Proxy"],"x-cli":"proxy6 ip list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>/ips\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Địa chỉ IPv6 của gói (phân trang)"}},"/v1/proxy6/subscriptions/{id}/logs":{"get":{"description":"Returns the connection log of the plan, newest first: which client address connected to which destination through which outgoing IPv6 address, with the transferred bytes and whether the connection was denied. Without `q` the last 30 days are searched; with `q` the search is limited to the last 7 days. Limited to 30 calls per minute per account.\n\n**Required scope:** `vpn:detail`.","operationId":"proxy6_subscription_logs","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Search text (at least 2 characters), matched against client address, destination host and outgoing address.","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"conns":3,"denied":0,"down":40960,"host":"example.com","out_addr":"2001:db8:1234:5678::a1","port":443,"src":"203.0.113.5","sub_id":21,"ts":1760003400,"up":2048}],"page":1,"per_page":50,"total":1},"schema":{"properties":{"items":{"items":{"properties":{"conns":{"description":"Number of connections in the minute.","type":"integer"},"denied":{"description":"Connections that were denied.","type":"integer"},"down":{"description":"Bytes received from the destination.","type":"integer"},"host":{"description":"Destination host name or address.","type":"string"},"out_addr":{"description":"Outgoing IPv6 address used.","type":"string"},"port":{"description":"Destination port.","type":"integer"},"src":{"description":"Client address that connected.","type":"string"},"sub_id":{"description":"Plan identifier.","type":"integer"},"ts":{"description":"Start of the minute the row covers (Unix time, seconds, UTC)","type":"integer"},"up":{"description":"Bytes sent to the destination.","type":"integer"}},"required":["sub_id","ts","src","host","port","out_addr","conns","up","down","denied"],"type":"object","x-order":["sub_id","ts","src","host","port","out_addr","conns","up","down","denied"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_request","message":"`page` is greater than 200."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page` is greater than 200. (`bad_request`)","x-error-codes":[{"code":"bad_request","description":"`page` is greater than 200."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Connection log of a Proxy IPv6 plan (paged, searchable)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription logs","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>/logs\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Nhật ký kết nối của gói Proxy IPv6 (phân trang, tìm kiếm)"}},"/v1/proxy6/subscriptions/{id}/release-device":{"post":{"description":"Releases the devices (client source IPs) locked to the plan. The plan allows a limited number of devices; the first devices that connect are locked in. After a release, the next devices that connect are locked instead.\n\n**Required scope:** `vpn:write`.","operationId":"proxy6_subscription_release_device","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"released":["203.0.113.5"]},"schema":{"properties":{"ok":{"description":"Always `true`.","type":"boolean"},"released":{"items":{"description":"Source IP that was released.","type":"string"},"type":"array"}},"required":["ok","released"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Release the devices locked to the plan","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription release-device","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions/<id>/release-device\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Nhả các thiết bị đang bị khoá vào gói"}},"/v1/proxy6/subscriptions/{id}/renew":{"post":{"description":"Renews the plan for one or more periods at the price fixed when it was bought. The amount is charged to the wallet and the expiry moves forward; for rotating plans more rotations are added to the plan. Send an `Idempotency-Key` so that a retried call does not charge twice.\n\n**Required scope:** `vpn:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"proxy6_subscription_renew","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"periods":1},"schema":{"properties":{"periods":{"description":"Number of periods to buy, from 1 up to `renew_max_periods` of the plan. Defaults to 1.","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"invoice_id":92,"invoice_number":"INV-000092","renewal":{"charged_cents":20,"created_at":1760080000,"from":1760086400,"id":5,"months":0,"periods":1,"seq":1,"status":"done","to":1760172800},"subscription":{"activated_at":1760000010,"addons":[],"auto_renew":false,"bandwidth_gb":0,"canceled_at":null,"created_at":1760000000,"cycle":"daily","expires_at":1760086400,"fail_reason":null,"hidden_at":null,"id":21,"ip_count":5,"ip_released_at":null,"monthly_uusd":4000000,"months":0,"period_days":1,"renew_cents":20,"renew_max_periods":30,"renewable":true,"status":"active","tier":"dedicated","total_uusd":200000}},"schema":{"properties":{"invoice_id":{"description":"Invoice identifier.","type":["integer","null"]},"invoice_number":{"description":"Invoice number.","type":["string","null"]},"pending":{"description":"True when the answer is 202 and the payment is still being finalized.","type":"boolean"},"renewal":{"$ref":"#/components/schemas/VpnRenewal"},"replayed":{"description":"True when this is the stored result of an earlier call with the same Idempotency-Key.","type":"boolean"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","renewal"],"type":"object","x-order":["subscription","renewal","invoice_id","invoice_number","pending","replayed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This site does not sell Proxy IPv6. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"This site does not sell Proxy IPv6."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_renewable","message":"The plan cannot be renewed in its current state."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_renewable`: The plan cannot be renewed in its current state. `renewal_in_progress`: Another renewal of this plan is still being processed. `idempotency_key_reused`: The Idempotency-Key was already used for a different order in the last 24 hours. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_renewable","description":"The plan cannot be renewed in its current state."},{"code":"renewal_in_progress","description":"Another renewal of this plan is still being processed."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was already used for a different order in the last 24 hours."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`periods` is out of range; the body has `max`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `periods` is out of range; the body has `max`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`periods` is out of range; the body has `max`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"refund_pending","message":"The payment was taken and the automatic refund failed; do not retry, contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The payment was taken and the automatic refund failed; do not retry, contact support. (`refund_pending`)","x-error-codes":[{"code":"refund_pending","description":"The payment was taken and the automatic refund failed; do not retry, contact support."}]}},"security":[{"bearerAuth":["vpn:create"]}],"summary":"Renew a Proxy IPv6 plan (charges the wallet)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions/<id>/renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"periods\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:create","x-summary-vi":"Gia hạn gói Proxy IPv6 (trừ tiền ví)"}},"/v1/proxy6/subscriptions/{id}/reset-password":{"post":{"description":"Generates a new proxy password and returns it. The old password stops working at once, so update your clients. At most 5 resets per plan every 5 minutes.\n\n**Required scope:** `vpn:write`.","operationId":"proxy6_subscription_reset_password","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"password":"Hq7Lm2Zx9PrTk4Wd"},"schema":{"properties":{"ok":{"description":"Always `true`.","type":"boolean"},"password":{"description":"The new proxy password (16 characters).","type":"string"}},"required":["ok","password"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Generate a new proxy password (returned once)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription reset-password","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions/<id>/reset-password\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Tạo mật khẩu proxy mới (chỉ hiện một lần)"}},"/v1/proxy6/subscriptions/{id}/rotate":{"post":{"description":"Rotates the IPv6 address of a rotating plan now and returns the new one. Each call uses one of the plan's rotations; when none are left the call fails with `turns_exhausted` until you renew. Send an `Idempotency-Key` so that a retried call does not use a second rotation. At most one rotation every 3 seconds per plan.\n\n**Required scope:** `vpn:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"proxy6_subscription_rotate","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ip":"2001:db8:1234:5678::b7","ok":true,"old":"2001:db8:1234:5678::a1","turns_left":3},"schema":{"properties":{"ip":{"description":"The new IPv6 address.","type":"string"},"ok":{"description":"Always `true`.","type":"boolean"},"old":{"description":"The address that was replaced.","type":["string","null"]},"turns_left":{"description":"Rotations left after this one.","type":"integer"}},"required":["ok","old","ip","turns_left"],"type":"object","x-order":["ok","old","ip","turns_left"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"turns_exhausted","message":"All rotations are used; renew the plan to get more."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`turns_exhausted`: All rotations are used; renew the plan to get more. `static_no_rotate`: Static plans keep fixed addresses and cannot rotate. `not_active`: The plan is not active. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"turns_exhausted","description":"All rotations are used; renew the plan to get more."},{"code":"static_no_rotate","description":"Static plans keep fixed addresses and cannot rotate."},{"code":"not_active","description":"The plan is not active."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"no_space","message":"No free IPv6 address is available right now; try again shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No free IPv6 address is available right now; try again shortly. (`no_space`)","x-error-codes":[{"code":"no_space","description":"No free IPv6 address is available right now; try again shortly."}]}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Rotate the IPv6 address now (uses one rotation of the plan)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription rotate","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions/<id>/rotate\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:write","x-summary-vi":"Xoay địa chỉ IPv6 ngay (tốn một lượt xoay của gói)"}},"/v1/proxy6/subscriptions/{id}/rotation":{"put":{"description":"Sets the automatic rotation interval of a rotating plan. Every automatic rotation uses one of the plan's rotations. Static plans cannot rotate.\n\n**Required scope:** `vpn:write`.","operationId":"proxy6_subscription_set_rotation","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"interval_s":60},"schema":{"properties":{"interval_s":{"description":"Seconds between rotations, from 30 to 600; 0 turns automatic rotation off.","type":"integer"}},"required":["interval_s"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"next_rotate_at":1760003660,"ok":true,"rotate_interval_s":60},"schema":{"properties":{"next_rotate_at":{"description":"Time of the next rotation, null when off (Unix time, seconds, UTC)","type":["integer","null"]},"ok":{"description":"Always `true`.","type":"boolean"},"rotate_interval_s":{"description":"The interval now in effect.","type":"integer"}},"required":["ok","rotate_interval_s","next_rotate_at"],"type":"object","x-order":["ok","rotate_interval_s","next_rotate_at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"static_no_rotate","message":"Static plans keep fixed addresses and cannot rotate."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Static plans keep fixed addresses and cannot rotate. (`static_no_rotate`)","x-error-codes":[{"code":"static_no_rotate","description":"Static plans keep fixed addresses and cannot rotate."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bad_interval","message":"The interval is not 0 or between 30 and 600 seconds; the body has `min_s` and `max_s`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The interval is not 0 or between 30 and 600 seconds; the body has `min_s` and `max_s`. (`bad_interval`)","x-error-codes":[{"code":"bad_interval","description":"The interval is not 0 or between 30 and 600 seconds; the body has `min_s` and `max_s`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Set the automatic IP rotation interval (0 = off)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription set-rotation","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/proxy6/subscriptions/<id>/rotation\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"interval_s\":60}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Đặt chu kỳ tự xoay IP (0 = tắt)"}},"/v1/proxy6/subscriptions/{id}/rotation/token":{"post":{"description":"Issues a new public rotation link and invalidates the previous one. Calling the link (GET or POST, no API key needed) rotates the address once, which is handy for scripts and phones. Anyone who holds the link can use up the plan's rotations, so treat it as a secret and issue a new one if it leaks.\n\n**Required scope:** `vpn:write`.","operationId":"proxy6_subscription_rotation_token","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"rotate_path":"/v1/proxy6/rotate/Zk3q9rVx0aLm2PwTnB7cYdHs5uJgEoXf"},"schema":{"properties":{"rotate_path":{"description":"Path of the rotation link on this site, `/v1/proxy6/rotate/{token}`.","type":"string"}},"required":["rotate_path"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"static_no_rotate","message":"Static plans cannot rotate."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`static_no_rotate`: Static plans cannot rotate. `not_active`: The plan has already released its addresses.","x-error-codes":[{"code":"static_no_rotate","description":"Static plans cannot rotate."},{"code":"not_active","description":"The plan has already released its addresses."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Issue a new public rotation link (anyone holding it can burn rotations)","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription rotation-token","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/proxy6/subscriptions/<id>/rotation/token\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Cấp link xoay công khai mới (ai cầm link đều đốt được lượt xoay)"}},"/v1/proxy6/subscriptions/{id}/traffic":{"get":{"description":"Returns real traffic of the plan: a time series for charting, the latest rate, the usage of the current billing period and the busiest endpoints. Minute buckets are available for `1h` and `6h`, hourly buckets for `24h`, `7d` and `30d`, daily buckets for `month` and monthly buckets for `all`. Limited to 30 calls per minute per account.\n\n**Required scope:** `vpn:detail`.","operationId":"proxy6_subscription_traffic","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Time range of the series.","in":"query","name":"range","required":false,"schema":{"default":"24h","enum":["1h","6h","24h","7d","30d","month","all"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"bucket_secs":3600,"endpoints":[],"live":{"at":null,"conns":0,"rx_bps":0.0,"tx_bps":0.0},"metering":"directional","range":"24h","series":[{"conns":4,"rx_bps":250000.0,"t":1760000000,"tx_bps":40000.0}],"usage":{"pct":0.0,"period_end":1760086400,"period_start":1760000000,"quota_bytes":0,"rx_bytes":1048576,"total_bytes":1310720,"tx_bytes":262144}},"schema":{"$ref":"#/components/schemas/VpnTraffic"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`range` is not one of 1h, 6h, 24h, 7d, 30d."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`range` is not one of 1h, 6h, 24h, 7d, 30d. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`range` is not one of 1h, 6h, 24h, 7d, 30d."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Real traffic chart and usage of a Proxy IPv6 plan","tags":["VPN and Proxy"],"x-cli":"proxy6 subscription traffic","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/proxy6/subscriptions/<id>/traffic\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Biểu đồ và mức dùng lưu lượng thật của gói Proxy IPv6"}},"/v1/public/dedicated":{"get":{"description":"Returns the public list of Dedicated Server (Bare Metal) plans: a physical Dell PowerEdge server for your exclusive use, with the hardware of each plan. Prices are in whole Vietnamese dong (VND) per month; `fx` gives the exchange rate for showing them in US dollars. The response may be cached for 60 seconds.\n\nPrices are only shown while the service is on sale at your site (`available` is true) and only for the plans that are on sale. While it is not on sale `available` is false and every plan lists its specifications only: no `monthly_vnd`, `setup_fee_vnd` or `cycles`. Stock, addresses and host names are never part of this list. Sites run by resellers do not sell Dedicated Servers and answer `404 service_unavailable`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_dedicated","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"currency":"VND","fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"plans":[{"available":true,"code":"DS-6138-128","cycles":[{"cycle":"monthly","discount_pct":0.0,"months":1},{"cycle":"yearly","discount_pct":12.0,"months":12}],"monthly_vnd":2990000,"name":"DS-6138-128","setup_fee_vnd":500000,"spec":{"console":true,"cores":40,"cpu":"2x Intel Xeon Gold 6138","ipv4":1,"ram_gb":128,"storage":"SSD ~1 TB","threads":80}}]},"schema":{"properties":{"available":{"description":"Whether Dedicated Servers are on sale at your site right now. When false the plans carry no prices.","type":"boolean"},"currency":{"description":"Currency of the prices: always `VND`.","type":"string"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"order_url":{"description":"Path of the order page (`/deploy/bare-metal`); present only while `available` is true.","type":"string"},"plans":{"items":{"properties":{"available":{"description":"Whether this plan can be ordered: the service is on sale and the plan is enabled. When false the price fields are absent.","type":"boolean"},"code":{"description":"Plan code, e.g. `DS-6138-128`.","type":"string"},"cycles":{"description":"Billing cycles offered for the plan. Present only when `available` is true.","items":{"properties":{"cycle":{"description":"Billing cycle slug, e.g. `yearly`.","type":"string"},"discount_pct":{"description":"Discount on the monthly price for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months.","type":"integer"}},"required":["cycle","months","discount_pct"],"type":"object","x-order":["cycle","months","discount_pct"]},"type":"array"},"monthly_vnd":{"description":"Price for one month, in VND. Present only when `available` is true.","type":"integer"},"name":{"description":"Display name.","type":"string"},"setup_fee_vnd":{"description":"One-time setup fee in VND (0 = none). Present only when `available` is true.","type":"integer"},"spec":{"description":"Hardware of the plan. Only the fields that are published for the plan are present.","properties":{"bandwidth":{"description":"Included bandwidth when published.","type":"string"},"console":{"description":"Whether a browser console is included.","type":"boolean"},"cores":{"description":"Total physical cores.","type":"integer"},"cpu":{"description":"Processors, e.g. `2x Intel Xeon Gold 6138`.","type":"string"},"disk":{"description":"Disk description when `storage` is not given.","type":"string"},"ipv4":{"description":"Public IPv4 addresses included.","type":"integer"},"port":{"description":"Network port speed when published.","type":"string"},"ram_gb":{"description":"Memory in GB.","type":"integer"},"ram_note":{"description":"Remark on how the memory is installed.","type":"string"},"storage":{"description":"Storage, e.g. `SSD ~1 TB`.","type":"string"},"threads":{"description":"Total threads.","type":"integer"}},"type":"object","x-order":["cpu","cores","threads","ram_gb","ram_note","storage","disk","ipv4","console","port","bandwidth"]}},"required":["code","name","spec","available"],"type":"object","x-order":["code","name","spec","available","monthly_vnd","setup_fee_vnd","cycles"]},"type":"array"}},"required":["available","currency","plans","fx"],"type":"object","x-order":["available","order_url","currency","plans","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site is closed or inactive, or is run by a reseller (Dedicated Servers are not sold there)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site is closed or inactive, or is run by a reseller (Dedicated Servers are not sold there). (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site is closed or inactive, or is run by a reseller (Dedicated Servers are not sold there)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The plan list could not be built right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The plan list could not be built right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The plan list could not be built right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public Dedicated Server (Bare Metal) plans: specifications; prices only while on sale","tags":["Catalog"],"x-cli":"catalog dedicated","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/dedicated\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Gói Dedicated Server (Bare Metal) công khai: cấu hình; giá chỉ khi đang mở bán"}},"/v1/public/gpu":{"get":{"description":"Returns the public price list of GPU servers: the available configurations with their hourly and monthly prices and current stock, and the software templates that can be started on them. Prices are the retail prices for the default disk size (`disk_gb`) in millionths of a US dollar per hour. The list follows the live market, so prices and stock change; it is refreshed at most once a minute.\n\nGPU servers are not sold on every site: when your site does not sell them the call returns `404 service_unavailable`. Right after a restart the first call can return `503 catalog_unavailable`; retry in a few seconds. Use [Get the GPU catalog](#operation/gpu_catalog) for the full catalog needed to order.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_gpu","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"at":1760000000,"disk_gb":32,"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"hours_per_month":730,"plans":[{"cpu":16,"cuda_max":12.8,"disk_gb":32,"gpu_count":1,"gpu_name":"RTX 4090","hot":true,"hot_rank":2,"hourly_uusd":410000,"is_5090":false,"model_slug":"rtx-4090","monthly_cents":28400,"name":"RTX 4090 - 24 GB","ram_gb":64,"slug":"1x-rtx-4090","stock":14,"storage_uusd_gb_h":120,"vram_gb":24}],"sales_enabled":true,"stale":false,"templates":[{"category":"Machine learning","default_disk_gb":32,"is_vm":false,"min_cuda":12.0,"min_vram_gb":8,"name":"PyTorch"}]},"schema":{"properties":{"at":{"description":"When the market snapshot behind the list was taken (Unix time, seconds, UTC)","type":"integer"},"disk_gb":{"description":"Disk size the prices are computed for, in GB.","type":"integer"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"plans":{"items":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cuda_max":{"description":"Highest CUDA version supported.","type":"number"},"disk_gb":{"description":"Disk size the price is for, in GB.","type":"integer"},"gpu_count":{"description":"Number of GPUs.","type":"integer"},"gpu_name":{"description":"GPU model.","type":"string"},"hot":{"description":"Whether the configuration is among the most popular ones.","type":"boolean"},"hot_rank":{"description":"Popularity rank (1 = most popular); null when not ranked.","type":["integer","null"]},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"is_5090":{"description":"Whether the configuration uses an RTX 5090.","type":"boolean"},"model_slug":{"description":"URL-friendly name of the GPU model, e.g. `rtx-4090`.","type":"string"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"name":{"description":"Display name.","type":"string"},"ram_gb":{"description":"System memory in GB.","type":"integer"},"slug":{"description":"Stable short name of the configuration, e.g. `1x-rtx-4090`.","type":"string"},"stock":{"description":"Number of matching machines in stock.","type":"integer"},"storage_uusd_gb_h":{"description":"Price per extra GB of disk per hour, in millionths of a US dollar.","type":"integer"},"vram_gb":{"description":"Total GPU memory in GB.","type":"integer"}},"required":["slug","name","gpu_name","model_slug","gpu_count","vram_gb","cpu","ram_gb","disk_gb","cuda_max","hourly_uusd","monthly_cents","storage_uusd_gb_h","stock","is_5090"],"type":"object","x-order":["slug","name","gpu_name","model_slug","gpu_count","vram_gb","cpu","ram_gb","disk_gb","cuda_max","hourly_uusd","monthly_cents","storage_uusd_gb_h","stock","is_5090","hot_rank","hot"]},"type":"array"},"sales_enabled":{"description":"Whether new GPU orders are being accepted.","type":"boolean"},"stale":{"description":"True when the snapshot could not be refreshed recently and may be out of date.","type":"boolean"},"templates":{"items":{"properties":{"category":{"description":"Template category.","type":"string"},"default_disk_gb":{"description":"Default (and minimum) disk size in GB.","type":"integer"},"is_vm":{"description":"True for a full virtual machine, false for a container.","type":"boolean"},"min_cuda":{"description":"Lowest CUDA version the template needs.","type":"number"},"min_vram_gb":{"description":"Lowest GPU memory the template needs, in GB.","type":"integer"},"name":{"description":"Template name.","type":"string"}},"required":["name","category","is_vm","default_disk_gb","min_cuda","min_vram_gb"],"type":"object","x-order":["name","category","is_vm","default_disk_gb","min_cuda","min_vram_gb"]},"type":"array"}},"required":["at","stale","sales_enabled","hours_per_month","disk_gb","plans","templates","fx"],"type":"object","x-order":["at","stale","sales_enabled","hours_per_month","disk_gb","plans","templates","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site does not sell GPU servers."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell GPU servers. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site does not sell GPU servers."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The market list has not been loaded yet. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The market list has not been loaded yet. Retry in a few seconds. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The market list has not been loaded yet. Retry in a few seconds."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public GPU price list","tags":["Catalog"],"x-cli":"catalog gpu","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/gpu\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá GPU công khai"}},"/v1/public/ip-subnets":{"get":{"description":"IPv4 subnets for sale (/24–/22, RPKI managed automatically), public — no login. Prices are the final monthly price in US cents; `setup_cents` is charged once per subnet. Filter, sort and page on the server.\n\n**Required scope:** `catalog:read`.","operationId":"ip_subnets_market","parameters":[{"description":"Exactly this subnet (for example `45.12.34.0/24`).","in":"query","name":"prefix","required":false,"schema":{"type":"string"}},{"description":"Prefix length.","in":"query","name":"len","required":false,"schema":{"enum":["24","23","22"],"type":"string"}},{"description":"Registry.","in":"query","name":"rir","required":false,"schema":{"enum":["afrinic","apnic","arin","lacnic","ripencc"],"type":"string"}},{"description":"Geolocation country (ISO 3166-1 alpha-2).","in":"query","name":"country","required":false,"schema":{"type":"string"}},{"description":"Maximum monthly price in US cents.","in":"query","name":"price_max_cents","required":false,"schema":{"type":"string"}},{"description":"Sort order.","in":"query","name":"sort","required":false,"schema":{"default":"price","enum":["price","-price","address","-address","country","len"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"filters":{"countries":["NL"],"lens":[24,23,22],"rirs":["ripencc"]},"items":[{"city":"Amsterdam","country":"NL","id":"45.12.34.0/24","ips":256,"prefix":"45.12.34.0/24","prefix_len":24,"price_cents":7997,"rir":"ripencc","rpki":"automated","setup_cents":1150}],"page":1,"per_page":25,"total":1,"updated_at":1761100000},"schema":{"properties":{"available":{"description":"Subnets are on sale on this site now.","type":"boolean"},"balance_cents":{"description":"Your wallet balance (logged in only).","type":"integer"},"filters":{"additionalProperties":true,"description":"Values available for `rir`, `country`, `len`.","type":"object"},"items":{"items":{"additionalProperties":true,"description":"`id`/`prefix`, `prefix_len`, `ips`, `rir`, `country`, `city`, `price_cents` (monthly), `setup_cents`, `rpki`.","type":"object"},"type":"array"},"page":{"description":"Page.","type":"integer"},"per_page":{"description":"Page size.","type":"integer"},"platform_asn":{"description":"Platform ASN for routing at this platform (logged in only).","type":"integer"},"total":{"description":"Matching subnets.","type":"integer"},"updated_at":{"description":"When the market list was refreshed (unix seconds).","type":["integer","null"]}},"required":["available","items","total","page","per_page"],"type":"object","x-order":["available","items","total","page","per_page","updated_at","filters","balance_cents","platform_asn"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"IPv4 subnets for sale (public, monthly price plus a one-time setup fee)","tags":["Bring Your Own IP"],"x-cli":"ip-subnets market","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/ip-subnets\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Subnet IPv4 đang bán (công khai, giá thuê theo tháng + phí khởi tạo một lần)"}},"/v1/public/k8s":{"get":{"description":"Returns the public price list of managed clusters: the worker plans with their hourly, monthly and per-cycle prices, the billing cycles, the versions on sale, the regions, the free control plane and the account limits. Prices are in US cents or millionths of a US dollar as named. The response may be cached for 60 seconds.\n\nWhen your site does not sell managed clusters the call returns `200` with just `{\"enabled\": false}`. The same minimal answer is returned while no region is ready to create clusters.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_k8s","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"control_plane":{"count":1,"cpu":2,"free":true,"ram_mb":2048},"cycles":[{"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"enabled":true,"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"hours_per_month":730,"limits":{"clusters_max":2,"workers_max":9,"workers_min":1},"versions":[{"is_default":true,"name":"v1.30.4","semver":"1.30.4"}],"worker_disk_gb":70,"worker_plans":[{"code":"K8S-1","cycles":[{"cycle":"monthly","cycle_cents":715,"discount_pct":0.0,"months":1}],"disk_gb":70,"hourly_uusd":9800,"monthly_cents":715,"ram_gb":4,"vcpu":2}],"zones":[{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]},"schema":{"properties":{"control_plane":{"properties":{"count":{"description":"Number of control plane nodes.","type":"integer"},"cpu":{"description":"vCPU cores of the control plane node.","type":"integer"},"free":{"description":"Whether the control plane is free of charge.","type":"boolean"},"ram_mb":{"description":"Memory of the control plane node in MiB.","type":"integer"}},"required":["free","count","cpu","ram_mb"],"type":"object","x-order":["free","count","cpu","ram_mb"]},"cycles":{"items":{"properties":{"discount_pct":{"description":"Discount applied for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"},"slug":{"description":"Billing cycle identifier.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"type":"array"},"enabled":{"description":"Whether clusters can be created right now. When false the other fields may be absent or empty.","type":"boolean"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"limits":{"properties":{"clusters_max":{"description":"Most clusters per account.","type":"integer"},"workers_max":{"description":"Most workers in a cluster.","type":"integer"},"workers_min":{"description":"Fewest workers in a cluster.","type":"integer"}},"required":["workers_min","workers_max","clusters_max"],"type":"object","x-order":["workers_min","workers_max","clusters_max"]},"versions":{"items":{"properties":{"is_default":{"description":"Whether this version is used when none is chosen.","type":"boolean"},"name":{"description":"Version name to pass when creating a cluster.","type":"string"},"semver":{"description":"Semantic version.","type":"string"}},"required":["name","semver","is_default"],"type":"object","x-order":["name","semver","is_default"]},"type":"array"},"worker_disk_gb":{"description":"Disk size of every worker in GB.","type":"integer"},"worker_plans":{"items":{"properties":{"code":{"description":"Worker plan code, e.g. `K8S-1`.","type":"string"},"cycles":{"items":{"properties":{"cycle":{"description":"Billing cycle slug.","type":"string"},"cycle_cents":{"description":"Price of one worker for one cycle, in US cents.","type":"integer"},"discount_pct":{"description":"Cycle discount in percent.","type":"number"},"months":{"description":"Length of the cycle in months.","type":"integer"}},"required":["cycle","months","discount_pct","cycle_cents"],"type":"object","x-order":["cycle","months","discount_pct","cycle_cents"]},"type":"array"},"disk_gb":{"description":"Disk per worker in GB.","type":"integer"},"hourly_uusd":{"description":"Price of one worker per hour in millionths of a US dollar.","type":"integer"},"monthly_cents":{"description":"Price of one worker for a 30-day month in US cents.","type":"integer"},"ram_gb":{"description":"Memory per worker in GB.","type":"integer"},"vcpu":{"description":"Virtual CPU cores per worker.","type":"integer"}},"required":["code","vcpu","ram_gb","disk_gb","hourly_uusd","monthly_cents","cycles"],"type":"object","x-order":["code","vcpu","ram_gb","disk_gb","hourly_uusd","monthly_cents","cycles"]},"type":"array"},"zones":{"items":{"$ref":"#/components/schemas/Zone"},"type":"array"}},"required":["enabled"],"type":"object","x-order":["enabled","zones","versions","worker_plans","worker_disk_gb","cycles","control_plane","limits","hours_per_month","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site is closed or inactive."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site is closed or inactive. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site is closed or inactive."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be built right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be built right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be built right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public Kubernetes price list","tags":["Catalog"],"x-cli":"catalog k8s","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/k8s\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá Kubernetes công khai"}},"/v1/public/plans":{"get":{"description":"Returns the public price list of the site: fixed plans and the unit prices of custom configurations. It is the same information as the pricing page, with no account data, and is cached for up to a minute.\n\nUse [Get the VM catalog](#operation/catalog_vm) when you also need images and regions.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_plans","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"custom":{"enabled":false},"plans":[{"cpu":2,"disk_gb":60,"hourly":"$0.004704","hourly_uusd":4704,"monthly_cents":343,"name":"Standard 2/4","ram_mb":4096,"slug":"s-2c-4g"}],"settings":{"brand_name":"Example Cloud","bw_quota_gb":2048,"hours_per_month":730,"min_balance_cents":500,"port_speed":"10 Gbps"}},"schema":{"properties":{"custom":{"additionalProperties":true,"description":"Custom configuration pricing: `enabled`, unit prices per vCPU / GB RAM / GB disk, limits and allowed cycles.","type":"object"},"plans":{"items":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month in US cents.","type":"integer"},"name":{"description":"Display name.","type":"string"},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"slug":{"description":"Stable short name.","type":"string"}},"required":["name","slug","cpu","ram_mb","disk_gb","hourly_uusd","hourly","monthly_cents"],"type":"object","x-order":["name","slug","cpu","ram_mb","disk_gb","hourly_uusd","hourly","monthly_cents"]},"type":"array"},"settings":{"additionalProperties":true,"description":"Site settings relevant to prices: `port_speed`, `bw_quota_gb`, `hours_per_month`, `min_balance_cents`, `brand_name`, `fx`.","type":"object"}},"required":["plans","custom","settings"],"type":"object","x-order":["plans","custom","settings"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public price list of the site","tags":["Catalog"],"x-cli":"catalog plans","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/plans\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá công khai của site"}},"/v1/public/pricing":{"get":{"description":"Returns the complete retail price list of the site in one call: every fixed plan with the price of each billing cycle, the unit prices of custom configurations, the unit prices of the optional storage services, and the list of optional features switched on for the site. It is the data behind a public pricing page and contains no account information. Hourly prices are in millionths of a US dollar (`hourly_uusd`) and cycle prices are in US cents. The response may be cached for 60 seconds.\n\nPlans here have no identifiers; use [Get the VM catalog](#operation/catalog_vm) to get the `plan_id` and image identifiers needed to create a server.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_pricing","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"custom":{"cycle_discount":false,"cycles":[{"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"enabled":true,"from_monthly_cents":160,"limits":{"cpu":{"max":16,"min":1,"step":1},"disk_gb":{"max":500,"min":10,"step":10},"ram_gb":{"max":64,"min":1,"step":1}},"unit_hourly":{"cpu":"$0.002","disk_gb":"$0.00008","ram_gb":"$0.001"},"unit_uusd_h":{"cpu":2000,"disk_gb":80,"ram_gb":1000}},"features":{"backup":true,"bandwidth":true,"custom_plan":true,"gpu":false,"snapshots":true,"volume":true},"plans":[{"cpu":2,"cycles":[{"cents":0,"discount_pct":0.0,"months":0,"name":"Hourly","slug":"hourly"},{"cents":343,"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"disk_gb":60,"hourly":"$0.004704","hourly_mills":5,"hourly_uusd":4704,"monthly_cents":343,"name":"Standard 2/4","ram_mb":4096,"slug":"s-2c-4g"}],"settings":{"brand_name":"Example Cloud","bw_quota_gb":2048,"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"hours_per_month":730,"min_balance_cents":500,"port_speed":"10 Gbps"},"storage":{"backup_uusd_gb_hour":76,"snapshot_gb_month_cents":10,"snapshot_limit":3,"volume_uusd_gb_hour":136}},"schema":{"properties":{"custom":{"description":"Custom configuration pricing (any vCPU / RAM / disk combination within `limits`).","properties":{"cycle_discount":{"description":"Whether the cycle discounts also apply to custom configurations.","type":"boolean"},"cycles":{"items":{"properties":{"discount_pct":{"description":"Discount applied for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"},"slug":{"description":"Billing cycle identifier.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"type":"array"},"enabled":{"description":"Whether the site sells custom configurations. When false no other field is present.","type":"boolean"},"from_monthly_cents":{"description":"Monthly price of the smallest allowed configuration, in US cents.","type":"integer"},"limits":{"properties":{"cpu":{"description":"vCPU cores.","properties":{"max":{"description":"Largest allowed value.","type":"integer"},"min":{"description":"Smallest allowed value.","type":"integer"},"step":{"description":"Allowed values are `min` plus a multiple of `step`.","type":"integer"}},"required":["min","max","step"],"type":"object","x-order":["min","max","step"]},"disk_gb":{"description":"Disk in GB.","properties":{"max":{"description":"Largest allowed value.","type":"integer"},"min":{"description":"Smallest allowed value.","type":"integer"},"step":{"description":"Allowed values are `min` plus a multiple of `step`.","type":"integer"}},"required":["min","max","step"],"type":"object","x-order":["min","max","step"]},"ram_gb":{"description":"RAM in GB.","properties":{"max":{"description":"Largest allowed value.","type":"integer"},"min":{"description":"Smallest allowed value.","type":"integer"},"step":{"description":"Allowed values are `min` plus a multiple of `step`.","type":"integer"}},"required":["min","max","step"],"type":"object","x-order":["min","max","step"]}},"required":["cpu","ram_gb","disk_gb"],"type":"object","x-order":["cpu","ram_gb","disk_gb"]},"unit_hourly":{"properties":{"cpu":{"description":"Same as `unit_uusd_h.cpu` as a decimal string.","type":"string"},"disk_gb":{"description":"Same as `unit_uusd_h.disk_gb` as a decimal string.","type":"string"},"ram_gb":{"description":"Same as `unit_uusd_h.ram_gb` as a decimal string.","type":"string"}},"required":["cpu","ram_gb","disk_gb"],"type":"object","x-order":["cpu","ram_gb","disk_gb"]},"unit_uusd_h":{"properties":{"cpu":{"description":"Price of one vCPU per hour, in millionths of a US dollar.","type":"integer"},"disk_gb":{"description":"Price of 1 GB of disk per hour, in millionths of a US dollar.","type":"integer"},"ram_gb":{"description":"Price of 1 GB of RAM per hour, in millionths of a US dollar.","type":"integer"}},"required":["cpu","ram_gb","disk_gb"],"type":"object","x-order":["cpu","ram_gb","disk_gb"]}},"required":["enabled"],"type":"object","x-order":["enabled","unit_uusd_h","unit_hourly","limits","cycles","cycle_discount","from_monthly_cents"]},"features":{"additionalProperties":{"description":"Whether the feature is on.","type":"boolean"},"description":"Optional features of the site, keyed by feature name (for example `snapshots`, `backup`, `volume`, `gpu`, `bandwidth`). Names may be added over time.","type":"object"},"plans":{"items":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cycles":{"items":{"$ref":"#/components/schemas/CycleQuote"},"type":"array"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly":{"description":"Price per hour as a decimal string, e.g. `$0.004704`.","type":"string"},"hourly_mills":{"description":"Price per hour in mills (1 mill = US$0.001), rounded.","type":"integer"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar (exact).","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"name":{"description":"Display name.","type":"string"},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"slug":{"description":"Stable short name.","type":"string"}},"required":["name","slug","cpu","ram_mb","disk_gb","hourly_mills","hourly_uusd","hourly","monthly_cents"],"type":"object","x-order":["name","slug","cpu","ram_mb","disk_gb","hourly_mills","hourly_uusd","hourly","monthly_cents","cycles"]},"type":"array"},"settings":{"properties":{"brand_name":{"description":"Name of the provider.","type":"string"},"bw_quota_gb":{"description":"Monthly outbound traffic included with each server, in GB. 0 when traffic is not metered.","type":"integer"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"min_balance_cents":{"description":"Minimum wallet balance needed to create a server, in US cents.","type":"integer"},"port_speed":{"description":"Network port speed of servers, e.g. `10 Gbps`.","type":"string"}},"required":["port_speed","bw_quota_gb","hours_per_month","min_balance_cents","brand_name","fx"],"type":"object","x-order":["port_speed","bw_quota_gb","hours_per_month","min_balance_cents","brand_name","fx"]},"storage":{"description":"Unit prices of the optional storage services that are switched on. Fields of services that are off are absent. See [Get storage prices](#operation/catalog_storage) for limits.","properties":{"backup_auto_daily":{"description":"`true` when the site runs the automatic daily backup: one free copy per server, extra or pinned copies are billed. Present only when backups are on sale.","type":"boolean"},"backup_uusd_gb_hour":{"description":"Backup price per GB per hour, in millionths of a US dollar. Present only when backups are on sale.","type":"integer"},"snapshot_gb_month_cents":{"description":"Snapshot price per GB per month in US cents, rounded. Snapshots are billed by size at the same price as data volumes. Present only when snapshots are on sale.","type":"integer"},"snapshot_limit":{"description":"Most snapshots per server. Every snapshot is billed by size. Present only when snapshots are on sale.","type":"integer"},"snapshot_uusd_gb_hour":{"description":"Exact snapshot price per GB per hour, in millionths of a US dollar (equal to `volume_uusd_gb_hour`). Present only when snapshots are on sale.","type":"integer"},"volume_uusd_gb_hour":{"description":"Block storage volume price per GB per hour, in millionths of a US dollar. Present only when volumes are on sale.","type":"integer"}},"type":"object","x-order":["volume_uusd_gb_hour","backup_uusd_gb_hour","snapshot_gb_month_cents","snapshot_uusd_gb_hour","snapshot_limit","backup_auto_daily"]}},"required":["plans","custom","settings","storage","features"],"type":"object","x-order":["plans","custom","settings","storage","features"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site is closed or inactive."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site is closed or inactive. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site is closed or inactive."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be built right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be built right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be built right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Consolidated site pricing (VMs, storage, enabled features)","tags":["Catalog"],"x-cli":"catalog pricing","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/pricing\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá tổng hợp của site (VM, lưu trữ, tính năng đang bật)"}},"/v1/public/proxy":{"get":{"description":"Returns the public price list of the worldwide proxy products: Datacenter, Static Residential (fixed IPs, priced per IP per month with a 250 GB traffic allowance) and Rotating Residential (priced per GB of traffic). For each product it lists the countries with stock, the price a customer pays from, and sample price tiers. All prices are in millionths of a US dollar and already include every fee. Stock numbers are rounded down. The response may be cached for 10 minutes.\n\nWhen the products are not on sale `enabled` is false and nothing else is returned. Place an order from your account with the VPN order flow.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_proxy_intl","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"kinds":[{"countries":[{"code":"DE","stock":480},{"code":"US","stock":900}],"cycles":["monthly"],"from_uusd":1890000,"gb":250,"kind":"dc","tiers":[{"qty":1,"total_uusd":1890000,"unit_uusd":1890000},{"qty":10,"total_uusd":15000000,"unit_uusd":1500000}],"unit":"ip"}],"supply_hours":24},"schema":{"properties":{"enabled":{"description":"Whether the worldwide proxy products are on sale. When false no other field is present.","type":"boolean"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"kinds":{"items":{"properties":{"countries":{"items":{"properties":{"code":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"stock":{"description":"IPs in stock, rounded down. Absent for traffic-priced products.","type":"integer"}},"required":["code"],"type":"object"},"type":"array"},"cycles":{"items":{"description":"Billing period: only `monthly`.","type":"string"},"type":"array"},"from_uusd":{"description":"Lowest price per unit (`unit`) across the tiers, in millionths of a US dollar.","type":"integer"},"gb":{"description":"Traffic allowance in GB of the sample plan (IP-based products); null for traffic-priced products.","type":["integer","null"]},"kind":{"description":"`dc` Datacenter, `isp` Static Residential, `resi` Rotating Residential.","enum":["dc","isp","resi"],"type":"string"},"tiers":{"items":{"properties":{"qty":{"description":"Number of IPs or GB the tier prices.","type":"integer"},"total_uusd":{"description":"Price of the whole tier for one month, in millionths of a US dollar.","type":"integer"},"unit_uusd":{"description":"Price per IP or per GB at this tier, in millionths of a US dollar.","type":"integer"}},"required":["qty","total_uusd","unit_uusd"],"type":"object"},"type":"array"},"unit":{"description":"What the price is per: one IP per month, or one GB of traffic.","enum":["ip","gb"],"type":"string"}},"required":["kind","unit","cycles","from_uusd","tiers","countries"],"type":"object","x-order":["kind","unit","gb","cycles","from_uusd","tiers","countries"]},"type":"array"},"supply_hours":{"description":"Hours within which a paid order is delivered; an order not delivered by then is refunded automatically.","type":"integer"}},"required":["enabled"],"type":"object","x-order":["enabled","kinds","supply_hours","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site does not sell VPN products."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell VPN products. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site does not sell VPN products."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be read right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be read right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be read right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public worldwide proxy price list (Datacenter, Static/Rotating Residential)","tags":["Catalog"],"x-cli":"catalog proxy intl","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/proxy\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá proxy quốc tế công khai (Datacenter, Static/Rotating Residential)"}},"/v1/public/proxy6":{"get":{"description":"Returns the public price list of IPv6 proxies: the fixed plans with the price of each billing period, the bandwidth and device add-ons, and the regions with their availability. All prices are in millionths of a US dollar. The response may be cached for 60 seconds.\n\nWhen your site does not sell IPv6 proxies the call returns `200` with just `{\"enabled\": false}`. When it does not sell VPN products at all it returns `404 service_unavailable`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_proxy6","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"blocked_ports":[25,465,587,2525],"cycles":[{"days":1,"months":0,"slug":"daily"},{"days":7,"months":0,"slug":"weekly"},{"days":0,"months":1,"slug":"monthly"},{"days":0,"months":12,"slug":"yearly"}],"device_addon":{"max":20,"prices":{"daily":192000,"monthly":3837000,"weekly":1200000,"yearly":32230000}},"egress":"ipv6_only","enabled":true,"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"mbps_addon":{"max":20,"prices":{"daily":192000,"monthly":3837000,"weekly":1200000,"yearly":32230000},"step":50},"plans":[{"count":100,"devices":0,"kind":"static","mbps":50,"prices":{"daily":288000,"monthly":5755000,"weekly":1800000,"yearly":48342000},"slug":"static-100"}],"zones":[{"available":true,"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]},"schema":{"properties":{"available":{"description":"Whether proxies can be ordered right now. False means capacity is temporarily out.","type":"boolean"},"blocked_ports":{"items":{"description":"TCP port that is blocked.","type":"integer"},"type":"array"},"cycles":{"items":{"properties":{"days":{"description":"Length in days (0 for monthly and yearly).","type":"integer"},"months":{"description":"Length in months (0 for daily and weekly).","type":"integer"},"slug":{"description":"Billing period identifier: `daily`, `weekly`, `monthly` or `yearly`.","type":"string"}},"required":["slug","months","days"],"type":"object","x-order":["slug","months","days"]},"type":"array"},"device_addon":{"properties":{"max":{"description":"Most units per order.","type":"integer"},"prices":{"$ref":"#/components/schemas/Proxy6PriceSet"}},"required":["prices","max"],"type":"object","x-order":["prices","max"]},"egress":{"description":"Address family of outbound traffic: always `ipv6_only`.","type":"string"},"enabled":{"description":"Whether the site sells IPv6 proxies. When false no other field is present.","type":"boolean"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"mbps_addon":{"properties":{"max":{"description":"Most units per order.","type":"integer"},"prices":{"$ref":"#/components/schemas/Proxy6PriceSet"},"step":{"description":"Each add-on unit adds this many Mbps.","type":"integer"}},"required":["step","prices","max"],"type":"object","x-order":["step","prices","max"]},"plans":{"items":{"properties":{"count":{"description":"Static plans: number of IPs. Rotating plans: rotations per period. Unlimited plans: 0.","type":"integer"},"devices":{"description":"Devices included (0 = not limited per device).","type":"integer"},"kind":{"description":"`static` keeps fixed IPs, `rotate` changes IP on request with a limited number of rotations, `unlimited` rotates without a limit.","enum":["static","rotate","unlimited"],"type":"string"},"mbps":{"description":"Standard speed of the plan in Mbps.","type":"integer"},"prices":{"$ref":"#/components/schemas/Proxy6PriceSet"},"slug":{"description":"Plan identifier, e.g. `static-100`. Pass it as `plan` when quoting or ordering.","type":"string"}},"required":["slug","kind","count","mbps","devices","prices"],"type":"object","x-order":["slug","kind","count","mbps","devices","prices"]},"type":"array"},"zones":{"items":{"properties":{"available":{"description":"Whether the region can take new orders right now.","type":"boolean"},"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"id":{"description":"Region identifier. Pass it as `zone_id` when ordering.","type":"integer"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"}},"required":["id","slug","name","name_en","country","city","available"],"type":"object","x-order":["id","slug","name","name_en","country","city","available"]},"type":"array"}},"required":["enabled"],"type":"object","x-order":["enabled","available","cycles","plans","mbps_addon","device_addon","zones","egress","blocked_ports","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site does not sell VPN products."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell VPN products. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site does not sell VPN products."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be read right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be read right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be read right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public Proxy IPv6 price list","tags":["Catalog"],"x-cli":"catalog proxy6","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/proxy6\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá Proxy IPv6 công khai"}},"/v1/public/s3":{"get":{"description":"Returns the public price list of pay-as-you-go object storage: the price per GB of storage and per GB downloaded, the free allowance, and the regions where it can be ordered. Uploads are free.\n\nUnlike the rest of the catalog, **object storage prices are in Vietnamese dong (VND)**, not US dollars. Use `fx.usd_vnd` to convert. Usage is metered per hour (the monthly storage price divided by 730 per GB-hour) and charged to the wallet in US cents at the exchange rate of the day. Object storage is not sold on every site: when your site does not sell it the call returns `404 service_unavailable`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_s3","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"policy":{"bandwidth_in_price_per_gb":0.0,"bandwidth_out_price_per_gb":999.0,"free_tier_gb":100.0,"storage_price_per_gb_month":399.0},"units":{"gb_bytes":1073741824,"hours_per_month":730},"zones":[{"city":"Ho Chi Minh City","country":"VN","id":1,"is_default":true,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","services":["vm","vpn","s3"],"slug":"hcm-1"}]},"schema":{"properties":{"fx":{"$ref":"#/components/schemas/CatalogFx"},"policy":{"properties":{"bandwidth_in_price_per_gb":{"description":"Upload (inbound traffic) price per GB, in VND. Always 0.","type":"number"},"bandwidth_out_price_per_gb":{"description":"Download (outbound traffic) price per GB, in VND.","type":"number"},"free_tier_gb":{"description":"Storage in GB that is free while the account has a running server.","type":"number"},"storage_price_per_gb_month":{"description":"Storage price per GB per month, in VND.","type":"number"}},"required":["storage_price_per_gb_month","bandwidth_out_price_per_gb","bandwidth_in_price_per_gb","free_tier_gb"],"type":"object","x-order":["storage_price_per_gb_month","bandwidth_out_price_per_gb","bandwidth_in_price_per_gb","free_tier_gb"]},"units":{"properties":{"gb_bytes":{"description":"Bytes in one GB as used for billing (1073741824, i.e. a GiB).","type":"integer"},"hours_per_month":{"description":"Hours used to turn the monthly storage price into an hourly one (730).","type":"integer"}},"required":["gb_bytes","hours_per_month"],"type":"object"},"zones":{"items":{"$ref":"#/components/schemas/CatalogZone"},"type":"array"}},"required":["policy","zones","fx","units"],"type":"object","x-order":["policy","zones","fx","units"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site does not sell object storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell object storage. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site does not sell object storage."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be read right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be read right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be read right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public S3 price list","tags":["Catalog"],"x-cli":"catalog s3","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/s3\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá S3 công khai"}},"/v1/public/storage":{"get":{"description":"Returns the retail prices and limits of the storage services: block storage volumes, backups, snapshots and uploaded images. Each service appears as an object with `enabled`; when a service is not on sale at your site only `{\"enabled\": false}` is returned for it. Prices per GB-hour are in millionths of a US dollar. The response may be cached for 60 seconds.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_storage","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"backup":{"enabled":true,"keep_default":3,"max_per_vm":5,"uusd_gb_hour":76},"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"hours_per_month":730,"images":{"enabled":false},"snapshot":{"enabled":true,"gb_month_cents":10,"limit_per_vm":3,"schedules_per_vm":2},"volume":{"attach_with_backups":false,"enabled":true,"max_gb":2000,"max_per_account":20,"max_per_vm":4,"min_gb":10,"step_gb":10,"uusd_gb_hour":136}},"schema":{"properties":{"backup":{"description":"Server backups.","properties":{"auto_daily":{"description":"`true` when the automatic daily backup is running on this site.","type":"boolean"},"auto_free_copies":{"description":"Copies per server that are free under the automatic daily backup (the newest unpinned one).","type":"integer"},"enabled":{"description":"Whether backups are on sale. When false no other field is present.","type":"boolean"},"keep_default":{"description":"Number of backups kept by default when a schedule does not say otherwise.","type":"integer"},"max_per_vm":{"description":"Most backups kept per server.","type":"integer"},"uusd_gb_hour":{"description":"Price per GB of backup data per hour, in millionths of a US dollar.","type":"integer"}},"required":["enabled"],"type":"object","x-order":["enabled","uusd_gb_hour","max_per_vm","keep_default","auto_daily","auto_free_copies"]},"fx":{"$ref":"#/components/schemas/CatalogFx"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"images":{"description":"Uploaded OS and ISO images.","properties":{"enabled":{"description":"Whether uploaded images are on sale. When false no other field is present.","type":"boolean"},"iso_max_gb":{"description":"Largest ISO image in GB.","type":"integer"},"max_gb_per_account":{"description":"Most total image storage per account, in GB.","type":"integer"},"max_per_account":{"description":"Most images per account.","type":"integer"},"template_max_gb":{"description":"Largest OS image in GB.","type":"integer"},"uusd_gb_hour":{"description":"Price per GB of stored image per hour, in millionths of a US dollar.","type":"integer"}},"required":["enabled"],"type":"object","x-order":["enabled","uusd_gb_hour","iso_max_gb","template_max_gb","max_per_account","max_gb_per_account"]},"snapshot":{"description":"Server snapshots.","properties":{"enabled":{"description":"Whether snapshots are on sale. When false no other field is present.","type":"boolean"},"gb_month_cents":{"description":"Price per GB per month in US cents, rounded. Snapshots are billed by size at the data-volume price.","type":"integer"},"limit_per_vm":{"description":"Most snapshots per server.","type":"integer"},"schedules_per_vm":{"description":"Most automatic snapshot schedules per server.","type":"integer"},"uusd_gb_hour":{"description":"Exact price per GB per hour, in millionths of a US dollar.","type":"integer"}},"required":["enabled"],"type":"object","x-order":["enabled","gb_month_cents","uusd_gb_hour","limit_per_vm","schedules_per_vm"]},"volume":{"description":"Block storage volumes.","properties":{"attach_with_backups":{"description":"Whether a volume can be attached to or detached from a server that has backups. When false, delete the server backups first.","type":"boolean"},"enabled":{"description":"Whether block storage volumes are on sale. When false no other field is present.","type":"boolean"},"max_gb":{"description":"Largest volume size in GB.","type":"integer"},"max_per_account":{"description":"Most data volumes per account.","type":"integer"},"max_per_vm":{"description":"Most data volumes that can be attached to one server.","type":"integer"},"min_gb":{"description":"Smallest volume size in GB.","type":"integer"},"step_gb":{"description":"Volume sizes must be a multiple of this many GB.","type":"integer"},"uusd_gb_hour":{"description":"Price per GB per hour, in millionths of a US dollar.","type":"integer"}},"required":["enabled"],"type":"object","x-order":["enabled","uusd_gb_hour","min_gb","max_gb","step_gb","max_per_vm","max_per_account","attach_with_backups"]}},"required":["hours_per_month","fx","volume","backup","snapshot","images"],"type":"object","x-order":["hours_per_month","fx","volume","backup","snapshot","images"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site is closed or inactive."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site is closed or inactive. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site is closed or inactive."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be built right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be built right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be built right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Block Storage, Backup, Snapshot and Images pricing","tags":["Catalog"],"x-cli":"catalog storage","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/storage\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Giá Block Storage, Backup, Snapshot, Images"}},"/v1/public/trial":{"get":{"description":"Public description of the trial credit program shown on the website: amount, validity, the top-up that activates it and the services it covers. No sign-in needed. Sites run by a reseller return `enabled: false`.\n\n**Required scope:** `catalog:read`.","operationId":"public_trial","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"amount_cents":10000,"days":30,"enabled":true,"fx":{"usd_vnd":26210},"min_deposit_cents":1000,"services":["vm","vpn4","vpn6"]},"schema":{"properties":{"amount_cents":{"description":"Trial credit, in US cents.","type":"integer"},"days":{"description":"Validity after activation, in days.","type":"integer"},"enabled":{"description":"Whether the program is on.","type":"boolean"},"fx":{"additionalProperties":true,"description":"Public display exchange rates (same object as `settings.fx` of the public price list) so the amount can be shown in the visitor's currency; amounts stay in US cents.","type":"object"},"min_deposit_cents":{"description":"Smallest real top-up that activates it, in US cents.","type":"integer"},"services":{"items":{"description":"Covered service.","enum":["vm","vpn4","vpn6"],"type":"string"},"type":"array"}},"required":["enabled","amount_cents","days","min_deposit_cents","services","fx"],"type":"object","x-order":["enabled","amount_cents","days","min_deposit_cents","services","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Trial program (public)","tags":["Billing"],"x-cli":"public trial","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/trial\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Chương trình dùng thử (công khai)"}},"/v1/public/vm-quote":{"get":{"description":"Prices a custom size in a region without an account: the same answer as [Quote a custom size in a region](#operation/catalog_region-quote) but for visitors. Only values listed in the region's `custom` block are accepted. Limited to 30 calls per minute per IP address.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_region_price","parameters":[{"description":"Region `slug` from List regions.","example":"sg-singapore","in":"query","name":"region","required":true,"schema":{"type":"string"}},{"description":"CPU type: `A` Availability, `B` General Purpose, `D` Dedicated.","in":"query","name":"cpu_type","required":true,"schema":{"enum":["A","B","D"],"type":"string"}},{"description":"Number of cores, one of the values listed for the CPU type.","example":4,"in":"query","name":"cores","required":true,"schema":{"type":"integer"}},{"description":"Memory in MiB, one of the values listed for the CPU type.","example":8192,"in":"query","name":"ram_mb","required":true,"schema":{"type":"integer"}},{"description":"System disk in GiB, one of the listed values.","example":100,"in":"query","name":"disk_gb","required":true,"schema":{"type":"integer"}},{"description":"OS image you intend to install; when given, the size must reach that image's minimum.","in":"query","name":"template_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"cycles":[{"cents":0,"discount_pct":0.0,"months":0,"name":"Hourly","slug":"hourly"},{"cents":10118,"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"hourly":"$0.1386","hourly_uusd":138600,"monthly_cents":10118,"off_hourly_uusd":15400,"spec":{"cores":4,"cpu_type":"B","disk_gb":100,"ram_mb":8192},"traffic":{"pay_per_use":true,"usd_per_gb":0.011}},"schema":{"properties":{"cycles":{"items":{"$ref":"#/components/schemas/CycleQuote"},"type":"array"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour while running, in millionths of a US dollar.","type":"integer"},"license":{"properties":{"family":{"description":"Which operating-system license the image needs: Windows Server or Windows desktop.","enum":["server","desktop"],"type":"string"},"hourly_uusd":{"description":"License price per hour, in millionths of a US dollar. Already included in `hourly_uusd`, `off_hourly_uusd` and the cycle prices.","type":"integer"},"monthly_cents":{"description":"License price for a 30-day month (730 hours) in US cents.","type":"integer"}},"required":["family","hourly_uusd","monthly_cents"],"type":["object","null"]},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"off_hourly_uusd":{"description":"Price per hour while the server is stopped, in millionths of a US dollar. Includes the license fee of a licensed image (it is charged while stopped too).","type":"integer"},"spec":{"properties":{"cores":{"description":"Number of cores.","type":"integer"},"cpu_type":{"description":"CPU type.","type":"string"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["cpu_type","cores","ram_mb","disk_gb"],"type":"object","x-order":["cpu_type","cores","ram_mb","disk_gb"]},"traffic":{"anyOf":[{"$ref":"#/components/schemas/VmTraffic"},{"type":"null"}]}},"required":["spec","hourly_uusd","hourly","monthly_cents","off_hourly_uusd","cycles","traffic"],"type":"object","x-order":["spec","hourly_uusd","hourly","monthly_cents","off_hourly_uusd","license","cycles","traffic"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A parameter is missing or is not a listed value for the region. `detail` names the parameter."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A parameter is missing or is not a listed value for the region. `detail` names the parameter. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A parameter is missing or is not a listed value for the region. `detail` names the parameter."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"zone_not_found","message":"The region does not exist or is not on sale."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The region does not exist or is not on sale. (`zone_not_found`)","x-error-codes":[{"code":"zone_not_found","description":"The region does not exist or is not on sale."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"zone_not_ready","message":"The region cannot price this size at the moment."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The region cannot price this size at the moment. (`zone_not_ready`)","x-error-codes":[{"code":"zone_not_ready","description":"The region cannot price this size at the moment."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"image_requirements","message":"`template_id` was given and the size is below the image's minimum. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`template_id` was given and the size is below the image's minimum. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`). (`image_requirements`)","x-error-codes":[{"code":"image_requirements","description":"`template_id` was given and the size is below the image's minimum. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 30 calls per minute from this IP address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 30 calls per minute from this IP address."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Quote a custom size in a region (public)","tags":["Catalog"],"x-cli":"catalog region-price","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/vm-quote?region=<region>&cpu_type=<cpu_type>&cores=<cores>&ram_mb=<ram_mb>&disk_gb=<disk_gb>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Báo giá cấu hình tuỳ chỉnh ở một vị trí (công khai)"}},"/v1/public/vm-regions":{"get":{"description":"Lists the regions where servers are on sale to everyone, with the monthly price of the cheapest fixed plan and the CPU types on offer. It needs no account, is the same for every visitor and is cached for up to five minutes. Use [Get the VM catalog](#operation/catalog_vm) for the full plan list of a signed-in account.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_regions","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"regions":[{"city":"Ho Chi Minh City","continent":"asia","cpu_types":[],"iso2":"VN","name":"Ho Chi Minh City","price_from_cents":343,"slug":"hcm-1","traffic":null},{"city":"Singapore","continent":"asia","cpu_types":["A","B","D"],"iso2":"SG","name":"Singapore","price_from_cents":402,"slug":"sg-singapore","traffic":{"unlimited":true,"uplink_gbps":1}}],"updated_at":1792400000},"schema":{"properties":{"regions":{"items":{"properties":{"city":{"description":"City.","type":["string","null"]},"continent":{"description":"Continent, for grouping.","enum":["asia","europe","north_america","middle_east","oceania",null],"type":["string","null"]},"cpu_types":{"items":{"description":"CPU type on offer: `A` Availability (shared cores, best value), `B` General Purpose (consistent performance), `D` Dedicated (dedicated cores). Empty in regions that offer a single kind of server.","enum":["A","B","D"],"type":"string"},"type":"array"},"iso2":{"description":"ISO country code.","type":"string"},"name":{"description":"Display name.","type":"string"},"price_from_cents":{"description":"Monthly price in US cents of the cheapest fixed plan. `null` when none is on sale.","type":["integer","null"]},"slug":{"description":"Stable short name of the region.","type":"string"},"traffic":{"properties":{"unlimited":{"description":"Always `true`: bandwidth is unlimited, there is no traffic allowance and no traffic fee.","type":"boolean"},"uplink_gbps":{"description":"Uplink port speed in Gbit/s (1).","type":"integer"}},"required":["unlimited","uplink_gbps"],"type":["object","null"]}},"required":["slug","name","city","iso2","continent","price_from_cents","traffic","cpu_types"],"type":"object","x-order":["slug","name","city","iso2","continent","price_from_cents","traffic","cpu_types"]},"type":"array"},"updated_at":{"description":"When the list was built, Unix seconds.","type":"integer"}},"required":["regions","updated_at"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"The site you call is not the main site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site you call is not the main site. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"The site you call is not the main site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Regions open for sale and starting prices","tags":["Catalog"],"x-cli":"catalog regions","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/vm-regions\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Vị trí đang mở bán máy ảo và giá từ"}},"/v1/public/vm-regions/{slug}":{"get":{"description":"Describes one region that is on sale to everyone: its CPU types (with a one-line description), every fixed plan with its hourly and monthly price, the custom sizes you can build (same `custom` block as the catalog), the price of traffic and the billing cycles sold there. It needs no account and is cached for up to five minutes.\n\nUse [Quote a custom size (public)](#operation/catalog_region-price) to price a custom size, and [List regions](#operation/catalog_regions) to find the `slug`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_region","parameters":[{"description":"Region `slug` from List regions.","in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cpu_types":[{"description":"Shared cores, best value","label":"Availability","type":"A"}],"custom":null,"cycles":["hourly","monthly"],"plans":[{"cpu":1,"cpu_type":"A","disk_gb":20,"hourly_uusd":5500,"id":41,"monthly_cents":402,"ram_mb":1024}],"region":{"city":"Singapore","continent":"asia","iso2":"SG","name":"Singapore","slug":"sg-singapore"},"traffic":{"unlimited":true,"uplink_gbps":1}},"schema":{"properties":{"cpu_types":{"items":{"properties":{"description":{"description":"One-line description of the CPU type.","type":"string"},"label":{"description":"Display name: `Availability`, `General Purpose` or `Dedicated`.","type":"string"},"type":{"description":"CPU type.","enum":["A","B","D"],"type":"string"}},"required":["type","label","description"],"type":"object","x-order":["type","label","description"]},"type":"array"},"custom":{"anyOf":[{"$ref":"#/components/schemas/VmCatalogCustom"},{"type":"null"}]},"cycles":{"items":{"description":"Billing cycle slug sold in the region, e.g. `hourly`, `monthly`.","type":"string"},"type":"array"},"plans":{"items":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cpu_type":{"description":"CPU type of the plan.","enum":["A","B","D",null],"type":["string","null"]},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"id":{"description":"Plan identifier.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["id","cpu_type","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents"],"type":"object","x-order":["id","cpu_type","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents"]},"type":"array"},"region":{"properties":{"city":{"description":"City.","type":["string","null"]},"continent":{"description":"Continent, for grouping.","enum":["asia","europe","north_america","middle_east","oceania",null],"type":["string","null"]},"iso2":{"description":"ISO country code.","type":"string"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Stable short name of the region.","type":"string"}},"required":["slug","name","city","iso2","continent"],"type":"object","x-order":["slug","name","city","iso2","continent"]},"traffic":{"properties":{"unlimited":{"description":"Always `true`: bandwidth is unlimited, there is no traffic allowance and no traffic fee.","type":"boolean"},"uplink_gbps":{"description":"Uplink port speed in Gbit/s (1).","type":"integer"}},"required":["unlimited","uplink_gbps"],"type":["object","null"]}},"required":["region","cpu_types","plans","custom","traffic","cycles"],"type":"object","x-order":["region","cpu_types","plans","custom","traffic","cycles"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"zone_not_found","message":"The region does not exist or is not on sale, or the site you call is not the main site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The region does not exist or is not on sale, or the site you call is not the main site. (`zone_not_found`)","x-error-codes":[{"code":"zone_not_found","description":"The region does not exist or is not on sale, or the site you call is not the main site."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"One region in detail: CPU types, plans, custom sizes, traffic, cycles","tags":["Catalog"],"x-cli":"catalog region","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/vm-regions/<slug>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Chi tiết một vị trí: loại CPU, gói, tuỳ chỉnh, traffic, chu kỳ"}},"/v1/public/vpc":{"get":{"description":"Returns the public price list of private cloud networks: the plans (dedicated unmetered bandwidth in Mbps) with their hourly, monthly and per-cycle prices, the billing cycles, the region, the account limits and the network features. Prices are in US cents or millionths of a US dollar as named. The response may be cached for 60 seconds.\n\nWhen your site does not sell private cloud networks the call returns `200` with just `{\"enabled\": false}`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_vpc","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"cycles":[{"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"enabled":true,"features":{"cidr":"/16","ipv6_per_tier":"/64","network_acl":true,"router":"single","unmetered":true},"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"hours_per_month":730,"limits":{"max_acl_rules":50,"max_per_account":1,"max_tiers":3,"max_vms":50},"plans":[{"cycles":[{"cycle":"monthly","cycle_cents":803,"discount_pct":0.0,"months":1,"name":"Monthly"}],"hourly_uusd":11000,"mbps":100,"monthly_cents":803,"name":"Private Cloud 100 Mbps","slug":"vpc-100"}],"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"schema":{"properties":{"cycles":{"items":{"properties":{"discount_pct":{"description":"Discount applied for paying this cycle up front, in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"},"slug":{"description":"Billing cycle identifier.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"type":"array"},"enabled":{"description":"Whether private cloud networks are on sale. When false no other field is present.","type":"boolean"},"features":{"properties":{"cidr":{"description":"Address range size of the network, e.g. `/16`.","type":"string"},"ipv6_per_tier":{"description":"IPv6 prefix size given to each subnet, e.g. `/64`.","type":"string"},"network_acl":{"description":"Whether network ACL rules are available.","type":"boolean"},"router":{"description":"Router layout: `single`.","type":"string"},"unmetered":{"description":"Traffic is not metered.","type":"boolean"}},"required":["unmetered","ipv6_per_tier","cidr","router","network_acl"],"type":"object","x-order":["unmetered","ipv6_per_tier","cidr","router","network_acl"]},"fx":{"$ref":"#/components/schemas/CatalogFx"},"hours_per_month":{"description":"Hours in a billing month (730).","type":"integer"},"limits":{"properties":{"max_acl_rules":{"description":"Most network ACL rules per network.","type":"integer"},"max_per_account":{"description":"Most private cloud networks per account.","type":"integer"},"max_tiers":{"description":"Most subnets (tiers) per network.","type":"integer"},"max_vms":{"description":"Most servers per network.","type":"integer"}},"required":["max_per_account","max_tiers","max_vms","max_acl_rules"],"type":"object","x-order":["max_per_account","max_tiers","max_vms","max_acl_rules"]},"plans":{"items":{"properties":{"cycles":{"items":{"properties":{"cycle":{"description":"Billing cycle slug.","type":"string"},"cycle_cents":{"description":"Price of one cycle in US cents (0 for hourly).","type":"integer"},"discount_pct":{"description":"Cycle discount in percent.","type":"number"},"months":{"description":"Length of the cycle in months (0 = pay by the hour).","type":"integer"},"name":{"description":"Display name of the cycle.","type":"string"}},"required":["cycle","name","months","discount_pct","cycle_cents"],"type":"object","x-order":["cycle","name","months","discount_pct","cycle_cents"]},"type":"array"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"mbps":{"description":"Dedicated unmetered bandwidth in Mbps.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month in US cents.","type":"integer"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Plan identifier.","type":"string"}},"required":["slug","name","mbps","hourly_uusd","monthly_cents","cycles"],"type":"object","x-order":["slug","name","mbps","hourly_uusd","monthly_cents","cycles"]},"type":"array"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}],"description":"Region where private cloud networks are created; null when none is ready."}},"required":["enabled"],"type":"object","x-order":["enabled","plans","cycles","zone","limits","features","hours_per_month","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site is closed or inactive."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site is closed or inactive. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site is closed or inactive."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be built right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be built right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be built right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public Private Cloud price list","tags":["Catalog"],"x-cli":"catalog vpc","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/vpc\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá Private Cloud công khai"}},"/v1/public/vpn":{"get":{"description":"Returns the public price list of VPN IPs: the price per IP at each order size, the bandwidth tiers, the add-ons, the billing cycles and the regions. Only the `dedicated` tier is on sale; `shared` and `private` stay in the response for compatibility but have empty `ip_breaks`. All prices are in millionths of a US dollar. The response may be cached for 60 seconds.\n\nTo price a specific order call [Quote a VPN order](#operation/catalog_vpn_quote). When your site does not sell VPN the call returns `404 service_unavailable`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_vpn","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"addons":[{"key":"concurrency","name":"High Concurrency","uusd_month":10090000}],"cycles":[{"days":1,"discount_pct":0.0,"months":0,"name":"Daily","price_bp":500,"slug":"daily"},{"days":0,"discount_pct":0.0,"months":1,"name":"Monthly","price_bp":0,"slug":"monthly"},{"days":0,"discount_pct":30.0,"months":12,"name":"Yearly","price_bp":0,"slug":"yearly"}],"dedicated":{"bw_breaks":[{"gb":250,"uusd_month":0},{"gb":1000,"uusd_month":13460000},{"gb":0,"uusd_month":61890000}],"ip_breaks":[{"min_ip":1,"uusd_ip_month":958000},{"min_ip":10,"uusd_ip_month":843000}],"max_ips":10000,"min_ips":1},"fx":{"margin_bp":0,"round_step":1000,"source":"auto","stale":false,"updated_at":1760000100,"usd_vnd":26000,"vcb_at":1760000000,"vcb_sell":26050},"private":{"bw_breaks":[{"gb":250,"uusd_month":0}],"ip_breaks":[],"max_ips":15000,"min_ips":1},"shared":{"bw_breaks":[{"gb":250,"uusd_month":0},{"gb":1000,"uusd_month":13460000}],"ip_breaks":[],"max_ips":15000,"min_ips":1},"zones":[{"available":true,"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]},"schema":{"properties":{"addons":{"items":{"$ref":"#/components/schemas/VpnAddonPrice"},"type":"array"},"cycles":{"items":{"$ref":"#/components/schemas/VpnCyclePrice"},"type":"array"},"dedicated":{"$ref":"#/components/schemas/VpnTierPricing"},"fx":{"$ref":"#/components/schemas/CatalogFx"},"private":{"$ref":"#/components/schemas/VpnTierPricing"},"shared":{"$ref":"#/components/schemas/VpnTierPricing"},"zones":{"items":{"properties":{"available":{"description":"Whether the region can take new orders right now.","type":"boolean"},"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"id":{"description":"Region identifier. Pass it as `zone_id` when ordering.","type":"integer"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"}},"required":["id","slug","name","name_en","country","city","available"],"type":"object","x-order":["id","slug","name","name_en","country","city","available"]},"type":"array"}},"required":["shared","private","dedicated","addons","cycles","zones","fx"],"type":"object","x-order":["shared","private","dedicated","addons","cycles","zones","fx"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site does not sell VPN."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell VPN. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site does not sell VPN."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be read right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be read right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be read right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Public VPN IPv4 price list","tags":["Catalog"],"x-cli":"catalog vpn","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/public/vpn\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Bảng giá VPN IPv4 công khai"}},"/v1/public/vpn/quote":{"post":{"description":"Prices a VPN order without creating anything and without charging. The body describes the order (tier, number of IPs, bandwidth tier, billing cycle, add-ons) and the response is the price breakdown in millionths of a US dollar; `total_uusd` is what one cycle costs.\n\nWhen the order is not valid (for example too many IPs or an unknown cycle) the call returns **422 with the same quote object**, whose `errors` array lists the problems. Orders for the retired `shared` and `private` tiers or for retired add-ons fail with `tier_retired` or `addon_retired` in the usual error format. A body that cannot be parsed at all gets a plain-text 400 or 422 from the server rather than the usual error object. When your site does not sell VPN the call returns `404 service_unavailable`.\n\nThe account-level call [Quote a VPN order for your account](#operation/vpn_quote) also returns the wallet amount in cents.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_vpn_quote","parameters":[],"requestBody":{"content":{"application/json":{"example":{"addons":["concurrency"],"bandwidth_gb":1000,"cycle":"monthly","ip_count":10,"tier":"dedicated"},"schema":{"$ref":"#/components/schemas/VpnQuoteRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"addon_lines":[["High Concurrency",10090000]],"addons_uusd_month":10090000,"bandwidth_gb":1000,"bandwidth_uusd_month":13460000,"cycle":"monthly","days":0,"discount_pct":0.0,"effective_monthly_uusd":31980000,"errors":[],"ip_count":10,"ips_uusd_month":8430000,"list_monthly_uusd":33120000,"list_unit_uusd_month":958000,"monthly_uusd":31980000,"months":1,"tier":"dedicated","total_uusd":31980000,"unit_uusd_month":843000},"schema":{"$ref":"#/components/schemas/VpnQuote"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"service_unavailable","message":"Your site does not sell VPN."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell VPN. (`service_unavailable`)","x-error-codes":[{"code":"service_unavailable","description":"Your site does not sell VPN."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"tier_retired","message":"The `shared` and `private` tiers are no longer sold; use `dedicated`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`tier_retired`: The `shared` and `private` tiers are no longer sold; use `dedicated`. `addon_retired`: An add-on in the request is no longer sold.","x-error-codes":[{"code":"tier_retired","description":"The `shared` and `private` tiers are no longer sold; use `dedicated`."},{"code":"addon_retired","description":"An add-on in the request is no longer sold."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"catalog_unavailable","message":"The price list could not be read right now. Retry shortly."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price list could not be read right now. Retry shortly. (`catalog_unavailable`)","x-error-codes":[{"code":"catalog_unavailable","description":"The price list could not be read right now. Retry shortly."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Quote a VPN IPv4 order (nothing is purchased)","tags":["Catalog"],"x-cli":"catalog vpn-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/public/vpn/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"addons\":[\"concurrency\"],\"bandwidth_gb\":1000,\"cycle\":\"monthly\",\"ip_count\":10,\"tier\":\"dedicated\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Báo giá VPN IPv4 (không đặt mua)"}},"/v1/s3":{"get":{"description":"Returns the S3 accounts you own, newest first. The list is not paginated. Accounts that are being deleted are not listed. Object storage is available on the main site only. Use the `id` of an account in every other S3 path.\n\n**Required scope:** `s3:read`.","operationId":"s3_account_list","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"billing_start":1792400400,"created_at":1792402313,"id":"mR7xQ2vK9tLp4WnZc8YbH1sJdGfE6uAoVi3TyNkX0Mw","name":"Backups","quota_gb":2048,"state":"active","zone_id":1}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/S3Account"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"Object storage is not available on this site (it is offered on the main site only)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Object storage is not available on this site (it is offered on the main site only). (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"Object storage is not available on this site (it is offered on the main site only)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["s3:read"]}],"summary":"List S3 accounts","tags":["Object Storage"],"x-cli":"s3 account list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:read","x-summary-vi":"Danh sách tài khoản S3"},"post":{"description":"Creates an S3 account in a region and returns its `id` together with the ID of its first access key. Creating an account is free; you pay for what you store and download (see `policy` in [Get an S3 account](#operation/s3_account_get)), but your wallet must hold the minimum balance, and the number of accounts per user is limited. For safety, the secret of the first key is **not** returned over the API: rotate that key with [Rotate an access key](#operation/s3_key_rotate) to receive a fresh secret, or create another key. Creation is limited to 10 per hour per account (429).\n\nIf provisioning fails part-way, the call fails with 502 and the account may remain listed in the `provisioning` state. Contact support instead of retrying with a new idempotency key, which would create a second account.\n\n**Required scope:** `s3:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"s3_account_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"name":"Backups","zone_id":1},"schema":{"properties":{"name":{"description":"Display name of the account, 1 to 80 characters.","type":"string"},"zone_id":{"description":"Region that will store the data. Choose one from the object storage catalog; it must be a region where object storage is sold.","type":"integer"}},"required":["name","zone_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"id":"mR7xQ2vK9tLp4WnZc8YbH1sJdGfE6uAoVi3TyNkX0Mw","key":{"access_key":"AKIAIOSFODNN7EXAMPLE"},"note":"The secret of this first key is not returned over the API: rotate the key to receive a new secret.","state":"active"},"schema":{"properties":{"id":{"description":"Identifier of the new account.","type":"string"},"key":{"properties":{"access_key":{"description":"ID of the first access key. Its secret is not returned here.","type":"string"}},"required":["access_key"],"type":"object"},"note":{"description":"Reminder on how to obtain the secret of the first key.","type":"string"},"state":{"description":"State of the account; `active` when the call succeeds.","type":"string"}},"required":["id","state"],"type":"object","x-order":["id","state","key","note"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"Object storage is not available on this site (it is offered on the main site only)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Object storage is not available on this site (it is offered on the main site only). (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"Object storage is not available on this site (it is offered on the main site only)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The request was refused by a business rule: new accounts are paused, the region does not sell object storage or has no storage capacity ready, you reached the maximum number of accounts, or your wallet is below the minimum balance."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`s3_error`: The request was refused by a business rule: new accounts are paused, the region does not sell object storage or has no storage capacity ready, you reached the maximum number of accounts, or your wallet is below the minimum balance. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"s3_error","description":"The request was refused by a business rule: new accounts are paused, the region does not sell object storage or has no storage capacity ready, you reached the maximum number of accounts, or your wallet is below the minimum balance."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"`name` is empty or longer than 80 characters, or `zone_id` is missing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`s3_error`: `name` is empty or longer than 80 characters, or `zone_id` is missing. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"s3_error","description":"`name` is empty or longer than 80 characters, or `zone_id` is missing."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service could not create the account. The account may remain listed in the `provisioning` state; contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service could not create the account. The account may remain listed in the `provisioning` state; contact support. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service could not create the account. The account may remain listed in the `provisioning` state; contact support."}]}},"security":[{"bearerAuth":["s3:create"]}],"summary":"Create an S3 account (usage-billed)","tags":["Object Storage"],"x-cli":"s3 account create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/s3\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Backups\",\"zone_id\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"s3:create","x-summary-vi":"Tạo tài khoản S3 (tính phí theo mức dùng)"}},"/v1/s3/catalog":{"get":{"description":"Returns the object storage catalog for your account: the price policy, the regions where an account can be created, whether your account currently qualifies for the free storage allowance, and the account limits. Create an account with a region `id` from `zones`.\n\n**Prices are in Vietnamese dong (VND)**, not US dollars; `fx_usd_vnd` is the conversion rate. Usage is metered per hour and charged to the wallet in US cents at the exchange rate of the day. Unlike the session-based dashboard, API keys do not receive your wallet balance in this response; read it from the billing endpoints with a key that has the billing scope.\n\nObject storage is not sold on every site; when your site does not sell it the call fails with `404 s3_error`.\n\n**Required scope:** `catalog:read`.","operationId":"s3_catalog","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"free_eligible":true,"fx_usd_vnd":26000,"policy":{"bandwidth_in_price_per_gb":0.0,"bandwidth_out_price_per_gb":999.0,"default_quota_gb":2048,"free_tier_gb":100.0,"max_accounts_per_user":10,"max_debt":50000.0,"min_balance_create":50000.0,"min_settle":500.0,"storage_price_per_gb_month":399.0},"units":{"gb_bytes":1073741824,"hours_per_month":730},"zones":[{"city":"Ho Chi Minh City","country":"VN","id":1,"is_default":true,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","services":["vm","vpn","s3"],"slug":"hcm-1"}]},"schema":{"properties":{"free_eligible":{"description":"Whether your account has a running server, which unlocks the free storage allowance.","type":"boolean"},"fx_usd_vnd":{"description":"Exchange rate: Vietnamese dong per 1 US dollar. 0 when no rate is set.","type":"integer"},"policy":{"properties":{"bandwidth_in_price_per_gb":{"description":"Upload (inbound traffic) price per GB, in VND. Always 0.","type":"number"},"bandwidth_out_price_per_gb":{"description":"Download (outbound traffic) price per GB, in VND.","type":"number"},"default_quota_gb":{"description":"Storage quota given to a new account, in GB.","type":"integer"},"free_tier_gb":{"description":"Storage in GB that is free while the account has a running server.","type":"number"},"max_accounts_per_user":{"description":"Most storage accounts per customer.","type":"integer"},"max_debt":{"description":"Unpaid accrued usage, in VND, above which the wallet is charged immediately. If the wallet cannot cover it, the storage account is locked until it is paid.","type":"number"},"min_balance_create":{"description":"Minimum wallet balance, in VND, required to create a storage account.","type":"number"},"min_settle":{"description":"Smallest daily amount, in VND, that is invoiced; smaller amounts roll over and are invoiced at the start of the month.","type":"number"},"storage_price_per_gb_month":{"description":"Storage price per GB per month, in VND.","type":"number"}},"required":["storage_price_per_gb_month","bandwidth_out_price_per_gb","bandwidth_in_price_per_gb","free_tier_gb","max_debt","min_settle","min_balance_create","max_accounts_per_user","default_quota_gb"],"type":"object","x-order":["storage_price_per_gb_month","bandwidth_out_price_per_gb","bandwidth_in_price_per_gb","free_tier_gb","max_debt","min_settle","min_balance_create","max_accounts_per_user","default_quota_gb"]},"units":{"properties":{"gb_bytes":{"description":"Bytes in one GB as used for billing (1073741824, i.e. a GiB).","type":"integer"},"hours_per_month":{"description":"Hours used to turn the monthly storage price into an hourly one (730).","type":"integer"}},"required":["gb_bytes","hours_per_month"],"type":"object"},"zones":{"items":{"$ref":"#/components/schemas/CatalogZone"},"type":"array"}},"required":["policy","zones","free_eligible","units","fx_usd_vnd"],"type":"object","x-order":["policy","zones","free_eligible","units","fx_usd_vnd"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"Your site does not sell object storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your site does not sell object storage. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"Your site does not sell object storage."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The price policy has not been configured yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The price policy has not been configured yet. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The price policy has not been configured yet."}]}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"S3 catalog: price policy and zones","tags":["Catalog"],"x-cli":"s3 catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục S3: chính sách giá, vùng"}},"/v1/s3/{id}":{"delete":{"description":"Deletes an S3 account. Every bucket must be deleted first (empty a bucket with the `purge-bucket` action or by deleting its objects, then delete the bucket); otherwise the call fails. The account is locked and disappears from the API immediately; usage up to the end of the current hour is still billed, then the storage user is removed. This cannot be undone. Deletions are limited to 10 per hour per account (429).\n\n**Required scope:** `s3:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"s3_account_delete","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","message":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result. (`idempotency_in_progress`)","x-error-codes":[{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account still has buckets (delete them first), or the storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account still has buckets (delete them first), or the storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account still has buckets (delete them first), or the storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:destroy"]}],"summary":"Delete the S3 account (all buckets must be removed first)","tags":["Object Storage"],"x-cli":"s3 account delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/s3/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"s3:destroy","x-summary-vi":"Xoá tài khoản S3 (phải hết bucket)"},"get":{"description":"Returns one account with what you need to connect and to understand its cost: the S3 endpoint and region to configure in your client, the region that stores the data, the quota and suspension status of the storage user, live totals (stored bytes, objects, buckets), the pricing policy that applies, and your cost-alert threshold. Totals are read live from the storage service, so the call is slower than the list and fails with 502 if the storage service cannot be reached.\n\n**Required scope:** `s3:read`.","operationId":"s3_account_get","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"endpoint":"https://s3.example.com","free_eligible":true,"policy":{"bandwidth_in_price_per_gb":0.0,"bandwidth_out_price_per_gb":999.0,"default_quota_gb":2048,"free_tier_gb":100.0,"max_accounts_per_user":10,"max_debt":50000.0,"min_balance_create":50000.0,"min_settle":500.0,"storage_price_per_gb_month":399.0},"preferences":{"alert_threshold_vnd":0.0},"region":"default","resource":{"billing_start":1792400400,"created_at":1792402313,"id":"mR7xQ2vK9tLp4WnZc8YbH1sJdGfE6uAoVi3TyNkX0Mw","name":"Backups","quota_gb":2048,"state":"active","zone_id":1},"stats":{"buckets":3,"objects":1284,"storage_bytes":53687091200},"user":{"bucket_quota":{"enabled":false,"max_objects":-1,"max_size":-1},"max_buckets":1000,"suspended":0,"user_quota":{"enabled":true,"max_objects":-1,"max_size":2199023255552}},"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"is_default":true,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","services":["vm","s3"],"slug":"hcm-1"}},"schema":{"properties":{"endpoint":{"description":"S3 endpoint URL to configure in S3 clients.","type":"string"},"free_eligible":{"description":"Whether you currently qualify for the free storage allowance (you have a running server).","type":"boolean"},"policy":{"$ref":"#/components/schemas/S3Policy"},"preferences":{"$ref":"#/components/schemas/S3Preferences"},"region":{"description":"Signing region name to configure in S3 clients.","type":"string"},"resource":{"$ref":"#/components/schemas/S3Account"},"stats":{"properties":{"buckets":{"description":"Number of buckets.","type":"integer"},"objects":{"description":"Total number of objects.","type":"integer"},"storage_bytes":{"description":"Total bytes stored in all buckets.","type":"integer"}},"required":["storage_bytes","objects","buckets"],"type":"object","x-order":["storage_bytes","objects","buckets"]},"user":{"properties":{"bucket_quota":{"$ref":"#/components/schemas/S3Quota"},"max_buckets":{"description":"Maximum number of buckets the account may own.","type":"integer"},"suspended":{"description":"Whether the storage user is suspended: 1 or `true` when suspended, 0 or `false` otherwise.","type":["integer","boolean"]},"user_quota":{"$ref":"#/components/schemas/S3Quota"}},"required":["suspended","max_buckets","user_quota","bucket_quota"],"type":"object","x-order":["suspended","max_buckets","user_quota","bucket_quota"]},"zone":{"$ref":"#/components/schemas/S3Zone"}},"required":["resource","endpoint","region","zone","user","stats","policy","free_eligible","preferences"],"type":"object","x-order":["resource","endpoint","region","zone","user","stats","policy","free_eligible","preferences"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:read"]}],"summary":"Get one S3 account: endpoint, quota, stats","tags":["Object Storage"],"x-cli":"s3 account get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:read","x-summary-vi":"Chi tiết tài khoản S3: endpoint, hạn mức, thống kê"},"patch":{"description":"Renames the account and/or sets its monthly cost alert. Send only the fields you want to change. When the cost of the usage accumulated in the current month reaches `alert_threshold_vnd`, a notification is created for you; 0 turns the alert off. Works in every account state, including suspended ones.\n\n**Required scope:** `s3:write`.","operationId":"s3_account_update","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"alert_threshold_vnd":500000,"name":"Production backups"},"schema":{"properties":{"alert_threshold_vnd":{"description":"Monthly cost in VND that triggers a notification. 0 disables the alert. Must be a number between 0 and 1,000,000,000,000.","type":"number"},"name":{"description":"New display name, 1 to 80 characters.","type":"string"}},"type":"object","x-order":["name","alert_threshold_vnd"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"preferences":{"alert_threshold_vnd":500000.0}},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"},"preferences":{"$ref":"#/components/schemas/S3Preferences"}},"required":["ok","preferences"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"`name` is empty or longer than 80 characters, or `alert_threshold_vnd` is not a number in the allowed range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`name` is empty or longer than 80 characters, or `alert_threshold_vnd` is not a number in the allowed range. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"`name` is empty or longer than 80 characters, or `alert_threshold_vnd` is not a number in the allowed range."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is waiting for a migration from a previous billing system to finish and cannot be changed yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is waiting for a migration from a previous billing system to finish and cannot be changed yet. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is waiting for a migration from a previous billing system to finish and cannot be changed yet."}]}},"security":[{"bearerAuth":["s3:write"]}],"summary":"Rename / set the cost alert threshold","tags":["Object Storage"],"x-cli":"s3 account update","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/s3/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"alert_threshold_vnd\":500000,\"name\":\"Production backups\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Đổi tên / ngưỡng cảnh báo chi phí"}},"/v1/s3/{id}/buckets":{"get":{"description":"Lists the buckets of the account with their creation time, object count and size. Counts and sizes are statistics reported by the storage service and may lag slightly behind very recent uploads or deletions. To list the objects inside a bucket use [List objects](#operation/s3_object_list).\n\n**Required scope:** `s3:read`.","operationId":"s3_bucket_list","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":"2026-10-19T03:21:08.512347Z","name":"my-bucket","objects":1284,"size_bytes":53687091200}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/S3Bucket"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:read"]}],"summary":"List buckets","tags":["Object Storage"],"x-cli":"s3 bucket list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>/buckets\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:read","x-summary-vi":"Danh sách bucket"},"post":{"description":"Creates a bucket. Bucket names are 3 to 63 characters long, use only lowercase letters, digits, hyphens and dots, begin and end with a letter or digit, contain no consecutive dots and must not look like an IP address. Names are unique across the whole service, so a name already used by anyone fails. A new bucket is private. It also receives a default CORS rule that allows the web dashboard to upload to it; replace it with the `cors-set` action of [Run a bucket action](#operation/s3_bucket_action) if you need a different policy. The account must be `active`.\n\n**Required scope:** `s3:write`.","operationId":"s3_bucket_create","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"name":"my-bucket"},"schema":{"properties":{"name":{"description":"Bucket name, 3 to 63 characters (lowercase letters, digits, hyphens, dots).","type":"string"}},"required":["name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The bucket name is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The bucket name is not valid. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The bucket name is not valid."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active` (it is still being created or is suspended), so it cannot create buckets."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active` (it is still being created or is suspended), so it cannot create buckets. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active` (it is still being created or is suspended), so it cannot create buckets."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service refused the request, for example because the bucket name is already taken, or it could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service refused the request, for example because the bucket name is already taken, or it could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service refused the request, for example because the bucket name is already taken, or it could not be reached."}]}},"security":[{"bearerAuth":["s3:write"]}],"summary":"Create a bucket","tags":["Object Storage"],"x-cli":"s3 bucket create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/s3/<id>/buckets\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"my-bucket\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Tạo bucket"}},"/v1/s3/{id}/buckets/{bucket}":{"delete":{"description":"Deletes an empty bucket. A bucket that still holds objects, including old versions, cannot be deleted and the call fails; to remove a bucket together with everything in it use the `purge-bucket` action of [Run a bucket action](#operation/s3_bucket_action). The bucket name becomes available to anyone once it is deleted. The account must be `active`.\n\n**Required scope:** `s3:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"s3_bucket_delete","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Name of a bucket that belongs to the S3 account.","in":"path","name":"bucket","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist, or the bucket belongs to a different account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist, or the bucket belongs to a different account. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist, or the bucket belongs to a different account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","message":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result. (`idempotency_in_progress`)","x-error-codes":[{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The bucket is not empty or does not exist, or the storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The bucket is not empty or does not exist, or the storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The bucket is not empty or does not exist, or the storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:destroy"]}],"summary":"Delete a bucket (must be empty)","tags":["Object Storage"],"x-cli":"s3 bucket delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/s3/<id>/buckets/<bucket>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"s3:destroy","x-summary-vi":"Xoá bucket (phải rỗng)"},"get":{"description":"Lists the objects of a bucket one folder level at a time. The listing uses `/` as delimiter: objects directly under `prefix` are returned in `objects` and deeper folders are returned as `prefixes`. A page holds at most 100 entries; when `truncated` is true pass `next` as `continuation-token` to get the following page. Works in every account state. For very large listings use the S3 protocol with an access key.\n\n**Required scope:** `s3:read`.","operationId":"s3_object_list","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Name of a bucket that belongs to the S3 account.","in":"path","name":"bucket","required":true,"schema":{"type":"string"}},{"description":"Only list keys that start with this prefix, at most 1024 bytes without control characters. Use a folder prefix ending in `/` to look inside a folder.","example":"reports/","in":"query","name":"prefix","required":false,"schema":{"type":"string"}},{"description":"Page token returned as `next` by the previous call, at most 4096 bytes.","in":"query","name":"continuation-token","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"next":null,"objects":[{"etag":"\"9e107d9d372bb6826bd81d3542a419d6\"","key":"reports/2026-10.pdf","modified":"2026-10-19T08:55:12.000Z","size":482113}],"prefixes":[{"prefix":"reports/archive/"}],"truncated":false},"schema":{"$ref":"#/components/schemas/S3ObjectList"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist, or the bucket belongs to a different account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist, or the bucket belongs to a different account. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist, or the bucket belongs to a different account."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"`prefix` or `continuation-token` is too long or contains control characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`prefix` or `continuation-token` is too long or contains control characters. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"`prefix` or `continuation-token` is too long or contains control characters."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service refused the request (for example the bucket does not exist) or could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service refused the request (for example the bucket does not exist) or could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service refused the request (for example the bucket does not exist) or could not be reached."}]}},"security":[{"bearerAuth":["s3:read"]}],"summary":"List objects in a bucket (paged)","tags":["Object Storage"],"x-cli":"s3 object list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>/buckets/<bucket>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:read","x-summary-vi":"Liệt kê object trong bucket (phân trang)"}},"/v1/s3/{id}/buckets/{bucket}/action":{"post":{"description":"Runs one operation on a bucket or on an object inside it. The operation is chosen with `op`; the other body fields depend on it (table below). Use it for management tasks and to obtain signed URLs. For bulk transfers, large uploads or listings of very many objects, use the S3 protocol directly with an access key.\n\n**Scopes and states.** Every operation needs `s3:write`. Operations that delete data additionally need `s3:destroy` and fail with 403 `scope_required` without it: `purge-bucket`, `delete-object`, `delete-objects`, `delete-folder`, `delete-version`, `move-object` (it removes the source) and `lifecycle-set` (a lifecycle rule can schedule deletions). All operations need the account to be `active` (otherwise 423), except the read-only ones: `info`, `versions`, `versioning-get`, `acl-get`, `object-acl-get`, `cors-get`, `lifecycle-get`, `policy-get`, `metadata-get` and `public-url`. Object keys are 1 to 1024 bytes, without control characters and without `.` or `..` path segments. A `destination_bucket` must belong to the same S3 account.\n\n**Signed URLs.** `download`, `preview`, `upload` and `multipart-part` return a pre-signed URL. For the first three, `expires_seconds` sets its lifetime (60 to 900, default 900; other values are clamped); a `multipart-part` URL is valid for 900 seconds. The `upload` URL must be used with an HTTP `PUT` that sends the same `Content-Type` that was requested (default `application/octet-stream`).\n\n| `op` | Fields | Result |\n|---|---|---|\n| `info` | `key` | `{size, content_type, etag, modified}`: size in bytes, `modified` as an HTTP date. |\n| `download` | `key`, `expires_seconds` | `{url, expires_seconds}`: signed `GET` URL that downloads the object as an attachment. |\n| `preview` | `key`, `expires_seconds` | `{url, expires_seconds}`: signed `GET` URL that lets a browser display the object. |\n| `upload` | `key`, `content_type`, `expires_seconds` | `{url, expires_seconds}`: signed `PUT` URL for uploading the object. |\n| `create-folder` | `key` (ends with `/`) | `{ok}`: creates an empty folder marker. |\n| `copy-object` | `key`, `destination`, `destination_bucket` | `{ok}`: copies the object. The destination must differ from the source. |\n| `move-object` | `key`, `destination`, `destination_bucket` | `{ok}`: copies the object, then removes the source. Needs `s3:destroy`. |\n| `delete-object` | `key` | `{ok}`. Needs `s3:destroy`. |\n| `delete-objects` | `keys` (1 to 1000) | `{deleted, errors}`: `deleted` is the number removed; `errors` lists `{key, code}` for the keys that failed. Needs `s3:destroy`. |\n| `delete-folder` | `key` (ends with `/`) | `{deleted, more}` (plus `errors` if some deletions failed, in which case it stops). Removes up to about 500 objects per call; call again while `more` is true. Needs `s3:destroy`. |\n| `versions` | `key`, `key-marker`, `version-id-marker` | `{items, next_key, next_version, truncated}`: versions and delete markers of that exact key, each `{key, version_id, latest, modified, size, etag, delete_marker}`. Page with the returned markers. |\n| `restore-version` | `key`, `version_id`, `destination_bucket` | `{ok}`: copies that version over the current object. |\n| `delete-version` | `key`, `version_id` | `{ok}`. Needs `s3:destroy`. |\n| `versioning-get` | none | `{enabled}`. |\n| `versioning-set` | `enabled` | `{ok}`: turns versioning on, or suspends it. |\n| `acl-get` | none | `{permission}`: `private` or `public-read` for the bucket. |\n| `acl-set` | `permission` | `{ok}`: sets the bucket permission. |\n| `object-acl-get` | `key` | `{permission}` for the object. |\n| `object-acl-set` | `key`, `permission` | `{ok}`. |\n| `cors-get`, `lifecycle-get`, `policy-get` | none | `{xml}`: the configuration document as text, empty when none is set. For `policy-get` the text is the JSON bucket policy. |\n| `cors-set`, `lifecycle-set` | `xml` (up to 16000 bytes; root element `CORSConfiguration` or `LifecycleConfiguration`) | `{ok}`: replaces the configuration. `lifecycle-set` needs `s3:destroy`. |\n| `cors-delete`, `lifecycle-delete` | none | `{ok}`. |\n| `multipart-init` | `key`, `content_type` | `{upload_id}`: starts a multipart upload. |\n| `multipart-part` | `key`, `upload_id`, `part_number` (1 to 10000) | `{url}`: signed `PUT` URL for one part. Read the `ETag` response header of the upload. |\n| `multipart-complete` | `key`, `upload_id`, `parts` | `{ok}`: `parts` is a list of `{part_number, etag}` in ascending order. |\n| `multipart-abort` | `key`, `upload_id` | `{ok}`. |\n| `purge-bucket` | `confirm` (the bucket name) | `{ok}`: deletes the bucket and ALL objects in it. Cannot be undone. Needs `s3:destroy`. |\n| `metadata-get` | none | `{public_prefixes, custom_domain, referer_allow}`: settings stored with the bucket. |\n| `metadata-set` | `custom_domain`, `referer_allow` | The updated settings. Both fields are replaced: one you omit is cleared. |\n| `public-prefixes-set` | `prefixes` (up to 50, each ending with `/`, no `*`) | The updated settings. Objects under these prefixes become publicly readable; an empty list removes public access. |\n| `public-url` | `key` | `{url}`: the public (unsigned) URL of the object, which works only if the object is public. Uses `custom_domain` when one is set. |\n\nAn unknown `op` is rejected with 422. A bucket that does not exist, an object that does not exist, or a refusal by the storage service is reported as 502.\n\n**Required scope:** `s3:write`.","operationId":"s3_bucket_action","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Name of a bucket that belongs to the S3 account.","in":"path","name":"bucket","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"expires_seconds":300,"key":"reports/2026-10.pdf","op":"download"},"schema":{"properties":{"confirm":{"description":"Repeat the bucket name exactly to confirm `purge-bucket`.","type":"string"},"content_type":{"description":"Content type of the uploaded object (`upload`, `multipart-init`). Default `application/octet-stream`.","type":"string"},"custom_domain":{"description":"Domain name that serves the bucket publicly (`metadata-set`). Host name only, without scheme, port or path. Empty clears it.","type":"string"},"destination":{"description":"Target object key (`copy-object`, `move-object`).","type":"string"},"destination_bucket":{"description":"Bucket that receives the copy. It must belong to the same S3 account. Defaults to the source bucket.","type":"string"},"enabled":{"description":"Turn versioning on (`true`) or suspend it (`false`) for `versioning-set`.","type":"boolean"},"expires_seconds":{"description":"Lifetime of a signed URL in seconds (`download`, `preview`, `upload`). Clamped to 60 to 900; default 900.","type":"integer"},"key":{"description":"Object key, or the folder prefix (ending with `/`) for folder operations.","type":"string"},"key-marker":{"description":"Key marker returned as `next_key` by the previous `versions` call.","type":"string"},"keys":{"description":"Keys to delete, 1 to 1000 (`delete-objects`).","items":{"description":"Object key.","type":"string"},"type":"array"},"op":{"description":"Operation to run. The table in the description lists the fields each operation uses.","enum":["info","download","preview","upload","create-folder","delete-object","delete-objects","delete-folder","copy-object","move-object","restore-version","versions","delete-version","versioning-get","versioning-set","acl-get","acl-set","object-acl-get","object-acl-set","cors-get","cors-set","cors-delete","lifecycle-get","lifecycle-set","lifecycle-delete","policy-get","multipart-init","multipart-part","multipart-complete","multipart-abort","purge-bucket","metadata-get","metadata-set","public-prefixes-set","public-url"],"type":"string"},"part_number":{"description":"Part number, 1 to 10000 (`multipart-part`).","type":"integer"},"parts":{"description":"Uploaded parts in ascending order (`multipart-complete`).","items":{"properties":{"etag":{"description":"ETag returned for that part.","type":"string"},"part_number":{"description":"Part number.","type":"integer"}},"required":["part_number","etag"],"type":"object","x-order":["part_number","etag"]},"type":"array"},"permission":{"description":"Access level for `acl-set` and `object-acl-set`.","enum":["private","public-read"],"type":"string"},"prefixes":{"description":"Folder prefixes to make public (`public-prefixes-set`).","items":{"description":"Folder prefix ending with `/`.","type":"string"},"type":"array"},"referer_allow":{"description":"Comma-separated referrer allow-list, up to 500 characters (`metadata-set`). Empty clears it.","type":"string"},"upload_id":{"description":"Multipart upload identifier returned by `multipart-init`.","type":"string"},"version-id-marker":{"description":"Version marker returned as `next_version` by the previous `versions` call.","type":"string"},"version_id":{"description":"Object version identifier, as returned by `versions` (`restore-version`, `delete-version`).","type":"string"},"xml":{"description":"Configuration document for `cors-set` or `lifecycle-set`.","type":"string"}},"required":["op"],"type":"object","x-order":["op","key","keys","destination","destination_bucket","version_id","key-marker","version-id-marker","confirm","permission","enabled","xml","expires_seconds","content_type","upload_id","part_number","parts","custom_domain","referer_allow","prefixes"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"expires_seconds":300,"url":"https://s3.example.com/my-bucket/reports/2026-10.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20261019%2Fdefault%2Fs3%2Faws4_request&X-Amz-Date=20261019T090000Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&response-content-disposition=attachment&X-Amz-Signature=3b1f0c5a8e7d4926b1c3a5f7e9d0b2c4a6e8f0123456789abcdef0123456789a"},"schema":{"additionalProperties":true,"description":"Result of the operation. Its shape depends on `op`: see the table in the description. Operations without data return `{\"ok\": true}`.","type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist, or a bucket (the source or `destination_bucket`) belongs to a different account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist, or a bucket (the source or `destination_bucket`) belongs to a different account. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist, or a bucket (the source or `destination_bucket`) belongs to a different account."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"`op` is missing or unknown, a required field is missing or malformed, or `purge-bucket` was sent without the exact bucket name in `confirm`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`op` is missing or unknown, a required field is missing or malformed, or `purge-bucket` was sent without the exact bucket name in `confirm`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"`op` is missing or unknown, a required field is missing or malformed, or `purge-bucket` was sent without the exact bucket name in `confirm`."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active` and the operation is not a read-only one."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active` and the operation is not a read-only one. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active` and the operation is not a read-only one."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service refused the request (for example the object or bucket does not exist) or could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service refused the request (for example the object or bucket does not exist) or could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service refused the request (for example the object or bucket does not exist) or could not be reached."}]}},"security":[{"bearerAuth":["s3:write"]}],"summary":"Bucket and object operations selected by the op field (delete ops also need s3:destroy)","tags":["Object Storage"],"x-cli":"s3 bucket action","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/s3/<id>/buckets/<bucket>/action\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"expires_seconds\":300,\"key\":\"reports/2026-10.pdf\",\"op\":\"download\"}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Thao tác bucket/object theo trường op (op xoá cần thêm s3:destroy)"}},"/v1/s3/{id}/keys":{"get":{"description":"Lists the access keys of the account. Secrets are never included; they are shown only when a key is created or rotated. The response is not cached. An account can hold up to 10 keys.\n\n**Required scope:** `s3:keys`.","operationId":"s3_key_list","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"access_key":"AKIAIOSFODNN7EXAMPLE","created_at":1792402313,"last_used_at":null}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/S3AccessKey"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:keys"]}],"summary":"List access keys (no secrets)","tags":["Object Storage"],"x-cli":"s3 key list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>/keys\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:keys","x-summary-vi":"Danh sách Access Key (không có Secret)"},"post":{"description":"Creates an additional access key and returns it with its secret. **The secret appears only in this response** (the response is marked `Cache-Control: no-store`); store it now, because it cannot be retrieved later. If it is lost, rotate the key. An account holds up to 10 keys, and the account must be `active`. This call takes no body and, because it returns a secret, does not use an `Idempotency-Key`: a retry creates another key.\n\n**Required scope:** `s3:keys`.","operationId":"s3_key_create","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"key":{"access_key":"AKIAIOSFODNN7EXAMPLE","secret_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}},"schema":{"properties":{"key":{"$ref":"#/components/schemas/S3IssuedKey"}},"required":["key"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account already has 10 access keys; delete one first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account already has 10 access keys; delete one first. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account already has 10 access keys; delete one first."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service could not create the key."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service could not create the key. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service could not create the key."}]}},"security":[{"bearerAuth":["s3:keys"]}],"summary":"Create an access key (the secret is shown once)","tags":["Object Storage"],"x-cli":"s3 key create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/s3/<id>/keys\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:keys","x-summary-vi":"Tạo Access Key (Secret chỉ hiện một lần)"}},"/v1/s3/{id}/keys/{key}":{"delete":{"description":"Deletes an access key. Clients that use it stop working immediately. The last remaining key cannot be deleted; create another one first. The account must be `active`.\n\n**Required scope:** `s3:keys`.","operationId":"s3_key_delete","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Access key ID (the `access_key` value returned when the key was created or listed). It is not the secret.","in":"path","name":"key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account or the access key does not exist, or the account belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account or the access key does not exist, or the account belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account or the access key does not exist, or the account belongs to someone else."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The key is the last one of the account, or the storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The key is the last one of the account, or the storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The key is the last one of the account, or the storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:keys"]}],"summary":"Delete an access key (at least one key must remain)","tags":["Object Storage"],"x-cli":"s3 key delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/s3/<id>/keys/<key>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"s3:keys","x-summary-vi":"Xoá Access Key (phải còn ít nhất một key)"}},"/v1/s3/{id}/keys/{key}/rotate":{"post":{"description":"Replaces an access key: a new key is created, returned with its secret, and the old key is deleted. **The secret appears only in this response** (marked `Cache-Control: no-store`). Use it to obtain a secret for the first key of a new account, or after a secret is lost or leaked. Because the new key is created before the old one is removed, the account must have fewer than 10 keys. If removing the old key fails, `old_key_removed` is `false`; delete it yourself with [Delete an access key](#operation/s3_key_delete). This call takes no body and does not use an `Idempotency-Key`: a retry rotates again.\n\n**Required scope:** `s3:keys`.","operationId":"s3_key_rotate","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Access key ID (the `access_key` value returned when the key was created or listed). It is not the secret.","in":"path","name":"key","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"key":{"access_key":"AKIAI44QH8DHBEXAMPLE","secret_key":"je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY"},"old_key_removed":true},"schema":{"properties":{"key":{"$ref":"#/components/schemas/S3IssuedKey"},"old_key_removed":{"description":"True when the previous key was deleted. If false, the old key still works until you delete it.","type":"boolean"}},"required":["key","old_key_removed"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account or the access key does not exist, or the account belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account or the access key does not exist, or the account belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account or the access key does not exist, or the account belongs to someone else."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account already has 10 access keys, so a new key cannot be created; delete one first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account already has 10 access keys, so a new key cannot be created; delete one first. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account already has 10 access keys, so a new key cannot be created; delete one first."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The storage service could not create the new key."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The storage service could not create the new key. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The storage service could not create the new key."}]}},"security":[{"bearerAuth":["s3:keys"]}],"summary":"Rotate an access key (the new secret is shown once)","tags":["Object Storage"],"x-cli":"s3 key rotate","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/s3/<id>/keys/<key>/rotate\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:keys","x-summary-vi":"Xoay Access Key (Secret mới chỉ hiện một lần)"}},"/v1/s3/{id}/share-links":{"get":{"description":"Lists the share links of the account, newest first, at most 500, including revoked ones (`revoked_at` is set). A share link lets anyone who has it open one object without credentials until the link expires, reaches its view limit or is revoked. Each entry includes the link path in `url`, which acts as a secret, so this call requires `s3:write` instead of `s3:read` and the response is not cached.\n\n**Required scope:** `s3:write`.","operationId":"s3_share_list","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"allow_download":true,"bucket":"my-bucket","created_at":1792410000,"expires_at":1793000000,"has_password":true,"id":"Hc2LwT9sEoQ5zXn7BvKd1RgYpU4aJmFi8NtCe0ZyAhk","key":"reports/2026-10.pdf","max_views":10,"referer_allow":"","revoked_at":null,"url":"/s/ZxP4mQe1Rk8WvTn6Lc3YbHs9JdGf2UaOiV5TyNjXw0M","view_count":2}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/S3ShareLink"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["s3:write"]}],"summary":"List object share links (includes the link token)","tags":["Object Storage"],"x-cli":"s3 share list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>/share-links\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Danh sách link chia sẻ object (có token link)"},"post":{"description":"Creates a share link for one existing object and returns its path. Append `url` to the base URL of your site to get the full link, for example `https://cloud.example.com/s/...`. You can protect the link with a password, an expiry time, a view limit, a referrer allow-list, and by disallowing downloads (visitors can then only preview images, audio and video). The password is stored hashed and is never returned. An account can have at most 500 active links; creation is limited to 20 per minute (429). The account must be `active`.\n\n**Required scope:** `s3:write`.","operationId":"s3_share_create","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"allow_download":true,"bucket":"my-bucket","expires_at":1793000000,"key":"reports/2026-10.pdf","max_views":10,"password":"correct-horse-battery"},"schema":{"properties":{"allow_download":{"description":"Whether visitors may download the file. Default `true`.","type":"boolean"},"bucket":{"description":"Bucket that holds the object.","type":"string"},"expires_at":{"description":"Unix time in seconds when the link stops working. Must be in the future and at most 366 days ahead. 0 or omitted: never expires.","type":"integer"},"key":{"description":"Key of the object to share. The object must exist.","type":"string"},"max_views":{"description":"Maximum number of times the link can be opened, 0 to 1,000,000. 0 or omitted: unlimited.","type":"integer"},"password":{"description":"Password visitors must enter, 8 to 64 characters. Omit or send an empty string for no password.","type":"string"},"referer_allow":{"description":"Comma-separated referrer hosts allowed to use the link, up to 500 characters. `*.example.com` matches subdomains. Omit for any referrer.","type":"string"}},"required":["bucket","key"],"type":"object","x-order":["bucket","key","expires_at","max_views","password","referer_allow","allow_download"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"id":"Hc2LwT9sEoQ5zXn7BvKd1RgYpU4aJmFi8NtCe0ZyAhk","url":"/s/ZxP4mQe1Rk8WvTn6Lc3YbHs9JdGf2UaOiV5TyNjXw0M"},"schema":{"properties":{"id":{"description":"Link identifier. Use it as `{link}` to edit or revoke the link.","type":"string"},"url":{"description":"Path of the link page, `/s/<token>`. Append it to the base URL of your site.","type":"string"}},"required":["id","url"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist, or the bucket belongs to a different account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist, or the bucket belongs to a different account. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist, or the bucket belongs to a different account."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"`bucket` or `key` is missing or invalid, a protection setting is out of range (expiry, view limit, password length, referrer list), or the account already has 500 active links."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bucket` or `key` is missing or invalid, a protection setting is out of range (expiry, view limit, password length, referrer list), or the account already has 500 active links. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"`bucket` or `key` is missing or invalid, a protection setting is out of range (expiry, view limit, password length, referrer list), or the account already has 500 active links."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active`."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 20 links were created within a minute. (`s3_error`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"s3_error","description":"More than 20 links were created within a minute."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The object or the bucket does not exist, or the storage service could not be reached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The object or the bucket does not exist, or the storage service could not be reached. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The object or the bucket does not exist, or the storage service could not be reached."}]}},"security":[{"bearerAuth":["s3:write"]}],"summary":"Create an object share link","tags":["Object Storage"],"x-cli":"s3 share create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/s3/<id>/share-links\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"allow_download\":true,\"bucket\":\"my-bucket\",\"expires_at\":1793000000,\"key\":\"reports/2026-10.pdf\",\"max_views\":10,\"password\":\"correct-horse-battery\"}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Tạo link chia sẻ object"}},"/v1/s3/{id}/share-links/{link}":{"delete":{"description":"Revokes a share link. It stops working immediately and visitors see a not-found page. The entry stays in the list with `revoked_at` set. Revoking a link that is already revoked succeeds. Works in every account state.\n\n**Required scope:** `s3:write`.","operationId":"s3_share_revoke","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Share link identifier (the `id` returned when the link was created or listed, not the token inside its URL).","in":"path","name":"link","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist, or the link does not belong to it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist, or the link does not belong to it. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist, or the link does not belong to it."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["s3:write"]}],"summary":"Revoke a share link","tags":["Object Storage"],"x-cli":"s3 share revoke","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/s3/<id>/share-links/<link>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Thu hồi link chia sẻ"},"patch":{"description":"Changes the protection settings of an active link. Expiry, view limit, referrer list and download flag are replaced as a set: a field you omit goes back to its default (never expires, unlimited views, any referrer, download allowed), so send all of them. The password is the exception: omit it to keep the current one, send an empty string to remove it, or send a new value of 8 to 64 characters. The object, the token and the view counter do not change. A revoked link cannot be edited. The account must be `active`.\n\n**Required scope:** `s3:write`.","operationId":"s3_share_update","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Share link identifier (the `id` returned when the link was created or listed, not the token inside its URL).","in":"path","name":"link","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"allow_download":true,"expires_at":1793500000,"max_views":25},"schema":{"properties":{"allow_download":{"description":"Whether visitors may download the file. Default `true`.","type":"boolean"},"expires_at":{"description":"Unix time in seconds when the link stops working; must be in the future, at most 366 days ahead. 0 or omitted: never expires.","type":"integer"},"max_views":{"description":"Maximum number of times the link can be opened, 0 to 1,000,000. 0 or omitted: unlimited.","type":"integer"},"password":{"description":"New password, 8 to 64 characters. Empty string removes the password. Omit to keep the current one.","type":"string"},"referer_allow":{"description":"Comma-separated referrer hosts allowed to use the link, up to 500 characters. Omit or empty for any referrer.","type":"string"}},"type":"object","x-order":["expires_at","max_views","password","referer_allow","allow_download"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist, or the link does not exist or was already revoked."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist, or the link does not exist or was already revoked. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist, or the link does not exist or was already revoked."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"A setting is out of range or has the wrong type (expiry, view limit, password length, referrer list, download flag)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A setting is out of range or has the wrong type (expiry, view limit, password length, referrer list, download flag). (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"A setting is out of range or has the wrong type (expiry, view limit, password length, referrer list, download flag)."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account is not `active`. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account is not `active`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["s3:write"]}],"summary":"Edit expiry / password / limits of a share link","tags":["Object Storage"],"x-cli":"s3 share update","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/s3/<id>/share-links/<link>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"allow_download\":true,\"expires_at\":1793500000,\"max_views\":25}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:write","x-summary-vi":"Sửa hạn / mật khẩu / giới hạn của link chia sẻ"}},"/v1/s3/{id}/usage":{"get":{"description":"Returns the hourly usage records of the account, newest first, with the cost computed for each hour, plus the pricing policy that applies. Each record covers one hour: the bytes stored at the end of the hour, the bytes uploaded and downloaded during it, and the resulting cost in VND. At most 1000 records are returned. Records appear a few minutes after the hour ends. For a per-day view of one month use [Get S3 usage summary](#operation/s3_account_usage_summary).\n\n**Required scope:** `s3:read`.","operationId":"s3_account_usage","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Earliest hour to include, as Unix time in seconds. Defaults to 31 days ago. Values older than 366 days are raised to that limit; a value that is not a number is ignored.","example":1789776000,"in":"query","name":"from","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"bandwidth_cost_vnd":1998.0,"bytes_in":1073741824,"bytes_out":2147483648,"cost_vnd":1998.0,"free_bytes":53687091200,"hour":1792400400,"status":"accrued","storage_bytes":53687091200,"storage_cost_vnd":0.0}],"policy":{"bandwidth_in_price_per_gb":0.0,"bandwidth_out_price_per_gb":999.0,"default_quota_gb":2048,"free_tier_gb":100.0,"max_accounts_per_user":10,"max_debt":50000.0,"min_balance_create":50000.0,"min_settle":500.0,"storage_price_per_gb_month":399.0}},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/S3UsageHour"},"type":"array"},"policy":{"anyOf":[{"$ref":"#/components/schemas/S3Policy"},{"type":"null"}]}},"required":["items","policy"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["s3:read"]}],"summary":"Hourly storage, traffic and cost","tags":["Object Storage"],"x-cli":"s3 account usage","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>/usage\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:read","x-summary-vi":"Dung lượng, lưu lượng và chi phí theo giờ"}},"/v1/s3/{id}/usage-summary":{"get":{"description":"Aggregates the hourly records of one calendar month into days (UTC) and returns the month total. Days with no records are omitted. `cost_vnd` counts only hours that are billed, so hours forgiven while your account was blocked do not add to it. Stored sizes are daily averages. Use it for monthly charts and to see how close you are to your cost alert.\n\n**Required scope:** `s3:read`.","operationId":"s3_account_usage_summary","parameters":[{"description":"S3 account identifier, as returned by List S3 accounts.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Month to summarise as `YYYY-MM` (years 2000 to 2100). Defaults to the current month in UTC.","example":"2026-10","in":"query","name":"month","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cost_vnd":47952.0,"daily":[{"bytes_in":5368709120,"bytes_out":2147483648,"cost_vnd":47952.0,"day":1792281600,"free_bytes":53687091200.0,"storage_bytes":53687091200.0}],"month":"2026-10","preferences":{"alert_threshold_vnd":500000.0}},"schema":{"properties":{"cost_vnd":{"description":"Total billed cost of the month in VND.","type":"number"},"daily":{"items":{"properties":{"bytes_in":{"description":"Bytes uploaded during the day.","type":"integer"},"bytes_out":{"description":"Bytes downloaded during the day.","type":"integer"},"cost_vnd":{"description":"Billed cost of the day in VND.","type":"number"},"day":{"description":"Start of the day (00:00 UTC) (Unix time, seconds, UTC)","type":"integer"},"free_bytes":{"description":"Average bytes covered by the free allowance during the day.","type":"number"},"storage_bytes":{"description":"Average bytes stored during the day.","type":"number"}},"required":["day","bytes_in","bytes_out","cost_vnd","storage_bytes","free_bytes"],"type":"object","x-order":["day","bytes_in","bytes_out","cost_vnd","storage_bytes","free_bytes"]},"type":"array"},"month":{"description":"The month that was summarised, `YYYY-MM`.","type":"string"},"preferences":{"$ref":"#/components/schemas/S3Preferences"}},"required":["month","daily","cost_vnd","preferences"],"type":"object","x-order":["month","daily","cost_vnd","preferences"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"The account does not exist or belongs to someone else."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account does not exist or belongs to someone else. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"The account does not exist or belongs to someone else."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"s3_error","message":"`month` is not a valid `YYYY-MM` value."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`month` is not a valid `YYYY-MM` value. (`s3_error`)","x-error-codes":[{"code":"s3_error","description":"`month` is not a valid `YYYY-MM` value."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["s3:read"]}],"summary":"Daily usage summary for a month","tags":["Object Storage"],"x-cli":"s3 account usage-summary","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/s3/<id>/usage-summary\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"s3:read","x-summary-vi":"Tổng hợp dùng theo ngày trong một tháng"}},"/v1/snapshot-policies":{"get":{"description":"Lists the automatic snapshot schedules of all your servers in one paged list. To see the schedules of one server, or to add or remove one, use the per-server operations.\n\n`meta.max_per_vm` is how many schedules one server may have and `meta.keep_max` the largest `keep` allowed.\n\n**Required scope:** `vm:read`.","operationId":"snapshot_schedule_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","vm","keep","enabled","next_run_at","last_run_at"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Alias of `dir`, used only when `dir` is absent.","in":"query","name":"order","required":false,"schema":{"enum":["asc","desc"],"type":"string"}},{"description":"Only list schedules of this server (UUID). A server that is not yours gives an empty list.","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"created_at":1795100000,"cron":"weekly 1 03:30","dow":1,"enabled":true,"hostname":"web-1","hour":3,"id":17,"keep":2,"kind":"weekly","last_error":null,"last_run_at":null,"minute":30,"next_run_at":1795663800,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"Web server"}],"meta":{"keep_max":3,"max_per_vm":2,"total":1},"page":1,"per_page":20,"sort":"created_at","total":1},"schema":{"properties":{"dir":{"description":"The sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/AccountSnapshotSchedule"},"type":"array"},"meta":{"properties":{"keep_max":{"description":"Largest allowed `keep`: the number of snapshots one server may hold.","type":"integer"},"max_per_vm":{"description":"Maximum number of schedules one server may have.","type":"integer"},"total":{"description":"Number of schedules matching the filters.","type":"integer"}},"required":["total","max_per_vm","keep_max"],"type":"object","x-order":["total","max_per_vm","keep_max"]},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"The sort field applied. An unknown `sort` falls back to `created_at`.","enum":["created_at","vm","keep","enabled","next_run_at","last_run_at"],"type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir","meta"],"type":"object","x-order":["items","total","page","per_page","sort","dir","meta"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Automatic snapshot schedules of all VMs (paged)","tags":["Snapshots"],"x-cli":"snapshot schedule list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/snapshot-policies\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Lịch chụp tự động của mọi máy trong tài khoản (phân trang)"}},"/v1/snapshots":{"get":{"description":"Lists the snapshots of all your servers in one paged list, newest first by default. Snapshots of deleted servers are not shown. To list or manage the snapshots of one server use the per-server operations. The list is cached for about 20 seconds, so a snapshot you just took or deleted can take a moment to appear or disappear.\n\n`meta.limit` is the number of snapshots one server may hold.\n\n**Required scope:** `vm:read`.","operationId":"snapshot_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created","enum":["created","size","vm","state","name"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Alias of `dir`, used only when `dir` is absent.","in":"query","name":"order","required":false,"schema":{"enum":["asc","desc"],"type":"string"}},{"description":"Only list snapshots of this server (UUID). A server that is not yours gives an empty list.","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"created":"2026-10-18T21:14:07+0000","created_at":1792358047,"current":true,"description":"Before the 24.04 upgrade","hostname":"web-1","id":"0c5d1e7a-6b3f-4a9e-8d21-7f4b2c9e1a60","name":"before-upgrade","size":2147483648,"source":"manual","state":"Ready","type":"Disk","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"Web server"}],"meta":{"limit":3,"total":1},"page":1,"per_page":20,"sort":"created","total":1},"schema":{"properties":{"dir":{"description":"The sort direction applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/AccountSnapshot"},"type":"array"},"meta":{"properties":{"limit":{"description":"Maximum number of snapshots one server may hold.","type":"integer"},"total":{"description":"Number of snapshots matching the filters.","type":"integer"}},"required":["total","limit"],"type":"object","x-order":["total","limit"]},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"The sort field applied. An unknown `sort` falls back to `created`.","enum":["created","size","vm","state","name"],"type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir","meta"],"type":"object","x-order":["items","total","page","per_page","sort","dir","meta"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The snapshots could not be read. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The snapshots could not be read. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The snapshots could not be read. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Snapshots of all VMs in the account (paged, sortable)","tags":["Snapshots"],"x-cli":"snapshot list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/snapshots\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Bản chụp của mọi máy trong tài khoản (phân trang, sắp xếp)"}},"/v1/tenants/{tid}":{"get":{"description":"Returns your DDoS Shield account: status, limits, current usage and every protected IP with its blocking rules. Rules created by the protection system or by staff appear with an actor label instead of a name.\n\n**Required scope:** `shield:read`.","operationId":"shield_tenant_get","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"created_at":1759000000,"id":"acc-42","name":"Example","note":"","quota":{"max_rules":100,"max_targets":10},"registered":true,"status":"active","targets":[{"created_at":1759000000,"enabled":true,"id":"pt1760000000a","ip":"203.0.113.10","kind":"vm","label":"acc-42/vm:3f6c1d0e-0000-4000-8000-000000000001","rules":[{"at":1760000000,"by":"you","expires":null,"id":"r-x1760000000a","kind":"ip","mode":"block","note":"scanner","prefixes":[],"value":"198.51.100.72"}],"seen_at":1760000100,"web":{"enabled":false,"pkt_rate":0,"ports":[],"syn_rate":0}}],"usage":{"rules":1,"targets":1,"waf_domains":0}},"schema":{"properties":{"created_at":{"description":"Creation time (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Tenant identifier.","type":"string"},"name":{"description":"Display name.","type":"string"},"note":{"description":"Note.","type":"string"},"quota":{"properties":{"max_rules":{"description":"Maximum blocking rules, 0 = no limit.","type":"integer"},"max_targets":{"description":"Maximum protected IPs, 0 = no limit.","type":"integer"}},"required":["max_targets","max_rules"],"type":"object","x-order":["max_targets","max_rules"]},"registered":{"description":"Whether the tenant is registered.","type":"boolean"},"status":{"description":"`active` or `suspended`. A suspended tenant is read-only.","type":"string"},"targets":{"items":{"$ref":"#/components/schemas/ShieldTargetRaw"},"type":"array"},"usage":{"properties":{"rules":{"description":"Rules in use.","type":"integer"},"targets":{"description":"Protected IPs in use.","type":"integer"},"waf_domains":{"description":"Always 0 (web firewall domains were retired).","type":"integer"}},"required":["targets","rules","waf_domains"],"type":"object","x-order":["targets","rules","waf_domains"]}},"required":["id","name","status","note","created_at","registered","quota","usage","targets"],"type":"object","x-order":["id","name","status","note","created_at","registered","quota","usage","targets"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Tenant overview: quota, usage and protected IPs","tags":["DDoS Shield"],"x-cli":"shield tenant get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Tổng quan khách: hạn mức, mức dùng và các IP được bảo vệ"}},"/v1/tenants/{tid}/blocks":{"get":{"description":"Lists every blocking rule of the tenant across all protected IPs in one flat list, newest first, with cursor paging. To list the rules of one IP with their hit counters use the target rule list instead.\n\n**Required scope:** `shield:read`.","operationId":"shield_block_list","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Only rules of this protected IP (identifier or address).","in":"query","name":"target","required":false,"schema":{"type":"string"}},{"description":"Rules per page.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Offset to continue from: pass the `next_cursor` of the previous page.","in":"query","name":"cursor","required":false,"schema":{"default":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"blocks":[{"at":1760000000,"by":"you","id":"pt1760000000a:r-x1760000000a","kind":"ip","note":"scanner","prefixes":0,"target_id":"pt1760000000a","target_ip":"203.0.113.10","value":"198.51.100.72"}],"next_cursor":null,"total":1},"schema":{"properties":{"blocks":{"items":{"$ref":"#/components/schemas/ShieldBlock"},"type":"array"},"next_cursor":{"description":"Cursor of the next page, null on the last page.","type":["integer","null"]},"total":{"description":"Total number of rules matching.","type":"integer"}},"required":["blocks","total","next_cursor"],"type":"object","x-order":["blocks","total","next_cursor"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"All blocking rules of the tenant, flat and paged","tags":["DDoS Shield"],"x-cli":"shield block list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/blocks\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Mọi luật chặn của khách, dạng phẳng có phân trang"}},"/v1/tenants/{tid}/blocks/export":{"get":{"description":"Downloads every blocking rule of the tenant as a CSV file with the columns `id,target_ip,kind,value,prefixes,note,by,at`.\n\n**Required scope:** `shield:read`.","operationId":"shield_block_export","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Only rules of this protected IP (identifier or address).","in":"query","name":"target","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/csv":{"schema":{"description":"CSV file.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Download the tenant's blocking rules as CSV","tags":["DDoS Shield"],"x-cli":"shield block export","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/blocks/export\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Tải mọi luật chặn của khách dạng CSV"}},"/v1/tenants/{tid}/countries":{"get":{"description":"Returns the countries seen in recent traffic, for building country rules. Each entry has the ISO country code and its name. The call needs the traffic analyzer to be running and returns 503 `unavailable` otherwise.\n\n**Required scope:** `shield:read`.","operationId":"shield_country_list","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":[{"cc":"VN","name":"Vietnam"},{"cc":"US","name":"United States"}],"schema":{"items":{"properties":{"cc":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"name":{"description":"Country name.","type":"string"}},"required":["cc","name"],"type":"object"},"type":"array"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"upstream","message":"The traffic analyzer refused the request."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The traffic analyzer refused the request. (`upstream`)","x-error-codes":[{"code":"upstream","description":"The traffic analyzer refused the request."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"unavailable","message":"The traffic analyzer is not running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The traffic analyzer is not running. (`unavailable`)","x-error-codes":[{"code":"unavailable","description":"The traffic analyzer is not running."}]}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Country code table used by country rules","tags":["DDoS Shield"],"x-cli":"shield country list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/countries\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Bảng mã quốc gia dùng cho luật chặn theo quốc gia"}},"/v1/tenants/{tid}/events":{"get":{"description":"Lists attack events against the tenant's IPs, newest first (at most 300). Events from before an IP was assigned to you are never shown. Use `brief=1` to drop the bulky sample arrays.\n\n**Required scope:** `shield:read`.","operationId":"shield_tenant_events","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Only events that started within this range.","in":"query","name":"range","required":false,"schema":{"default":"30d","enum":["1h","6h","24h","7d","30d"],"type":"string"}},{"description":"Pass `1` for the short form without `samples`, with `severity`, `peak_bits`, `duration_s` and `open` added.","in":"query","name":"brief","required":false,"schema":{"maximum":1,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"events":[{"duration_s":900,"ended":1760000900,"id":"ev-1760000000-1","label":"UDP flood","open":false,"peak_bits":100000000.0,"peak_bps":12500000.0,"peak_pps":410000.0,"severity":"high","started":1760000000,"target":"203.0.113.10"}],"range":"24h"},"schema":{"properties":{"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"events":{"items":{"$ref":"#/components/schemas/ShieldEvent"},"type":"array"},"range":{"description":"The range you asked for.","type":["string","null"]}},"required":["events","at","range"],"type":"object","x-order":["events","at","range"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Attack events against the tenant's IPs","tags":["DDoS Shield"],"x-cli":"shield tenant events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Sự kiện tấn công vào các IP của khách"}},"/v1/tenants/{tid}/events/{eid}":{"get":{"description":"Returns one attack event with the captured packet sample (top sources, protocols and ports) and a link to the text report.\n\n**Required scope:** `shield:read`.","operationId":"shield_event_get","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Attack event identifier as returned by the events calls.","in":"path","name":"eid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ai_tasks":[],"at":1760001000,"event":{"duration_s":900,"ended":1760000900,"id":"ev-1760000000-1","label":"UDP flood","open":false,"peak_bits":100000000.0,"peak_bps":12500000.0,"peak_pps":410000.0,"severity":"high","started":1760000000,"target":"203.0.113.10"},"links":{"report":"/v1/tenants/acc-42/events/ev-1760000000-1/report"},"sample":{}},"schema":{"properties":{"ai_tasks":{"items":{"description":"Reserved, always empty."},"type":"array"},"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"event":{"$ref":"#/components/schemas/ShieldEvent"},"links":{"properties":{"report":{"description":"Path of the text report.","type":"string"}},"required":["report"],"type":"object"},"sample":{"additionalProperties":true,"description":"Packet sample: `at`, `packets`, `top_sources` (`ip`, `packets`), `protocols`, `ports`. Empty when no sample was captured.","type":"object"}},"required":["event","sample","ai_tasks","at","links"],"type":"object","x-order":["event","sample","ai_tasks","at","links"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The event identifier has invalid characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The event identifier has invalid characters. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The event identifier has invalid characters."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"One attack event with packet sample","tags":["DDoS Shield"],"x-cli":"shield event get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/events/<eid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Một sự kiện tấn công kèm mẫu gói"}},"/v1/tenants/{tid}/events/{eid}/report":{"get":{"description":"Downloads the incident report of an attack event as a plain-text file: target, type, times, peak rates, top sources and protocol mix. The text is written in Vietnamese.\n\n**Required scope:** `shield:read`.","operationId":"shield_event_report","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Attack event identifier as returned by the events calls.","in":"path","name":"eid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"description":"The report.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The event identifier has invalid characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The event identifier has invalid characters. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The event identifier has invalid characters."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Plain-text incident report of an attack event","tags":["DDoS Shield"],"x-cli":"shield event report","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/events/<eid>/report\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Báo cáo sự cố dạng văn bản của một sự kiện tấn công"}},"/v1/tenants/{tid}/overview":{"get":{"description":"Returns everything the DDoS Shield dashboard shows on one page, for ALL IPs of your account together: totals (current rate, protected IPs, attacks in progress, blocking rules, blackholes), one row per IP, the combined edge traffic stacked by IP, the attack events of the last 24 hours and the countries attacks and traffic come from. Only IPs of your own account are included, and every total is the sum of those IPs.\n\n`range` chooses the traffic window: `30m` (default) is the live window sampled every 5 seconds; `6h` and `24h` are stored history with one point per 5 minutes (the highest rate of each 5 minutes), kept across restarts of the edge service; history starts when it was first recorded, so a young account or a new IP may show fewer points than the window. Nothing is kept for longer than 48 hours. `events.peak_bits_24h` is the highest inbound bit rate of the attacks of the last 24 hours, left at 0 (and counted in `events.peak_bits_unsure_24h`) when the measurement is not plausible. Attack countries (`events.attack_cc`, `events.attack_ev`) are only known for attacks detected by an agent installed on your server. `geo.cc` lists the countries inbound traffic comes from, sampled over the last 15 minutes from the busiest IPs; it is refreshed in the background, so `geo.at` is 0 until the first sample is ready. Data is cached for 2 seconds. For the rules of one IP use [List blocking rules](#operation/shield_rule_list); for the attacks of one IP use [List attack events](#operation/shield_event_list).\n\n**Required scope:** `shield:read`.","operationId":"shield_overview","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Traffic window of `traffic`. Any other value is treated as `30m`.","in":"query","name":"range","required":false,"schema":{"default":"30m","enum":["30m","6h","24h"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792368030,"events":{"active":1,"attack_cc":[],"attack_ev":[],"by_kind":{"syn_flood":1},"by_severity":{"high":1},"hourly":[[0,0],[1,3]],"last":{"ended":null,"id":"ev-1792368000-20311_11","kind":"syn_flood","label":"SYN flood","severity":"high","started":1792368000,"target":"203.0.113.11"},"last24h":1,"list":[{"duration_s":30,"ended":null,"id":"ev-1792368000-20311_11","kind":"syn_flood","label":"SYN flood","open":true,"peak_bits":700000000.0,"peak_ok":true,"peak_pps":182000,"severity":"high","src":"edge","started":1792368000,"target":"203.0.113.11"}],"peak_bits_24h":700000000.0,"peak_bits_unsure_24h":0,"peak_pps_24h":182000,"truncated":false},"geo":{"at":1792368000,"cc":[{"bytes":5120993740,"cc":"US"}],"ips":1,"ok":true,"window_s":900},"range":"30m","targets":[{"bps":640000000.0,"enabled":true,"event":{"id":"ev-1792368000-20311_11","label":"SYN flood","peak_pps":182000,"severity":"high","started":1792368000},"events24":1,"id":"pt-1792000100","ip":"203.0.113.11","kind":"vm","label":"acc-7k3m9x2p/vm:9b1d4a77-02ce-4f3e-8d15-6a7e2c90f3b4","out_bps":1200000.0,"out_pps":900.0,"pps":180000.0,"rules":1,"spark":[4000000.0,640000000.0],"spark_out":[1100000.0,1200000.0],"status":"attack","vm":null,"web":false}],"targets_truncated":false,"tenant":{"id":"acc-7k3m9x2p","max_targets":10,"name":"Example Corp","status":"active"},"totals":{"attacking":1,"bps":644200000.0,"high":0,"ips":2,"out_bps":82200000.0,"out_pps":11900.0,"pps":180900.0,"protected":2,"rtbh_active":0,"rules_block":2,"rules_count":0,"rules_temp":1},"traffic":{"by_ip":[{"ip":"203.0.113.11","v":[640000000.0]}],"other":[0.0],"points":[[1792368020.0,640000000.0,1200000.0,180000.0,900.0]],"range":"30m","step_s":5}},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"events":{"description":"Attacks on your IPs.","properties":{"active":{"description":"Attacks in progress.","type":"integer"},"attack_cc":{"description":"Countries attacks come from (agent-detected attacks only), most packets first.","items":{"properties":{"cc":{"description":"Country code.","type":"string"},"events":{"description":"Attacks involving the country.","type":"integer"},"packets":{"description":"Sampled packets.","type":"integer"}},"required":["cc","packets","events"],"type":"object","x-order":["cc","packets","events"]},"type":"array"},"attack_ev":{"description":"Source countries per attack, newest first, at most 80.","items":{"properties":{"cc":{"description":"`[country code, sampled packets]`, at most 6.","items":{"items":{"description":"Value.","type":"number"},"type":"array"},"type":"array"},"id":{"description":"Event identifier.","type":"string"}},"required":["id","cc"],"type":"object","x-order":["id","cc"]},"type":"array"},"by_kind":{"additionalProperties":{"description":"Count.","type":"integer"},"description":"Attacks per class.","type":"object"},"by_severity":{"additionalProperties":{"description":"Count.","type":"integer"},"description":"Attacks per severity.","type":"object"},"hourly":{"description":"24 entries, oldest hour first: `[attack count, highest severity rank 0-4]`.","items":{"items":{"description":"Number.","type":"integer"},"type":"array"},"type":"array"},"last":{"properties":{"ended":{"description":"When it ended, null while open (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Event identifier.","type":"string"},"kind":{"description":"Attack class.","type":"string"},"label":{"description":"Description (not translated).","type":"string"},"severity":{"description":"Severity.","type":"string"},"started":{"description":"When it was detected (Unix time, seconds, UTC)","type":"integer"},"target":{"description":"The IP.","type":"string"}},"required":["id","kind","started","ended","label","target","severity"],"type":["object","null"],"x-order":["id","kind","started","ended","label","target","severity"]},"last24h":{"description":"Attacks that started in the last 24 hours (or are still open).","type":"integer"},"list":{"description":"Attacks of the last 24 hours, newest first, at most 200.","items":{"properties":{"duration_s":{"description":"Duration in seconds so far.","type":"integer"},"ended":{"description":"When it ended, null while open (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Event identifier.","type":"string"},"kind":{"description":"Attack class.","type":"string"},"label":{"description":"Description of the attack class (not translated).","type":"string"},"open":{"description":"True while the attack is in progress.","type":"boolean"},"peak_bits":{"description":"Highest inbound bit rate; unreliable when `peak_ok` is false.","type":"number"},"peak_ok":{"description":"False when the measurement is implausible and `peak_bits` should not be shown.","type":"boolean"},"peak_pps":{"description":"Highest packet rate.","type":"number"},"severity":{"description":"`low`, `medium`, `high` or `critical`.","type":"string"},"src":{"description":"Where the attack was detected: the network edge or an agent installed on your server.","enum":["edge","agent"],"type":"string"},"started":{"description":"When the attack was detected (Unix time, seconds, UTC)","type":"integer"},"target":{"description":"The IP that was attacked.","type":"string"}},"required":["id","target","kind","label","severity","started","ended","open","duration_s","peak_pps","peak_bits","peak_ok","src"],"type":"object","x-order":["id","target","kind","label","severity","started","ended","open","duration_s","peak_pps","peak_bits","peak_ok","src"]},"type":"array"},"peak_bits_24h":{"description":"Highest inbound bit rate of an attack of the last 24 hours with a plausible measurement; 0 if none.","type":"number"},"peak_bits_unsure_24h":{"description":"Attacks whose bit rate was left out because the measurement is implausible.","type":"integer"},"peak_pps_24h":{"description":"Highest packet rate seen in an attack of the last 24 hours.","type":"integer"},"truncated":{"description":"True when `last24h` is larger than the list.","type":"boolean"}},"required":["last24h","active","peak_pps_24h","peak_bits_24h","peak_bits_unsure_24h","by_severity","by_kind","hourly","list","truncated","attack_cc","attack_ev","last"],"type":"object","x-order":["last24h","active","peak_pps_24h","peak_bits_24h","peak_bits_unsure_24h","by_severity","by_kind","hourly","list","truncated","attack_cc","attack_ev","last"]},"geo":{"description":"Countries inbound traffic comes from.","properties":{"at":{"description":"When the sample was taken; 0 until the first one is ready (Unix time, seconds, UTC)","type":"integer"},"cc":{"description":"Countries inbound traffic comes from, most bytes first (at most 40).","items":{"properties":{"bytes":{"description":"Bytes received from the country in the window.","type":"integer"},"cc":{"description":"Country code.","type":"string"}},"required":["cc","bytes"],"type":"object","x-order":["cc","bytes"]},"type":"array"},"ips":{"description":"Number of IPs sampled (the busiest).","type":"integer"},"ok":{"description":"False when the traffic analyser could not be reached.","type":"boolean"},"window_s":{"description":"Length of the sampled window in seconds.","type":"integer"}},"required":["at","ok","cc","window_s","ips"],"type":"object","x-order":["at","ok","cc","window_s","ips"]},"range":{"description":"The traffic window that was applied.","enum":["30m","6h","24h"],"type":"string"},"targets":{"description":"One row per IP, at most 500.","items":{"properties":{"bps":{"description":"Current inbound rate, bits per second.","type":"number"},"enabled":{"description":"Whether protection is switched on.","type":"boolean"},"event":{"properties":{"id":{"description":"Event identifier.","type":"string"},"label":{"description":"Description of the attack class (not translated).","type":"string"},"peak_pps":{"description":"Highest packet rate so far.","type":"number"},"severity":{"description":"`low`, `medium`, `high` or `critical`.","type":"string"},"started":{"description":"When the attack was detected (Unix time, seconds, UTC)","type":"integer"}},"required":["id","label","started","peak_pps","severity"],"type":["object","null"],"x-order":["id","label","started","peak_pps","severity"]},"events24":{"description":"Attack events of the IP that started in the last 24 hours.","type":"integer"},"id":{"description":"Protected target identifier.","type":"string"},"ip":{"description":"The protected IP address.","type":"string"},"kind":{"description":"Kind of resource behind the IP.","type":"string"},"label":{"description":"Label of the target; it starts with your tenant identifier.","type":"string"},"out_bps":{"description":"Current outbound rate, bits per second.","type":"number"},"out_pps":{"description":"Current outbound rate, packets per second.","type":"number"},"pps":{"description":"Current inbound rate, packets per second.","type":"number"},"rules":{"description":"Number of rules on the IP.","type":"integer"},"spark":{"description":"Recent inbound samples, oldest first (at most 30).","items":{"description":"Bits per second.","type":"number"},"type":"array"},"spark_out":{"description":"Recent outbound samples, oldest first (at most 30).","items":{"description":"Bits per second.","type":"number"},"type":"array"},"status":{"description":"Traffic status of the IP.","enum":["ok","idle","high","attack"],"type":"string"},"vm":{"properties":{"id":{"description":"Server identifier.","type":"string"},"name":{"description":"Display name of the server.","type":"string"}},"required":["id","name"],"type":["object","null"]},"web":{"description":"Whether web protection is switched on.","type":"boolean"}},"required":["id","ip","label","kind","enabled","web","vm","status","bps","pps","out_bps","out_pps","spark","spark_out","rules","events24","event"],"type":"object","x-order":["id","ip","label","kind","enabled","web","vm","status","bps","pps","out_bps","out_pps","spark","spark_out","rules","events24","event"]},"type":"array"},"targets_truncated":{"description":"True when the account has more than 500 IPs and `targets` is cut.","type":"boolean"},"tenant":{"description":"Your tenant.","properties":{"id":{"description":"Tenant identifier.","type":"string"},"max_targets":{"description":"Maximum number of protected IPs; 0 means no limit.","type":"integer"},"name":{"description":"Name of the tenant.","type":"string"},"status":{"description":"`active` or `suspended`.","type":"string"}},"required":["id"],"type":"object","x-order":["id","name","status","max_targets"]},"totals":{"description":"Sums over the IPs of your account.","properties":{"attacking":{"description":"IPs with an attack in progress.","type":"integer"},"bps":{"description":"Total inbound rate, bits per second.","type":"number"},"high":{"description":"IPs whose inbound packet rate is well above their normal level.","type":"integer"},"ips":{"description":"Number of IPs on the account.","type":"integer"},"out_bps":{"description":"Total outbound rate, bits per second.","type":"number"},"out_pps":{"description":"Total outbound rate, packets per second.","type":"number"},"pps":{"description":"Total inbound rate, packets per second.","type":"number"},"protected":{"description":"IPs with protection switched on.","type":"integer"},"rtbh_active":{"description":"Blackholes in force on your IPs.","type":"integer"},"rules_block":{"description":"Blocking rules in force on your IPs.","type":"integer"},"rules_count":{"description":"Count-only rules.","type":"integer"},"rules_temp":{"description":"Blocking rules that expire automatically.","type":"integer"}},"required":["ips","protected","attacking","high","bps","out_bps","pps","out_pps","rules_block","rules_count","rules_temp","rtbh_active"],"type":"object","x-order":["ips","protected","attacking","high","bps","out_bps","pps","out_pps","rules_block","rules_count","rules_temp","rtbh_active"]},"traffic":{"description":"Combined edge traffic of your IPs.","properties":{"by_ip":{"description":"The 5 IPs with the most inbound traffic.","items":{"properties":{"ip":{"description":"IP address.","type":"string"},"v":{"description":"Inbound rate aligned with `points`.","items":{"description":"Bits per second.","type":"number"},"type":"array"}},"required":["ip","v"],"type":"object"},"type":"array"},"other":{"description":"Inbound rate of all other IPs, aligned with `points`; `by_ip` plus `other` add up to the total.","items":{"description":"Bits per second.","type":"number"},"type":"array"},"points":{"description":"`[time, in_bps, out_bps, in_pps, out_pps]`, oldest first, at most 360 points; with `6h` and `24h` each value is the highest of its 5-minute bucket.","items":{"items":{"description":"Number.","type":"number"},"type":"array"},"type":"array"},"range":{"description":"Window.","enum":["30m","6h","24h"],"type":"string"},"step_s":{"description":"Seconds between points before any merging: 5 for `30m`, 300 for `6h` and `24h`.","type":"integer"}},"required":["range","step_s","points","by_ip","other"],"type":"object","x-order":["range","step_s","points","by_ip","other"]}},"required":["at","range","tenant","totals","targets","targets_truncated","traffic","events","geo"],"type":"object","x-order":["at","range","tenant","totals","targets","targets_truncated","traffic","events","geo"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The account is blocked or suspended. (`forbidden`)","x-error-codes":[{"code":"forbidden","description":"The account is blocked or suspended."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"DDoS Shield center: all IPs, traffic, 24-hour attacks","tags":["DDoS Shield"],"x-cli":"shield overview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/overview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Trung tâm DDoS: gộp mọi IP, lưu lượng, sự kiện 24 giờ"}},"/v1/tenants/{tid}/rtbh":{"get":{"description":"Lists the upstream blackhole (RTBH) entries that currently cover the tenant's IPs, including entries created by the protection system. Use the target blackhole calls for the full detail of one IP.\n\n**Required scope:** `shield:read`.","operationId":"shield_rtbh_list","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"rtbh":[{"created":1760000000,"event_id":"","id":"bh-1760000000-a1","ip":"203.0.113.10","note":"","remaining_s":420,"scope":"international","scope_label":"International","source":"manual","status":"active","until":1760000600}]},"schema":{"properties":{"rtbh":{"items":{"properties":{"created":{"description":"Creation time (Unix time, seconds, UTC)","type":"integer"},"event_id":{"description":"Related attack event, if any.","type":"string"},"id":{"description":"Entry identifier.","type":"string"},"ip":{"description":"Blackholed address.","type":"string"},"note":{"description":"Note.","type":"string"},"remaining_s":{"description":"Seconds left.","type":"integer"},"scope":{"description":"Scope of the blackhole.","type":"string"},"scope_label":{"description":"Display label of the scope.","type":"string"},"source":{"description":"`manual` or `auto`.","type":"string"},"status":{"description":"Entry status.","type":"string"},"until":{"description":"Expiry (Unix time, seconds, UTC)","type":"integer"}},"required":["id","ip","scope","scope_label","status","created","until","remaining_s","source","note","event_id"],"type":"object","x-order":["id","ip","scope","scope_label","status","created","until","remaining_s","source","note","event_id"]},"type":"array"}},"required":["rtbh"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Upstream blackhole (RTBH) entries of the tenant's IPs","tags":["DDoS Shield"],"x-cli":"shield rtbh list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/rtbh\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Các mục blackhole (RTBH) lên upstream của IP khách"}},"/v1/tenants/{tid}/rtbh/{bid}":{"delete":{"description":"Withdraws a blackhole entry that you created, so traffic to the IP flows again. Entries created by the protection system or by staff cannot be withdrawn this way.\n\n**Required scope:** `shield:write`.","operationId":"shield_rtbh_delete","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Blackhole entry identifier as returned by the blackhole calls.","in":"path","name":"bid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"entry":{"id":"bh-1760000000-a1","ip":"203.0.113.10","status":"withdrawn"},"ok":true},"schema":{"properties":{"entry":{"additionalProperties":true,"description":"The entry after withdrawal.","type":"object"},"ok":{"description":"Always `true`.","type":"boolean"}},"required":["ok","entry"],"type":"object","x-order":["ok","entry"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `readonly_rtbh`: The entry was created by the system or staff; it is read-only for you. `tenant_suspended`: The tenant is suspended and is read-only.","x-error-codes":[{"code":"readonly_rtbh","description":"The entry was created by the system or staff; it is read-only for you."},{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The entry is already withdrawn or expired."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The entry is already withdrawn or expired. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The entry is already withdrawn or expired."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Withdraw a blackhole entry you created","tags":["DDoS Shield"],"x-cli":"shield rtbh delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/tenants/<tid>/rtbh/<bid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Rút một mục blackhole do bạn tạo"}},"/v1/tenants/{tid}/rtbh/{bid}/extend":{"post":{"description":"Restarts the lifetime of a blackhole entry that you created: it now expires `ttl_s` seconds from now (it does not add to the old remaining time).\n\n**Required scope:** `shield:write`.","operationId":"shield_rtbh_extend","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Blackhole entry identifier as returned by the blackhole calls.","in":"path","name":"bid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"ttl_s":1800},"schema":{"properties":{"ttl_s":{"description":"New lifetime in seconds, from 60 to 86400.","type":"integer"}},"required":["ttl_s"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"entry":{"id":"bh-1760000000-a1","ip":"203.0.113.10","ttl_s":1800},"ok":true},"schema":{"properties":{"entry":{"additionalProperties":true,"description":"The entry with its new expiry.","type":"object"},"ok":{"description":"Always `true`.","type":"boolean"}},"required":["ok","entry"],"type":"object","x-order":["ok","entry"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `readonly_rtbh`: The entry was created by the system or staff; it is read-only for you. `tenant_suspended`: The tenant is suspended and is read-only.","x-error-codes":[{"code":"readonly_rtbh","description":"The entry was created by the system or staff; it is read-only for you."},{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`ttl_s` is out of range, or the entry already expired."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`ttl_s` is out of range, or the entry already expired. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`ttl_s` is out of range, or the entry already expired."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Reset the lifetime of a blackhole entry you created","tags":["DDoS Shield"],"x-cli":"shield rtbh extend","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/tenants/<tid>/rtbh/<bid>/extend\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ttl_s\":1800}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Đặt lại thời hạn của một mục blackhole do bạn tạo"}},"/v1/tenants/{tid}/shape":{"get":{"description":"Returns the traffic shaping (rate limiting) state of every protected IP of the tenant: whether a shaper applies, its limits and the live rates. Read-only.\n\n**Required scope:** `shield:read`.","operationId":"shield_shape_list","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"engine":"off","items":[{"expires":null,"ip":"203.0.113.10","live":null,"shaped":false,"shaper":null,"since":null,"state":"off","target_id":"pt1760000000a"}],"readonly":true},"schema":{"properties":{"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"engine":{"description":"Shaping engine mode.","type":"string"},"items":{"items":{"additionalProperties":true,"description":"Per IP: `ip`, `target_id`, `shaped`, `shaper` (name, port_mbps, rate_mbps, burst_secs, direction), `live` (in and out rates), `state`, `since`, `expires`.","type":"object"},"type":"array"},"readonly":{"description":"Always true.","type":"boolean"}},"required":["engine","readonly","items","at"],"type":"object","x-order":["engine","readonly","items","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Traffic shaping state of all the tenant's IPs (read-only)","tags":["DDoS Shield"],"x-cli":"shield shape list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/shape\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Trạng thái giới hạn băng thông của mọi IP khách (chỉ đọc)"}},"/v1/tenants/{tid}/summary":{"get":{"description":"Returns the overview shown on the DDoS Shield page of the dashboard: every protected IP with its current inbound and outbound rate, status, number of blocking rules and the attack in progress (if any), plus totals. Rates are measured at the network edge and refresh every few seconds; `spark` and `spark_out` hold up to 30 recent samples per direction for drawing a chart.\n\n`status` is `attack` while an attack event is open, `high` when the inbound packet rate is well above the normal level of the IP, `idle` when no inbound traffic is measured and `ok` otherwise. For details about attacks use [List attack events](#operation/shield_event_list).\n\n**Required scope:** `shield:read`.","operationId":"shield_summary","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792368030,"attacks":1,"sum_bps":644200000.0,"sum_out_bps":82200000.0,"targets":[{"bps":4200000.0,"enabled":true,"event":null,"id":"pt-1792000000","ip":"203.0.113.10","kind":"vm","label":"acc-7k3m9x2p/vm:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","out_bps":81000000.0,"out_pps":11000.0,"pps":900.0,"rules":2,"spark":[3900000.0,4100000.0,4200000.0],"spark_out":[78000000.0,80500000.0,81000000.0],"status":"ok","vm":{"display_name":"Web 1","hostname":"web-1","id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"web":false},{"bps":640000000.0,"enabled":true,"event":{"label":"SYN flood","peak_pps":182000,"severity":"high","started":1792368000},"id":"pt-1792000100","ip":"203.0.113.11","kind":"vm","label":"acc-7k3m9x2p/vm:9b1d4a77-02ce-4f3e-8d15-6a7e2c90f3b4","out_bps":1200000.0,"out_pps":900.0,"pps":180000.0,"rules":0,"spark":[4000000.0,640000000.0],"spark_out":[1100000.0,1200000.0],"status":"attack","vm":null,"web":false}],"tenant":{"id":"acc-7k3m9x2p","max_targets":10,"name":"Example Corp","status":"active"}},"schema":{"properties":{"at":{"description":"Time of the response (Unix time, seconds, UTC)","type":"integer"},"attacks":{"description":"Number of IPs whose status is `attack`.","type":"integer"},"sum_bps":{"description":"Total inbound rate of all protected IPs, in bits per second.","type":"number"},"sum_out_bps":{"description":"Total outbound rate of all protected IPs, in bits per second.","type":"number"},"targets":{"items":{"properties":{"bps":{"description":"Current inbound rate in bits per second.","type":"number"},"enabled":{"description":"Whether protection is switched on for this IP.","type":"boolean"},"event":{"description":"The attack in progress on this IP, or null.","properties":{"label":{"description":"Description of the attack class (not translated).","type":"string"},"peak_pps":{"description":"Highest inbound packet rate so far, in packets per second.","type":"number"},"severity":{"description":"`low`, `medium`, `high` or `critical`.","type":"string"},"started":{"description":"When the attack was detected (Unix time, seconds, UTC)","type":"integer"}},"required":["label","started","peak_pps","severity"],"type":["object","null"],"x-order":["label","started","peak_pps","severity"]},"id":{"description":"Protected target identifier.","type":"string"},"ip":{"description":"The protected IP address.","type":"string"},"kind":{"description":"Kind of resource behind the IP.","enum":["vm","baremetal","service"],"type":"string"},"label":{"description":"Label of the target; it starts with your tenant identifier.","type":"string"},"out_bps":{"description":"Current outbound rate in bits per second.","type":"number"},"out_pps":{"description":"Current outbound rate in packets per second.","type":"number"},"pps":{"description":"Current inbound rate in packets per second.","type":"number"},"rules":{"description":"Number of blocking rules on the IP.","type":"integer"},"spark":{"description":"Recent inbound rate samples in bits per second, oldest first (at most 30).","items":{"description":"Bits per second.","type":"number"},"type":"array"},"spark_out":{"description":"Recent outbound rate samples in bits per second, oldest first (at most 30).","items":{"description":"Bits per second.","type":"number"},"type":"array"},"status":{"description":"Traffic status of the IP.","enum":["ok","idle","high","attack"],"type":"string"},"vm":{"description":"The server that uses this IP as its public address, or null when no server does.","properties":{"display_name":{"description":"Display name of the server.","type":"string"},"hostname":{"description":"Host name of the server.","type":"string"},"id":{"description":"Server identifier.","type":"string"}},"required":["id","hostname","display_name"],"type":["object","null"],"x-order":["id","hostname","display_name"]},"web":{"description":"Whether web protection is switched on for the IP.","type":"boolean"}},"required":["id","ip","label","kind","enabled","rules","vm","web","bps","pps","out_bps","out_pps","status","spark","spark_out","event"],"type":"object","x-order":["id","ip","label","kind","enabled","rules","vm","web","bps","pps","out_bps","out_pps","status","spark","spark_out","event"]},"type":"array"},"tenant":{"description":"Your tenant. Only `id` is present when the tenant has no stored settings.","properties":{"id":{"description":"Tenant identifier.","type":"string"},"max_targets":{"description":"Maximum number of protected IPs; 0 means no limit.","type":"integer"},"name":{"description":"Name of the tenant.","type":"string"},"status":{"description":"`active`, or `suspended` when changes to blocking rules are not allowed (reads still work).","type":"string"}},"required":["id"],"type":"object","x-order":["id","name","status","max_targets"]}},"required":["tenant","targets","sum_bps","sum_out_bps","attacks","at"],"type":"object","x-order":["tenant","targets","sum_bps","sum_out_bps","attacks","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The account is blocked or suspended. (`forbidden`)","x-error-codes":[{"code":"forbidden","description":"The account is blocked or suspended."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"DDoS Shield overview","tags":["DDoS Shield"],"x-cli":"shield summary","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/summary\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Tổng quan DDoS Shield"}},"/v1/tenants/{tid}/targets":{"get":{"description":"Returns the IP addresses protected by DDoS Shield on your account, each with its blocking rules, web protection settings and cumulative edge counters. The list is not paginated.\n\nRules created from an AS number or a country carry the expanded `prefixes`, which can be very long; if you only need rule details use [List blocking rules](#operation/shield_rule_list). `counters.targets` is keyed by IP and counts packets and bytes since the edge started, so subtract two readings to get a rate (or use [Get edge traffic](#operation/shield_traffic)). Protected IPs are managed for you and cannot be added or removed here.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_list","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"counters":{"at":1792368005,"targets":{"203.0.113.10":{"in":{"bytes":3012451120,"packets":5821733},"out":{"bytes":5120993740,"packets":4410220}}}},"targets":[{"created_at":1792000000,"enabled":true,"id":"pt-1792000000","ip":"203.0.113.10","kind":"vm","label":"acc-7k3m9x2p/vm:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","rules":[{"at":1792100000,"by":"you","expires":null,"id":"r-0-1792100000","kind":"ip","mode":"","note":"scanner","prefixes":[],"value":"198.51.100.7/32"}],"seen_at":1792368000,"web":{"enabled":false,"pkt_rate":0,"ports":[],"syn_rate":0}}]},"schema":{"properties":{"counters":{"description":"Edge counters of your protected IPs.","properties":{"at":{"description":"When the counters were read; 0 if no counters are available (Unix time, seconds, UTC)","type":"integer"},"targets":{"additionalProperties":{"description":"Cumulative edge counters of one IP since the edge started (they restart from zero when it restarts). A direction is absent until it has been counted.","properties":{"in":{"description":"Traffic received for the IP at the network edge.","properties":{"bytes":{"description":"Number of bytes.","type":"integer"},"packets":{"description":"Number of packets.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]},"out":{"description":"Traffic sent from the IP through the network edge.","properties":{"bytes":{"description":"Number of bytes.","type":"integer"},"packets":{"description":"Number of packets.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]},"web":{"description":"Packets dropped by the web protection limits of the IP.","properties":{"bytes":{"description":"Number of bytes.","type":"integer"},"packets":{"description":"Number of packets.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]}},"type":"object"},"description":"Counters keyed by the IP address of the target. IPs without counters are absent.","type":"object"}},"required":["at","targets"],"type":"object"},"targets":{"items":{"$ref":"#/components/schemas/ShieldTarget"},"type":"array"}},"required":["targets","counters"],"type":"object","x-order":["targets","counters"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The account is blocked or suspended. (`forbidden`)","x-error-codes":[{"code":"forbidden","description":"The account is blocked or suspended."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Protected IPs","tags":["DDoS Shield"],"x-cli":"shield target list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Danh sách IP đang bảo vệ"}},"/v1/tenants/{tid}/targets/{id}/agent":{"get":{"description":"Returns the monitoring agent installed on the server that holds this IP: its settings, the last 60 samples, the addresses it currently blocks and its baseline. `agent` is null when none is installed. This call only reads: it never starts an installation, whatever the credential (`installing` is always false). Installing the agent is done from the dashboard.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_agent","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"agent":{"arch":"amd64","enforce":false,"enrolled_at":1759500000,"id":"ag-8c2d1f","last_seen":1760000050,"name":"web-1","note":"","os":"linux","status":"active","thr_conns":0,"thr_pps":0,"version":"1.4.2"},"baseline":{"conns":120.0,"pps":800.0},"blocks":[],"ip":"203.0.113.10","now":1760001000,"samples":[],"token_available":true},"schema":{"properties":{"agent":{"anyOf":[{"$ref":"#/components/schemas/ShieldAgentInfo"},{"type":"null"}]},"baseline":{"properties":{"conns":{"description":"Normal connections.","type":"number"},"pps":{"description":"Normal packets per second.","type":"number"}},"required":["pps","conns"],"type":"object","x-order":["pps","conns"]},"blocks":{"items":{"description":"Address the agent currently blocks.","type":"string"},"type":"array"},"installing":{"description":"Always false; kept for compatibility.","type":"boolean"},"ip":{"description":"The protected IP.","type":"string"},"now":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"samples":{"items":{"additionalProperties":true,"description":"Sample with rates and connection counts.","type":"object"},"type":"array"},"token_available":{"description":"Legacy flag, always true.","type":"boolean"}},"required":["ip","agent","now","token_available"],"type":"object","x-order":["ip","agent","samples","blocks","baseline","now","token_available","installing"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Monitoring agent installed on the VM that holds this IP","tags":["DDoS Shield"],"x-cli":"shield target agent","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/agent\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Agent giám sát cài trên VM đang giữ IP này"},"patch":{"description":"Changes the settings of the monitoring agent on the server that holds this IP. Turning `enforce` on lets the agent block, by itself, any source that exceeds the thresholds, which can cut off real users if the thresholds are too low. Send at least one field. The agent must already be installed.\n\n**Required scope:** `shield:agent`.","operationId":"shield_target_update_agent","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"enforce":true,"thr_pps":50000},"schema":{"properties":{"enforce":{"description":"Block sources automatically when a threshold is exceeded.","type":"boolean"},"note":{"description":"Note, up to 120 characters.","type":"string"},"thr_conns":{"description":"Connections per source above which a source is blocked. 0 = default.","type":"integer"},"thr_pps":{"description":"Packets per second per source above which a source is blocked. 0 = default.","type":"integer"}},"type":"object","x-order":["note","enforce","thr_pps","thr_conns"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"agent":{"arch":"amd64","enforce":true,"enrolled_at":1759500000,"id":"ag-8c2d1f","last_seen":1760000050,"name":"web-1","note":"","os":"linux","status":"active","thr_conns":0,"thr_pps":50000,"version":"1.4.2"}},"schema":{"properties":{"agent":{"$ref":"#/components/schemas/ShieldAgentInfo"}},"required":["agent"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The tenant is suspended and is read-only. (`tenant_suspended`)","x-error-codes":[{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"No agent is installed on this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No agent is installed on this server. (`not_found`)","x-error-codes":[{"code":"not_found","description":"No agent is installed on this server."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"No field to change was sent."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No field to change was sent. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"No field to change was sent."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server that holds this IP is locked for billing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server that holds this IP is locked for billing. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server that holds this IP is locked for billing."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:agent"]}],"summary":"Change agent note, auto-block switch and thresholds","tags":["DDoS Shield"],"x-cli":"shield target update-agent","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/agent\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enforce\":true,\"thr_pps\":50000}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"shield:agent","x-summary-vi":"Đổi ghi chú, công tắc tự chặn và ngưỡng của agent"}},"/v1/tenants/{tid}/targets/{id}/agent/cmd":{"post":{"description":"Sends a command to the agent on your server. `block` and `unblock` add or remove one source address in the agent's block list; `acct` asks the agent to refresh its accounting. The agent picks the command up at its next heartbeat. Only single public addresses are accepted: your own IPs, the agent's own address and private ranges are refused. This acts directly on your server, so keep the key that has this scope tightly guarded.\n\n**Required scope:** `shield:agent`.","operationId":"shield_target_agent_command","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cmd":"block","ip":"198.51.100.72"},"schema":{"properties":{"cmd":{"description":"Command.","enum":["block","unblock","acct"],"type":"string"},"ip":{"description":"Single IPv4 or IPv6 address for `block` and `unblock`.","type":"string"}},"required":["cmd"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true`; the command is queued for the agent.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The tenant is suspended and is read-only. (`tenant_suspended`)","x-error-codes":[{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"No agent is installed on this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No agent is installed on this server. (`not_found`)","x-error-codes":[{"code":"not_found","description":"No agent is installed on this server."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"Unknown command, not a single address, or the address is one of yours or private."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown command, not a single address, or the address is one of yours or private. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"Unknown command, not a single address, or the address is one of yours or private."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server that holds this IP is locked for billing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server that holds this IP is locked for billing. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server that holds this IP is locked for billing."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:agent"]}],"summary":"Send a block, unblock or acct command to the agent","tags":["DDoS Shield"],"x-cli":"shield target agent-command","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/agent/cmd\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cmd\":\"block\",\"ip\":\"198.51.100.72\"}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"shield:agent","x-summary-vi":"Gửi lệnh block, unblock hoặc acct tới agent"}},"/v1/tenants/{tid}/targets/{id}/ai/analyze":{"post":{"description":"Asks the AI to analyze one protected IP, either one of its attack events or its last 30 minutes of traffic. The request is queued and the result appears in the AI task list within a minute or two. Each IP allows 3 analyses per day and the tenant 10 per day (UTC); the call is rejected with `quota_exceeded` after that. Send an `Idempotency-Key` so that a retried call does not use a second analysis.\n\n**Required scope:** `shield:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"shield_target_analyze","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"event_id":"ev-1760000000-1","note":"UDP to port 53"},"schema":{"properties":{"event_id":{"description":"Attack event of this IP to analyze. Omit to analyze the last 30 minutes.","type":"string"},"note":{"description":"Hint for the analyzer, up to 60 characters.","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"id":"q-1760001000-a1b2c3","ok":true,"quota":{"account_max":10,"account_used":1,"ip_max":3,"ip_used":1}},"schema":{"properties":{"id":{"description":"Identifier of the queued request.","type":"string"},"ok":{"description":"Always `true`.","type":"boolean"},"quota":{"$ref":"#/components/schemas/ShieldAiQuota"}},"required":["ok","id","quota"],"type":"object","x-order":["ok","id","quota"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The tenant is suspended and is read-only. (`tenant_suspended`)","x-error-codes":[{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","message":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result. (`idempotency_in_progress`)","x-error-codes":[{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`event_id` has invalid characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `event_id` has invalid characters. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`event_id` has invalid characters."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server that holds this IP is locked for billing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server that holds this IP is locked for billing. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server that holds this IP is locked for billing."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: The daily analysis quota is used up; the body has `quota`. (`quota_exceeded`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"quota_exceeded","description":"The daily analysis quota is used up; the body has `quota`."}]}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Ask the AI to analyze one protected IP (uses a daily quota)","tags":["DDoS Shield"],"x-cli":"shield target analyze","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/ai/analyze\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"event_id\":\"ev-1760000000-1\",\"note\":\"UDP to port 53\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"shield:write","x-summary-vi":"Nhờ AI phân tích một IP được bảo vệ (tốn hạn mức ngày)"}},"/v1/tenants/{tid}/targets/{id}/ai/tasks":{"get":{"description":"Lists the AI analysis tasks of one protected IP, newest first, with the analyses still waiting and your quota for today. The analyzer states whether the traffic looks like an attack, why, and which blocking actions it proposes or applied. Start one with [Ask the AI to analyze](#operation/shield_target_analyze).\n\n**Required scope:** `shield:read`.","operationId":"shield_target_ai_tasks","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Maximum tasks.","in":"query","name":"n","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"ai_ready":true,"at":1760001000,"ip":"203.0.113.10","queued":0,"quota":{"account_max":10,"account_used":1,"ip_max":3,"ip_used":1},"tasks":[]},"schema":{"properties":{"ai_ready":{"description":"Whether the analyzer is available.","type":"boolean"},"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"ip":{"description":"The protected IP.","type":"string"},"queued":{"description":"Analyses requested and not finished yet.","type":"integer"},"quota":{"$ref":"#/components/schemas/ShieldAiQuota"},"tasks":{"items":{"$ref":"#/components/schemas/ShieldAiTask"},"type":"array"}},"required":["ip","tasks","queued","ai_ready","quota","at"],"type":"object","x-order":["ip","tasks","queued","ai_ready","quota","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"AI analysis tasks of one protected IP and today's quota","tags":["DDoS Shield"],"x-cli":"shield target ai-tasks","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/ai/tasks\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Các tác vụ phân tích AI của một IP và hạn mức hôm nay"}},"/v1/tenants/{tid}/targets/{id}/ai/tasks/{task}":{"get":{"description":"Returns one AI analysis task of a protected IP.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_ai_task","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"AI analysis task identifier as returned by the AI task list.","in":"path","name":"task","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ip":"203.0.113.10","task":{"actions":[{"reason":"top source","type":"block","valid":true,"value":"198.51.100.72"}],"applied":[],"at":1760000500,"confidence":0.92,"event_id":null,"evidence":["52k pps of UDP to port 53"],"id":"t-1","kind":"udp_flood","ms":2300,"note":"","severity":"high","status":"done","summary":"UDP flood from a few networks","trigger":"customer","verdict":"attack"}},"schema":{"properties":{"ip":{"description":"The protected IP.","type":"string"},"task":{"$ref":"#/components/schemas/ShieldAiTask"}},"required":["task","ip"],"type":"object","x-order":["task","ip"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"One AI analysis task","tags":["DDoS Shield"],"x-cli":"shield target ai-task","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/ai/tasks/<task>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Một tác vụ phân tích AI"}},"/v1/tenants/{tid}/targets/{id}/detail":{"get":{"description":"Returns everything about one protected IP in a single call: protection status, current and baseline rates, the last 5 and 30 minutes of history, counters, up to 10 recent events, all blocking rules with their hit counters, the web protection policy, blackhole entries and the server that holds the IP.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_get","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"baseline_pps":1000,"counters":{"at":1760001000,"in":{},"out":{}},"created_at":1759000000,"enabled":true,"events":[],"history_30m":[],"history_5m":[],"id":"pt1760000000a","ip":"203.0.113.10","ipv4_only":false,"kind":"vm","label":"acc-42","now":{},"open_event":null,"protected":true,"rtbh":[],"rules":[],"rules_total":0,"sigma":0,"status":"idle","vm":null,"web":{"enabled":false,"pkt_rate":0,"ports":[],"syn_rate":0}},"schema":{"properties":{"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"baseline_pps":{"description":"Normal packet rate."},"counters":{"additionalProperties":true,"description":"Packet and byte counters: `in`, `out`, `at`.","type":"object"},"created_at":{"description":"When the IP was added (Unix time, seconds, UTC)","type":"integer"},"enabled":{"description":"Whether protection is on.","type":"boolean"},"events":{"items":{"$ref":"#/components/schemas/ShieldEvent"},"type":"array"},"history_30m":{"items":{"additionalProperties":true,"description":"Point with `t`, `in_pps`, `in_bps`, `out_pps`, `out_bps`.","type":"object"},"type":"array"},"history_5m":{"items":{"additionalProperties":true,"description":"Point with `t`, `in_pps`, `in_bps`, `out_pps`, `out_bps`.","type":"object"},"type":"array"},"id":{"description":"Target identifier.","type":"string"},"ip":{"description":"The protected IP.","type":"string"},"ipv4_only":{"description":"True when the IP is IPv6 and web protection is unavailable.","type":"boolean"},"kind":{"description":"What the IP belongs to.","type":"string"},"label":{"description":"Label of the target.","type":"string"},"now":{"description":"Current rates."},"open_event":{"anyOf":[{"$ref":"#/components/schemas/ShieldEvent"},{"type":"null"}]},"protected":{"description":"Same as `enabled`.","type":"boolean"},"rtbh":{"items":{"$ref":"#/components/schemas/ShieldRtbhEntry"},"type":"array"},"rules":{"items":{"additionalProperties":true,"description":"Rule with `id`, `kind`, `value`, `prefixes`, `note`, `at`, `mode`, `expires`, `hits` (`packets`, `bytes`), `source`, `readonly`, `actor`.","type":"object"},"type":"array"},"rules_total":{"description":"Number of rules.","type":"integer"},"sigma":{"description":"Deviation used to detect attacks."},"status":{"description":"Traffic status: `idle`, `normal` or `attack`."},"vm":{"properties":{"display_name":{"description":"Display name.","type":"string"},"hostname":{"description":"Host name.","type":"string"},"id":{"description":"Server identifier.","type":"string"},"locked":{"description":"True when the server is locked for billing.","type":"boolean"},"state":{"description":"Server state.","type":"string"}},"required":["id","hostname","display_name","state","locked"],"type":["object","null"],"x-order":["id","hostname","display_name","state","locked"]},"web":{"$ref":"#/components/schemas/ShieldWebPolicy"}},"required":["id","ip","label","kind","enabled","protected","created_at","status","at","now","baseline_pps","sigma","history_5m","history_30m","counters","events","open_event","rules","rules_total","web","ipv4_only","rtbh","vm"],"type":"object","x-order":["id","ip","label","kind","enabled","protected","created_at","status","at","now","baseline_pps","sigma","history_5m","history_30m","counters","events","open_event","rules","rules_total","web","ipv4_only","rtbh","vm"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Everything about one protected IP: status, history, rules, events, RTBH","tags":["DDoS Shield"],"x-cli":"shield target get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/detail\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Mọi thứ về một IP được bảo vệ: trạng thái, lịch sử, luật, sự kiện, RTBH"}},"/v1/tenants/{tid}/targets/{id}/events":{"get":{"description":"Lists the attacks detected on one protected IP in the chosen period, newest first, and the attack in progress (`open`) if there is one. `:id` is the target `id`; the IP address itself is accepted too. Events from before the IP was assigned to your account are not shown.\n\nBy default events are brief: the raw `samples` are left out and `peak_bits`, `duration_s` and `open` are added. Pass `brief=0` to get the full event with its samples. Only the most recent 300 events of the whole system are searched, so a very old event can be missing from a long range.\n\n**Required scope:** `shield:read`.","operationId":"shield_event_list","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target identifier, as returned by List protected IPs (for example `pt-1792000000`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Only return events that started within this period. Any other value is treated as `30d`.","in":"query","name":"range","required":false,"schema":{"default":"30d","enum":["1h","6h","24h","7d","30d"],"type":"string"}},{"description":"`1` returns brief events (no `samples`); `0` returns full events.","in":"query","name":"brief","required":false,"schema":{"default":1,"maximum":1,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792368000,"events":[{"avg_packet":64,"baseline_pps":900,"duration_s":420,"ended":1792300420,"has_sample":true,"id":"ev-1792300000-203011310","kind":"syn_flood","label":"SYN flood","open":false,"peak_bits":92160000.0,"peak_bps":11520000,"peak_pps":180000,"severity":"high","started":1792300000,"target":"203.0.113.10"}],"ip":"203.0.113.10","open":null,"range":"30d"},"schema":{"properties":{"at":{"description":"When the event list was last updated; 0 if no events exist (Unix time, seconds, UTC)","type":"integer"},"events":{"items":{"$ref":"#/components/schemas/ShieldAttackEvent"},"type":"array"},"ip":{"description":"IP address of the target.","type":"string"},"open":{"anyOf":[{"$ref":"#/components/schemas/ShieldAttackEvent"},{"type":"null"}]},"range":{"description":"The `range` value of the request, or `30d` when none was given.","type":"string"}},"required":["ip","range","events","open","at"],"type":"object","x-order":["ip","range","events","open","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The account is blocked or suspended. (`forbidden`)","x-error-codes":[{"code":"forbidden","description":"The account is blocked or suspended."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Attack events of one IP","tags":["DDoS Shield"],"x-cli":"shield event list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Sự kiện tấn công của một IP"}},"/v1/tenants/{tid}/targets/{id}/flows":{"get":{"description":"Lists the live connections of one protected IP, the busiest first: peer address, ports, protocol, bytes, packets and duration, refreshed every few seconds. Returns 503 `unavailable` when the traffic analyzer is not running.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_flows","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Direction of the connections.","in":"query","name":"dir","required":false,"schema":{"enum":["in","out","both"],"type":"string"}},{"description":"Address family.","in":"query","name":"fam","required":false,"schema":{"enum":["4","6"],"type":"string"}},{"description":"Window in seconds the byte counts cover; 0 = the whole session.","in":"query","name":"win","required":false,"schema":{"default":0,"type":"integer"}},{"description":"Maximum rows.","in":"query","name":"n","required":false,"schema":{"default":200,"maximum":1000,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"ip":"203.0.113.10","rows":[],"sessions":0},"schema":{"properties":{"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"ip":{"description":"The protected IP.","type":"string"},"rows":{"items":{"additionalProperties":true,"description":"One connection: peer, ports, protocol, bytes, packets, duration.","type":"object"},"type":"array"},"sessions":{"description":"Number of rows returned.","type":"integer"}},"required":["ip","rows","sessions","at"],"type":"object","x-order":["ip","rows","sessions","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"upstream","message":"The traffic analyzer refused the request."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The traffic analyzer refused the request. (`upstream`)","x-error-codes":[{"code":"upstream","description":"The traffic analyzer refused the request."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"unavailable","message":"The traffic analyzer is not running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The traffic analyzer is not running. (`unavailable`)","x-error-codes":[{"code":"unavailable","description":"The traffic analyzer is not running."}]}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Live connections of one protected IP","tags":["DDoS Shield"],"x-cli":"shield target flows","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/flows\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Kết nối trực tiếp của một IP được bảo vệ"}},"/v1/tenants/{tid}/targets/{id}/ips":{"get":{"description":"Returns the most recent intrusion-prevention (IPS) alerts aimed at one protected IP: source, ports, protocol, signature, category and severity (1 = highest). Alerts of other IPs are never shown.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_ips","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Maximum alerts.","in":"query","name":"n","required":false,"schema":{"default":100,"maximum":500,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"alerts":[],"at":1760001000,"ip":"203.0.113.10","running":true},"schema":{"properties":{"alerts":{"items":{"properties":{"category":{"description":"Rule category.","type":"string"},"dst_port":{"description":"Destination port."},"proto":{"description":"Protocol.","type":"string"},"severity":{"description":"Severity, 1 (high) to 3 (low).","type":"integer"},"signature":{"description":"Rule that matched.","type":"string"},"src":{"description":"Source address.","type":"string"},"src_port":{"description":"Source port."},"time":{"description":"Alert time as an ISO 8601 string.","type":"string"}},"required":["time","src","src_port","dst_port","proto","signature","category","severity"],"type":"object","x-order":["time","src","src_port","dst_port","proto","signature","category","severity"]},"type":"array"},"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"ip":{"description":"The protected IP.","type":"string"},"running":{"description":"Whether the intrusion-prevention engine is running.","type":"boolean"}},"required":["ip","running","alerts","at"],"type":"object","x-order":["ip","running","alerts","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Intrusion-prevention (IPS) alerts aimed at one protected IP","tags":["DDoS Shield"],"x-cli":"shield target ips","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/ips\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Cảnh báo IPS nhắm vào một IP được bảo vệ"}},"/v1/tenants/{tid}/targets/{id}/logs":{"get":{"description":"Returns the action log of one protected IP for the last 24 hours at most: rules added and removed, blackholes, web protection changes, AI requests and agent commands, each with the actor that did it.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_logs","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Only entries after this Unix time. Cannot go back further than 24 hours.","in":"query","name":"since","required":false,"schema":{"type":"integer"}},{"description":"Maximum entries.","in":"query","name":"n","required":false,"schema":{"default":200,"maximum":500,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"entries":[{"actor":"you","data":{},"kind":"rule","msg":"block 198.51.100.72","t":1760000000}],"ip":"203.0.113.10","since":1759914600},"schema":{"properties":{"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"entries":{"items":{"properties":{"actor":{"description":"Actor label: `you`, `portal`, `ips`, `ai`, `auto` or `system`.","type":"string"},"data":{"description":"Structured details."},"kind":{"description":"Entry kind, e.g. `rule`, `unrule`, `rtbh`, `web`, `ai`, `agent`.","type":"string"},"msg":{"description":"Message.","type":"string"},"t":{"description":"Time (Unix time, seconds, UTC)","type":"integer"}},"required":["t","kind","actor","msg","data"],"type":"object","x-order":["t","kind","actor","msg","data"]},"type":"array"},"ip":{"description":"The protected IP.","type":"string"},"since":{"description":"Start of the returned window (Unix time, seconds, UTC)","type":"integer"}},"required":["ip","since","entries","at"],"type":"object","x-order":["ip","since","entries","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Action log of one protected IP (last 24 hours)","tags":["DDoS Shield"],"x-cli":"shield target logs","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/logs\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Nhật ký thao tác của một IP (24 giờ gần nhất)"}},"/v1/tenants/{tid}/targets/{id}/rtbh":{"get":{"description":"Returns the blackhole (RTBH) entries of one protected IP, the active one if any, and the allowed scopes and lifetimes for [Blackhole an IP](#operation/shield_target_blackhole).\n\n**Required scope:** `shield:read`.","operationId":"shield_target_rtbh","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"active":{"actor":"you","bps_before":31000000.0,"bps_now":800000.0,"created":1760000000,"drop_ratio":0.97,"event_id":"","id":"bh-1760000000-a1","ip":"203.0.113.10","mine":true,"note":"","pps_before":52000.0,"pps_now":1200.0,"remaining_s":420,"scope":"international","scope_label":"International","source":"manual","status":"active","ttl_s":600,"until":1760000600,"withdrawn_at":null},"at":1760000100,"ip":"203.0.113.10","rtbh":[{"actor":"you","bps_before":31000000.0,"bps_now":800000.0,"created":1760000000,"drop_ratio":0.97,"event_id":"","id":"bh-1760000000-a1","ip":"203.0.113.10","mine":true,"note":"","pps_before":52000.0,"pps_now":1200.0,"remaining_s":420,"scope":"international","scope_label":"International","source":"manual","status":"active","ttl_s":600,"until":1760000600,"withdrawn_at":null}],"scopes":["international","domestic"],"ttl_max":86400,"ttl_min":60,"ttl_presets":[600,1800,3600,21600,86400]},"schema":{"properties":{"active":{"anyOf":[{"$ref":"#/components/schemas/ShieldRtbhEntry"},{"type":"null"}]},"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"ip":{"description":"The protected IP.","type":"string"},"rtbh":{"items":{"$ref":"#/components/schemas/ShieldRtbhEntry"},"type":"array"},"scopes":{"items":{"description":"Scopes you may request: `international`, `domestic`.","type":"string"},"type":"array"},"ttl_max":{"description":"Longest lifetime in seconds.","type":"integer"},"ttl_min":{"description":"Shortest lifetime in seconds.","type":"integer"},"ttl_presets":{"items":{"description":"Suggested lifetimes in seconds.","type":"integer"},"type":"array"}},"required":["ip","rtbh","active","scopes","ttl_presets","ttl_min","ttl_max","at"],"type":"object","x-order":["ip","rtbh","active","scopes","ttl_presets","ttl_min","ttl_max","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Blackhole (RTBH) entries of one protected IP","tags":["DDoS Shield"],"x-cli":"shield target rtbh","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rtbh\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Các mục blackhole (RTBH) của một IP"},"post":{"description":"Blackholes one of your IPs at the upstream network (RTBH): traffic to the IP is dropped before it reaches you, which stops a volumetric attack but takes the IP offline for the chosen scope. `international` drops traffic from abroad, `domestic` drops domestic traffic; dropping everything is not available to customers. To prevent accidents you must repeat the IP in `confirm`. Only one active entry per IP, and the entry expires after `ttl_s`. Withdraw it early with [Withdraw a blackhole](#operation/shield_rtbh_delete). Send an `Idempotency-Key` to retry safely.\n\n**Required scope:** `shield:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"shield_target_blackhole","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":"203.0.113.10","note":"UDP flood","scope":"international","ttl_s":3600},"schema":{"properties":{"confirm":{"description":"The protected IP address, typed again. Must match exactly.","type":"string"},"event_id":{"description":"Attack event this blackhole responds to.","type":"string"},"note":{"description":"Note, up to 120 characters.","type":"string"},"scope":{"description":"Which traffic to drop. Default `international`.","enum":["international","domestic"],"type":"string"},"ttl_s":{"description":"Lifetime in seconds, from 60 to 86400. Default 3600.","type":"integer"}},"required":["confirm"],"type":"object","x-order":["scope","ttl_s","confirm","note","event_id"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"entry":{"actor":"you","bps_before":31000000.0,"bps_now":800000.0,"created":1760000000,"drop_ratio":0.97,"event_id":"","id":"bh-1760000000-a1","ip":"203.0.113.10","mine":true,"note":"","pps_before":52000.0,"pps_now":1200.0,"remaining_s":420,"scope":"international","scope_label":"International","source":"manual","status":"active","ttl_s":600,"until":1760000600,"withdrawn_at":null},"ok":true,"warnings":["covering prefix: 203.0.113.0/24"]},"schema":{"properties":{"entry":{"$ref":"#/components/schemas/ShieldRtbhEntry"},"ok":{"description":"Always `true`.","type":"boolean"},"warnings":{"items":{"description":"Advisory messages, e.g. the covering prefix.","type":"string"},"type":"array"}},"required":["ok","entry","warnings"],"type":"object","x-order":["ok","entry","warnings"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The tenant is suspended and is read-only. (`tenant_suspended`)","x-error-codes":[{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"already_active","message":"The IP already has an active blackhole entry; withdraw or extend it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`already_active`: The IP already has an active blackhole entry; withdraw or extend it. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"already_active","description":"The IP already has an active blackhole entry; withdraw or extend it."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"confirm_required","message":"`confirm` does not match the IP address."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`confirm_required`: `confirm` does not match the IP address. `invalid_argument`: The scope or lifetime is not allowed, or the IP cannot be blackholed. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"confirm_required","description":"`confirm` does not match the IP address."},{"code":"invalid_argument","description":"The scope or lifetime is not allowed, or the IP cannot be blackholed."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server that holds this IP is locked for billing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server that holds this IP is locked for billing. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server that holds this IP is locked for billing."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Blackhole one of your IPs upstream (RTBH) — the IP goes offline for the chosen scope","tags":["DDoS Shield"],"x-cli":"shield target blackhole","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rtbh\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":\"203.0.113.10\",\"note\":\"UDP flood\",\"scope\":\"international\",\"ttl_s\":3600}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"shield:write","x-summary-vi":"Blackhole một IP của bạn lên upstream (RTBH) — IP mất kết nối theo phạm vi đã chọn"}},"/v1/tenants/{tid}/targets/{id}/rules":{"get":{"description":"Lists the blocking rules of one protected IP, newest first, with the number of packets and bytes each rule matched and the limits that apply when you add more. `:id` is the target `id` from [List protected IPs](#operation/shield_target_list); the IP address itself is accepted too.\n\nRules whose `actor` is `you` were created by your account (dashboard or API) and can be deleted with [Delete a blocking rule](#operation/shield_rule_delete); rules created by an integration, intrusion prevention, AI analysis, automatic mitigation or an operator are read-only. `total` counts all rules of the IP, whatever the filters. In `caps`, `max_rules` is 0 when the account uses the default limit (500 rules and 20,000 networks in total).\n\n**Required scope:** `shield:read`.","operationId":"shield_rule_list","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target identifier, as returned by List protected IPs (for example `pt-1792000000`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Only return rules in this mode. Any other value matches nothing.","in":"query","name":"mode","required":false,"schema":{"enum":["block","count"],"type":"string"}},{"description":"Case-insensitive text; only rules whose value or note contains it are returned.","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792368005,"caps":{"max_rules":0,"per_call":50,"ttl_max":43200,"ttl_min":5,"used_rules":1},"ip":"203.0.113.10","rules":[{"actor":"you","at":1792100000,"expires":null,"hits":{"bytes":98560,"packets":1520},"id":"r-0-1792100000","ip":"203.0.113.10","kind":"ip","label":"acc-7k3m9x2p/vm:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","mode":"block","note":"scanner","prefixes":[],"readonly":false,"source":"portal","target_id":"pt-1792000000","value":"198.51.100.7/32"}],"target_id":"pt-1792000000","total":1,"ttl_presets":[0,30,60,360,1440,10080]},"schema":{"properties":{"at":{"description":"When the hit counters were read; 0 if no counters are available (Unix time, seconds, UTC)","type":"integer"},"caps":{"description":"Limits that apply to Add a blocking rule.","properties":{"max_rules":{"description":"Maximum number of rules for the whole account; 0 means the default limit applies.","type":"integer"},"per_call":{"description":"Most values accepted in one Add call.","type":"integer"},"ttl_max":{"description":"Longest allowed `ttl_min` in minutes.","type":"integer"},"ttl_min":{"description":"Shortest allowed `ttl_min` in minutes.","type":"integer"},"used_rules":{"description":"Rules currently used by the whole account (all IPs).","type":"integer"}},"required":["per_call","max_rules","used_rules","ttl_min","ttl_max"],"type":"object","x-order":["per_call","max_rules","used_rules","ttl_min","ttl_max"]},"ip":{"description":"IP address of the target.","type":"string"},"rules":{"items":{"$ref":"#/components/schemas/ShieldRule"},"type":"array"},"target_id":{"description":"Identifier of the target.","type":"string"},"total":{"description":"Number of rules on the IP, ignoring `mode` and `q`.","type":"integer"},"ttl_presets":{"description":"Durations in minutes offered by the dashboard (0 = permanent).","items":{"description":"Minutes.","type":"integer"},"type":"array"}},"required":["ip","target_id","rules","total","at","caps","ttl_presets"],"type":"object","x-order":["ip","target_id","rules","total","at","caps","ttl_presets"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The account is blocked or suspended. (`forbidden`)","x-error-codes":[{"code":"forbidden","description":"The account is blocked or suspended."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Rules of one IP","tags":["DDoS Shield"],"x-cli":"shield rule list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rules\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Luật chặn của một IP"},"post":{"description":"Adds one or more blocking rules to a protected IP. A rule drops (`block`) or only counts (`count`) traffic from a source: an IPv4 address or network (`/8` to `/32`), an IPv6 address or network (`/32` to `/128`), an AS number such as `AS64500`, or a two-letter country code. Private, loopback and multicast ranges are refused. A country is only accepted when it is repeated in `confirm_country`, because it blocks a whole country. AS and country values are expanded to their networks, which needs a lookup and takes longer.\n\nPass the values in `values` (an array, or one string separated by spaces, commas, semicolons or new lines) or a single one in `value`. At most 50 values are processed per call; the rest are returned in `rejected`, as are duplicates and invalid values, so a call can succeed with `added` equal to 0. `:id` must be the target `id` (the IP address is not accepted here). Rules are limited per account (500 rules and 20,000 networks by default), and an account can make 60 calls per minute to this operation (10 per minute for calls that contain an AS number or a country). New rules take effect shortly after the call returns.\n\n**Required scope:** `shield:write`.","operationId":"shield_rule_add","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target identifier, as returned by List protected IPs (for example `pt-1792000000`).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"mode":"block","note":"scanner traffic","ttl_min":1440,"values":["198.51.100.7","203.0.113.0/24","AS64500"]},"schema":{"properties":{"confirm_country":{"description":"Country codes you confirm to block. A country value in `values` is rejected unless its code is listed here.","items":{"description":"Two-letter country code.","type":"string"},"type":"array"},"mode":{"description":"`block` (default) drops matching packets; `count` only counts them, which lets you test a rule safely.","enum":["block","count"],"type":"string"},"note":{"description":"Free text note stored with each rule. Longer text is cut to 120 characters.","type":"string"},"ttl_min":{"description":"Lifetime of the rules in minutes, from 5 to 43200 (30 days). Omit or send 0 for permanent rules.","maximum":43200,"minimum":0,"type":"integer"},"value":{"description":"A single value to add. Used when `values` is empty or absent.","type":"string"},"values":{"description":"Values to add: an array of strings, or one string with the values separated by spaces, commas, semicolons or new lines. At most 50 values are processed per call. Takes precedence over `value`.","oneOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}]}},"type":"object","x-order":["values","value","mode","ttl_min","note","confirm_country"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"added":3,"expires":1792454400,"kind":"ip","mode":"block","rejected":[],"value":"198.51.100.7/32"},"schema":{"properties":{"added":{"description":"Number of rules created.","type":"integer"},"expires":{"description":"When the new rules are removed automatically, or null for permanent rules (Unix time, seconds, UTC)","type":["integer","null"]},"kind":{"description":"Kind of the first value of the request that passed validation, or null if none did. It is reported even when that value turned out to be a duplicate.","type":["string","null"]},"mode":{"description":"Mode applied to the new rules.","enum":["block","count"],"type":"string"},"rejected":{"description":"Values that were not added: duplicates, invalid or internal addresses, countries that were not confirmed, and anything over the limits. The reason text is not translated and is currently provided in Vietnamese only.","items":{"description":"Value followed by the reason in parentheses.","type":"string"},"type":"array"},"value":{"description":"The first value of the request that passed validation, normalised, or null if none did.","type":["string","null"]}},"required":["added","rejected","mode","expires","kind","value"],"type":"object","x-order":["added","rejected","mode","expires","kind","value"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `tenant_suspended`: The DDoS Shield account is suspended; rules cannot be changed until it is reactivated (reads still work). `limit_exceeded`: The account already has the maximum number of blocking rules. `forbidden`: The account is blocked.","x-error-codes":[{"code":"tenant_suspended","description":"The DDoS Shield account is suspended; rules cannot be changed until it is reactivated (reads still work)."},{"code":"limit_exceeded","description":"The account already has the maximum number of blocking rules."},{"code":"forbidden","description":"The account is blocked."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`ttl_min` is not 0 or between 5 and 43200, or the JSON body is malformed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`ttl_min` is not 0 or between 5 and 43200, or the JSON body is malformed. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`ttl_min` is not 0 or between 5 and 43200, or the JSON body is malformed."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server that holds this IP is locked for billing reasons, so its rules cannot be changed until the balance is restored."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server that holds this IP is locked for billing reasons, so its rules cannot be changed until the balance is restored. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server that holds this IP is locked for billing reasons, so its rules cannot be changed until the balance is restored."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Add a blocking rule","tags":["DDoS Shield"],"x-cli":"shield rule add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rules\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"mode\":\"block\",\"note\":\"scanner traffic\",\"ttl_min\":1440,\"values\":[\"198.51.100.7\",\"203.0.113.0/24\",\"AS64500\"]}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Thêm luật chặn"}},"/v1/tenants/{tid}/targets/{id}/rules/bulk-delete":{"post":{"description":"Deletes up to 100 blocking rules of one protected IP in a single call. Only rules you created are deleted; rules made by the protection system or by staff are skipped and listed in `skipped` with the reason. Unknown identifiers are skipped too.\n\n**Required scope:** `shield:write`.","operationId":"shield_rule_bulk_delete","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"ids":["r-x1760000000a","r-x1760000000b"]},"schema":{"properties":{"ids":{"description":"Rules to delete, 1 to 100.","items":{"description":"Rule identifier.","type":"string"},"type":"array"}},"required":["ids"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"deleted":1,"skipped":["r-x1760000000b (not found)"]},"schema":{"properties":{"deleted":{"description":"Number of rules deleted.","type":"integer"},"skipped":{"items":{"description":"Identifier with the reason it was skipped, e.g. `r-x1 (read-only)`.","type":"string"},"type":"array"}},"required":["deleted","skipped"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The tenant is suspended and is read-only. (`tenant_suspended`)","x-error-codes":[{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`ids` is empty or has more than 100 entries."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`ids` is empty or has more than 100 entries. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`ids` is empty or has more than 100 entries."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Delete up to 100 of your own blocking rules at once","tags":["DDoS Shield"],"x-cli":"shield rule bulk-delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rules/bulk-delete\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ids\":[\"r-x1760000000a\",\"r-x1760000000b\"]}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Gỡ tối đa 100 luật chặn của chính bạn cùng lúc"}},"/v1/tenants/{tid}/targets/{id}/rules/export":{"get":{"description":"Downloads the blocking rules of one protected IP as a CSV file with the columns `id,kind,value,mode,source,note,created_at,expires_at,hits_packets,hits_bytes,prefixes`.\n\n**Required scope:** `shield:read`.","operationId":"shield_rule_export","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/csv":{"schema":{"description":"CSV file.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Download one IP's blocking rules as CSV","tags":["DDoS Shield"],"x-cli":"shield rule export","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rules/export\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Tải luật chặn của một IP dạng CSV"}},"/v1/tenants/{tid}/targets/{id}/rules/{rid}":{"delete":{"description":"Deletes a blocking rule that was created by your account (`actor` is `you` in [List blocking rules](#operation/shield_rule_list)); the rule stops applying shortly after the call returns. Rules created by an integration, intrusion prevention, AI analysis, automatic mitigation or an operator are read-only and cannot be deleted: the call fails with `403 readonly_rule`. `:id` is the target `id`; the IP address itself is accepted too.\n\n**Required scope:** `shield:write`.","operationId":"shield_rule_delete","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target identifier, as returned by List protected IPs (for example `pt-1792000000`).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Blocking rule identifier, as returned by List blocking rules (for example `r-0-1792100000`).","in":"path","name":"rid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `readonly_rule`: The rule was not created by your account (it comes from the system, an integration or an operator) and can only be viewed. `tenant_suspended`: The DDoS Shield account is suspended; rules cannot be changed until it is reactivated (reads still work). `forbidden`: The account is blocked.","x-error-codes":[{"code":"readonly_rule","description":"The rule was not created by your account (it comes from the system, an integration or an operator) and can only be viewed."},{"code":"tenant_suspended","description":"The DDoS Shield account is suspended; rules cannot be changed until it is reactivated (reads still work)."},{"code":"forbidden","description":"The account is blocked."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Delete a blocking rule","tags":["DDoS Shield"],"x-cli":"shield rule delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/rules/<rid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Xoá luật chặn"}},"/v1/tenants/{tid}/targets/{id}/shape":{"get":{"description":"Returns the traffic shaping state of one protected IP: the shaper in effect with its limits, live rates in both directions and a history series. Read-only.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_shape","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"History range.","in":"query","name":"range","required":false,"schema":{"default":"1h","enum":["1h","24h"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"engine":"off","expires":null,"history":null,"ip":"203.0.113.10","live":null,"readonly":true,"shaped":false,"shaper":null,"since":null},"schema":{"properties":{"engine":{"description":"Shaping engine mode.","type":"string"},"expires":{"description":"When the shaper stops (Unix time, seconds, UTC)","type":["integer","null"]},"history":{"additionalProperties":true,"description":"History: `range`, `step_s`, `in`, `out`.","type":["object","null"]},"ip":{"description":"The protected IP.","type":"string"},"live":{"additionalProperties":true,"description":"Live `in` and `out` rates and drops.","type":["object","null"]},"readonly":{"description":"Always true.","type":"boolean"},"shaped":{"description":"Whether a shaper applies to this IP.","type":"boolean"},"shaper":{"additionalProperties":true,"description":"Shaper in effect: `name`, `port_mbps`, `rate_mbps`, `burst_secs`, `direction`.","type":["object","null"]},"since":{"description":"When the shaper started (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["ip","engine","shaped","readonly","shaper","since","expires","live","history"],"type":"object","x-order":["ip","engine","shaped","readonly","shaper","since","expires","live","history"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Traffic shaping state and history of one protected IP (read-only)","tags":["DDoS Shield"],"x-cli":"shield target shape","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/shape\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Trạng thái và lịch sử giới hạn băng thông của một IP (chỉ đọc)"}},"/v1/tenants/{tid}/targets/{id}/top":{"get":{"description":"Returns the traffic of one protected IP broken down by source country, source network, protocol and port over a time range, with a rate series for charting. The series columns are named in `series_cols`. Returns 503 `unavailable` when the traffic analyzer is not running.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_top","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Time range.","in":"query","name":"range","required":false,"schema":{"default":"1h","enum":["15m","1h","6h","24h"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"countries":[],"ip":"203.0.113.10","range":"1h","series_cols":["t","in_bps","in_pps","out_bps","out_pps"]},"schema":{"properties":{"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"countries":{"description":"Traffic per source country."},"ip":{"description":"The protected IP.","type":"string"},"range":{"description":"The range that was returned.","type":"string"},"series_cols":{"items":{"description":"Column names of each `series` row: `t`, `in_bps`, `in_pps`, `out_bps`, `out_pps`.","type":"string"},"type":"array"}},"required":["ip","range","series_cols","countries","at"],"type":"object","x-order":["ip","range","series_cols","countries","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"upstream","message":"The traffic analyzer refused the request."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The traffic analyzer refused the request. (`upstream`)","x-error-codes":[{"code":"upstream","description":"The traffic analyzer refused the request."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"unavailable","message":"The traffic analyzer is not running."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The traffic analyzer is not running. (`unavailable`)","x-error-codes":[{"code":"unavailable","description":"The traffic analyzer is not running."}]}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Top traffic sources of one protected IP over a range","tags":["DDoS Shield"],"x-cli":"shield target top","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/top\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Nguồn truy cập nhiều nhất của một IP theo khoảng thời gian"}},"/v1/tenants/{tid}/targets/{id}/web":{"get":{"description":"Returns the web protection policy of one protected IP: per-source SYN and packet rate limits applied to the web ports, plus the allowed ranges and how often the policy may change.\n\n**Required scope:** `shield:read`.","operationId":"shield_target_web","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"apply_interval_min":10,"at":1760001000,"floors":{"pkt_rate_max":1000000,"ports_max":16,"syn_rate_max":100000},"ip":"203.0.113.10","ipv4_only":false,"protected":true,"web":{"enabled":false,"pkt_rate":0,"ports":[],"syn_rate":0}},"schema":{"properties":{"apply_interval_min":{"description":"Minimum minutes between two changes of the policy.","type":"integer"},"at":{"description":"Time of the snapshot (Unix time, seconds, UTC)","type":"integer"},"floors":{"properties":{"pkt_rate_max":{"description":"Highest allowed `pkt_rate`.","type":"integer"},"ports_max":{"description":"Most ports allowed.","type":"integer"},"syn_rate_max":{"description":"Highest allowed `syn_rate`.","type":"integer"}},"required":["syn_rate_max","pkt_rate_max","ports_max"],"type":"object","x-order":["syn_rate_max","pkt_rate_max","ports_max"]},"ip":{"description":"The protected IP.","type":"string"},"ipv4_only":{"description":"True for IPv6 addresses, where web protection is unavailable.","type":"boolean"},"protected":{"description":"Whether protection is on.","type":"boolean"},"web":{"$ref":"#/components/schemas/ShieldWebPolicy"}},"required":["ip","protected","ipv4_only","web","floors","apply_interval_min","at"],"type":"object","x-order":["ip","protected","ipv4_only","web","floors","apply_interval_min","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Web protection policy of one protected IP","tags":["DDoS Shield"],"x-cli":"shield target web","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/web\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Chính sách bảo vệ web của một IP"},"put":{"description":"Changes the web protection of one protected IPv4: per-source SYN and packet rate limits on the web ports. Values above the allowed maximum are clamped. Sending the policy that is already in effect succeeds with `unchanged: true`. A policy can change at most once every 10 minutes per IP.\n\n**Required scope:** `shield:write`.","operationId":"shield_target_set_web","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}},{"description":"Protected target: its identifier (`pt…`) or the protected IP address itself.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"enabled":true,"pkt_rate":1000,"ports":[80,443],"syn_rate":100},"schema":{"properties":{"enabled":{"description":"Turn web protection on or off.","type":"boolean"},"pkt_rate":{"description":"Packets per second per source (0 = no limit, capped at 1000000).","type":"integer"},"ports":{"description":"Web ports to protect, at most 16. Empty means 80 and 443.","items":{"description":"Port number.","type":"integer"},"type":"array"},"syn_rate":{"description":"SYN packets per second per source (0 = no limit, capped at 100000).","type":"integer"}},"required":["enabled","syn_rate","pkt_rate","ports"],"type":"object","x-order":["enabled","syn_rate","pkt_rate","ports"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"applied":true,"ok":true,"web":{"enabled":true,"pkt_rate":1000,"ports":[80,443],"syn_rate":100}},"schema":{"properties":{"applied":{"description":"True when the change was saved.","type":"boolean"},"ok":{"description":"Always `true`.","type":"boolean"},"unchanged":{"description":"True when the policy was already in effect.","type":"boolean"},"web":{"$ref":"#/components/schemas/ShieldWebPolicy"}},"required":["ok","web"],"type":"object","x-order":["ok","web","applied","unchanged"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The tenant is suspended and is read-only. (`tenant_suspended`)","x-error-codes":[{"code":"tenant_suspended","description":"The tenant is suspended and is read-only."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"Web protection cannot be turned on for an IPv6 address."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Web protection cannot be turned on for an IPv6 address. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"Web protection cannot be turned on for an IPv6 address."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server that holds this IP is locked for billing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server that holds this IP is locked for billing. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server that holds this IP is locked for billing."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: The policy was changed less than 10 minutes ago. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"The policy was changed less than 10 minutes ago."}]}},"security":[{"bearerAuth":["shield:write"]}],"summary":"Change web protection (per-source SYN / packet rate limits) of one IPv4","tags":["DDoS Shield"],"x-cli":"shield target set-web","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/tenants/<tid>/targets/<id>/web\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\":true,\"pkt_rate\":1000,\"ports\":[80,443],\"syn_rate\":100}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:write","x-summary-vi":"Đổi bảo vệ web (giới hạn SYN / gói theo nguồn) của một IPv4"}},"/v1/tenants/{tid}/traffic":{"get":{"description":"Returns, for each protected IP, the cumulative edge counters and the learned traffic baseline. `counters` holds packets and bytes per direction since the edge started (`in` is traffic toward your IP, `out` is traffic from it). `baseline` holds the normal inbound packet rate (`baseline_pps`), its standard deviation (`sigma`) and up to 60 recent samples (about the last five minutes) in `history`.\n\nEach `history` sample is `[unix_time, inbound_packets_per_s, inbound_bytes_per_s, outbound_packets_per_s, outbound_bytes_per_s]`; note that the byte columns are bytes, not bits, per second. For the same figures in bits per second use [Get the overview](#operation/shield_summary). An IP without measurements has empty `counters` or `baseline` objects.\n\n**Required scope:** `shield:read`.","operationId":"shield_traffic","parameters":[{"description":"Your tenant (customer) identifier, of the form `acc-xxxxxxxx`, shown on the Account page of the dashboard. Any other identifier returns `404`.","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"traffic":{"203.0.113.10":{"baseline":{"baseline_pps":912.4,"history":[[1792367990,905.0,525000.0,1370.0,10100000.0],[1792367995,931.2,541000.0,1390.0,10250000.0]],"sigma":130.2},"counters":{"in":{"bytes":3012451120,"packets":5821733},"out":{"bytes":5120993740,"packets":4410220}}}}},"schema":{"properties":{"traffic":{"additionalProperties":{"properties":{"baseline":{"description":"Baseline learned by the attack detector. Empty when the IP has not been measured yet.","properties":{"baseline_pps":{"description":"Normal inbound packet rate of the IP, in packets per second.","type":"number"},"history":{"description":"Recent samples, oldest first: `[unix_time, inbound_packets_per_s, inbound_bytes_per_s, outbound_packets_per_s, outbound_bytes_per_s]`.","items":{"items":{"description":"Value.","type":"number"},"type":"array"},"type":"array"},"sigma":{"description":"Usual deviation around the baseline, in packets per second.","type":"number"}},"type":"object","x-order":["baseline_pps","sigma","history"]},"counters":{"description":"Cumulative edge counters of one IP since the edge started (they restart from zero when it restarts). A direction is absent until it has been counted.","properties":{"in":{"description":"Traffic received for the IP at the network edge.","properties":{"bytes":{"description":"Number of bytes.","type":"integer"},"packets":{"description":"Number of packets.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]},"out":{"description":"Traffic sent from the IP through the network edge.","properties":{"bytes":{"description":"Number of bytes.","type":"integer"},"packets":{"description":"Number of packets.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]},"web":{"description":"Packets dropped by the web protection limits of the IP.","properties":{"bytes":{"description":"Number of bytes.","type":"integer"},"packets":{"description":"Number of packets.","type":"integer"}},"required":["packets","bytes"],"type":"object","x-order":["packets","bytes"]}},"type":"object"}},"required":["counters","baseline"],"type":"object","x-order":["counters","baseline"]},"description":"Traffic data keyed by the IP address of each protected target.","type":"object"}},"required":["traffic"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The account is blocked or suspended. (`forbidden`)","x-error-codes":[{"code":"forbidden","description":"The account is blocked or suspended."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Edge traffic","tags":["DDoS Shield"],"x-cli":"shield traffic","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/traffic\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Lưu lượng biên"}},"/v1/tenants/{tid}/traffic/live":{"get":{"description":"Returns the current packet and bit rate of every protected IP, computed from the last two counter readings. `stale` is true when no earlier reading was available to compare with.\n\n**Required scope:** `shield:read`.","operationId":"shield_traffic_live","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1760001000,"live":{"203.0.113.10":{"bps":9600000.0,"pps":1200.0,"stale":false,"window_s":10.0}}},"schema":{"properties":{"at":{"description":"Time of the latest reading (Unix time, seconds, UTC)","type":"integer"},"live":{"additionalProperties":{"properties":{"bps":{"description":"Bits per second.","type":"number"},"pps":{"description":"Packets per second.","type":"number"},"stale":{"description":"True when the rate could not be computed from two readings.","type":"boolean"},"window_s":{"description":"Seconds between the two readings.","type":"number"}},"required":["pps","bps","window_s","stale"],"type":"object","x-order":["pps","bps","window_s","stale"]},"description":"Rates keyed by protected IP.","type":"object"}},"required":["at","live"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Live packet and bit rate of each protected IP","tags":["DDoS Shield"],"x-cli":"shield traffic live","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/traffic/live\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"Tốc độ gói và bit tức thời của từng IP được bảo vệ"}},"/v1/tenants/{tid}/traffic/top-sources":{"get":{"description":"Returns the 50 source addresses that sent the most packets to your IPs across the recorded attack events. Useful for building block rules; the numbers come from packet samples, not from full counting.\n\n**Required scope:** `shield:read`.","operationId":"shield_traffic_sources","parameters":[{"description":"Tenant identifier of your DDoS Shield (as shown in the dashboard).","in":"path","name":"tid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"note":"","sources":[{"ip":"198.51.100.72","packets":18000}]},"schema":{"properties":{"note":{"description":"Explanation when there is no data yet.","type":"string"},"sources":{"items":{"properties":{"ip":{"description":"Source address.","type":"string"},"packets":{"description":"Sampled packets from this source.","type":"integer"}},"required":["ip","packets"],"type":"object"},"type":"array"}},"required":["sources","note"],"type":"object","x-order":["sources","note"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["shield:read"]}],"summary":"Top attacking source IPs seen in the tenant's events","tags":["DDoS Shield"],"x-cli":"shield traffic sources","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/tenants/<tid>/traffic/top-sources\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"shield:read","x-summary-vi":"IP nguồn tấn công nhiều nhất trong các sự kiện của khách"}},"/v1/transfers":{"get":{"description":"Lists transfer requests. By default it returns the requests you sent (`dir=out`); with `dir=in` it returns the requests addressed to your account, which only appear once the sender confirmed them and show fewer fields.\n\n**Required scope:** `transfer:read`.","operationId":"transfer_list","parameters":[{"description":"`out` for requests you sent, `in` for requests addressed to you.","in":"query","name":"dir","required":false,"schema":{"default":"out","enum":["out","in"],"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["id","status","resource_kind","created_at"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"order","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":1760860800,"executed_at":null,"fail_reason":null,"id":7001,"owner_confirmed_at":null,"owner_token_expires_at":1760947200,"recipient_decided_at":null,"resource_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","resource_kind":"vm","status":"pending_owner","to_email":"colleague@example.com","updated_at":1760860800}],"page":1,"per_page":20,"total":1},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Transfer"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["transfer:read"]}],"summary":"List service transfer requests (outgoing or incoming)","tags":["Service Transfers"],"x-cli":"transfer list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/transfers\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"transfer:read","x-summary-vi":"Danh sách yêu cầu chuyển dịch vụ (đi hoặc đến)"}},"/v1/transfers/precheck":{"get":{"description":"Checks whether one of your services can be transferred right now, without starting anything. `ok` is true when `reasons` is empty; otherwise each reason names a blocker, for example an unpaid invoice, a server that is not active or busy, outstanding storage charges, or a plan that is expired.\n\n**Required scope:** `transfer:read`.","operationId":"transfer_precheck","parameters":[{"description":"Kind of service.","in":"query","name":"type","required":true,"schema":{"enum":["vm","vpn"],"type":"string"}},{"description":"Server UUID for `vm`, plan number for `vpn`.","in":"query","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":false,"reasons":["invoice_unpaid"]},"schema":{"properties":{"ok":{"description":"True when the service can be transferred.","type":"boolean"},"reasons":{"items":{"description":"Blocker code, such as `invoice_unpaid`, `vm_not_active`, `vm_busy`, `vm_in_vpc`, `vm_private_image`, `owner_disputed`, `storage_unpaid`, `vpn_not_active`, `vpn_expired` or `vpn_busy`.","type":"string"},"type":"array"}},"required":["ok","reasons"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`type` is not `vm` or `vpn`, or `id` is missing."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`type` is not `vm` or `vpn`, or `id` is missing. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`type` is not `vm` or `vpn`, or `id` is missing."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The service does not exist or does not belong to your account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The service does not exist or does not belong to your account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The service does not exist or does not belong to your account."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["transfer:read"]}],"summary":"Check whether a service can be transferred","tags":["Service Transfers"],"x-cli":"transfer precheck","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/transfers/precheck?type=<type>&id=<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"transfer:read","x-summary-vi":"Kiểm tra một dịch vụ có chuyển được không"}},"/v1/transfers/{id}":{"get":{"description":"Returns one transfer request you sent or that is addressed to you. A request addressed to you is only visible after the sender confirmed it.\n\n**Required scope:** `transfer:read`.","operationId":"transfer_get","parameters":[{"description":"Transfer request number as returned by List service transfers.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"created_at":1760860800,"executed_at":null,"fail_reason":null,"id":7001,"owner_confirmed_at":null,"owner_token_expires_at":1760947200,"recipient_decided_at":null,"resource_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","resource_kind":"vm","status":"pending_owner","to_email":"colleague@example.com","updated_at":1760860800},"schema":{"$ref":"#/components/schemas/Transfer"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["transfer:read"]}],"summary":"Get one transfer request","tags":["Service Transfers"],"x-cli":"transfer get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/transfers/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"transfer:read","x-summary-vi":"Chi tiết một yêu cầu chuyển"}},"/v1/vm":{"get":{"description":"Returns the servers of your account, newest first by default, 25 per page (maximum 100). Servers in the `deleted` state are hidden unless you ask for them with `state=deleted`.\n\n`counts` always covers all of your servers that are not deleted, whatever the filters and the page, so you can show tab badges without extra requests. Each item is a summary; call Get a VM for the full record.\n\n**Required scope:** `vm:read`.","operationId":"vm_list","parameters":[{"description":"Search text. Matches host name, display name, public IP address or server ID (substring, case-insensitive).","example":"web","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Lifecycle state to keep: `provisioning`, `active`, `locked`, `failed`, `deleting` or `deleted`. Several states can be given separated by commas, for example `locked,failed`. Without this filter every state except `deleted` is returned.","example":"active","in":"query","name":"state","required":false,"schema":{"type":"string"}},{"description":"Power state to keep. `Running` keeps running servers; `Stopped` keeps every server that is not running (including those whose power state is not known yet). Any other value is compared with the reported power state, ignoring case.","example":"Running","in":"query","name":"cs_state","required":false,"schema":{"type":"string"}},{"description":"Keep only your servers in this region (`zones[].id` from the catalog). A region where you have no server gives an empty list. `total` and the paging apply after the filter; `counts` still covers all of your servers.","example":1,"in":"query","name":"zone_id","required":false,"schema":{"type":"integer"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","hostname","display_name","state","public_ip","paid_until","billed_until","updated_at","zone"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"counts":{"all":1,"error":0,"running":1,"stopped":0},"items":[{"autoscale_enabled":false,"billed_until":null,"capabilities":{"autoscale":true,"backup":true,"bandwidth":true,"byoip":true,"change_ip":true,"console":"vnc","ddos_shield":true,"firewall":true,"hypervisor":true,"ipv6":true,"iso":true,"metrics":true,"metrics_mem_disk":true,"nics":true,"port_forward":true,"private_ip":true,"reinstall":true,"reset_password":true,"resize_cpu_ram":true,"resize_disk_grow":true,"resize_live":true,"snapshot":true,"ssh_key_reset":true,"volumes":true,"vpc":true},"created_at":1792368000,"cs_state":"Running","cycle":"monthly","destroy_after":null,"display_name":"Web server 01","hostname":"web-01","hourly_mills":5,"hourly_uusd":4704,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":"2001:db8:10::25","job_running":false,"lock_reason":null,"locked_at":null,"paid_until":1794960000,"plan":{"cpu":2,"disk_gb":60,"is_custom":false,"name":"Standard 2/4","ram_mb":4096},"private_ip":"10.1.1.25","public_ip":"203.0.113.25","ready_at":1792368090,"state":"active","template":{"display_name":"Ubuntu 24.04 LTS","icon":"ubuntu","id":11,"os_family":"linux","os_version":"24.04"},"traffic":null,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"counts":{"properties":{"all":{"description":"All servers that are not deleted.","type":"integer"},"error":{"description":"Servers that are `locked` or `failed`.","type":"integer"},"running":{"description":"Active servers that are running.","type":"integer"},"stopped":{"description":"Active servers that are not running.","type":"integer"}},"required":["all","running","stopped","error"],"type":"object","x-order":["all","running","stopped","error"]},"items":{"items":{"$ref":"#/components/schemas/VmSummary"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","counts"],"type":"object","x-order":["items","total","page","per_page","counts"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`zone_id`, `page` or `per_page` is not an integer, or `sort` is not one of the listed fields."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`zone_id`, `page` or `per_page` is not an integer, or `sort` is not one of the listed fields. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`zone_id`, `page` or `per_page` is not an integer, or `sort` is not one of the listed fields."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"List VMs","tags":["Virtual Machines"],"x-cli":"vm list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Danh sách máy ảo"},"post":{"description":"Orders a new server and returns it at once in the `provisioning` state; it becomes `active` (usually within a couple of minutes) when the operating system is installed. The first charge is taken from your wallet in the same request: the first hour for `hourly` servers, or the whole price of the cycle for prepaid cycles. Nothing is charged if the request fails, and a deployment that fails later is refunded automatically (the server becomes `failed`).\n\nChoose the size with either `plan_id` (a fixed plan, see the catalog) or `custom` (your own vCPU, RAM and disk, only on sites that sell custom configurations; if both are sent, `custom` wins). `template_id` selects the operating system image; it must be available in the chosen region. Use `zone_id` to pick a region when the site has several; leave it out to use the default one.\n\nThe initial administrator password is never returned by the API: it is e-mailed to the account holder when the server is ready. Pass `ssh_key_id` to log in with an SSH key instead. Follow the deployment with List a VM's jobs or poll Get a VM.\n\nYour wallet must cover the first charge and the site's minimum balance, your e-mail address must be verified, and new accounts can run only a few servers (2 by default) until a first payment of at least US$10 has completed. Use Get the VM catalog for plans, images, cycles and regions, and Quote a custom configuration to price a custom size.\n\n**Required scope:** `vm:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cycle":"monthly","display_name":"Web server 01","enable_ipv6":true,"hostname":"web-01","plan_id":3,"ssh_key_id":7,"template_id":11,"zone_id":1},"schema":{"properties":{"custom":{"properties":{"cpu":{"description":"Virtual CPU cores, within the site limits (1 to 32 by default).","type":"integer"},"cpu_type":{"description":"CPU type, required when `zone_id` is a region with several CPU types (its catalog `custom` block lists the allowed cores, memory and disk for each type): `A` Availability, `B` General Purpose, `D` Dedicated. Price it first with Quote a custom size in a region. A region where custom sizes are switched off answers `409 not_supported_in_zone` with `capability` `custom`. Ignored elsewhere.","enum":["A","B","D"],"type":"string"},"disk_gb":{"description":"System disk in GiB within the site limits (20 to 1000 by default, in steps of 10) and at least the size the image needs.","type":"integer"},"ram_mb":{"description":"Memory in MiB: a multiple of 1024 within the site limits (1 to 64 GiB by default).","type":"integer"}},"required":["cpu","ram_mb","disk_gb"],"type":"object","x-order":["cpu","ram_mb","disk_gb","cpu_type"]},"cycle":{"description":"Billing cycle slug: `hourly` (the default) or a prepaid cycle such as `monthly` or `yearly`, as listed in the catalog.","type":"string"},"display_name":{"description":"Label for dashboards, at most 100 characters. Defaults to the host name.","type":"string"},"enable_ipv6":{"description":"Put the server on the dual-stack network so it gets a public IPv6 address. Defaults to `true`; always on inside a Private Cloud.","type":"boolean"},"extra_ips":{"description":"Additional IPv4 addresses, 0 to 3 (default 0), only in regions whose catalog `extras` block is present. Chosen when ordering; they cannot be added or removed later. Each adds its catalog price to every billing cycle.","type":"integer"},"hostname":{"description":"Host name: 1 to 63 characters, lowercase letters, digits and hyphens, not starting or ending with a hyphen (upper case is lowered). It must be unique on the whole platform.","type":"string"},"network":{"description":"`shared` (default) uses the standard shared network. `vpc` places the server in one of your Private Cloud tiers and needs `vpc_tier_id`.","enum":["shared","vpc"],"type":"string"},"plan_id":{"description":"Fixed plan from the catalog. Required unless `custom` is given. Custom plans of other servers are not accepted here.","type":"integer"},"ssh_key_id":{"description":"One of your saved SSH keys to install on the server.","type":"integer"},"template_id":{"description":"Operating system image from the catalog (or one of your own images that is ready).","type":"integer"},"vpc_tier_id":{"description":"Tier of your Private Cloud to join. Required when `network` is `vpc`.","type":"string"},"zone_id":{"description":"Region to create the server in, from the catalog `zones`. Required (`422 zone_required`) when the site offers several regions and has no default.","type":"integer"}},"required":["hostname","template_id"],"type":"object","x-order":["hostname","display_name","plan_id","template_id","cycle","ssh_key_id","custom","enable_ipv6","extra_ips","zone_id","network","vpc_tier_id"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"vm":{"auto_renew":true,"autoscale_enabled":false,"billed_until":null,"cancel_requested":false,"capabilities":{"autoscale":true,"backup":true,"bandwidth":true,"byoip":true,"change_ip":true,"console":"vnc","ddos_shield":true,"firewall":true,"hypervisor":true,"ipv6":true,"iso":true,"metrics":true,"metrics_mem_disk":true,"nics":true,"port_forward":true,"private_ip":true,"reinstall":true,"reset_password":true,"resize_cpu_ram":true,"resize_disk_grow":true,"resize_live":true,"snapshot":true,"ssh_key_reset":true,"volumes":true,"vpc":true},"created_at":1792368000,"cs_state":null,"cs_vm_id":null,"cycle":"monthly","cycle_cents":343,"cycle_started_at":1792368000,"destroy_after":null,"display_name":"Web server 01","enable_ipv6":true,"ha":true,"hostname":"web-01","hourly_mills":5,"hourly_uusd":4704,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":null,"job_running":true,"lock_reason":null,"locked_at":null,"network":{"type":"shared"},"paid_until":1794960000,"password_lost":false,"plan":{"cpu":2,"disk_gb":60,"is_custom":false,"name":"Standard 2/4","ram_mb":4096},"private_ip":null,"public_ip":null,"ready_at":null,"ssh_key":"laptop","state":"provisioning","template":{"display_name":"Ubuntu 24.04 LTS","icon":"ubuntu","id":11,"os_family":"linux","os_version":"24.04"},"traffic":null,"username":"ubuntu","zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"vm":{"$ref":"#/components/schemas/Vm"}},"required":["vm"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON. `bad_input`: The order is not valid. `detail` says why: unknown or unavailable plan, image or billing cycle, a `custom` size outside the site limits or below the image's minimum disk, an SSH key that is not yours, or an image larger than the plan's disk. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."},{"code":"bad_input","description":"The order is not valid. `detail` says why: unknown or unavailable plan, image or billing cycle, a `custom` size outside the site limits or below the image's minimum disk, an SSH key that is not yours, or an image larger than the plan's disk."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot pay the first charge or the site's minimum balance. The error carries `need_cents` (what the wallet must hold) and `balance_cents` (what it holds now). Top up and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot pay the first charge or the site's minimum balance. The error carries `need_cents` (what the wallet must hold) and `balance_cents` (what it holds now). Top up and retry. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot pay the first charge or the site's minimum balance. The error carries `need_cents` (what the wallet must hold) and `balance_cents` (what it holds now). Top up and retry."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `email_unverified`: The e-mail address of the account is not verified yet. `too_many_vms`: A new account may run only a few servers until a first payment of at least US$10 has completed. `quota_exceeded`: The order exceeds the account's resource or server-count limits. The error carries `reason`, `used`, `requested`, `limit`, `need_more_cents` and the `next` tier that would allow it. `feature_disabled`: The site does not sell custom configurations. `limit_reached`: The site has reached its maximum number of servers. `vpc_disabled`: Private Cloud is not available on this site.","x-error-codes":[{"code":"email_unverified","description":"The e-mail address of the account is not verified yet."},{"code":"too_many_vms","description":"A new account may run only a few servers until a first payment of at least US$10 has completed."},{"code":"quota_exceeded","description":"The order exceeds the account's resource or server-count limits. The error carries `reason`, `used`, `requested`, `limit`, `need_more_cents` and the `next` tier that would allow it."},{"code":"feature_disabled","description":"The site does not sell custom configurations."},{"code":"limit_reached","description":"The site has reached its maximum number of servers."},{"code":"vpc_disabled","description":"Private Cloud is not available on this site."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"vpc_tier_not_found","message":"`vpc_tier_id` does not exist, is not yours, or is not active."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vpc_tier_not_found`: `vpc_tier_id` does not exist, is not yours, or is not active. `zone_not_found`: `zone_id` does not exist or is not visible to your site.","x-error-codes":[{"code":"vpc_tier_not_found","description":"`vpc_tier_id` does not exist, is not yours, or is not active."},{"code":"zone_not_found","description":"`zone_id` does not exist or is not visible to your site."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vpc_full","message":"The Private Cloud has reached its maximum number of servers."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vpc_full`: The Private Cloud has reached its maximum number of servers. `hostname_taken`: The host name is not available. Choose another one. `zone_not_ready`: The region cannot take new servers at the moment: it is not open for sale to your account yet, it has reached its capacity limit, or the chosen plan is temporarily not available there. The error carries the `zone_id`; pick another region or retry later. `not_supported_in_zone`: `network` is `vpc` but the chosen region does not offer Private Cloud networking. The error carries `capability` (`vpc`). Nothing is charged; order in the default network or in another region. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vpc_full","description":"The Private Cloud has reached its maximum number of servers."},{"code":"hostname_taken","description":"The host name is not available. Choose another one."},{"code":"zone_not_ready","description":"The region cannot take new servers at the moment: it is not open for sale to your account yet, it has reached its capacity limit, or the chosen plan is temporarily not available there. The error carries the `zone_id`; pick another region or retry later."},{"code":"not_supported_in_zone","description":"`network` is `vpc` but the chosen region does not offer Private Cloud networking. The error carries `capability` (`vpc`). Nothing is charged; order in the default network or in another region."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing or invalid: `plan_id` and `template_id` (or `custom` and `template_id`), `network`, `vpc_tier_id`. The error names the offending `field`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: A field is missing or invalid: `plan_id` and `template_id` (or `custom` and `template_id`), `network`, `vpc_tier_id`. The error names the offending `field`. `invalid_hostname`: The host name is not 1 to 63 characters of lowercase letters, digits and hyphens, or it starts or ends with a hyphen. `extras_not_available`: `extra_ips` was sent for a plan, billing cycle or site that does not sell it (only prepaid servers in regions whose catalog has an `extras` block). `image_requirements`: The plan or `custom` size is below the minimum of the chosen image (`template_id`): Desktop and Windows images need more memory, disk and cores than a Server image. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`); nothing is charged. The minimums are listed as `min` on each catalog template. `cycle_not_available_for_image`: The image carries an operating-system license fee (Windows) and is sold with the `monthly` cycle only. The error carries the allowed `cycles`; nothing is charged. The catalog lists them as `cycles` on each template. `zone_required`: The site offers several regions and none is the default: send `zone_id`. The error carries the `zones` to choose from. `plan_zone_mismatch`: The plan is not sold in the selected region. `template_unavailable_in_zone`: The image is not available in the selected region. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `cycle_not_available_in_zone`: The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"A field is missing or invalid: `plan_id` and `template_id` (or `custom` and `template_id`), `network`, `vpc_tier_id`. The error names the offending `field`."},{"code":"invalid_hostname","description":"The host name is not 1 to 63 characters of lowercase letters, digits and hyphens, or it starts or ends with a hyphen."},{"code":"extras_not_available","description":"`extra_ips` was sent for a plan, billing cycle or site that does not sell it (only prepaid servers in regions whose catalog has an `extras` block)."},{"code":"image_requirements","description":"The plan or `custom` size is below the minimum of the chosen image (`template_id`): Desktop and Windows images need more memory, disk and cores than a Server image. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`); nothing is charged. The minimums are listed as `min` on each catalog template."},{"code":"cycle_not_available_for_image","description":"The image carries an operating-system license fee (Windows) and is sold with the `monthly` cycle only. The error carries the allowed `cycles`; nothing is charged. The catalog lists them as `cycles` on each template."},{"code":"zone_required","description":"The site offers several regions and none is the default: send `zone_id`. The error carries the `zones` to choose from."},{"code":"plan_zone_mismatch","description":"The plan is not sold in the selected region."},{"code":"template_unavailable_in_zone","description":"The image is not available in the selected region."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"cycle_not_available_in_zone","description":"The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vpc_locked","message":"The Private Cloud is locked. Top up to unlock it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vpc_locked`: The Private Cloud is locked. Top up to unlock it. `sales_disabled`: New servers cannot be ordered at the moment. `site_unavailable`: The site is not accepting new orders.","x-error-codes":[{"code":"vpc_locked","description":"The Private Cloud is locked. Top up to unlock it."},{"code":"sales_disabled","description":"New servers cannot be ordered at the moment."},{"code":"site_unavailable","description":"The site is not accepting new orders."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Custom configurations are not available on this platform at the moment (`feature` is `custom_plan`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Custom configurations are not available on this platform at the moment (`feature` is `custom_plan`). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Custom configurations are not available on this platform at the moment (`feature` is `custom_plan`)."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"quota_unavailable","message":"The account's limits could not be verified. Retry in a moment."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`quota_unavailable`: The account's limits could not be verified. Retry in a moment. `provider_unavailable`: The service provider is temporarily not accepting new orders. Retry later. `tenant_unavailable`: The account is temporarily unavailable. Retry in a few minutes.","x-error-codes":[{"code":"quota_unavailable","description":"The account's limits could not be verified. Retry in a moment."},{"code":"provider_unavailable","description":"The service provider is temporarily not accepting new orders. Retry later."},{"code":"tenant_unavailable","description":"The account is temporarily unavailable. Retry in a few minutes."}]}},"security":[{"bearerAuth":["vm:create"]}],"summary":"Create a VM (charges the wallet)","tags":["Virtual Machines"],"x-cli":"vm create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"monthly\",\"display_name\":\"Web server 01\",\"enable_ipv6\":true,\"hostname\":\"web-01\",\"plan_id\":3,\"ssh_key_id\":7,\"template_id\":11,\"zone_id\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:create","x-summary-vi":"Tạo máy ảo mới (trừ tiền ví)"}},"/v1/vm/catalog":{"get":{"description":"Returns everything needed to order a server: the plans on sale with their prices for each billing cycle, the operating system images, the regions, and the account-independent rules (minimum balance, snapshot limits). Call this before [Create a VM](#tag/Virtual-Machines).\n\nOnly plans and images that can actually be provisioned in a region you can use are listed.\n\nThe response carries an `ETag`: send it back in `If-None-Match` and an unchanged catalog answers `304 Not Modified` with no body. With `view=shell` you get only `cycles`, `settings` and `account` (a few KB) — enough for the rules, feature flags and maintenance notice, without the plans, images and regions.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_vm","parameters":[{"description":"`shell` returns only `cycles`, `settings` and `account`; `plans`, `templates`, `zones` and `default_zone_id` are left out. Omit it for the full catalog.","in":"query","name":"view","required":false,"schema":{"enum":["shell"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"account":{"email_verified":true,"lang":"en"},"cycles":[{"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"default_zone_id":1,"plans":[{"cpu":2,"cycles":[{"cents":343,"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"description":"2 vCPU, 4 GB RAM, 60 GB SSD","disk_gb":60,"hourly":"$0.004704","hourly_mills":7,"id":3,"monthly_cents":343,"name":"Standard 2/4","ram_mb":4096,"slug":"s-2c-4g","zone_id":1}],"settings":{"hours_per_month":730,"min_balance_cents":500,"snapshot_limit":3},"templates":[{"display_name":"Ubuntu 24.04 LTS","icon":"ubuntu","id":11,"os_family":"linux","os_version":"24.04","size_gb":10,"username":"ubuntu","zone_ids":[1]}],"zones":[{"billed_when_stopped":false,"capabilities":{"autoscale":true,"backup":true,"bandwidth":true,"byoip":true,"change_ip":true,"console":"vnc","ddos_shield":true,"firewall":true,"hypervisor":true,"ipv6":true,"iso":true,"metrics":true,"metrics_mem_disk":true,"nics":true,"port_forward":true,"private_ip":true,"reinstall":true,"reset_password":true,"resize_cpu_ram":true,"resize_disk_grow":true,"resize_live":true,"snapshot":true,"ssh_key_reset":true,"volumes":true,"vpc":true},"city":"Ho Chi Minh City","country":"VN","cycles":null,"id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1","traffic":null}]},"schema":{"properties":{"account":{"properties":{"email_verified":{"description":"Whether the account e-mail is verified. Servers can only be created once it is.","type":"boolean"},"lang":{"description":"Preferred language of the account.","type":"string"}},"required":["email_verified","lang"],"type":"object"},"cycles":{"items":{"properties":{"discount_pct":{"description":"Discount percent.","type":"number"},"months":{"description":"Months in the cycle.","type":"integer"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Cycle identifier.","type":"string"}},"required":["slug","name","months","discount_pct"],"type":"object","x-order":["slug","name","months","discount_pct"]},"type":"array"},"default_zone_id":{"description":"Region used when you omit `zone_id`, or null when you must choose.","type":["integer","null"]},"plans":{"items":{"$ref":"#/components/schemas/Plan"},"type":"array"},"settings":{"additionalProperties":true,"description":"Site rules: `min_balance_cents`, `min_topup_cents`, `hours_per_month`, `snapshot_limit`, feature flags and similar. Fields may be added over time.","type":"object"},"templates":{"items":{"$ref":"#/components/schemas/CatalogOs"},"type":"array"},"zones":{"description":"Regions you can order a server in. Besides the region itself, each one tells what servers there can do (`capabilities`), which billing cycles are sold (`cycles`), how traffic is provided (`traffic`) and whether a stopped server is still charged (`billed_when_stopped`). Plans and images carry `zone_id` / `zone_ids` to say where they are sold.","items":{"$ref":"#/components/schemas/VmCatalogZone"},"type":"array"}},"required":["plans","templates","cycles","zones","default_zone_id","settings","account"],"type":"object","x-order":["plans","templates","cycles","zones","default_zone_id","settings","account"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Plans, regions and OS images","tags":["Catalog"],"x-cli":"catalog vm","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục gói, vùng, hệ điều hành"}},"/v1/vm/custom-quote":{"get":{"description":"Prices a custom configuration (any vCPU / RAM / disk combination within the site limits) without creating anything and without charging. The response includes the cost per billing cycle, the cost of the first charge, a per-resource breakdown, the cheapest fixed plan that is at least as large, and your current balance, so you can check you can afford it before calling Create a VM with `custom`.\n\nThe site must sell custom configurations; otherwise the call fails with `feature_disabled`.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_custom_quote","parameters":[{"description":"Number of vCPU cores.","example":4,"in":"query","name":"cpu","required":true,"schema":{"type":"integer"}},{"description":"Memory in MiB.","example":8192,"in":"query","name":"ram_mb","required":true,"schema":{"type":"integer"}},{"description":"System disk in GiB.","example":80,"in":"query","name":"disk_gb","required":true,"schema":{"type":"integer"}},{"description":"Billing cycle slug (see the catalog).","in":"query","name":"cycle","required":false,"schema":{"default":"monthly","type":"string"}},{"description":"OS image the disk must fit; the quote reports the minimum disk it needs.","in":"query","name":"template_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"balance_cents":2500,"breakdown":{"cpu":{"qty":4,"uusd":5000},"disk_gb":{"qty":80,"uusd":2200},"ram_gb":{"qty":8,"uusd":4000}},"compare":null,"cpu":4,"cycle":"monthly","cycle_cents":818,"cycles":[{"cents":818,"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"discount_pct":0.0,"disk_gb":80,"first_charge_cents":818,"hourly":"$0.011200","hourly_uusd":11200,"min_disk_gb":10,"monthly_cents":818,"months":1,"ram_mb":8192},"schema":{"properties":{"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"breakdown":{"additionalProperties":true,"description":"Per-resource cost: `cpu`, `ram_gb`, `disk_gb`, each with `qty` and `uusd`.","type":"object"},"compare":{"additionalProperties":true,"description":"Smallest fixed plan that is at least as large, with `cheaper` and `cheaper_pct`; null when none fits.","type":["object","null"]},"cpu":{"description":"Requested vCPU cores.","type":"integer"},"cycle":{"description":"Billing cycle used for the quote.","type":"string"},"cycle_cents":{"description":"Price of one cycle in US cents.","type":"integer"},"cycles":{"items":{"$ref":"#/components/schemas/CycleQuote"},"type":"array"},"discount_pct":{"description":"Cycle discount in percent.","type":"number"},"disk_gb":{"description":"Requested disk in GiB.","type":"integer"},"first_charge_cents":{"description":"Amount charged from the wallet when the server is created, in US cents.","type":"integer"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"min_disk_gb":{"description":"Smallest disk allowed for the chosen image.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month in US cents.","type":"integer"},"months":{"description":"Months in the cycle.","type":"integer"},"ram_mb":{"description":"Requested memory in MiB.","type":"integer"}},"required":["cpu","ram_mb","disk_gb","cycle","months","discount_pct","hourly_uusd","hourly","monthly_cents","cycle_cents","first_charge_cents","cycles","breakdown","compare","min_disk_gb","balance_cents"],"type":"object","x-order":["cpu","ram_mb","disk_gb","cycle","months","discount_pct","hourly_uusd","hourly","monthly_cents","cycle_cents","first_charge_cents","cycles","breakdown","compare","min_disk_gb","balance_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The site does not sell custom configurations. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell custom configurations."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`cpu`, `ram_mb` or `disk_gb` is missing or outside the allowed limits."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `cpu`, `ram_mb` or `disk_gb` is missing or outside the allowed limits. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before.","x-error-codes":[{"code":"invalid_argument","description":"`cpu`, `ram_mb` or `disk_gb` is missing or outside the allowed limits."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Quote a custom configuration","tags":["Catalog"],"x-cli":"catalog custom-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/custom-quote?cpu=<cpu>&ram_mb=<ram_mb>&disk_gb=<disk_gb>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Báo giá một cấu hình tuỳ chọn"}},"/v1/vm/ops-key":{"get":{"description":"Returns the name and fingerprint of the platform's maintenance SSH key. When `attach` is `true`, this key is installed on new servers next to your own key so that support can help you; use the fingerprint to recognise it in your server's authorized keys. The value is public information and the same for every customer of the site; it is cached for 15 minutes.\n\n**Required scope:** `vm:read`.","operationId":"vm_ops_key","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"attach":true,"fingerprint":"5c:2a:91:0e:7b:63:d4:18:aa:f0:3e:4d:92:6b:71:c5","found":true,"name":"support-ops"},"schema":{"properties":{"attach":{"description":"Whether the key is installed on new servers.","type":"boolean"},"fingerprint":{"description":"Key fingerprint, or null when the key is not found.","type":["string","null"]},"found":{"description":"Whether the key exists.","type":"boolean"},"name":{"description":"Key name.","type":"string"}},"required":["name","fingerprint","found","attach"],"type":"object","x-order":["name","fingerprint","found","attach"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The infrastructure did not answer. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The infrastructure did not answer. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The infrastructure did not answer. Retry in a few seconds."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"The pre-attached ops SSH key (name + fingerprint, not a secret)","tags":["Virtual Machines"],"x-cli":"vm ops-key","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/ops-key\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Khoá SSH vận hành được gắn sẵn (tên + vân tay, không phải bí mật)"}},"/v1/vm/prices":{"get":{"description":"Returns the price of every plan on sale for each billing cycle, plus the unit prices used for custom configurations. A compact alternative to the catalog when you only need prices (for example to display a cost estimate).\n\n**Required scope:** `catalog:read`.","operationId":"catalog_prices","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"custom":{"enabled":false},"fx":{},"hpm":730,"plans":[{"cycles":[{"cents":343,"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"hourly":"$0.004704","hourly_uusd":4704,"id":3,"monthly_cents":343,"name":"Standard 2/4","slug":"s-2c-4g"}]},"schema":{"properties":{"custom":{"additionalProperties":true,"description":"Custom configuration unit prices and limits (`enabled` is false when the site does not sell custom configurations).","type":"object"},"fx":{"additionalProperties":true,"description":"Public exchange-rate information used to display local-currency prices.","type":"object"},"hpm":{"description":"Hours in a billing month (730).","type":"integer"},"plans":{"items":{"properties":{"cycles":{"items":{"$ref":"#/components/schemas/CycleQuote"},"type":"array"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"id":{"description":"Plan identifier.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month in US cents.","type":"integer"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"Stable short name.","type":"string"}},"required":["id","slug","name","hourly_uusd","hourly","monthly_cents","cycles"],"type":"object","x-order":["id","slug","name","hourly_uusd","hourly","monthly_cents","cycles"]},"type":"array"}},"required":["hpm","fx","plans","custom"],"type":"object","x-order":["hpm","fx","plans","custom"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Unit prices per component (vCPU, RAM, disk)","tags":["Catalog"],"x-cli":"catalog prices","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/prices\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Đơn giá từng thành phần (vCPU, RAM, đĩa)"}},"/v1/vm/px-quote":{"get":{"description":"Prices a custom size (CPU type, cores, memory, disk) in a region that offers several CPU types, without creating anything and without charging. Only values listed in that region's `custom` block of the catalog are accepted. Use it to show the price while the customer moves the sliders, then send the same values as `custom` (with `cpu_type`) and the region as `zone_id` to Create a VM.\n\nA stopped server in these regions is still charged, at `off_hourly_uusd` per hour. Traffic is billed per gigabyte used (`traffic`). Limited to 60 calls per minute per account.\n\n**Required scope:** `vm:read`.","operationId":"catalog_region_quote","parameters":[{"description":"Region from the catalog `zones` that has a `custom` block.","example":5,"in":"query","name":"zone_id","required":true,"schema":{"type":"integer"}},{"description":"CPU type: `A` Availability (shared cores, best value), `B` General Purpose (consistent performance), `D` Dedicated (dedicated cores).","in":"query","name":"cpu_type","required":true,"schema":{"enum":["A","B","D"],"type":"string"}},{"description":"Number of cores, one of the values listed for the CPU type.","example":4,"in":"query","name":"cores","required":true,"schema":{"type":"integer"}},{"description":"Memory in MiB, one of the values listed for the CPU type.","example":8192,"in":"query","name":"ram_mb","required":true,"schema":{"type":"integer"}},{"description":"System disk in GiB, one of the listed values.","example":100,"in":"query","name":"disk_gb","required":true,"schema":{"type":"integer"}},{"description":"OS image you intend to install; when given, the size must reach that image's minimum (`min` in the catalog `templates`).","in":"query","name":"template_id","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"cycles":[{"cents":0,"discount_pct":0.0,"months":0,"name":"Hourly","slug":"hourly"},{"cents":8103,"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"}],"hourly":"$0.111","hourly_uusd":111000,"monthly_cents":8103,"off_hourly_uusd":16000,"spec":{"cores":4,"cpu_type":"B","disk_gb":100,"ram_mb":8192},"traffic":{"pay_per_use":true,"usd_per_gb":0.011}},"schema":{"properties":{"cycles":{"items":{"$ref":"#/components/schemas/CycleQuote"},"type":"array"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour while running, in millionths of a US dollar.","type":"integer"},"license":{"properties":{"family":{"description":"Which operating-system license the image needs: Windows Server or Windows desktop.","enum":["server","desktop"],"type":"string"},"hourly_uusd":{"description":"License price per hour, in millionths of a US dollar. Already included in `hourly_uusd`, `off_hourly_uusd` and the cycle prices.","type":"integer"},"monthly_cents":{"description":"License price for a 30-day month (730 hours) in US cents.","type":"integer"}},"required":["family","hourly_uusd","monthly_cents"],"type":["object","null"]},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"off_hourly_uusd":{"description":"Price per hour while the server is stopped, in millionths of a US dollar. Includes the license fee of a licensed image (it is charged while stopped too).","type":"integer"},"spec":{"properties":{"cores":{"description":"Number of cores.","type":"integer"},"cpu_type":{"description":"CPU type.","type":"string"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["cpu_type","cores","ram_mb","disk_gb"],"type":"object","x-order":["cpu_type","cores","ram_mb","disk_gb"]},"traffic":{"anyOf":[{"$ref":"#/components/schemas/VmTraffic"},{"type":"null"}]}},"required":["spec","hourly_uusd","hourly","monthly_cents","off_hourly_uusd","cycles","traffic"],"type":"object","x-order":["spec","hourly_uusd","hourly","monthly_cents","off_hourly_uusd","license","cycles","traffic"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"A parameter is missing, not a listed value for the region, or `cpu_type` is not one of A, B, T, D. `detail` names the parameter."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A parameter is missing, not a listed value for the region, or `cpu_type` is not one of A, B, T, D. `detail` names the parameter. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"A parameter is missing, not a listed value for the region, or `cpu_type` is not one of A, B, T, D. `detail` names the parameter."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"zone_not_found","message":"The region does not exist, is not open to your account, or has no custom sizes."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The region does not exist, is not open to your account, or has no custom sizes. (`zone_not_found`)","x-error-codes":[{"code":"zone_not_found","description":"The region does not exist, is not open to your account, or has no custom sizes."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"zone_not_ready","message":"The region cannot price this size at the moment, or the licensed image (`template_id`) has no license price yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`zone_not_ready`: The region cannot price this size at the moment, or the licensed image (`template_id`) has no license price yet. `not_supported_in_zone`: Custom sizes are switched off for the region (`capability` is `custom`).","x-error-codes":[{"code":"zone_not_ready","description":"The region cannot price this size at the moment, or the licensed image (`template_id`) has no license price yet."},{"code":"not_supported_in_zone","description":"Custom sizes are switched off for the region (`capability` is `custom`)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"image_requirements","message":"`template_id` was given and the size is below the image's minimum. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`template_id` was given and the size is below the image's minimum. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`). (`image_requirements`)","x-error-codes":[{"code":"image_requirements","description":"`template_id` was given and the size is below the image's minimum. The error carries `min` (`cpu`, `ram_mb`, `disk_gb`)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Quote a custom configuration in a region (CPU type, cores, RAM, disk)","tags":["Catalog"],"x-cli":"catalog region-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/px-quote?zone_id=<zone_id>&cpu_type=<cpu_type>&cores=<cores>&ram_mb=<ram_mb>&disk_gb=<disk_gb>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Báo giá cấu hình tuỳ chỉnh ở một vị trí (loại CPU, lõi, RAM, đĩa)"}},"/v1/vm/scale-events":{"get":{"description":"Lists the size changes of the servers of your account, newest first: resizes you requested, scheduled ones, automatic growth by Auto Scaling, returns to base size, and automatic growth that was held back (`kind: blocked`, with the `reason`). Each entry shows the size before and after, the hourly prices, what was charged or refunded and whether the change was applied without a restart.\n\nThe filters narrow the list; `vm_id` is only a filter, so another account's server id simply matches nothing. Limited to 60 requests per minute per account.\n\n**Required scope:** `vm:read`.","operationId":"scale_events","parameters":[{"description":"Only events of this server (UUID).","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}},{"description":"Only events with this source, for example `manual`, `autoscale` or `revert`. Exact match.","in":"query","name":"source","required":false,"schema":{"type":"string"}},{"description":"Only events of this kind, for example `up`, `down`, `revert` or `blocked`. Exact match.","in":"query","name":"kind","required":false,"schema":{"type":"string"}},{"description":"Only events at or after this time (Unix seconds). A value that is not a number is ignored.","in":"query","name":"from","required":false,"schema":{"type":"integer"}},{"description":"Only events at or before this time (Unix seconds). A value that is not a number is ignored.","in":"query","name":"to","required":false,"schema":{"type":"integer"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page, at most 100. Larger values are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. Unknown values fall back to `at`.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","id","cpu_pct","charged_cents","source","kind","to_cpu","to_ram_mb"],"type":"string"}},{"description":"Sort direction. Anything other than `asc` means `desc`.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"dir":"desc","items":[{"actor":"customer:1042","at":1790001200,"charged_cents":2,"cpu_pct":null,"from":{"cpu":2,"disk_gb":50,"hourly_uusd":16460,"ram_mb":4096},"id":211,"job_id":18342,"kind":"up","live":true,"ok":true,"reason":null,"refunded_cents":0,"source":"manual","to":{"cpu":2,"disk_gb":50,"hourly_uusd":21940,"ram_mb":8192},"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"page":1,"per_page":25,"sort":"at","total":1},"schema":{"properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"items":{"items":{"$ref":"#/components/schemas/ScaleEvent"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","sort","dir"],"type":"object","x-order":["items","total","page","per_page","sort","dir"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 60 requests in a minute for this account. The body carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 60 requests in a minute for this account. The body carries `retry_after` in seconds."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Scaling history of the account (paged, filterable)","tags":["Scaling"],"x-cli":"scale events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/scale-events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Lịch sử co giãn của tài khoản (phân trang, lọc)"}},"/v1/vm/sshkeys":{"get":{"description":"Lists the SSH public keys stored in your account, oldest first. The list is not paginated because an account holds at most 20 keys.\n\n**Required scope:** `sshkey:read`.","operationId":"ssh_key_list","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":1792300000,"fingerprint":"SHA256:Qm9ndXNGaW5nZXJwcmludEV4YW1wbGVPbmx5MDEyMzQ","id":12,"name":"laptop","public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrJvc3RhcmV4YW1wbGVrZXlvbmx5MDEyMzQ1Njc4OQ laptop","type":"ssh-ed25519"}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SshKey"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["sshkey:read"]}],"summary":"List SSH keys","tags":["SSH Keys"],"x-cli":"ssh-key list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/sshkeys\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"sshkey:read","x-summary-vi":"Danh sách khoá SSH"},"post":{"description":"Stores an SSH public key in your account so you can attach it to servers. Paste the contents of the `.pub` file as `public_key`. Only `ssh-ed25519` and `ssh-rsa` keys are accepted; other types (for example `ecdsa-sha2-nistp256`) are rejected. The key is checked structurally, and its fingerprint must be new to your account.\n\nThe key is only stored; it is not installed on any server until you attach it. Returns `201` with the stored key.\n\n**Required scope:** `sshkey:write`.","operationId":"ssh_key_add","parameters":[],"requestBody":{"content":{"application/json":{"example":{"name":"laptop","public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrJvc3RhcmV4YW1wbGVrZXlvbmx5MDEyMzQ1Njc4OQ laptop"},"schema":{"properties":{"name":{"description":"Name to recognise the key by, 1 to 60 characters (control characters are removed).","type":"string"},"public_key":{"description":"The public key in OpenSSH format, at most 16 KiB: `ssh-ed25519 AAAA... comment` or `ssh-rsa AAAA... comment`.","type":"string"}},"required":["name","public_key"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"key":{"created_at":1792300000,"fingerprint":"SHA256:Qm9ndXNGaW5nZXJwcmludEV4YW1wbGVPbmx5MDEyMzQ","id":12,"name":"laptop","public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrJvc3RhcmV4YW1wbGVrZXlvbmx5MDEyMzQ1Njc4OQ laptop","type":"ssh-ed25519"}},"schema":{"properties":{"key":{"$ref":"#/components/schemas/SshKey"}},"required":["key"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A key with the same fingerprint is already stored in your account (`detail` = `duplicate_key`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A key with the same fingerprint is already stored in your account (`detail` = `duplicate_key`). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A key with the same fingerprint is already stored in your account (`detail` = `duplicate_key`)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`name` is missing or empty. The error carries `field` = `name`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `name` is missing or empty. The error carries `field` = `name`. `invalid_key`: `public_key` is not a valid `ssh-ed25519` or `ssh-rsa` key. The error carries a `detail` such as `type`, `base64`, `blob`, `type_mismatch`, `ed25519_len` or `rsa_short`. `too_many_keys`: Your account already stores the maximum of 20 keys. Delete one first.","x-error-codes":[{"code":"invalid_argument","description":"`name` is missing or empty. The error carries `field` = `name`."},{"code":"invalid_key","description":"`public_key` is not a valid `ssh-ed25519` or `ssh-rsa` key. The error carries a `detail` such as `type`, `base64`, `blob`, `type_mismatch`, `ed25519_len` or `rsa_short`."},{"code":"too_many_keys","description":"Your account already stores the maximum of 20 keys. Delete one first."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["sshkey:write"]}],"summary":"Add an SSH key","tags":["SSH Keys"],"x-cli":"ssh-key add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/sshkeys\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"laptop\",\"public_key\":\"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrJvc3RhcmV4YW1wbGVrZXlvbmx5MDEyMzQ1Njc4OQ laptop\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"sshkey:write","x-summary-vi":"Thêm khoá SSH"}},"/v1/vm/sshkeys/{id}":{"delete":{"description":"Deletes a stored SSH key. Servers that already use the key keep working and keep the key installed; only the stored copy is removed, so you can no longer attach it to other servers. Deleting a key that does not exist, or was already deleted, answers `404`.\n\n**Required scope:** `sshkey:write`.","operationId":"ssh_key_delete","parameters":[{"description":"SSH key identifier as returned by List SSH keys.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["sshkey:write"]}],"summary":"Delete an SSH key","tags":["SSH Keys"],"x-cli":"ssh-key delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/sshkeys/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"sshkey:write","x-summary-vi":"Xoá khoá SSH"}},"/v1/vm/{id}":{"delete":{"description":"Permanently deletes the server. This cannot be undone: the system disk, data disks, backups and VM snapshots of the server are destroyed and its public addresses are released. Call Get delete preview first and show the user what will be lost.\n\nThe call returns at once: the server moves to `deleting` and the `job_id` job removes it within a few minutes. For prepaid servers the unused part of the paid period is credited to the wallet when the job completes; `refund_cents` is the estimate. Hourly servers are not refunded for the hour already started. A server that is still `provisioning` can be cancelled this way and is refunded in full. Locked servers cannot be deleted until they are unlocked.\n\nTo guard against mistakes you must send the server's host name as `confirm_hostname`.\n\n**Required scope:** `vm:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_delete","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm_hostname":"web-01"},"schema":{"properties":{"confirm_hostname":{"description":"The host name of the server being deleted, exactly as returned by Get a VM.","type":"string"}},"required":["confirm_hostname"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":4815,"refund_cents":297},"schema":{"properties":{"job_id":{"description":"Identifier of the deletion job. Follow it with List a VM's jobs.","type":"integer"},"refund_cents":{"description":"Estimated refund in US cents. The real refund is credited when the job completes.","type":"integer"}},"required":["job_id","refund_cents"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON. `bad_input`: The server cannot be deleted in its current state, or a deletion is already in progress (`detail` says which). `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."},{"code":"bad_input","description":"The server cannot be deleted in its current state, or a deletion is already in progress (`detail` says which)."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is already being deleted or is gone. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is already being deleted or is gone. The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish and retry. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_active","description":"The server is already being deleted or is gone. The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish and retry."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"confirm_mismatch","message":"`confirm_hostname` is missing or does not match the server's host name."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`confirm_mismatch`: `confirm_hostname` is missing or does not match the server's host name. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"confirm_mismatch","description":"`confirm_hostname` is missing or does not match the server's host name."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). Settle the balance or contact support first. The error carries `reason`, `destroy_after` and `locked_at`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). Settle the balance or contact support first. The error carries `reason`, `destroy_after` and `locked_at`. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). Settle the balance or contact support first. The error carries `reason`, `destroy_after` and `locked_at`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:destroy"]}],"summary":"Delete the VM (data is lost)","tags":["Virtual Machines"],"x-cli":"vm delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm_hostname\":\"web-01\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:destroy","x-summary-vi":"Xoá máy ảo (mất dữ liệu)"},"get":{"description":"Returns one server with its plan, image, network placement, billing cycle and lock details.\n\n`live` is included only when the power state was synced during the last two minutes. Pass `refresh=1` to read the current state from the infrastructure first; this is limited to one refresh every 10 seconds per server, and a faster call simply returns the stored data without an error. `job_running` tells you whether an action is still in flight.\n\n**Required scope:** `vm:read`.","operationId":"vm_get","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Set to `1` or `true` to refresh the power state and addresses from the infrastructure before answering.","in":"query","name":"refresh","required":false,"schema":{"enum":["1","true"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"auto_renew":true,"autoscale_enabled":false,"billed_until":null,"cancel_requested":false,"capabilities":{"autoscale":true,"backup":true,"bandwidth":true,"byoip":true,"change_ip":true,"console":"vnc","ddos_shield":true,"firewall":true,"hypervisor":true,"ipv6":true,"iso":true,"metrics":true,"metrics_mem_disk":true,"nics":true,"port_forward":true,"private_ip":true,"reinstall":true,"reset_password":true,"resize_cpu_ram":true,"resize_disk_grow":true,"resize_live":true,"snapshot":true,"ssh_key_reset":true,"volumes":true,"vpc":true},"created_at":1792368000,"credentials_once":null,"cs_state":"Running","cs_vm_id":"b6a3f6d2-4c1e-4f7a-9d58-2e0c7b1a9f34","cycle":"monthly","cycle_cents":343,"cycle_started_at":1792368000,"destroy_after":null,"display_name":"Web server 01","enable_ipv6":true,"failed_reason":null,"ha":true,"hostname":"web-01","hourly_mills":5,"hourly_uusd":4704,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":"2001:db8:10::25","job_running":false,"live":{"cs_state":"Running","ip":"203.0.113.25","ipv6":"2001:db8:10::25","nic":"10.1.1.25","synced_at":1792400000},"lock_note":null,"lock_reason":null,"locked_at":null,"network":{"type":"shared"},"paid_until":1794960000,"password_lost":false,"plan":{"cpu":2,"disk_gb":60,"is_custom":false,"name":"Standard 2/4","ram_mb":4096},"private_ip":"10.1.1.25","public_ip":"203.0.113.25","ready_at":1792368090,"ssh_key":"laptop","state":"active","template":{"display_name":"Ubuntu 24.04 LTS","icon":"ubuntu","id":11,"os_family":"linux","os_version":"24.04"},"traffic":null,"username":"ubuntu","zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"schema":{"$ref":"#/components/schemas/Vm"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Get one VM","tags":["Virtual Machines"],"x-cli":"vm get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Chi tiết một máy ảo"},"patch":{"description":"Changes the display name of the server. The host name cannot be changed. Works in any state except `locked`; it does not need the server to be idle. The updated server is returned (without the network and lock details that Get a VM adds).\n\n**Required scope:** `vm:write`.","operationId":"vm_update","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"display_name":"Production web server"},"schema":{"properties":{"display_name":{"description":"New display name, 1 to 120 characters after trimming. Control characters are removed.","type":"string"}},"required":["display_name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"vm":{"auto_renew":true,"autoscale_enabled":false,"billed_until":null,"cancel_requested":false,"capabilities":{"autoscale":true,"backup":true,"bandwidth":true,"byoip":true,"change_ip":true,"console":"vnc","ddos_shield":true,"firewall":true,"hypervisor":true,"ipv6":true,"iso":true,"metrics":true,"metrics_mem_disk":true,"nics":true,"port_forward":true,"private_ip":true,"reinstall":true,"reset_password":true,"resize_cpu_ram":true,"resize_disk_grow":true,"resize_live":true,"snapshot":true,"ssh_key_reset":true,"volumes":true,"vpc":true},"created_at":1792368000,"cs_state":"Running","cs_vm_id":"b6a3f6d2-4c1e-4f7a-9d58-2e0c7b1a9f34","cycle":"monthly","cycle_cents":343,"cycle_started_at":1792368000,"destroy_after":null,"display_name":"Production web server","enable_ipv6":true,"ha":true,"hostname":"web-01","hourly_mills":5,"hourly_uusd":4704,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":"2001:db8:10::25","job_running":false,"lock_reason":null,"locked_at":null,"paid_until":1794960000,"password_lost":false,"plan":{"cpu":2,"disk_gb":60,"is_custom":false,"name":"Standard 2/4","ram_mb":4096},"private_ip":"10.1.1.25","public_ip":"203.0.113.25","ready_at":1792368090,"ssh_key":"laptop","state":"active","template":{"display_name":"Ubuntu 24.04 LTS","icon":"ubuntu","id":11,"os_family":"linux","os_version":"24.04"},"traffic":null,"username":"ubuntu"}},"schema":{"properties":{"vm":{"$ref":"#/components/schemas/Vm"}},"required":["vm"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`display_name` is missing or empty."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`display_name` is missing or empty. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`display_name` is missing or empty."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The new name could not be applied on the infrastructure. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The new name could not be applied on the infrastructure. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The new name could not be applied on the infrastructure. Retry in a few seconds."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Rename / notes","tags":["Virtual Machines"],"x-cli":"vm update","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/vm/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"display_name\":\"Production web server\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Đổi tên hiển thị / ghi chú"}},"/v1/vm/{id}/ai-agent":{"post":{"description":"Sends a message to the AI agent, which can run shell commands on the server over SSH to answer. The response is a stream of server-sent events (`text/event-stream`): each `data:` line is one JSON object (see the schema), separated by a blank line. The `X-AI-Session-Id` response header carries the conversation identifier.\n\nA typical stream is `hello`, then `assistant_turn` (the agent's text), then one of two paths:\n\n- **Needs your approval** (the default): `tool_request` with the proposed `command`, then `done` with `awaiting_confirm: true`. Show the command to the user and, if approved, call this operation again with the same `session_id` and `confirmed_cmd` set to that exact command. The server runs it as given, without re-checking it, so only send commands the user approved.\n- **Runs by itself** (`auto_execute: true`, the command is on the read-only allowlist (checking status, reading logs/configuration, network diagnostics), and is not flagged as risky): `tool_start`, `tool_result` (output and exit code), then the agent continues with more `assistant_turn` / `tool_*` events, up to 10 steps, and ends with `done`. All commands that modify the server (installing packages, editing files, restarting services) stop at `tool_request` with `auto_blocked: true` and `read_only: false`; commands that look dangerous (deleting or overwriting files, changing accounts or keys, piping downloads into a shell, shutting down or rebooting) also include a `risk_reason`.\n\nAn `error` event ends the stream early. The server must be active and running. Limits: 20 requests per minute per account, 2 conversations streaming at once, and a daily quota of AI calls per account (300 by default, resets at 00:00 UTC); when exceeded the call fails with `429 rate_limited` (the daily case carries `limit`, `used` and `retry_after`).\n\n```\ndata: {\"type\":\"hello\",\"session_id\":\"ais_9b1d4c0a7e3f5a21c6d8\"}\n\ndata: {\"type\":\"assistant_turn\",\"content\":\"I will check the free disk space.\",\"model\":\"example-model-1\"}\n\ndata: {\"type\":\"tool_request\",\"id\":\"call_1\",\"command\":\"df -h /\",\"reason\":\"Check free disk space\",\"risk_reason\":null,\"auto_blocked\":false,\"read_only\":true}\n\ndata: {\"type\":\"done\",\"session_id\":\"ais_9b1d4c0a7e3f5a21c6d8\",\"model\":\"example-model-1\",\"awaiting_confirm\":true}\n```\n\n**Required scope:** `vm:console`.","operationId":"vm_ai_agent_run","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_execute":false,"messages":[{"content":"How much disk space is left?","role":"user"}],"session_id":"ais_9b1d4c0a7e3f5a21c6d8","vm_context":{"os":"Ubuntu 24.04"}},"schema":{"properties":{"auto_execute":{"description":"Run read-only commands automatically instead of asking first. Defaults to `false`. Commands that modify the server always wait for confirmation.","type":"boolean"},"confirmed_cmd":{"description":"A command the user approved after a `tool_request`. It is executed first, and its output is given to the agent. When present, `messages` is not stored as a new user message.","type":"string"},"messages":{"description":"The conversation so far; the last 20 messages are used and the last `user` message is the one to answer. Required unless `confirmed_cmd` is sent.","items":{"properties":{"content":{"description":"Message text; at most 12000 characters are used.","type":"string"},"role":{"description":"Author of the message. Other roles are ignored.","enum":["user","assistant"],"type":"string"}},"required":["role","content"],"type":"object","x-order":["role","content"]},"type":"array"},"session_id":{"description":"Conversation to continue, as returned by an earlier call or by [Get AI agent status](#operation/vm_ai_agent_status). Omit it, or send an unknown value, to start a new conversation.","type":"string"},"vm_context":{"properties":{"os":{"description":"Operating system name, to help the agent pick the right commands. Defaults to `Linux`.","type":"string"}},"type":"object"}},"type":"object","x-order":["messages","session_id","vm_context","auto_execute","confirmed_cmd"]}}},"required":true},"responses":{"200":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/AiAgentEvent"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_running","message":"The server is not active and running, so the agent cannot connect to it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is not active and running, so the agent cannot connect to it. (`vm_not_running`)","x-error-codes":[{"code":"vm_not_running","description":"The server is not active and running, so the agent cannot connect to it."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The AI agent is switched off for this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The AI agent is switched off for this site. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The AI agent is switched off for this site."}]}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Run AI SSH Agent (SSE stream)","tags":["Console and AI Agent"],"x-cli":"vm ai-agent run","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/ai-agent\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_execute\":false,\"messages\":[{\"content\":\"How much disk space is left?\",\"role\":\"user\"}],\"session_id\":\"ais_9b1d4c0a7e3f5a21c6d8\",\"vm_context\":{\"os\":\"Ubuntu 24.04\"}}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Chạy AI SSH Agent (SSE stream)"}},"/v1/vm/{id}/ai-agent/clear":{"post":{"description":"Starts a new, empty AI agent conversation for this server. The earlier conversation is kept but is no longer the one [Get AI agent status](#operation/vm_ai_agent_status) returns, so the agent forgets the previous context. Pass the returned `session_id` to [Run the AI agent](#operation/vm_ai_agent_run), or omit `session_id` there to start a fresh conversation automatically. No body is needed.\n\n**Required scope:** `vm:write`.","operationId":"vm_ai_agent_clear","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true,"session_id":"ais_5d2e8a1c7b3f9046e1a2"},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"},"session_id":{"description":"Identifier of the new conversation.","type":"string"}},"required":["ok","session_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Start a new AI SSH Agent session","tags":["Console and AI Agent"],"x-cli":"vm ai-agent clear","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/ai-agent/clear\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Tạo phiên hội thoại AI SSH Agent mới"}},"/v1/vm/{id}/ai-agent/status":{"get":{"description":"Returns whether the AI agent is enabled, the model it uses, and the most recent conversation you had with it about this server (up to the last 40 messages, oldest first). `session_id` is null and `messages` is empty when there is no conversation yet. Use `session_id` in [Run the AI agent](#operation/vm_ai_agent_run) to continue the conversation.\n\n**Required scope:** `vm:read`.","operationId":"vm_ai_agent_status","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"messages":[{"content":"How much disk space is left?","created_at":1792399000,"id":101,"meta":null,"role":"user"},{"content":"The root disk is 38% full.","created_at":1792399012,"id":102,"meta":{"model":"example-model-1","steps":[{"command":"df -h /","duration_ms":412,"error":"","exit_code":0,"id":"call_1","reason":"Check free disk space","status":"done","stderr":"","stdout":"Filesystem Size Used Avail Use% Mounted on\n/dev/vda1 40G 15G 25G 38% /\n","timed_out":false}]},"role":"assistant"}],"model":"example-model-1","provider":"AI Assistant","session_id":"ais_9b1d4c0a7e3f5a21c6d8"},"schema":{"properties":{"enabled":{"description":"Whether the AI agent is switched on for this site. When false, [Run the AI agent](#operation/vm_ai_agent_run) fails with `503 feature_disabled`.","type":"boolean"},"messages":{"items":{"$ref":"#/components/schemas/AiAgentMessage"},"type":"array"},"model":{"description":"Name of the model in use.","type":"string"},"provider":{"description":"Name of the AI service in use.","type":"string"},"session_id":{"description":"Identifier of the latest conversation for this server; null when there is none.","type":["string","null"]}},"required":["enabled","provider","model","session_id","messages"],"type":"object","x-order":["enabled","provider","model","session_id","messages"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"AI SSH Agent status and history","tags":["Console and AI Agent"],"x-cli":"vm ai-agent status","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/ai-agent/status\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Trạng thái & lịch sử AI SSH Agent"}},"/v1/vm/{id}/autoscale":{"get":{"description":"Returns the Auto Scaling rule of one server and its live state. Auto Scaling watches the CPU and RAM load of a server billed by the hour or on a prepaid cycle (a prepaid server keeps its plan and expiry; only the extra capacity is billed separately by the hour, see `extra`; a trial Black Friday server cannot use it): when the load stays above `rule.up_pct` for `rule.up_secs` seconds, the server grows to the `target` size and is billed at the target price; when the load stays below `rule.down_pct` for `rule.down_secs` seconds, billing falls back to the base price (`cooling`) while the larger size remains until the server is returned to its base size (see [Return to base size](#operation/vm_scale_revert)).\n\nWhen no rule was ever saved the defaults are returned with `enabled: false`. `blocked` lists what currently prevents Auto Scaling from working, and `feature` is false when the site does not sell it.\n\n**Required scope:** `vm:read`.","operationId":"vm_autoscale_get","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"balance_cents":2500,"base":{"cpu":2,"hourly_uusd":16460,"ram_mb":4096},"blocked":[],"caps":{"down_pct":[5,60],"down_secs":[300,7200],"max_cpu":8,"max_ram_mb":16384,"max_steps_day":4,"up_pct":[50,95],"up_secs":[120,1800]},"cooling_since":null,"current":{"cpu":2,"hourly_uusd":16460,"ram_mb":4096},"enabled":true,"extra":null,"feature":true,"last_error":null,"last_error_at":null,"pending_revert":false,"prepaid":false,"ram_stats_at":1790001150,"ram_used_mb":1900,"revert_at":null,"revert_available":false,"revert_manual":false,"revert_phase":null,"rule":{"down_pct":30,"down_secs":900,"up_pct":80,"up_secs":300},"state":"base","target":{"cpu":4,"hourly_uusd":32920,"monthly_cents":2403,"ram_mb":8192}},"schema":{"$ref":"#/components/schemas/AutoscaleState"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`autoscale`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`autoscale`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. (`not_supported_in_zone`)","x-error-codes":[{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`autoscale`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Auto Scaling rule and state of the VM","tags":["Scaling"],"x-cli":"vm autoscale get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/autoscale\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Luật Auto Scaling của máy và trạng thái"},"put":{"description":"Switches Auto Scaling on or off for a server and saves its rule. The call replaces the whole rule: tuning fields you leave out go back to their defaults (not to the previous values), and an omitted `enabled` means `false`. Saving a rule charges nothing; money is only charged when the server actually grows, at the price of the target size.\n\nTo enable, send `enabled: true` with `target_cpu` and `target_ram_mb`: the size to grow to, larger than the current size in at least one of the two and within the site ceiling (`caps.max_cpu`, `caps.max_ram_mb`). `up_pct`, `up_secs`, `down_pct` and `down_secs` are optional and are clamped into their allowed ranges (`caps`); `down_pct` must end up lower than `up_pct`. With `enabled: false` the other fields are ignored.\n\nAuto Scaling works only for servers billed by the hour, not running Windows, that have been restarted since live resizing became available and whose image can bring vCPUs online. The call answers with the new [Auto Scaling state](#operation/vm_autoscale_get). Limited to 20 requests per minute per account.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_autoscale_set","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"down_pct":30,"down_secs":900,"enabled":true,"target_cpu":4,"target_ram_mb":8192,"up_pct":80,"up_secs":300},"schema":{"properties":{"down_pct":{"description":"Consider the load gone when it stays at or below this percentage. Clamped to 5..60; default 30; must be lower than `up_pct`.","type":"integer"},"down_secs":{"description":"... for at least this many seconds. Clamped to 300..7200; default 900.","type":"integer"},"enabled":{"description":"`true` to switch Auto Scaling on, `false` to switch it off. Treated as `false` when omitted.","type":"boolean"},"target_cpu":{"description":"vCPU cores to grow to. Required when `enabled` is true.","type":"integer"},"target_ram_mb":{"description":"Memory in MiB to grow to; a multiple of 1024. Required when `enabled` is true.","type":"integer"},"up_pct":{"description":"Grow when the load stays at or above this percentage. Clamped to 50..95; default 80.","type":"integer"},"up_secs":{"description":"... for at least this many seconds. Clamped to 120..1800; default 300.","type":"integer"}},"required":["enabled"],"type":"object","x-order":["enabled","target_cpu","target_ram_mb","up_pct","up_secs","down_pct","down_secs"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"balance_cents":2500,"base":{"cpu":2,"hourly_uusd":16460,"ram_mb":4096},"blocked":[],"caps":{"down_pct":[5,60],"down_secs":[300,7200],"max_cpu":8,"max_ram_mb":16384,"max_steps_day":4,"up_pct":[50,95],"up_secs":[120,1800]},"cooling_since":null,"current":{"cpu":2,"hourly_uusd":16460,"ram_mb":4096},"enabled":true,"extra":null,"feature":true,"last_error":null,"last_error_at":null,"pending_revert":false,"prepaid":false,"ram_stats_at":null,"ram_used_mb":null,"revert_at":null,"revert_available":false,"revert_manual":false,"revert_phase":null,"rule":{"down_pct":30,"down_secs":900,"up_pct":80,"up_secs":300},"state":"base","target":{"cpu":4,"hourly_uusd":32920,"monthly_cents":2403,"ram_mb":8192}},"schema":{"$ref":"#/components/schemas/AutoscaleState"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`enabled` is true but `target_cpu` or `target_ram_mb` is missing or not a number."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `enabled` is true but `target_cpu` or `target_ram_mb` is missing or not a number. `bad_input`: The target is outside the limits of the site (`detail` explains which value and the allowed range). `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"`enabled` is true but `target_cpu` or `target_ram_mb` is missing or not a number."},{"code":"bad_input","description":"The target is outside the limits of the site (`detail` explains which value and the allowed range)."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"Prepaid server: your balance does not cover 24 hours of the extra capacity of the target size. The body carries `need_cents` and `balance_cents`; nothing is charged."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Prepaid server: your balance does not cover 24 hours of the extra capacity of the target size. The body carries `need_cents` and `balance_cents`; nothing is charged. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"Prepaid server: your balance does not cover 24 hours of the extra capacity of the target size. The body carries `need_cents` and `balance_cents`; nothing is charged."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `feature_disabled`: The site does not sell Auto Scaling. `quota_exceeded`: The target size would exceed your account resource quota. The body carries the usage, the limit and the next tier.","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Auto Scaling."},{"code":"quota_exceeded","description":"The target size would exceed your account resource quota. The body carries the usage, the limit and the next tier."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"needs_reboot","message":"The server must be restarted once before it can use Auto Scaling, or its image cannot bring added vCPUs online (`detail`: `template_no_cpu_hotplug`). Restart it with [Restart for scaling](#operation/vm_scale_reboot), or reinstall it from a current image."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`needs_reboot`: The server must be restarted once before it can use Auto Scaling, or its image cannot bring added vCPUs online (`detail`: `template_no_cpu_hotplug`). Restart it with [Restart for scaling](#operation/vm_scale_reboot), or reinstall it from a current image. `bf_locked`: A Black Friday trial server (or one with a pending refund) cannot use Auto Scaling; a paid Black Friday server can. `autoscale_renewal_due`: A prepaid server has expired: renew it first. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`autoscale`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"needs_reboot","description":"The server must be restarted once before it can use Auto Scaling, or its image cannot bring added vCPUs online (`detail`: `template_no_cpu_hotplug`). Restart it with [Restart for scaling](#operation/vm_scale_reboot), or reinstall it from a current image."},{"code":"bf_locked","description":"A Black Friday trial server (or one with a pending refund) cannot use Auto Scaling; a paid Black Friday server can."},{"code":"autoscale_renewal_due","description":"A prepaid server has expired: renew it first."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`autoscale`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"windows_unsupported","message":"Auto Scaling is not available for Windows servers."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`windows_unsupported`: Auto Scaling is not available for Windows servers. `ram_step`: `target_ram_mb` is not a multiple of 1024. `autoscale_target_too_low`: The target is not larger than the current size in vCPUs or RAM. The body carries `base_cpu` and `base_ram_mb`. `invalid_argument`: The target is above the site ceiling (the body carries `max_cpu` and `max_ram_mb`), or `down_pct` is not lower than `up_pct` (`field`: `down_pct`). `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"windows_unsupported","description":"Auto Scaling is not available for Windows servers."},{"code":"ram_step","description":"`target_ram_mb` is not a multiple of 1024."},{"code":"autoscale_target_too_low","description":"The target is not larger than the current size in vCPUs or RAM. The body carries `base_cpu` and `base_ram_mb`."},{"code":"invalid_argument","description":"The target is above the site ceiling (the body carries `max_cpu` and `max_ram_mb`), or `down_pct` is not lower than `up_pct` (`field`: `down_pct`)."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 20 requests in a minute for this account. The body carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 20 requests in a minute for this account. The body carries `retry_after` in seconds."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Enable/disable and set the Auto Scaling rule (grows the VM with load)","tags":["Scaling"],"x-cli":"vm autoscale set","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/vm/<id>/autoscale\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"down_pct\":30,\"down_secs\":900,\"enabled\":true,\"target_cpu\":4,\"target_ram_mb\":8192,\"up_pct\":80,\"up_secs\":300}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Bật/tắt và đặt luật Auto Scaling (tự nâng cấu hình theo tải)"}},"/v1/vm/{id}/backup":{"get":{"description":"Returns the backup status of one server in a single call: whether Backup is enabled, the automatic schedule, every backup that is kept, the price and what you can do right now. Use `meta.can_create` before asking for a new backup. `pending_job` is true while an enable, disable, create, delete or restore operation is still running on the server.\n\nFor a paged and sortable list of the backups only, use [List the backups of a VM](#operation/vm_backup_list).\n\n**Required scope:** `backup:read`.","operationId":"vm_backup_get","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"enabled":true,"items":[{"auto":false,"billable":true,"created_at":1792263600,"error_code":null,"free":false,"id":41,"interval_type":"DAILY","last_error":null,"name":"web-1-20261018-0200","paid_cents":3,"pinned":true,"rate_uusd":76,"size_bytes":2147483648,"size_gb":2.0,"status":"BackedUp","type":"FULL","uusd_per_hour":152,"virtual_size_bytes":26843545600}],"meta":{"can_create":true,"cents_per_month":11,"count":1,"hours_per_month":730,"keep_default":3,"max":10,"rate_uusd_gb_hour":76,"remaining":9,"total_size_bytes":2147483648,"uusd_per_hour":152,"vm_running":true},"pending_job":false,"schedule":{"day":null,"enabled":true,"hour":2,"interval_type":"DAILY","last_backup_at":1792263600,"max_backups":5,"minute":0,"schedule":"0:2","timezone":"Asia/Ho_Chi_Minh"}},"schema":{"properties":{"enabled":{"description":"Whether Backup is switched on for the server.","type":"boolean"},"items":{"description":"All backups kept for the server, newest first.","items":{"$ref":"#/components/schemas/Backup"},"type":"array"},"meta":{"properties":{"can_create":{"description":"Whether a backup can be created right now: Backup is enabled, the limit is not reached, no other operation is running and the server is active.","type":"boolean"},"cents_per_month":{"description":"The same cost over a month of `hours_per_month` hours, in US cents.","type":"integer"},"count":{"description":"Number of backups kept.","type":"integer"},"hours_per_month":{"description":"Hours in a billing month used for `cents_per_month` (730 by default).","type":"integer"},"keep_default":{"description":"Number of backups a schedule keeps when you do not choose `max_backups`.","type":"integer"},"max":{"description":"Maximum number of backups allowed per server on this site.","type":"integer"},"rate_uusd_gb_hour":{"description":"Current price per GB-hour of backup storage on this site, in millionths of a US dollar.","type":"integer"},"remaining":{"description":"How many more backups can be created (`max` minus `count`).","type":"integer"},"total_size_bytes":{"description":"Space used by all billed backups of the server, in bytes.","type":"integer"},"uusd_per_hour":{"description":"Current cost of all backups of the server, in millionths of a US dollar per hour.","type":"integer"},"vm_running":{"description":"Whether the server is running. A backup can only be created while it is.","type":"boolean"}},"required":["count","max","remaining","total_size_bytes","uusd_per_hour","cents_per_month","hours_per_month","rate_uusd_gb_hour","keep_default","can_create","vm_running"],"type":"object","x-order":["count","max","remaining","total_size_bytes","uusd_per_hour","cents_per_month","hours_per_month","rate_uusd_gb_hour","keep_default","can_create","vm_running"]},"pending_job":{"description":"Whether a backup operation is currently running on the server.","type":"boolean"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/BackupSchedule"},{"type":"null"}]}},"required":["enabled","schedule","items","meta","pending_job"],"type":"object","x-order":["enabled","schedule","items","meta","pending_job"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. (`not_supported_in_zone`)","x-error-codes":[{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:read"]}],"summary":"Backup status of one VM: schedule, kept backups, price","tags":["Backups"],"x-cli":"vm backup get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/backup\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"backup:read","x-summary-vi":"Trạng thái sao lưu của một máy: lịch, bản đang giữ, giá"}},"/v1/vm/{id}/backup/auto":{"put":{"description":"Sets how many rotating (not pinned) nightly backups are kept for the server. `keep` 1 is the default: one free copy. Every copy beyond the first is billed per GB-hour. Lowering `keep` deletes the oldest rotating backups at the next nightly cycle. The maximum is the per-server limit minus your pinned backups minus one. Fails with `501 feature_disabled` until the site switches nightly backups on.\n\n**Costs money** when you raise `keep`: the wallet balance must be positive. This operation requires an `Idempotency-Key` header.\n\n**Required scope:** `backup:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_auto_set","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"keep":2},"schema":{"properties":{"keep":{"description":"Number of rotating backups to keep, at least 1.","type":"integer"}},"required":["keep"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"changed":true,"keep":2,"keep_max":8},"schema":{"properties":{"changed":{"description":"`false` when the value was already set.","type":"boolean"},"keep":{"description":"The saved value.","type":"integer"},"keep_max":{"description":"The highest value allowed right now.","type":"integer"}},"required":["keep","keep_max","changed"],"type":"object","x-order":["keep","keep_max","changed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is zero or negative, so more billable copies cannot be kept."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is zero or negative, so more billable copies cannot be kept. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is zero or negative, so more billable copies cannot be kept."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_enabled","message":"Backup is not enabled for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_enabled`: Backup is not enabled for this server. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_enabled","description":"Backup is not enabled for this server."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`keep` is missing or outside 1..`max` (the response includes the range)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `keep` is missing or outside 1..`max` (the response includes the range). `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`keep` is missing or outside 1..`max` (the response includes the range)."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Set how many nightly backups are kept (extra copies are billed)","tags":["Backups"],"x-cli":"vm backup auto set","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/vm/<id>/backup/auto\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"keep\":2}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:write","x-summary-vi":"Đặt số bản sao lưu hằng đêm được giữ (giữ thêm tính tiền)"}},"/v1/vm/{id}/backup/disable":{"post":{"description":"Switches Backup off for the server. All backups of the server must be deleted first (see [Delete a backup](#operation/vm_backup_delete)); otherwise the call fails with `backups_exist`. Switching it off also stops the schedule. The change runs in the background and returns a `job_id`.\n\nThis operation requires an `Idempotency-Key` header.\n\n**Required scope:** `backup:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_disable","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":8813},"schema":{"$ref":"#/components/schemas/BackupJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_enabled","message":"Backup is not enabled for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_enabled`: Backup is not enabled for this server. `backups_exist`: The server still has backups. Delete every backup before switching Backup off. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_enabled","description":"Backup is not enabled for this server."},{"code":"backups_exist","description":"The server still has backups. Delete every backup before switching Backup off."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Disable backup (only when no backups remain)","tags":["Backups"],"x-cli":"vm backup disable","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/backup/disable\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:write","x-summary-vi":"Tắt sao lưu (chỉ khi không còn bản nào)"}},"/v1/vm/{id}/backup/enable":{"post":{"description":"Switches Backup on for the server, which is required before any backup or schedule can be created. Switching it on costs nothing by itself; you are billed only for backups that exist, per GB-hour of the space they use. The change runs in the background and returns a `job_id`; follow it with the VM jobs call or poll [Get the backup status of a VM](#operation/vm_backup_get) until `enabled` is true.\n\nThis operation requires an `Idempotency-Key` header so a retry never queues it twice.\n\n**Required scope:** `backup:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_enable","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":8812},"schema":{"$ref":"#/components/schemas/BackupJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"already_enabled","message":"Backup is already enabled for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`already_enabled`: Backup is already enabled for this server. `vm_not_ready`: The server has not finished being created, so Backup cannot be attached yet. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"already_enabled","description":"Backup is already enabled for this server."},{"code":"vm_not_ready","description":"The server has not finished being created, so Backup cannot be attached yet."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Enable backup for the VM (storage is billed)","tags":["Backups"],"x-cli":"vm backup enable","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/backup/enable\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:write","x-summary-vi":"Bật sao lưu cho máy (lưu trữ tính tiền)"}},"/v1/vm/{id}/backup/schedule":{"delete":{"description":"Removes the automatic schedule of the server. Backups that already exist are kept (and keep being billed until you delete them), and Backup stays enabled so you can still create backups by hand. Removing a schedule that is not set succeeds and returns `schedule: null`.\n\n**Required scope:** `backup:write`.","operationId":"vm_backup_schedule_delete","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"schedule":null},"schema":{"properties":{"schedule":{"anyOf":[{"$ref":"#/components/schemas/BackupSchedule"},{"type":"null"}]}},"required":["schedule"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_enabled","message":"Backup is not enabled for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_enabled`: Backup is not enabled for this server. `vm_not_ready`: The server has not finished being created. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"not_enabled","description":"Backup is not enabled for this server."},{"code":"vm_not_ready","description":"The server has not finished being created."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Remove the backup schedule (existing backups are kept)","tags":["Backups"],"x-cli":"vm backup schedule delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/backup/schedule\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"backup:write","x-summary-vi":"Tắt lịch sao lưu (giữ các bản đã có)"},"put":{"description":"Sets the automatic backup schedule of the server, replacing the previous one (a server has at most one schedule). The call is synchronous and returns the new schedule. Scheduled backups are billed like manual ones; the oldest scheduled backups are removed automatically so that no more than `max_backups` are kept.\n\n`minute` is always used (0 to 59). `hour` (0 to 23) is used by DAILY, WEEKLY and MONTHLY and has no effect on HOURLY, but a value outside 0 to 23 is rejected for every interval. `day` is required for WEEKLY (1 to 7, 1 = Monday) and MONTHLY (1 to 28) and ignored otherwise. Times are in the `timezone` reported by [Get the backup status of a VM](#operation/vm_backup_get). Backup must be enabled first.\n\n**Required scope:** `backup:write`.","operationId":"vm_backup_schedule_set","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"hour":2,"interval_type":"DAILY","max_backups":5,"minute":0},"schema":{"properties":{"day":{"description":"Day of the week (1 to 7, WEEKLY) or day of the month (1 to 28, MONTHLY). Defaults to 0, which is rejected for WEEKLY and MONTHLY.","type":"integer"},"hour":{"description":"Hour of the day, 0 to 23. Defaults to 0.","type":"integer"},"interval_type":{"description":"How often a backup is taken.","enum":["HOURLY","DAILY","WEEKLY","MONTHLY"],"type":"string"},"max_backups":{"description":"How many scheduled backups to keep, from 1 up to the site maximum per server (values outside the range are clamped). Defaults to the current setting of the server.","type":"integer"},"minute":{"description":"Minute of the hour, 0 to 59. Defaults to 0.","type":"integer"}},"required":["interval_type"],"type":"object","x-order":["interval_type","minute","hour","day","max_backups"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"schedule":{"day":null,"enabled":true,"hour":2,"interval_type":"DAILY","last_backup_at":null,"max_backups":5,"minute":0,"schedule":"0:2","timezone":"Asia/Ho_Chi_Minh"}},"schema":{"properties":{"schedule":{"$ref":"#/components/schemas/BackupSchedule"}},"required":["schedule"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON or a field has the wrong type."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is not valid JSON or a field has the wrong type. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON or a field has the wrong type."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_enabled","message":"Backup is not enabled for this server. Enable it first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_enabled`: Backup is not enabled for this server. Enable it first. `vm_not_ready`: The server has not finished being created. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"not_enabled","description":"Backup is not enabled for this server. Enable it first."},{"code":"vm_not_ready","description":"The server has not finished being created."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A schedule field is out of range. The response field `field` names it: `bad_interval` (unknown `interval_type`), `bad_time` (`minute` or `hour` out of range) or `bad_day` (`day` missing or out of range for WEEKLY and MONTHLY)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A schedule field is out of range. The response field `field` names it: `bad_interval` (unknown `interval_type`), `bad_time` (`minute` or `hour` out of range) or `bad_day` (`day` missing or out of range for WEEKLY and MONTHLY). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A schedule field is out of range. The response field `field` names it: `bad_interval` (unknown `interval_type`), `bad_time` (`minute` or `hour` out of range) or `bad_day` (`day` missing or out of range for WEEKLY and MONTHLY)."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The backup service could not apply the schedule. Nothing was changed; retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The backup service could not apply the schedule. Nothing was changed; retry later. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The backup service could not apply the schedule. Nothing was changed; retry later."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Set the automatic backup schedule","tags":["Backups"],"x-cli":"vm backup schedule set","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/vm/<id>/backup/schedule\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hour\":2,\"interval_type\":\"DAILY\",\"max_backups\":5,\"minute\":0}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"backup:write","x-summary-vi":"Đặt lịch sao lưu tự động"}},"/v1/vm/{id}/backups":{"get":{"description":"Lists the backups of one server with paging and sorting. Backups that were deleted are not shown. The paging details are in `meta` (this list has no top-level `total`, `page` or `per_page`). For an overview that also includes the schedule and the price, use [Get the backup status of a VM](#operation/vm_backup_get).\n\n**Required scope:** `backup:read`.","operationId":"vm_backup_list","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","name","size_bytes","status","interval_type"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"auto":false,"billable":true,"created_at":1792263600,"error_code":null,"free":false,"id":41,"interval_type":"DAILY","last_error":null,"name":"web-1-20261018-0200","paid_cents":3,"pinned":true,"rate_uusd":76,"size_bytes":2147483648,"size_gb":2.0,"status":"BackedUp","type":"FULL","uusd_per_hour":152,"virtual_size_bytes":26843545600}],"meta":{"dir":"desc","last_page":1,"page":1,"per_page":20,"sort":"created_at","total":1}},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Backup"},"type":"array"},"meta":{"properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"last_page":{"description":"Number of the last page.","type":"integer"},"page":{"description":"Current page (1-based).","type":"integer"},"per_page":{"description":"Page size applied (clamped to 100).","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"total":{"description":"Total number of backups of the server.","type":"integer"}},"required":["total","page","per_page","last_page","sort","dir"],"type":"object","x-order":["total","page","per_page","last_page","sort","dir"]}},"required":["items","meta"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. (`not_supported_in_zone`)","x-error-codes":[{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:read"]}],"summary":"Backups of one VM (paged, sortable)","tags":["Backups"],"x-cli":"vm backup list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/backups\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"backup:read","x-summary-vi":"Bản sao lưu của một máy (phân trang, sắp xếp)"},"post":{"description":"Creates a backup of the server now. The server must be running and Backup must be enabled. The backup is created in the background: the call returns a `job_id` immediately and the backup appears in the list with status `BackingUp`, then `BackedUp` when it is ready. Find it with [List the backups of a VM](#operation/vm_backup_list); the response does not contain its id.\n\n**Costs money.** From the moment the backup is ready you are billed per GB-hour of the space it really uses (see `rate_uusd`), taken from the wallet balance until you delete it. If the wallet balance is zero or negative the call fails with `insufficient_funds`. This operation requires an `Idempotency-Key` header so a retry never creates two backups.\n\n**Required scope:** `backup:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_create","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"name":"before-upgrade"},"schema":{"properties":{"name":{"description":"Name for the backup. Only letters, digits, spaces and `- _ .` are kept, at most 60 characters. When empty, the name is `<hostname>-<date>-<time>`.","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":8814},"schema":{"$ref":"#/components/schemas/BackupJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The request body is not valid JSON or a field has the wrong type."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The request body is not valid JSON or a field has the wrong type. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The request body is not valid JSON or a field has the wrong type."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is zero or negative, so no new billable backup can be created. Top up the wallet and retry. The response includes `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is zero or negative, so no new billable backup can be created. Top up the wallet and retry. The response includes `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is zero or negative, so no new billable backup can be created. Top up the wallet and retry. The response includes `balance_cents`."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_running","message":"The server must be running to take a backup. The response includes its current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_running`: The server must be running to take a backup. The response includes its current `state`. `not_enabled`: Backup is not enabled for this server. Enable it first. `backup_limit`: The server already has the maximum number of backups. The response includes the `limit`. Delete one first. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_running","description":"The server must be running to take a backup. The response includes its current `state`."},{"code":"not_enabled","description":"Backup is not enabled for this server. Enable it first."},{"code":"backup_limit","description":"The server already has the maximum number of backups. The response includes the `limit`. Delete one first."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Create a backup now (storage is billed)","tags":["Backups"],"x-cli":"vm backup create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/backups\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"before-upgrade\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:write","x-summary-vi":"Tạo bản sao lưu ngay (lưu trữ tính tiền)"}},"/v1/vm/{id}/backups/{bid}":{"delete":{"description":"Deletes one backup permanently. It cannot be undone. Billing for the backup stops as soon as the deletion starts. The deletion runs in the background and returns a `job_id`; a backup that never finished being created is removed immediately and the response is `deleted: true` with a null `job_id`. A backup that is being restored or deleted cannot be deleted again.\n\n**Required scope:** `backup:write`.","operationId":"vm_backup_delete","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Backup identifier (integer) as returned by the list operations.","in":"path","name":"bid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":8815},"schema":{"properties":{"deleted":{"description":"`true` only when the backup was removed immediately (no background job).","type":"boolean"},"job_id":{"description":"Background job that deletes the backup, or `null` when the backup was removed immediately.","type":["integer","null"]}},"required":["job_id"],"type":"object","x-order":["job_id","deleted"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"backup_busy","message":"The backup is being restored or deleted. Wait for that to finish."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`backup_busy`: The backup is being restored or deleted. Wait for that to finish. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"backup_busy","description":"The backup is being restored or deleted. Wait for that to finish."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Delete one backup","tags":["Backups"],"x-cli":"vm backup delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/backups/<bid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"backup:write","x-summary-vi":"Xoá một bản sao lưu"}},"/v1/vm/{id}/backups/{bid}/pin":{"post":{"description":"Keeps a backup: the nightly rotation never deletes a pinned backup, and it is billed per GB-hour like any other backup. Pinning a backup that is already pinned succeeds with `changed: false`. Only a backup with status `BackedUp` can be pinned. The nightly backup must be switched on by the site, otherwise the call fails with `501 feature_disabled`.\n\n**Costs money.** The free copy is the newest backup that is not pinned; pinning it starts billing. If the wallet balance is zero or negative the call fails with `insufficient_funds`. This operation requires an `Idempotency-Key` header.\n\n**Required scope:** `backup:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_pin","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Backup identifier (integer) as returned by the list operations.","in":"path","name":"bid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"changed":true,"id":91,"pinned":true},"schema":{"properties":{"changed":{"description":"`false` when the backup was already in that state.","type":"boolean"},"id":{"description":"Backup identifier.","type":"integer"},"pinned":{"description":"The new pinned state.","type":"boolean"}},"required":["id","pinned","changed"],"type":"object","x-order":["id","pinned","changed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is zero or negative. Top up and retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is zero or negative. Top up and retry. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is zero or negative. Top up and retry."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The backup does not exist on this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The backup does not exist on this server. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The backup does not exist on this server."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"backup_busy","message":"The backup is not in the `BackedUp` state (it is being created, restored or deleted)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`backup_busy`: The backup is not in the `BackedUp` state (it is being created, restored or deleted). `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"backup_busy","description":"The backup is not in the `BackedUp` state (it is being created, restored or deleted)."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Pin a backup (never rotated away, billed)","tags":["Backups"],"x-cli":"vm backup pin","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/backups/<bid>/pin\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:write","x-summary-vi":"Giữ một bản sao lưu (không bị xoay vòng xoá, tính tiền)"}},"/v1/vm/{id}/backups/{bid}/restore":{"post":{"description":"Restores the server from a backup, in place. **This overwrites the server disk**: everything written after the backup was taken is lost. A running server is stopped, its disk is replaced with the contents of the backup and it is started again; a server that was already stopped stays stopped. It takes roughly 11 minutes for a 20 GB disk and longer for bigger disks, and the call returns a `job_id` straight away. The backup itself is kept.\n\nOnly a backup with status `BackedUp` can be restored. This operation needs the separate scope `backup:restore` and an `Idempotency-Key` header. Take a fresh backup first if you may need the current state.\n\n**Required scope:** `backup:restore`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_restore","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Backup identifier (integer) as returned by the list operations.","in":"path","name":"bid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":8816},"schema":{"$ref":"#/components/schemas/BackupJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"backup_not_ready","message":"Only a backup with status `BackedUp` can be restored. The response includes the backup's current `status`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`backup_not_ready`: Only a backup with status `BackedUp` can be restored. The response includes the backup's current `status`. `vm_not_active`: The server is not in the `active` state, for example it is still being created. The response includes the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"backup_not_ready","description":"Only a backup with status `BackedUp` can be restored. The response includes the backup's current `status`."},{"code":"vm_not_active","description":"The server is not in the `active` state, for example it is still being created. The response includes the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish (see the VM jobs call) and retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (for example for lack of funds) and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (for example for lack of funds) and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (for example for lack of funds) and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:restore"]}],"summary":"Restore the VM from a backup (stops, overwrites the disk, restarts)","tags":["Backups"],"x-cli":"vm backup restore","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/backups/<bid>/restore\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:restore","x-summary-vi":"Khôi phục máy từ bản sao lưu (tắt máy, ghi đè đĩa, bật lại)"}},"/v1/vm/{id}/backups/{bid}/unpin":{"post":{"description":"Puts a backup back into the nightly rotation. It is deleted automatically once newer nightly backups exceed the number you keep (see [Set how many backups to keep](#operation/vm_backup_auto_set)). The newest unpinned backup is the free copy. Unpinning a backup that is not pinned succeeds with `changed: false`. This operation requires an `Idempotency-Key` header.\n\n**Required scope:** `backup:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_backup_unpin","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Backup identifier (integer) as returned by the list operations.","in":"path","name":"bid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"changed":true,"id":91,"pinned":false},"schema":{"properties":{"changed":{"description":"`false` when the backup was already in that state.","type":"boolean"},"id":{"description":"Backup identifier.","type":"integer"},"pinned":{"description":"The new pinned state.","type":"boolean"}},"required":["id","pinned","changed"],"type":"object","x-order":["id","pinned","changed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The backup does not exist on this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The backup does not exist on this server. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The backup does not exist on this server."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"backup_busy","message":"The backup is not in the `BackedUp` state."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`backup_busy`: The backup is not in the `BackedUp` state. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"backup_busy","description":"The backup is not in the `BackedUp` state."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`backup`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked and cannot be changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked and cannot be changed. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked and cannot be changed."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Backup (or has not set it up yet)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Backup (or has not set it up yet). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Backup (or has not set it up yet)."}]}},"security":[{"bearerAuth":["backup:write"]}],"summary":"Unpin a backup (back into the nightly rotation)","tags":["Backups"],"x-cli":"vm backup unpin","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/backups/<bid>/unpin\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"backup:write","x-summary-vi":"Bỏ giữ một bản sao lưu (vào vòng xoay hằng đêm)"}},"/v1/vm/{id}/bandwidth":{"get":{"description":"Returns the traffic of the server as a time series (bytes) together with the monthly bandwidth quota. `in` is traffic into the server, `out` is traffic leaving it.\n\nWith `range=1h` the points are 5-second live samples (`source` is `edge_live`); longer ranges are hourly (`6h`, `12h`, `24h`) or daily (`7d`, `30d`) totals. Pass both `from` and `to` to choose an exact window of at most 31 days. `quota` and `period` describe the current quota month, which is anchored on the hour the server was created; they are null when the server has no quota record. `bw` is the same object as Get a service's bandwidth.\n\n**Required scope:** `vm:read`.","operationId":"vm_bandwidth","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Window ending now. Unknown values fall back to the default.","in":"query","name":"range","required":false,"schema":{"default":"24h","enum":["1h","6h","12h","24h","7d","30d"],"type":"string"}},{"description":"Start of an explicit window, Unix seconds. Used only together with `to`, and only when `to` is later than `from` and the window is at most 31 days; otherwise `range` applies.","in":"query","name":"from","required":false,"schema":{"type":"integer"}},{"description":"End of an explicit window, Unix seconds. See `from`.","in":"query","name":"to","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"bucket":"hour","bw":null,"from":1792281600,"peak":{"at":1792360800,"total":70500000},"period":{"end":1793545200,"in":27600000,"kind":"anchored_month","out":83900000,"start":1790953200,"total":111500000},"points":[{"in":18400000,"out":52100000,"t":1792360800,"total":70500000},{"in":9200000,"out":31800000,"t":1792364400,"total":41000000}],"port_speed":"10 Gbps","quota":{"limit_bytes":2199023255552,"period_end":1793545200,"period_start":1790953200,"used_bytes":111500000,"used_in":27600000,"used_out":83900000},"range":"24h","source":"edge_flow","to":1792368000,"totals":{"in":27600000,"out":83900000,"total":111500000}},"schema":{"properties":{"bucket":{"description":"Size of the points: `raw` (5-second samples), `hour` or `day`.","enum":["raw","hour","day"],"type":"string"},"bw":{"additionalProperties":true,"description":"Full bandwidth record of the server (quota, add-ons, usage). Same shape as the response of Get a service's bandwidth.","type":["object","null"]},"from":{"description":"Start of the window (Unix time, seconds, UTC)","type":"integer"},"peak":{"properties":{"at":{"description":"Start of the busiest bucket (Unix time, seconds, UTC)","type":"integer"},"total":{"description":"Largest bucket total, in bytes.","type":"integer"}},"required":["total","at"],"type":"object","x-order":["total","at"]},"period":{"properties":{"end":{"description":"End of the quota month (Unix time, seconds, UTC)","type":"integer"},"in":{"description":"Bytes received in the quota month.","type":"integer"},"kind":{"description":"How the month is defined, for example `anchored_month`.","type":"string"},"out":{"description":"Bytes sent in the quota month.","type":"integer"},"start":{"description":"Start of the quota month (Unix time, seconds, UTC)","type":"integer"},"total":{"description":"`in` + `out` in the quota month.","type":"integer"}},"required":["start","end","in","out","total","kind"],"type":["object","null"],"x-order":["start","end","in","out","total","kind"]},"points":{"items":{"properties":{"in":{"description":"Bytes received by the server in the bucket.","type":"integer"},"out":{"description":"Bytes sent by the server in the bucket.","type":"integer"},"t":{"description":"Start of the bucket (Unix time, seconds, UTC)","type":"integer"},"total":{"description":"`in` + `out`.","type":"integer"}},"required":["t","in","out","total"],"type":"object","x-order":["t","in","out","total"]},"type":"array"},"port_speed":{"description":"Network port speed of the site, for example `10 Gbps`.","type":"string"},"quota":{"properties":{"limit_bytes":{"description":"Bytes allowed in the quota month (monthly allowance plus purchased add-ons).","type":"integer"},"period_end":{"description":"End of the quota month (Unix time, seconds, UTC)","type":"integer"},"period_start":{"description":"Start of the quota month (Unix time, seconds, UTC)","type":"integer"},"used_bytes":{"description":"Bytes counted against the quota so far.","type":"integer"},"used_in":{"description":"Bytes received in the quota month.","type":"integer"},"used_out":{"description":"Bytes sent in the quota month.","type":"integer"}},"required":["limit_bytes","used_bytes","used_in","used_out","period_start","period_end"],"type":["object","null"],"x-order":["limit_bytes","used_bytes","used_in","used_out","period_start","period_end"]},"range":{"description":"Range that was applied.","type":"string"},"source":{"description":"Where the points come from: `edge_live` for 5-second samples, `edge_flow` for hourly and daily totals.","enum":["edge_live","edge_flow"],"type":"string"},"to":{"description":"End of the window (Unix time, seconds, UTC)","type":"integer"},"totals":{"properties":{"in":{"description":"Bytes received over the window.","type":"integer"},"out":{"description":"Bytes sent over the window.","type":"integer"},"total":{"description":"`in` + `out` over the window.","type":"integer"}},"required":["in","out","total"],"type":"object"}},"required":["points","totals","peak","bucket","range","from","to","quota","period","bw","source","port_speed"],"type":"object","x-order":["points","totals","peak","bucket","range","from","to","quota","period","bw","source","port_speed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Bandwidth usage","tags":["Virtual Machines"],"x-cli":"vm bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Lưu lượng đã dùng"}},"/v1/vm/{id}/billing":{"get":{"description":"Returns the billing state of one server: price, billing cycle, how far it is paid, your wallet balance, and the wallet charges and invoices that belong to this server. `charges` holds up to the 200 latest wallet entries linked to the server (newest first) and `invoices` up to the 100 latest invoices. If the server was transferred to you, invoices of earlier owners are included with `previous_owner: true` and their personal fields redacted.\n\nFor the account-wide wallet and invoices use the Billing endpoints.\n\n**Required scope:** `vm:read`.","operationId":"vm_billing","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"auto_renew":true,"balance_cents":2157,"billed_until":null,"charges":[{"account_id":1042,"actor":"customer:1042","at":1792368000,"delta_cents":-343,"id":5531,"kind":"charge","note":"New VM web-01 (monthly)","ref":"vm:new:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"cycle":"monthly","cycle_cents":343,"cycle_started_at":1792368000,"hourly":"$0.005","hourly_mills":5,"invoices":[{"account_id":1042,"buyer_json":"{}","created_at":1792368000,"currency":"usd","due_at":null,"id":311,"kind":"receipt","ledger_ref":"vm:new:3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","note":null,"number":"EX202610-000042","paid_at":1792368000,"seller_json":"{}","status":"paid","subtotal_cents":343,"total_cents":343,"updated_at":1792368000,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"monthly_cents":343,"paid_until":1794960000},"schema":{"properties":{"auto_renew":{"description":"Whether a prepaid server renews automatically from the wallet.","type":"boolean"},"balance_cents":{"description":"Wallet balance in US cents.","type":"integer"},"billed_until":{"description":"End of the hour already billed. null for prepaid servers (Unix time, seconds, UTC)","type":["integer","null"]},"charges":{"items":{"$ref":"#/components/schemas/VmLedgerEntry"},"type":"array"},"cycle":{"description":"Billing cycle slug.","type":"string"},"cycle_cents":{"description":"Price of one billing cycle in US cents, as locked in for the current period. 0 for hourly servers.","type":"integer"},"cycle_started_at":{"description":"Start of the current billing cycle (Unix time, seconds, UTC)","type":["integer","null"]},"hourly":{"description":"Hourly price as a decimal string, for example `$0.005`.","type":"string"},"hourly_mills":{"description":"Hourly price in mills (US$0.001), rounded.","type":"integer"},"invoices":{"items":{"$ref":"#/components/schemas/VmInvoice"},"type":"array"},"monthly_cents":{"description":"Price of a 30-day month (730 hours) in US cents, at the hourly price.","type":"integer"},"paid_until":{"description":"End of the paid period. null for hourly servers (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["cycle","hourly_mills","hourly","monthly_cents","cycle_cents","cycle_started_at","paid_until","billed_until","auto_renew","balance_cents","charges","invoices"],"type":"object","x-order":["cycle","hourly_mills","hourly","monthly_cents","cycle_cents","cycle_started_at","paid_until","billed_until","auto_renew","balance_cents","charges","invoices"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Billing of this VM","tags":["Virtual Machines"],"x-cli":"vm billing","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/billing\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Chi phí của riêng máy này"}},"/v1/vm/{id}/byoip":{"get":{"description":"Own-IP state of a VM: whether it can be attached, the attachment, and the commands/netplan to configure each active prefix inside the VM (policy routing keeps the main default route of the VM).\n\n**Required scope:** `byoip:read`.","operationId":"vm_byoip_get","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"attachment":null,"can_attach":true,"can_detach":false,"eligible":true,"enabled":true,"l2_ready":true,"network_ready":true,"prefixes":[{"family":4,"gateway":"45.12.34.1","id":12,"kind":"own","prefix":"45.12.34.0/24","setup":{"commands":["IF=$(ip -br link | awk '$3==\"02:00:aa:bb:cc:01\" {sub(/@.*/,\"\",$1); print $1}')","ip link set dev \"$IF\" mtu 1450 up","ip addr add 45.12.34.2/24 dev \"$IF\"","ip route replace default via 45.12.34.1 dev \"$IF\" table 100","ip rule add from 45.12.34.0/24 table 100"],"example_ip":"45.12.34.2","gateway":"45.12.34.1","mac":"02:00:aa:bb:cc:01","mtu":1450}}],"zone_ok":true},"schema":{"properties":{"attachment":{"additionalProperties":true,"description":"Attachment state of this VM: `attaching`, `attached`, `detaching`, `failed`, plus `mac`.","type":["object","null"]},"can_attach":{"description":"Attach is possible now (false while VM targets are not open).","type":"boolean"},"can_detach":{"description":"Detach is possible now.","type":"boolean"},"eligible":{"description":"This VM can receive the own-IP NIC (running VM).","type":"boolean"},"enabled":{"description":"The site sells Bring Your Own IP.","type":"boolean"},"l2_ready":{"description":"`false` = VM targets are not open for own IP prefixes yet.","type":"boolean"},"network_ready":{"description":"Your private own-IP network exists.","type":"boolean"},"prefixes":{"items":{"additionalProperties":true,"description":"Active prefix with gateway and `setup` (commands + netplan, policy routing). The in-VM card is found by the MAC of the own-IP NIC (`setup.mac`), never a fixed name like eth1.","type":"object"},"type":"array"},"zone_ok":{"description":"VM in the platform BGP zone (Ho Chi Minh City).","type":"boolean"}},"required":["enabled","eligible","zone_ok","network_ready","attachment","prefixes","can_attach","l2_ready","can_detach"],"type":"object","x-order":["enabled","eligible","zone_ok","network_ready","attachment","prefixes","can_attach","l2_ready","can_detach"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:read"]}],"summary":"Own-IP attachment of a VM and sample configuration","tags":["Bring Your Own IP"],"x-cli":"vm byoip get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/byoip\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"byoip:read","x-summary-vi":"Trạng thái gắn dải IP riêng của VM + lệnh cấu hình mẫu"}},"/v1/vm/{id}/byoip/attach":{"post":{"description":"Adds a second NIC on your private own-IP network to the running VM (hot-plug). Then configure the addresses shown in `prefixes[].setup`. Requires `Idempotency-Key`; 10 attach/detach per minute.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_byoip_attach","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"attachment":null,"can_attach":true,"can_detach":false,"eligible":true,"enabled":true,"l2_ready":true,"network_ready":true,"prefixes":[{"family":4,"gateway":"45.12.34.1","id":12,"kind":"own","prefix":"45.12.34.0/24","setup":{"commands":["IF=$(ip -br link | awk '$3==\"02:00:aa:bb:cc:01\" {sub(/@.*/,\"\",$1); print $1}')","ip link set dev \"$IF\" mtu 1450 up","ip addr add 45.12.34.2/24 dev \"$IF\"","ip route replace default via 45.12.34.1 dev \"$IF\" table 100","ip rule add from 45.12.34.0/24 table 100"],"example_ip":"45.12.34.2","gateway":"45.12.34.1","mac":"02:00:aa:bb:cc:01","mtu":1450}}],"zone_ok":true},"schema":{"properties":{"attachment":{"additionalProperties":true,"description":"Attachment state of this VM: `attaching`, `attached`, `detaching`, `failed`, plus `mac`.","type":["object","null"]},"can_attach":{"description":"Attach is possible now (false while VM targets are not open).","type":"boolean"},"can_detach":{"description":"Detach is possible now.","type":"boolean"},"eligible":{"description":"This VM can receive the own-IP NIC (running VM).","type":"boolean"},"enabled":{"description":"The site sells Bring Your Own IP.","type":"boolean"},"l2_ready":{"description":"`false` = VM targets are not open for own IP prefixes yet.","type":"boolean"},"network_ready":{"description":"Your private own-IP network exists.","type":"boolean"},"prefixes":{"items":{"additionalProperties":true,"description":"Active prefix with gateway and `setup` (commands + netplan, policy routing). The in-VM card is found by the MAC of the own-IP NIC (`setup.mac`), never a fixed name like eth1.","type":"object"},"type":"array"},"zone_ok":{"description":"VM in the platform BGP zone (Ho Chi Minh City).","type":"boolean"}},"required":["enabled","eligible","zone_ok","network_ready","attachment","prefixes","can_attach","l2_ready","can_detach"],"type":"object","x-order":["enabled","eligible","zone_ok","network_ready","attachment","prefixes","can_attach","l2_ready","can_detach"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"already_attached","message":"The VM is already attached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`already_attached`: The VM is already attached. `vm_not_eligible`: The VM must be running. `l2_not_ready`: VM targets are not open yet; the VM cannot take the prefix now. `no_byoip_network`: You have no active prefix yet. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"already_attached","description":"The VM is already attached."},{"code":"vm_not_eligible","description":"The VM must be running."},{"code":"l2_not_ready","description":"VM targets are not open yet; the VM cannot take the prefix now."},{"code":"no_byoip_network","description":"You have no active prefix yet."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"byoip_unavailable","message":"Bring Your Own IP is not available on this site yet."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bring Your Own IP is not available on this site yet. (`byoip_unavailable`)","x-error-codes":[{"code":"byoip_unavailable","description":"Bring Your Own IP is not available on this site yet."}]}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Attach your own-IP network to a VM (adds a NIC)","tags":["Bring Your Own IP"],"x-cli":"vm byoip attach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/byoip/attach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Gắn mạng dải IP riêng vào VM (thêm NIC)"}},"/v1/vm/{id}/byoip/detach":{"post":{"description":"Removes the own-IP NIC from the VM. Requires `Idempotency-Key`.\n\n**Required scope:** `byoip:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_byoip_detach","parameters":[{"description":"Prefix identifier (integer) — for `/v1/vm/:id/byoip…` it is the VM UUID.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"attachment":null,"can_attach":true,"can_detach":false,"eligible":true,"enabled":true,"l2_ready":true,"network_ready":true,"prefixes":[{"family":4,"gateway":"45.12.34.1","id":12,"kind":"own","prefix":"45.12.34.0/24","setup":{"commands":["IF=$(ip -br link | awk '$3==\"02:00:aa:bb:cc:01\" {sub(/@.*/,\"\",$1); print $1}')","ip link set dev \"$IF\" mtu 1450 up","ip addr add 45.12.34.2/24 dev \"$IF\"","ip route replace default via 45.12.34.1 dev \"$IF\" table 100","ip rule add from 45.12.34.0/24 table 100"],"example_ip":"45.12.34.2","gateway":"45.12.34.1","mac":"02:00:aa:bb:cc:01","mtu":1450}}],"zone_ok":true},"schema":{"properties":{"attachment":{"additionalProperties":true,"description":"Attachment state of this VM: `attaching`, `attached`, `detaching`, `failed`, plus `mac`.","type":["object","null"]},"can_attach":{"description":"Attach is possible now (false while VM targets are not open).","type":"boolean"},"can_detach":{"description":"Detach is possible now.","type":"boolean"},"eligible":{"description":"This VM can receive the own-IP NIC (running VM).","type":"boolean"},"enabled":{"description":"The site sells Bring Your Own IP.","type":"boolean"},"l2_ready":{"description":"`false` = VM targets are not open for own IP prefixes yet.","type":"boolean"},"network_ready":{"description":"Your private own-IP network exists.","type":"boolean"},"prefixes":{"items":{"additionalProperties":true,"description":"Active prefix with gateway and `setup` (commands + netplan, policy routing). The in-VM card is found by the MAC of the own-IP NIC (`setup.mac`), never a fixed name like eth1.","type":"object"},"type":"array"},"zone_ok":{"description":"VM in the platform BGP zone (Ho Chi Minh City).","type":"boolean"}},"required":["enabled","eligible","zone_ok","network_ready","attachment","prefixes","can_attach","l2_ready","can_detach"],"type":"object","x-order":["enabled","eligible","zone_ok","network_ready","attachment","prefixes","can_attach","l2_ready","can_detach"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_attached","message":"The VM is not attached."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_attached`: The VM is not attached. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_attached","description":"The VM is not attached."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["byoip:write"]}],"summary":"Detach your own-IP network from a VM","tags":["Bring Your Own IP"],"x-cli":"vm byoip detach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/byoip/detach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"byoip:write","x-summary-vi":"Gỡ mạng dải IP riêng khỏi VM"}},"/v1/vm/{id}/change-custom":{"post":{"description":"Resizes a server that runs a custom configuration: change its vCPU count, memory and disk. CPU and memory can go up or down; the disk can only grow, in steps of the site's disk step. Only the values you change are checked against the site limits. The server is stopped, resized and started again, so expect a short downtime.\n\nMoney works as in Change plan: prepaid servers are charged or credited the prorated difference immediately (`charged_cents` or `refunded_cents`, never both), hourly servers pay the new hourly price from the next hour, with the first hour prepaid when the price goes up. Hourly servers can be resized at most once an hour. Only available where custom configurations are sold, and the server must have no VM snapshots.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_change_custom","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cpu":4,"disk_gb":90,"ram_mb":8192},"schema":{"properties":{"cpu":{"description":"New virtual CPU cores.","type":"integer"},"disk_gb":{"description":"New system disk in GiB: the current size or larger, growing in steps of the site's disk step.","type":"integer"},"ram_mb":{"description":"New memory in MiB: a multiple of 1024.","type":"integer"}},"required":["cpu","ram_mb","disk_gb"],"type":"object","x-order":["cpu","ram_mb","disk_gb"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"charged_cents":142,"job_id":4814},"schema":{"properties":{"charged_cents":{"description":"Amount charged to the wallet in US cents (0 when nothing is due now). Absent when `refunded_cents` is present.","type":"integer"},"job_id":{"description":"Identifier of the resize job. Follow it with List a VM's jobs.","type":"integer"},"refunded_cents":{"description":"Amount credited back to the wallet in US cents. Absent when `charged_cents` is present.","type":"integer"}},"required":["job_id"],"type":"object","x-order":["job_id","charged_cents","refunded_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON. `bad_input`: The configuration is not allowed. `detail` says why: it equals the current one, a value is outside the site limits or step, or Windows needs more memory. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."},{"code":"bad_input","description":"The configuration is not allowed. `detail` says why: it equals the current one, a value is outside the site limits or step, or Windows needs more memory."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot pay the difference. The error carries `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot pay the difference. The error carries `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot pay the difference. The error carries `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `feature_disabled`: Custom configurations are not sold on this site. `quota_exceeded`: The new size exceeds the account's resource limits.","x-error-codes":[{"code":"feature_disabled","description":"Custom configurations are not sold on this site."},{"code":"quota_exceeded","description":"The new size exceeds the account's resource limits."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry. `has_snapshots`: The server still has VM snapshots. Delete them first. The error carries the `count`. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."},{"code":"has_snapshots","description":"The server still has VM snapshots. Delete them first. The error carries the `count`."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`cpu`, `ram_mb` or `disk_gb` is missing or not an integer."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `cpu`, `ram_mb` or `disk_gb` is missing or not an integer. `custom_only`: The server runs a fixed plan. Use Change plan instead. `disk_shrink`: `disk_gb` is smaller than the current disk. The error carries the current `disk_gb`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`cpu`, `ram_mb` or `disk_gb` is missing or not an integer."},{"code":"custom_only","description":"The server runs a fixed plan. Use Change plan instead."},{"code":"disk_shrink","description":"`disk_gb` is smaller than the current disk. The error carries the current `disk_gb`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: This hourly server was already resized during the last hour. Retry later. (`change_cooldown`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"change_cooldown","description":"This hourly server was already resized during the last hour. Retry later."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The infrastructure did not answer. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The infrastructure did not answer. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The infrastructure did not answer. Retry in a few seconds."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"quota_unavailable","message":"The account's limits could not be verified. Retry in a moment."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`quota_unavailable`: The account's limits could not be verified. Retry in a moment. `provider_unavailable`: The service provider is temporarily not accepting changes that cost money. Retry later.","x-error-codes":[{"code":"quota_unavailable","description":"The account's limits could not be verified. Retry in a moment."},{"code":"provider_unavailable","description":"The service provider is temporarily not accepting changes that cost money. Retry later."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Custom resize","tags":["Virtual Machines"],"x-cli":"vm change-custom","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/change-custom\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cpu\":4,\"disk_gb\":90,\"ram_mb\":8192}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Đổi cấu hình tuỳ chọn"}},"/v1/vm/{id}/change-cycle":{"post":{"description":"Moves the server to another billing cycle, for example from hourly to monthly or from monthly to yearly. The unused part of a current prepaid period is refunded to the wallet and the first period of the new cycle is charged, both in one transaction: if the wallet cannot cover the difference nothing changes (`402 insufficient_funds`). Switching to `hourly` refunds the unused part and starts billing by the hour. Exception — servers in regions with calendar-month billing (international regions): switching a prepaid server to `hourly` is not immediate and refunds nothing; it is scheduled for the end of the paid period (`next_cycle` + `effective_at`) and sending the current cycle again cancels the schedule. Hourly servers there pay bandwidth per GB, monthly or longer cycles have unlimited bandwidth. Preview the amounts with [Quote a billing-cycle change](#operation/vm_cycle_quote).\n\nThe change is immediate and does not create a job. The invoices for the refund and the charge appear under Billing.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_change_cycle","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cycle":"yearly"},"schema":{"properties":{"cycle":{"description":"Slug of the new billing cycle, from the `cycles` of the catalog, e.g. `monthly`, `yearly`, `2y`, `3y` or `hourly`. It must differ from the current cycle.","type":"string"}},"required":["cycle"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"charged_cents":3705,"cycle":"yearly","effective_at":null,"next_cycle":null,"paid_until":1827100000,"refunded_cents":287},"schema":{"properties":{"charged_cents":{"description":"Amount charged for the first period of the new cycle, in US cents. 0 when switching to hourly.","type":"integer"},"cycle":{"description":"The cycle the server is on now.","type":"string"},"effective_at":{"description":"When the scheduled cycle takes effect (end of the paid period). null when nothing is scheduled (Unix time, seconds, UTC)","type":["integer","null"]},"next_cycle":{"description":"Cycle scheduled for the end of the paid period (`hourly`), or null when the change was immediate or a schedule was cancelled","type":["string","null"]},"paid_until":{"description":"End of the period now paid for. null when the server is now billed by the hour (Unix time, seconds, UTC)","type":["integer","null"]},"refunded_cents":{"description":"Amount refunded for the unused part of the previous cycle, in US cents.","type":"integer"}},"required":["charged_cents","refunded_cents","paid_until","cycle","next_cycle","effective_at"],"type":"object","x-order":["charged_cents","refunded_cents","paid_until","cycle","next_cycle","effective_at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The change could not be made, for example two changes arrived in the same second. The error carries a `detail`; retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The change could not be made, for example two changes arrived in the same second. The error carries a `detail`; retry. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The change could not be made, for example two changes arrived in the same second. The error carries a `detail`; retry."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the new cycle after the refund. The error carries `need_cents` and `balance_cents`. Nothing was changed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the new cycle after the refund. The error carries `need_cents` and `balance_cents`. Nothing was changed. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the new cycle after the refund. The error carries `need_cents` and `balance_cents`. Nothing was changed."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"same_cycle","message":"The server is already on this billing cycle."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`same_cycle`: The server is already on this billing cycle. `vm_not_active`: The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"same_cycle","description":"The server is already on this billing cycle."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`cycle` is missing, unknown or disabled. The error carries `field` = `cycle`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `cycle` is missing, unknown or disabled. The error carries `field` = `cycle`. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `cycle_not_available_in_zone`: The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`cycle` is missing, unknown or disabled. The error carries `field` = `cycle`."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"cycle_not_available_in_zone","description":"The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"provider_unavailable","message":"The site cannot accept new charges at the moment. Nothing was charged; retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site cannot accept new charges at the moment. Nothing was charged; retry later. (`provider_unavailable`)","x-error-codes":[{"code":"provider_unavailable","description":"The site cannot accept new charges at the moment. Nothing was charged; retry later."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Change the billing cycle (prorated)","tags":["Virtual Machines"],"x-cli":"vm change-cycle","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/change-cycle\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"yearly\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Đổi chu kỳ thanh toán (trừ/hoàn tiền chênh lệch)"}},"/v1/vm/{id}/change-ip":{"post":{"description":"Gives the server a new public IPv4 address and releases the old one. Firewall rules of the old address are copied to the new one. The old address is not reused for a few days, so you cannot cycle through addresses. Expect a short loss of connectivity while the address is switched; update DNS records and allow-lists that point at the old address.\n\nOnly one change is allowed per cooldown window (24 hours by default, set by the site); inside it the call fails with `429 ip_change_cooldown` and `retry_after_hours`. The call returns as soon as the job is queued (`job_id`); follow it with [List VM jobs](#operation/vm_jobs). The new address shows in [Get a VM](#operation/vm_get) when the job is done. The body is ignored.\n\n**Required scope:** `vm:write`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_change_ip","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":1904},"schema":{"$ref":"#/components/schemas/VmJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`change_ip`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`change_ip`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: The address was changed too recently. The error carries `retry_after_hours`, the whole hours left in the cooldown window. (`ip_change_cooldown`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"ip_change_cooldown","description":"The address was changed too recently. The error carries `retry_after_hours`, the whole hours left in the cooldown window."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Change the public IP (cooldown between changes)","tags":["Virtual Machines"],"x-cli":"vm change-ip","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/change-ip\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:write","x-summary-vi":"Đổi IP public (có thời gian chờ giữa hai lần)"}},"/v1/vm/{id}/change-plan":{"post":{"description":"Moves the server to another fixed plan of the same region. The server is stopped, resized and started again, so expect a short downtime (`requires_stop` in Get plan options says whether the change needs it). The disk can stay the same or grow, never shrink.\n\nMoney: prepaid servers are charged (or credited) the prorated price difference for the rest of the paid period immediately; the response carries `charged_cents` or `refunded_cents`, never both. Hourly servers are billed at the new hourly price from the next hour on; moving to a dearer plan prepays the first hour at the new price. If the resize job fails, the money is returned automatically. Hourly servers can be resized at most once an hour (`429 change_cooldown`).\n\nThe server must have no VM snapshots. Use Get plan quote first to show the price. For servers on a custom configuration use Change custom configuration.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_change_plan","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"plan_id":4},"schema":{"properties":{"live":{"description":"Reserved for restart-free changes, which are not supported yet. `true` is refused with `409 live_unavailable`; omit it or send `false`.","type":"boolean"},"plan_id":{"description":"Plan to move to, from the catalog or from Get plan options.","type":"integer"}},"required":["plan_id"],"type":"object","x-order":["plan_id","live"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"charged_cents":288,"job_id":4813},"schema":{"properties":{"charged_cents":{"description":"Amount charged to the wallet in US cents (0 when nothing is due now). Absent when `refunded_cents` is present.","type":"integer"},"job_id":{"description":"Identifier of the resize job. Follow it with List a VM's jobs.","type":"integer"},"refunded_cents":{"description":"Amount credited back to the wallet in US cents. Absent when `charged_cents` is present.","type":"integer"}},"required":["job_id"],"type":"object","x-order":["job_id","charged_cents","refunded_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON. `bad_input`: The change is not allowed. `detail` says why: the disk would shrink, the server runs a custom configuration (`custom_switch_unsupported`), or the plan is unavailable. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."},{"code":"bad_input","description":"The change is not allowed. `detail` says why: the disk would shrink, the server runs a custom configuration (`custom_switch_unsupported`), or the plan is unavailable."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot pay the difference. The error carries `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot pay the difference. The error carries `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot pay the difference. The error carries `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The new size exceeds the account's resource limits. The error carries `reason`, `used`, `requested`, `limit` and `need_more_cents`. (`quota_exceeded`)","x-error-codes":[{"code":"quota_exceeded","description":"The new size exceeds the account's resource limits. The error carries `reason`, `used`, `requested`, `limit` and `need_more_cents`."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry. `same_plan`: The server already has this plan. `resize_license`: The server runs a licensed operating system (for example Windows) and the license cannot be carried over to the chosen plan at the moment, or the chosen plan carries a license the server does not have. Nothing is changed or charged; choose another plan or contact support. `imported_vm_admin_only`: The server was provisioned for you by the team: only an administrator can change its plan. `live_unavailable`: `live: true` was sent; restart-free plan changes are not supported yet. `plan_other_zone`: The plan belongs to another region. A server cannot move between regions. `has_snapshots`: The server still has VM snapshots. Delete them first. The error carries the `count`. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."},{"code":"same_plan","description":"The server already has this plan."},{"code":"resize_license","description":"The server runs a licensed operating system (for example Windows) and the license cannot be carried over to the chosen plan at the moment, or the chosen plan carries a license the server does not have. Nothing is changed or charged; choose another plan or contact support."},{"code":"imported_vm_admin_only","description":"The server was provisioned for you by the team: only an administrator can change its plan."},{"code":"live_unavailable","description":"`live: true` was sent; restart-free plan changes are not supported yet."},{"code":"plan_other_zone","description":"The plan belongs to another region. A server cannot move between regions."},{"code":"has_snapshots","description":"The server still has VM snapshots. Delete them first. The error carries the `count`."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`plan_id` is missing, unknown, not on sale, a custom configuration, or not visible to your site. The error names the offending `field`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `plan_id` is missing, unknown, not on sale, a custom configuration, or not visible to your site. The error names the offending `field`. `image_requirements`: The chosen plan is below the minimum of the operating system installed on the server (Windows needs more memory, disk and cores). The error carries the `min` (`cpu`, `ram_mb`, `disk_gb`); nothing is charged; pick a bigger plan. Plans below the minimum are left out of Get plan options. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`plan_id` is missing, unknown, not on sale, a custom configuration, or not visible to your site. The error names the offending `field`."},{"code":"image_requirements","description":"The chosen plan is below the minimum of the operating system installed on the server (Windows needs more memory, disk and cores). The error carries the `min` (`cpu`, `ram_mb`, `disk_gb`); nothing is charged; pick a bigger plan. Plans below the minimum are left out of Get plan options."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: This hourly server was already resized during the last hour. Retry later. (`change_cooldown`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"change_cooldown","description":"This hourly server was already resized during the last hour. Retry later."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The infrastructure did not answer. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The infrastructure did not answer. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The infrastructure did not answer. Retry in a few seconds."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"quota_unavailable","message":"The account's limits could not be verified. Retry in a moment."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`quota_unavailable`: The account's limits could not be verified. Retry in a moment. `provider_unavailable`: The service provider is temporarily not accepting changes that cost money. Retry later.","x-error-codes":[{"code":"quota_unavailable","description":"The account's limits could not be verified. Retry in a moment."},{"code":"provider_unavailable","description":"The service provider is temporarily not accepting changes that cost money. Retry later."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Change plan (prorated)","tags":["Virtual Machines"],"x-cli":"vm change-plan","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/change-plan\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"plan_id\":4}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Đổi gói (trừ/hoàn tiền chênh lệch)"}},"/v1/vm/{id}/change-quote":{"get":{"description":"Previews what changing the server's plan or custom size would cost, without changing anything. Pass either `plan_id` (a fixed plan from the catalog) or all three of `cpu`, `ram_mb` and `disk_gb` (a custom size). The arithmetic is the one the change itself uses, so `amount_due_cents` is what would be taken from the wallet and `refund_cents` what would be returned for the unused part of the current period.\n\nCheck `allowed` before offering the change: it is false when the change cannot be made right now, and `reason` says why (`vm_locked`, `vm_not_active`, `job_running`, `disk_shrink`, `feature_disabled` or `custom_switch_unsupported`). `same` is true when the target equals the current size. For hourly servers the new price applies from the next billing hour; moving to a dearer size charges one hour at the new price up front.\n\nPass `scale=1` to price a live resize through the Scaling endpoints instead: it also allows moving from a fixed plan to a custom size, and for hourly servers `amount_due_cents` is the one hour charged up front.\n\n**Required scope:** `vm:read`.","operationId":"vm_change_quote","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Fixed plan to move to, from the catalog. When given, `cpu`, `ram_mb` and `disk_gb` are ignored.","in":"query","name":"plan_id","required":false,"schema":{"type":"integer"}},{"description":"Custom size: vCPU cores. Send together with `ram_mb` and `disk_gb`.","in":"query","name":"cpu","required":false,"schema":{"type":"integer"}},{"description":"Custom size: memory in MiB. Send together with `cpu` and `disk_gb`.","in":"query","name":"ram_mb","required":false,"schema":{"type":"integer"}},{"description":"Custom size: system disk in GiB; it can only grow. Send together with `cpu` and `ram_mb`.","in":"query","name":"disk_gb","required":false,"schema":{"type":"integer"}},{"description":"Billing cycle slug to price the target for. Defaults to the server's current cycle, which gives the real amount of a change; another cycle is for information only.","in":"query","name":"cycle","required":false,"schema":{"type":"string"}},{"description":"Send `1` or `true` to price a live resize (Scaling endpoints) instead of a plan change.","in":"query","name":"scale","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"allowed":true,"amount_due_cents":240,"balance_cents":2500,"cycle":"monthly","disk_shrink":false,"from":{"cents":343,"cpu":2,"disk_gb":60,"hourly":"$0.004704","hourly_uusd":4704,"monthly_cents":343,"name":"Standard 2/4","plan_id":3,"ram_mb":4096},"hourly_note":null,"immediate":true,"kind":"plan","months":1,"reason":null,"refund_cents":0,"remaining_hours":512,"same":false,"to":{"cents":687,"cpu":4,"disk_gb":80,"hourly":"$0.009408","hourly_uusd":9408,"monthly_cents":687,"name":"Standard 4/8","plan_id":4,"ram_mb":8192},"unused_cents":240},"schema":{"properties":{"allowed":{"description":"Whether the change can be made now.","type":"boolean"},"amount_due_cents":{"description":"Amount that would be charged to the wallet, in US cents. 0 when nothing is due or a refund applies.","type":"integer"},"balance_cents":{"description":"Wallet balance in US cents.","type":"integer"},"cycle":{"description":"Billing cycle the quote is for.","type":"string"},"disk_shrink":{"description":"True when the target disk is smaller than the current one. Disks cannot shrink.","type":"boolean"},"from":{"description":"The server as it is now.","properties":{"cents":{"description":"Price of one period of the quoted billing cycle in US cents (0 for hourly servers).","type":"integer"},"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"name":{"description":"Plan name, or a generated label such as `4 vCPU / 8 GB / 80 GB` for a custom size.","type":"string"},"plan_id":{"description":"Identifier of the current plan.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["plan_id","name","cpu","ram_mb","disk_gb","hourly_uusd","hourly","monthly_cents","cents"],"type":"object","x-order":["plan_id","name","cpu","ram_mb","disk_gb","hourly_uusd","hourly","monthly_cents","cents"]},"hourly_note":{"description":"For hourly servers, a sentence explaining when the new price applies. null for prepaid servers.","type":["string","null"]},"immediate":{"description":"Whether the change takes effect right away. Always true.","type":"boolean"},"kind":{"description":"`plan` for a fixed plan, `custom` for a custom size.","enum":["plan","custom"],"type":"string"},"months":{"description":"Months in that cycle (0 = hourly).","type":"integer"},"reason":{"description":"Why `allowed` is false. null when it is allowed, or when the target equals the current size.","enum":["vm_locked","vm_not_active","job_running","disk_shrink","feature_disabled","custom_switch_unsupported",null],"type":["string","null"]},"refund_cents":{"description":"Amount that would be returned to the wallet, in US cents. 0 when nothing is refunded.","type":"integer"},"remaining_hours":{"description":"Hours left in the current prepaid period. 0 for hourly servers.","type":"integer"},"same":{"description":"True when the target equals the current plan or size.","type":"boolean"},"to":{"description":"The target of the change.","properties":{"cents":{"description":"Price of one period of the quoted billing cycle in US cents (0 for hourly servers).","type":"integer"},"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly":{"description":"Price per hour as a decimal string.","type":"string"},"hourly_uusd":{"description":"Price per hour in millionths of a US dollar.","type":"integer"},"monthly_cents":{"description":"Price for a 30-day month (730 hours) in US cents.","type":"integer"},"name":{"description":"Plan name, or a generated label such as `4 vCPU / 8 GB / 80 GB` for a custom size.","type":"string"},"plan_id":{"description":"Identifier of the target plan. null for a custom size.","type":["integer","null"]},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["plan_id","name","cpu","ram_mb","disk_gb","hourly_uusd","hourly","monthly_cents","cents"],"type":"object","x-order":["plan_id","name","cpu","ram_mb","disk_gb","hourly_uusd","hourly","monthly_cents","cents"]},"unused_cents":{"description":"Value of the unused part of the current period, in US cents.","type":"integer"}},"required":["kind","from","to","cycle","months","remaining_hours","unused_cents","amount_due_cents","refund_cents","immediate","allowed","reason","disk_shrink","same","balance_cents","hourly_note"],"type":"object","x-order":["kind","from","to","cycle","months","remaining_hours","unused_cents","amount_due_cents","refund_cents","immediate","allowed","reason","disk_shrink","same","balance_cents","hourly_note"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The custom size is outside the site limits, or `cycle` is not a known billing cycle. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The custom size is outside the site limits, or `cycle` is not a known billing cycle. The error carries a `detail`. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The custom size is outside the site limits, or `cycle` is not a known billing cycle. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"plan_other_zone","message":"The plan is sold in a different region. A server cannot move between regions; order a new server there instead."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The plan is sold in a different region. A server cannot move between regions; order a new server there instead. (`plan_other_zone`)","x-error-codes":[{"code":"plan_other_zone","description":"The plan is sold in a different region. A server cannot move between regions; order a new server there instead."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"Neither a positive `plan_id` nor a complete `cpu` + `ram_mb` + `disk_gb` was given, or the plan is not available for this server. The error carries `field`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Neither a positive `plan_id` nor a complete `cpu` + `ram_mb` + `disk_gb` was given, or the plan is not available for this server. The error carries `field`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"Neither a positive `plan_id` nor a complete `cpu` + `ram_mb` + `disk_gb` was given, or the plan is not available for this server. The error carries `field`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Quote a plan change or custom resize","tags":["Virtual Machines"],"x-cli":"vm change-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/change-quote\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Báo giá đổi gói hoặc đổi cấu hình tuỳ chọn"}},"/v1/vm/{id}/clone":{"post":{"description":"Creates a copy of this server as a **new server that is ordered and charged like any other**: the first charge is taken from your wallet in the same request at the current price of the same plan in the chosen region, quotas apply, and nothing is charged if the request fails. The copy gets the disk contents of the original, a new IP address and a new administrator password (e-mailed when it is ready). The original is not changed. The call answers at once with the new server in the `provisioning` state; a failed copy is refunded automatically. Use Clone options to see the regions you can choose.\n\n**Required scope:** `vm:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_clone","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"hostname":"web-01-copy","zone_id":3},"schema":{"properties":{"cycle":{"description":"Billing cycle slug, `hourly` by default.","type":"string"},"display_name":{"description":"Label for dashboards, at most 100 characters. Defaults to the host name.","type":"string"},"hostname":{"description":"Host name of the new server: 1 to 63 characters, lowercase letters, digits and hyphens. It must be unique on the whole platform.","type":"string"},"ssh_key_id":{"description":"One of your saved SSH keys to install on the copy.","type":"integer"},"zone_id":{"description":"Region of the copy, from Clone options.","type":"integer"}},"required":["hostname","zone_id"],"type":"object","x-order":["hostname","display_name","zone_id","cycle","ssh_key_id"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"vm":{"auto_renew":true,"autoscale_enabled":false,"billed_until":null,"cancel_requested":false,"capabilities":{"autoscale":true,"backup":true,"bandwidth":true,"byoip":true,"change_ip":true,"console":"vnc","ddos_shield":true,"firewall":true,"hypervisor":true,"ipv6":true,"iso":true,"metrics":true,"metrics_mem_disk":true,"nics":true,"port_forward":true,"private_ip":true,"reinstall":true,"reset_password":true,"resize_cpu_ram":true,"resize_disk_grow":true,"resize_live":true,"snapshot":true,"ssh_key_reset":true,"volumes":true,"vpc":true},"created_at":1792368000,"cs_state":null,"cs_vm_id":null,"cycle":"monthly","cycle_cents":343,"cycle_started_at":1792368000,"destroy_after":null,"display_name":"Web server 01","enable_ipv6":true,"ha":true,"hostname":"web-01","hourly_mills":5,"hourly_uusd":4704,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":null,"job_running":true,"lock_reason":null,"locked_at":null,"network":{"type":"shared"},"paid_until":1794960000,"password_lost":false,"plan":{"cpu":2,"disk_gb":60,"is_custom":false,"name":"Standard 2/4","ram_mb":4096},"private_ip":null,"public_ip":null,"ready_at":null,"ssh_key":"laptop","state":"provisioning","template":{"display_name":"Ubuntu 24.04 LTS","icon":"ubuntu","id":11,"os_family":"linux","os_version":"24.04"},"traffic":null,"username":"ubuntu","zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"vm":{"$ref":"#/components/schemas/Vm"}},"required":["vm"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot pay the first charge or the site's minimum balance."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot pay the first charge or the site's minimum balance. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot pay the first charge or the site's minimum balance."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The order exceeds the account's resource or server-count limits. (`quota_exceeded`)","x-error-codes":[{"code":"quota_exceeded","description":"The order exceeds the account's resource or server-count limits."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not yours."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"Cloning is not available for this server."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_supported_in_zone`: Cloning is not available for this server. `vm_not_active`: The server is not in the `active` state. The error carries the current `state`. `job_running`: Another operation is already running on this server. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_supported_in_zone","description":"Cloning is not available for this server."},{"code":"vm_not_active","description":"The server is not in the `active` state. The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`zone_id` is missing or is not one of the regions in Clone options. The error names the offending `field`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `zone_id` is missing or is not one of the regions in Clone options. The error names the offending `field`. `invalid_hostname`: The host name is not 1 to 63 characters of lowercase letters, digits and hyphens. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`zone_id` is missing or is not one of the regions in Clone options. The error names the offending `field`."},{"code":"invalid_hostname","description":"The host name is not 1 to 63 characters of lowercase letters, digits and hyphens."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many clone requests; retry in a minute. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many clone requests; retry in a minute."}]}},"security":[{"bearerAuth":["vm:create"]}],"summary":"Clone a VM (new server, charges the wallet)","tags":["Virtual Machines"],"x-cli":"vm clone","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/clone\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hostname\":\"web-01-copy\",\"zone_id\":3}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:create","x-summary-vi":"Nhân bản máy ảo (tạo máy mới, trừ tiền ví)"}},"/v1/vm/{id}/clone-options":{"get":{"description":"Lists the regions where this server can be cloned: those that sell the same size as the server. Each region carries the price of the new server (hourly rate and monthly equivalent). Servers that cannot be cloned answer `409 not_supported_in_zone`.\n\n**Required scope:** `vm:read`.","operationId":"vm_clone_options","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"zones":[{"hourly_uusd":5500,"id":3,"monthly_cents":402,"name":"Singapore","slug":"sg-singapore"}]},"schema":{"properties":{"zones":{"items":{"properties":{"hourly_uusd":{"description":"Hourly price of the new server in millionths of a US dollar.","type":"integer"},"id":{"description":"Region identifier; pass it as `zone_id` to Clone a VM.","type":"integer"},"monthly_cents":{"description":"Monthly equivalent in US cents.","type":"integer"},"name":{"description":"Region name.","type":"string"},"slug":{"description":"Region slug.","type":"string"}},"required":["id","name","slug","hourly_uusd","monthly_cents"],"type":"object","x-order":["id","name","slug","hourly_uusd","monthly_cents"]},"type":"array"}},"required":["zones"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not yours."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"Cloning is not available for this server (`capability` is `clone`, or `clone_with_disks` when the server has extra data disks)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_supported_in_zone`: Cloning is not available for this server (`capability` is `clone`, or `clone_with_disks` when the server has extra data disks). `vm_not_active`: The server is not in the `active` state. The error carries the current `state`.","x-error-codes":[{"code":"not_supported_in_zone","description":"Cloning is not available for this server (`capability` is `clone`, or `clone_with_disks` when the server has extra data disks)."},{"code":"vm_not_active","description":"The server is not in the `active` state. The error carries the current `state`."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Regions this VM can be cloned to","tags":["Virtual Machines"],"x-cli":"vm clone options","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/clone-options\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Vị trí có thể nhân bản máy này"}},"/v1/vm/{id}/console":{"get":{"description":"Issues a one-time link to the graphical (VNC) console of a running server. Open `url` in a browser, or embed it in a page, within `expires_in` seconds (60). The link works for one console session; asking again issues a new one. Requests are limited to 10 per minute per client address.\n\nThe server must be active and running. For a text terminal use [Get an SSH ticket](#operation/vm_ssh_token) instead.\n\n**Required scope:** `vm:console`.","operationId":"vm_console","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"expires_in":60,"url":"https://console.example.com/c/4b8e2f6a1d3c9e7f5a0b2c4d6e8f1a3b5c7d9e0f"},"schema":{"properties":{"expires_in":{"description":"Seconds the ticket stays valid (60).","type":"integer"},"url":{"description":"Console address to open in a browser. It contains the one-time ticket, so treat it as a secret.","type":"string"}},"required":["url","expires_in"],"type":"object","x-order":["url","expires_in"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in the `active` state. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in the `active` state. The error carries the current `state`. `vm_not_running`: The server is not running, so there is nothing to connect to. The error carries `cs_state`, the power state the platform reports. `console_ssh_only`: The server's region offers no graphical console (`capabilities.console` is `ssh`). The error carries `kind` = `ssh`: use [Get an SSH ticket](#operation/vm_ssh_token) for a terminal instead.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in the `active` state. The error carries the current `state`."},{"code":"vm_not_running","description":"The server is not running, so there is nothing to connect to. The error carries `cs_state`, the power state the platform reports."},{"code":"console_ssh_only","description":"The server's region offers no graphical console (`capabilities.console` is `ssh`). The error carries `kind` = `ssh`: use [Get an SSH ticket](#operation/vm_ssh_token) for a terminal instead."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Get a one-time VNC console ticket","tags":["Console and AI Agent"],"x-cli":"vm console","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/console\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Xin vé console VNC (dùng một lần)"}},"/v1/vm/{id}/console-shares":{"get":{"description":"Lists the share links of the server that are still active (not revoked and not expired), newest first, at most 20. A share link lets someone else open the server's SSH terminal without an account. Each link carries its `token` and `websocket_url` only when the caller may use the terminal, which is the case for a signed-in session and for keys with the `vm:console` scope; keys with only `vm:read` see the links without tokens.\n\n**Required scope:** `vm:read`.","operationId":"vm_console_share_list","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"shares":[{"created_at":1792400000,"expires_at":1792403600,"id":"shr_7a3e9c1b5d2f4e60","label":"Support session","mode":"ro","token":"ofw_shr_2c4e6a8b0d1f3957a1b3c5d7e9f02468","variant":"shared","websocket_url":"wss://cloud.example.com/ssh-ws"}]},"schema":{"properties":{"shares":{"items":{"$ref":"#/components/schemas/ConsoleShare"},"type":"array"}},"required":["shares"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"List active SSH session share links","tags":["Console and AI Agent"],"x-cli":"vm console-share list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/console-shares\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Danh sách liên kết chia sẻ phiên SSH"},"post":{"description":"Creates a share link for the server's SSH terminal. The viewer connects to the returned `websocket_url` with `?mode=share&token=<token>` appended, with no account or password. Anyone holding the token can use the link until it expires or you revoke it with [Revoke a share link](#operation/vm_console_share_revoke), so share it only with people you trust, and use `ro` unless the viewer must type.\n\nSend a JSON body (`{}` is enough). Unknown `mode` or `variant` values fall back to `ro` and `shared`; `ttl_minutes` is clamped to 15 through 1440 (default 60). A server can have at most 5 active links. The link is created even if the server is not running; it only works while the server is.\n\n**Required scope:** `vm:console`.","operationId":"vm_console_share_create","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"label":"Support session","mode":"ro","ttl_minutes":60,"variant":"shared"},"schema":{"properties":{"label":{"description":"Free-text label to recognise the link, at most 80 characters.","type":"string"},"mode":{"description":"`ro` (default): the viewer can only watch. `rw`: the viewer can also type.","enum":["ro","rw"],"type":"string"},"ttl_minutes":{"description":"Lifetime of the link in minutes, 15 to 1440. Defaults to 60.","type":"integer"},"variant":{"description":"`shared` (default): the viewer joins the terminal session you use. `isolated`: the viewer gets a separate session.","enum":["shared","isolated"],"type":"string"}},"type":"object","x-order":["mode","variant","ttl_minutes","label"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"created_at":1792400000,"expires_at":1792403600,"id":"shr_7a3e9c1b5d2f4e60","label":"Support session","mode":"ro","tmux_session":"term-1042-3f6c1d0e","token":"ofw_shr_2c4e6a8b0d1f3957a1b3c5d7e9f02468","variant":"shared","websocket_url":"wss://cloud.example.com/ssh-ws"},"schema":{"properties":{"created_at":{"description":"Time the link was created (Unix time, seconds, UTC)","type":"integer"},"expires_at":{"description":"Time the link stops working (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Share link identifier. Pass it to [Revoke a share link](#operation/vm_console_share_revoke).","type":"string"},"label":{"description":"Label you gave the link.","type":["string","null"]},"mode":{"description":"Access mode granted.","enum":["ro","rw"],"type":"string"},"tmux_session":{"description":"Name of the terminal multiplexer session the link attaches to.","type":"string"},"token":{"description":"Secret token of the link.","type":"string"},"variant":{"description":"Session variant.","enum":["shared","isolated"],"type":"string"},"websocket_url":{"description":"WebSocket address to connect to together with the token.","type":"string"}},"required":["id","token","mode","variant","tmux_session","label","expires_at","created_at","websocket_url"],"type":"object","x-order":["id","token","mode","variant","tmux_session","label","expires_at","created_at","websocket_url"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"limit_reached","message":"The server already has 5 active share links. Revoke one first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server already has 5 active share links. Revoke one first. (`limit_reached`)","x-error-codes":[{"code":"limit_reached","description":"The server already has 5 active share links. Revoke one first."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Create an SSH session share link","tags":["Console and AI Agent"],"x-cli":"vm console-share create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/console-shares\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"label\":\"Support session\",\"mode\":\"ro\",\"ttl_minutes\":60,\"variant\":\"shared\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Tạo liên kết chia sẻ phiên SSH"}},"/v1/vm/{id}/console-shares/{sid}":{"delete":{"description":"Revokes a share link immediately: its token stops working for new connections. A link that is unknown, already revoked or belongs to another server answers `404`. Links also stop working on their own when they expire.\n\n**Required scope:** `vm:console`.","operationId":"vm_console_share_revoke","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Share link identifier as returned by the list operation.","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist, is not yours, or has no active share link with this identifier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist, is not yours, or has no active share link with this identifier. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist, is not yours, or has no active share link with this identifier."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Revoke an SSH session share link","tags":["Console and AI Agent"],"x-cli":"vm console-share revoke","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/console-shares/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Thu hồi liên kết chia sẻ phiên SSH"}},"/v1/vm/{id}/cycle-quote":{"get":{"description":"Previews switching the server to another billing cycle, without changing anything. The unused part of the current prepaid period is refunded and the first period of the new cycle is charged, so the result is either `net_due_cents` (to pay) or `net_refund_cents` (to receive), never both. Prices are today's prices for the server.\n\nIt works on a server in any state, but `allowed` is false unless the server is `active` and has no operation running. `sufficient` tells whether the wallet covers `net_due_cents`. Make the change with [Change the billing cycle](#operation/vm_change_cycle).\n\n**Required scope:** `vm:read`.","operationId":"vm_cycle_quote","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Slug of the cycle to switch to, from the `cycles` of the catalog (for example `monthly`, `yearly`, `2y`, `3y`, or `hourly`).","example":"yearly","in":"query","name":"cycle","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"allowed":true,"balance_cents":5000,"bandwidth":null,"effective_at":null,"from_cycle":"monthly","net_due_cents":3418,"net_refund_cents":0,"new_cents":3705,"next_charge_at":null,"next_charge_cents":null,"paid_until_current":1795600000,"paid_until_new":1827100000,"refund_cents":287,"scheduled":false,"sufficient":true,"to_cycle":"yearly","to_discount_pct":10.0,"to_months":12,"to_name":"1 year","used_hours":120},"schema":{"properties":{"allowed":{"description":"Whether the switch can be made now.","type":"boolean"},"balance_cents":{"description":"Wallet balance in US cents.","type":"integer"},"bandwidth":{"additionalProperties":true,"description":"International regions only: bandwidth of the target cycle — `{per_gb: true, usd_per_gb}` for hourly, `{unlimited: true}` for monthly or longer. null elsewhere","type":["object","null"]},"effective_at":{"description":"When a scheduled switch takes effect. null when the switch is immediate (Unix time, seconds, UTC)","type":["integer","null"]},"from_cycle":{"description":"The server's current cycle.","type":"string"},"net_due_cents":{"description":"Amount to pay: `new_cents` minus `refund_cents`, never below zero.","type":"integer"},"net_refund_cents":{"description":"Amount returned to the wallet when the refund exceeds the new price, in US cents.","type":"integer"},"new_cents":{"description":"Price of the first period of the new cycle, in US cents. 0 when switching to hourly.","type":"integer"},"next_charge_at":{"description":"International regions, hourly → prepaid with auto-renew on: when the next period is charged from the wallet (8 PM Vietnam time on the last day of the paid period; nothing for the next period is charged at the switch). null otherwise (Unix time, seconds, UTC)","type":["integer","null"]},"next_charge_cents":{"description":"Amount of that next automatic charge, in US cents. null when `next_charge_at` is null.","type":["integer","null"]},"paid_until_current":{"description":"End of the period currently paid for. null for hourly servers (Unix time, seconds, UTC)","type":["integer","null"]},"paid_until_new":{"description":"End of the paid period after the switch. null when switching to hourly (Unix time, seconds, UTC)","type":["integer","null"]},"refund_cents":{"description":"Refund for the unused part of the current period, in US cents. 0 for hourly servers.","type":"integer"},"scheduled":{"description":"true when the switch would be scheduled for the end of the paid period instead of made now (prepaid → hourly in international regions; nothing is refunded).","type":"boolean"},"sufficient":{"description":"Whether the wallet balance covers `net_due_cents`.","type":"boolean"},"to_cycle":{"description":"The cycle that was quoted.","type":"string"},"to_discount_pct":{"description":"Discount of the new cycle in percent.","type":"number"},"to_months":{"description":"Months in the new cycle (0 = hourly).","type":"integer"},"to_name":{"description":"Display name of the new cycle.","type":"string"},"used_hours":{"description":"Hours of the current period already used, rounded up.","type":"integer"}},"required":["from_cycle","to_cycle","used_hours","refund_cents","new_cents","net_due_cents","net_refund_cents","paid_until_current","paid_until_new","to_name","to_months","to_discount_pct","balance_cents","allowed","sufficient","scheduled","effective_at","bandwidth","next_charge_at","next_charge_cents"],"type":"object","x-order":["from_cycle","to_cycle","used_hours","refund_cents","new_cents","net_due_cents","net_refund_cents","paid_until_current","paid_until_new","to_name","to_months","to_discount_pct","balance_cents","allowed","sufficient","scheduled","effective_at","bandwidth","next_charge_at","next_charge_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"same_cycle","message":"The server is already on this billing cycle."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is already on this billing cycle. (`same_cycle`)","x-error-codes":[{"code":"same_cycle","description":"The server is already on this billing cycle."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`cycle` is missing, longer than 20 characters, or not an enabled billing cycle. The error carries `field` = `cycle`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `cycle` is missing, longer than 20 characters, or not an enabled billing cycle. The error carries `field` = `cycle`. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `cycle_not_available_in_zone`: The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`.","x-error-codes":[{"code":"invalid_argument","description":"`cycle` is missing, longer than 20 characters, or not an enabled billing cycle. The error carries `field` = `cycle`."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"cycle_not_available_in_zone","description":"The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Quote a billing-cycle change","tags":["Virtual Machines"],"x-cli":"vm cycle-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/cycle-quote?cycle=<cycle>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Báo giá đổi chu kỳ thanh toán"}},"/v1/vm/{id}/data-volumes":{"get":{"description":"Lists the data volumes attached to one server, with how many more it can take and the total size attached. These are the extra volumes you bought; the system disk of the server is not included. Use [List volumes](#operation/volume_list) for all volumes of the account, attached or not.\n\n**Required scope:** `vm:read`.","operationId":"vm_data_volumes","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"busy":false,"cents_per_month":248,"created_at":1789990000,"debt_since":null,"device_id":1,"error_code":null,"hourly_uusd":3400,"hours_per_month":730,"id":4172,"last_error":null,"name":"data-1","paid_cents":41,"rate_uusd_gb_hour":34,"size_gb":100,"state":"Attached","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"meta":{"count":1,"max_gb":2000,"max_per_vm":5,"min_gb":10,"remaining":4,"step_gb":10,"total_gb":100},"price":{"cents_per_hour":0,"cents_per_month":25,"hours_per_month":730,"rate_uusd_gb_hour":34,"size_gb":10,"uusd_per_hour":340}},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BlockVolume"},"type":"array"},"meta":{"description":"Counts and site limits.","properties":{"count":{"description":"Number of volumes attached to the server.","type":"integer"},"max_gb":{"description":"Largest allowed volume size in GB.","type":"integer"},"max_per_vm":{"description":"Most volumes that may be attached to one server.","type":"integer"},"min_gb":{"description":"Smallest allowed volume size in GB.","type":"integer"},"remaining":{"description":"How many more volumes the server can take.","type":"integer"},"step_gb":{"description":"Sizes must be the smallest size plus a multiple of this step, in GB.","type":"integer"},"total_gb":{"description":"Total size of the attached volumes in GB.","type":"integer"}},"required":["count","max_per_vm","remaining","min_gb","max_gb","step_gb","total_gb"],"type":"object","x-order":["count","max_per_vm","remaining","min_gb","max_gb","step_gb","total_gb"]},"price":{"$ref":"#/components/schemas/VolumePrice"}},"required":["items","meta","price"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. (`not_supported_in_zone`)","x-error-codes":[{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Data volumes attached to the VM","tags":["Block Storage"],"x-cli":"vm data-volumes","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/data-volumes\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Ổ dữ liệu mua thêm đang gắn vào máy"}},"/v1/vm/{id}/delete-preview":{"get":{"description":"Shows what deleting the server would do, without deleting anything: the estimated refund, how the refund is computed, and the resources that will be destroyed with it (data disks, backups, IP addresses, VM snapshots). Call it before Delete a VM and show it to the user.\n\n`formula` explains the refund: `prorated` (prepaid servers get the unused part of the paid period back), `hourly_no_refund` (hourly servers are billed up to the hour already started) or `cancel_full` (a server still being created is refunded in full). `can_delete` is `false` for locked servers.\n\n**Required scope:** `vm:read`.","operationId":"vm_delete_preview","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"backup_count":0,"backup_schedule":null,"can_delete":true,"cycle":"monthly","cycle_cents":343,"formula":"prorated","hostname":"web-01","ip":"203.0.113.25","ipv6":"2001:db8:10::25","paid_cents":343,"paid_until":1794960000,"refund_cents":297,"used_hours":82,"vm_snapshot_count":0,"volumes":[]},"schema":{"properties":{"backup_count":{"description":"Number of backups that will be destroyed with the server.","type":"integer"},"backup_schedule":{"description":"Backup schedule that will be removed, for example `daily`.","type":["string","null"]},"can_delete":{"description":"Whether Delete a VM would be accepted right now (state `active`, `failed` or `provisioning`, and not locked).","type":"boolean"},"cycle":{"description":"Billing cycle slug.","type":"string"},"cycle_cents":{"description":"Price of one billing cycle in US cents.","type":"integer"},"formula":{"description":"How the refund is computed.","enum":["prorated","hourly_no_refund","cancel_full"],"type":"string"},"hostname":{"description":"Host name to send as `confirm_hostname` when deleting.","type":"string"},"ip":{"description":"Public IPv4 address that will be released.","type":["string","null"]},"ipv6":{"description":"Public IPv6 address that will be released.","type":["string","null"]},"paid_cents":{"description":"Money actually paid for the current cycle in US cents. This is the ceiling of any refund.","type":"integer"},"paid_until":{"description":"End of the paid period (Unix time, seconds, UTC)","type":["integer","null"]},"refund_cents":{"description":"Estimated refund in US cents. The real refund is credited when deletion completes.","type":"integer"},"used_hours":{"description":"Hours used in the current billing cycle (rounded up).","type":"integer"},"vm_snapshot_count":{"description":"Number of VM snapshots that will be destroyed. null when the count could not be read.","type":["integer","null"]},"volumes":{"items":{"properties":{"name":{"description":"Data disk name.","type":"string"},"size_gb":{"description":"Data disk size in GiB.","type":"integer"}},"required":["name","size_gb"],"type":"object"},"type":"array"}},"required":["refund_cents","formula","used_hours","paid_cents","cycle_cents","cycle","paid_until","hostname","can_delete","backup_count","backup_schedule","volumes","ip","ipv6","vm_snapshot_count"],"type":"object","x-order":["refund_cents","formula","used_hours","paid_cents","cycle_cents","cycle","paid_until","hostname","can_delete","backup_count","backup_schedule","volumes","ip","ipv6","vm_snapshot_count"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Preview before delete","tags":["Virtual Machines"],"x-cli":"vm delete-preview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/delete-preview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Xem trước khi xoá (hoàn tiền, dữ liệu mất)"}},"/v1/vm/{id}/events":{"get":{"description":"Returns the activity log of the server, newest first: power actions, plan changes, renewals, locks, failures. `msg` is display text in English (older entries can be in Vietnamese); to show the message in your own language use `key` and `args`, and rely on `kind` and `status` for logic. Use `exclude=billing` to hide renewals, refunds, charges and lock events.\n\n**Required scope:** `vm:read`.","operationId":"vm_events","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Keep only events of this exact kind (letters, digits and underscores, at most 40 characters).","example":"change_plan","in":"query","name":"kind","required":false,"schema":{"type":"string"}},{"description":"Search text matched against the message and the actor (substring).","in":"query","name":"q","required":false,"schema":{"type":"string"}},{"description":"Optional, used together with `q`: comma-separated event `key` values (at most 200; each made of lowercase letters, digits, `_` and `.`, up to 80 characters). Events whose `key` is in the list match as well, so a client can search in its own language by sending the keys whose translated text contains the search text. Invalid entries are ignored.","example":"vm.rebooted,vm.started","in":"query","name":"keys","required":false,"schema":{"type":"string"}},{"description":"Set to `billing` to hide billing-related kinds (`renewal`, `refund`, `extend`, `billing_edit`, `change_cycle`, `lock`, `unlock`, `charge`, `reminder`, `invoice`). Several values can be separated by commas.","example":"billing","in":"query","name":"exclude","required":false,"schema":{"type":"string"}},{"description":"Keep only events with this outcome. Other values are ignored.","in":"query","name":"status","required":false,"schema":{"enum":["success","failed","warning"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"actor":"customer:1042","args":{},"at":1792400000,"id":981,"key":"vm.rebooted","kind":"reboot","msg":"Rebooted","status":"success"},{"actor":"customer:1042","args":{"cycle":"monthly","host":"web-01","plan":"Standard 2/4"},"at":1792368000,"id":975,"key":"bill.ordered","kind":"create","msg":"Ordered Standard 2/4 (web-01) cycle monthly","status":"success"}],"page":1,"per_page":50,"total":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VmEvent"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"VM event log","tags":["Virtual Machines"],"x-cli":"vm events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Nhật ký sự kiện của máy"}},"/v1/vm/{id}/firewall":{"get":{"description":"Lists the inbound firewall rules of the server: IPv4 rules on its public address and, when IPv6 is enabled for the server, its IPv6 rules. Each rule lets one protocol and port range in from one source range. The result is cached for about 20 seconds.\n\n`pending_job` is true while a rule you added or deleted is still being applied. A server that is still being provisioned has no public address yet and answers `409 vm_not_ready`.\n\n**Required scope:** `vm:read`.","operationId":"vm_firewall_list","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792400000,"items":[{"cidr_list":"0.0.0.0/0","end_port":22,"family":"ipv4","icmp_code":null,"icmp_type":null,"id":"6f1f8c0a-2d57-4b2e-9c1c-5a8f3e7d1b42","protocol":"tcp","start_port":22,"state":"Active"},{"cidr_list":"203.0.113.0/24","end_port":null,"family":"ipv4","icmp_code":-1,"icmp_type":-1,"id":"b2d7a1e4-93c0-4f5a-8a76-0e1c4d2f9a35","protocol":"icmp","start_port":null,"state":"Active"}],"max_rules":50,"pending_job":false,"public_ip":"203.0.113.10"},"schema":{"properties":{"at":{"description":"Time the rules were read (Unix time, seconds, UTC)","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/FirewallRule"},"type":"array"},"max_rules":{"description":"Maximum number of rules per address family on one server.","type":"integer"},"pending_job":{"description":"True while a rule change you requested is still queued or running.","type":"boolean"},"public_ip":{"description":"Public IPv4 address the IPv4 rules apply to.","type":["string","null"]}},"required":["items","public_ip","max_rules","pending_job","at"],"type":"object","x-order":["items","public_ip","max_rules","pending_job","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server has no public address yet because it is still being provisioned. The error carries the current `state`. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`firewall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`firewall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The rules could not be read from the network. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The rules could not be read from the network. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The rules could not be read from the network. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Firewall rules","tags":["VM Networking"],"x-cli":"vm firewall list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/firewall\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Luật tường lửa"},"post":{"description":"Adds an inbound rule that lets one protocol and port range reach the server from one source range. The call returns as soon as the change is queued (`job_id`); the rule appears in [List firewall rules](#operation/vm_firewall_list) with state `Active` once the job is done.\n\nFor `tcp` and `udp` give `start_port` (and `end_port` for a range). `icmp` rules take no ports. `cidr_list` takes one CIDR block or one address (a single address becomes `/32`, or `/128` for IPv6) and defaults to everywhere. With `family` set to `ipv6` the rule applies to the server's IPv6 address, which must have been enabled for the server first. A server can have at most 50 rules per address family.\n\n**Required scope:** `vm:write`.","operationId":"vm_firewall_add","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cidr_list":"203.0.113.0/24","protocol":"tcp","start_port":443},"schema":{"properties":{"cidr_list":{"description":"Source address range as one CIDR block or one address, for example `203.0.113.0/24`. Defaults to `0.0.0.0/0` (`::/0` for IPv6). `cidr` is accepted as an alias.","type":"string"},"end_port":{"description":"Last port of the range, not lower than `start_port`. Defaults to `start_port`.","maximum":65535,"minimum":1,"type":"integer"},"family":{"description":"Address family. Defaults to `ipv4`.","enum":["ipv4","ipv6"],"type":"string"},"protocol":{"description":"Protocol the rule applies to. Case-insensitive.","enum":["tcp","udp","icmp"],"type":"string"},"start_port":{"description":"First port, 1 to 65535. Required for `tcp` and `udp`; ignored for `icmp`.","maximum":65535,"minimum":1,"type":"integer"}},"required":["protocol"],"type":"object","x-order":["protocol","start_port","end_port","cidr_list","family"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":1842},"schema":{"properties":{"job_id":{"description":"Identifier of the background job that applies the change. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"too_many_rules","message":"The server already has the maximum number of rules (`max_rules`, 50)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`too_many_rules`: The server already has the maximum number of rules (`max_rules`, 50). `vm_ipv6_disabled`: `family` is `ipv6` but IPv6 is not enabled for this server. `vm_not_ready`: The server has no public address yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `vpc_managed`: The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`firewall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"too_many_rules","description":"The server already has the maximum number of rules (`max_rules`, 50)."},{"code":"vm_ipv6_disabled","description":"`family` is `ipv6` but IPv6 is not enabled for this server."},{"code":"vm_not_ready","description":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"vpc_managed","description":"The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`firewall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_protocol","message":"`protocol` is not `tcp`, `udp` or `icmp`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_protocol`: `protocol` is not `tcp`, `udp` or `icmp`. `invalid_cidr`: `cidr_list` is not a valid CIDR block or address for the chosen family. `invalid_port`: A port is outside 1 to 65535, missing for `tcp`/`udp`, or `start_port` is higher than `end_port`.","x-error-codes":[{"code":"invalid_protocol","description":"`protocol` is not `tcp`, `udp` or `icmp`."},{"code":"invalid_cidr","description":"`cidr_list` is not a valid CIDR block or address for the chosen family."},{"code":"invalid_port","description":"A port is outside 1 to 65535, missing for `tcp`/`udp`, or `start_port` is higher than `end_port`."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The network could not be reached or answered with an error. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The network could not be reached or answered with an error. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The network could not be reached or answered with an error. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Add a firewall rule","tags":["VM Networking"],"x-cli":"vm firewall add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/firewall\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cidr_list\":\"203.0.113.0/24\",\"protocol\":\"tcp\",\"start_port\":443}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Thêm luật tường lửa"}},"/v1/vm/{id}/firewall/{rule_id}":{"delete":{"description":"Removes one firewall rule of the server, IPv4 or IPv6. The call returns as soon as the removal is queued (`job_id`). Only rules that belong to this server can be removed; any other `rule_id` answers `404`.\n\nGet the `rule_id` from [List firewall rules](#operation/vm_firewall_list).\n\n**Required scope:** `vm:write`.","operationId":"vm_firewall_delete","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Rule identifier as returned by the list operation.","in":"path","name":"rule_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":1843},"schema":{"properties":{"job_id":{"description":"Identifier of the background job that applies the change. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist, is not yours, or has no rule with this identifier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist, is not yours, or has no rule with this identifier. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist, is not yours, or has no rule with this identifier."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server has no public address yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `vpc_managed`: The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`firewall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"vpc_managed","description":"The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`firewall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`rule_id` is not a valid rule identifier (lowercase hexadecimal digits and hyphens, at most 64 characters)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rule_id` is not a valid rule identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`rule_id` is not a valid rule identifier (lowercase hexadecimal digits and hyphens, at most 64 characters)."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The network could not be reached or answered with an error. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The network could not be reached or answered with an error. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The network could not be reached or answered with an error. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Delete a firewall rule","tags":["VM Networking"],"x-cli":"vm firewall delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/firewall/<rule_id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Xoá luật tường lửa"}},"/v1/vm/{id}/force-stop":{"post":{"description":"Powers the server off immediately, like pulling the power cable. Unsaved data in memory is lost and file systems may need a repair on the next boot, so use Stop first and keep this for servers that do not respond. The call returns immediately with a `job_id`.\n\n**Required scope:** `vm:write`.","operationId":"vm_force_stop","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":4812},"schema":{"$ref":"#/components/schemas/VmActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Force stop the VM","tags":["Virtual Machines"],"x-cli":"vm force-stop","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/force-stop\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Ngắt điện máy"}},"/v1/vm/{id}/fsinfo":{"get":{"description":"Returns how full the server's main disk is, measured from inside the server (root filesystem, or the `C:` drive on Windows). The three disk values are null when the server is not running, is locked, has no guest agent installed, or the measurement is not available on this site, so treat null as \"unknown\", not as an error. The result is cached for about 60 seconds; at most 30 uncached measurements per minute are allowed per client address.\n\n**Required scope:** `vm:console`.","operationId":"vm_fsinfo","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1795100000,"disk_pct":37.5,"disk_total_gb":60.0,"disk_used_gb":22.5},"schema":{"properties":{"at":{"description":"When the answer was produced (Unix time, seconds, UTC)","type":"integer"},"disk_pct":{"description":"Used share of the disk in percent, one decimal.","type":["number","null"]},"disk_total_gb":{"description":"Total size in GiB, one decimal.","type":["number","null"]},"disk_used_gb":{"description":"Used space in GiB, one decimal.","type":["number","null"]}},"required":["disk_pct","disk_used_gb","disk_total_gb","at"],"type":"object","x-order":["disk_pct","disk_used_gb","disk_total_gb","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 30 uncached measurements in a minute from the same client address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 30 uncached measurements in a minute from the same client address."}]}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Disk used/total measured inside the VM","tags":["Virtual Machines"],"x-cli":"vm fsinfo","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/fsinfo\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Dung lượng đĩa dùng/tổng đo trong máy"}},"/v1/vm/{id}/iso":{"get":{"description":"Shows which ISO is attached to a server and which of your ISO images can be attached to it. `attached` is the ISO currently inserted, or null when there is none; its `image_id` is null when that ISO is not one of yours (for example a system ISO attached by support). `images` lists your `Ready`, unlocked ISO images that are in the same region as the server. If the current attachment cannot be read right now, `live` is false and `attached` is null while `images` is still returned.\n\n**Required scope:** `vm:read`.","operationId":"vm_iso_get","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"attached":{"image_id":14,"name":"Rescue ISO"},"cs_state":"Running","images":[{"cents_per_month":1,"id":14,"name":"Rescue ISO","os_type_name":"Other Linux (64-bit)","size_gb":1}],"live":true,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"attached":{"description":"The ISO currently attached to the server.","properties":{"image_id":{"description":"Identifier of the attached image when it is one of yours, otherwise null.","type":["integer","null"]},"name":{"description":"Name of the attached ISO.","type":["string","null"]}},"required":["image_id","name"],"type":["object","null"]},"cs_state":{"description":"Last known power state of the server, for example `Running` or `Stopped`.","type":["string","null"]},"images":{"description":"ISO images that can be attached to this server.","items":{"properties":{"cents_per_month":{"description":"Estimated monthly storage cost in US cents.","type":"integer"},"id":{"description":"Image identifier; pass it as `iid` to Attach an ISO.","type":"integer"},"name":{"description":"Name of the ISO.","type":"string"},"os_type_name":{"description":"Operating system type chosen at import.","type":["string","null"]},"size_gb":{"description":"Billed size in whole GB.","type":"integer"}},"required":["id","name","size_gb","os_type_name","cents_per_month"],"type":"object","x-order":["id","name","size_gb","os_type_name","cents_per_month"]},"type":"array"},"live":{"description":"False when the attachment could not be read right now; `attached` is then null even if an ISO is attached.","type":"boolean"},"vm_id":{"description":"The server UUID.","type":"string"}},"required":["vm_id","attached","live","images","cs_state"],"type":"object","x-order":["vm_id","attached","live","images","cs_state"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`iso`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`iso`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. (`not_supported_in_zone`)","x-error-codes":[{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`iso`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Image management is switched off on this site (or not yet enabled for your account)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Image management is switched off on this site (or not yet enabled for your account). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Image management is switched off on this site (or not yet enabled for your account)."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"ISO attached to the VM + attachable ISOs","tags":["Images"],"x-cli":"vm iso get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/iso\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"ISO đang gắn vào máy + ISO gắn được"}},"/v1/vm/{id}/jobs":{"get":{"description":"Returns the 50 most recent background jobs of the server, newest first: creation, power actions, plan changes, SSH-key changes and deletion. Every action endpoint returns a `job_id`; poll this list until that job's `state` is `done`, `failed` or `cancelled`. `last_error` is a short customer-safe message and `error_code` a stable short code; internal diagnostics are never exposed.\n\n**Required scope:** `vm:read`.","operationId":"vm_jobs","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"attempt":1,"created_at":1792400000,"error_code":null,"finished_at":1792400042,"id":4812,"kind":"reboot","last_error":null,"state":"done","step":"done","updated_at":1792400042},{"attempt":1,"created_at":1792368000,"error_code":null,"finished_at":1792368090,"id":4790,"kind":"deploy","last_error":null,"state":"done","step":"done","updated_at":1792368090}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VmJob"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Running jobs of the VM","tags":["Virtual Machines"],"x-cli":"vm jobs","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/jobs\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Việc đang chạy trên máy"}},"/v1/vm/{id}/metrics":{"get":{"description":"Returns CPU, memory, disk and network time series for the last 30 minutes up to 12 hours, one sample per minute, plus the current reading in `now`. Rates are in KB/s; CPU and memory are percentages. Results are cached for 60 seconds per server and range.\n\nFails with `409 vm_not_ready` while the server has not been created on the infrastructure yet.\n\n**Required scope:** `vm:read`.","operationId":"vm_metrics","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Length of the window ending now. Unknown values fall back to the default.","in":"query","name":"range","required":false,"schema":{"default":"1h","enum":["30m","1h","6h","12h"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cpu":{"labels":["2026-10-19T09:00:00Z","2026-10-19T09:01:00Z","2026-10-19T09:02:00Z"],"values":[3.2,4.1,2.8]},"disk":{"unit":"KB/s","values_read":[0.0,1.2,0.0],"values_write":[14.5,9.8,11.1]},"memory":{"values":[41.5,41.7,41.6]},"network":{"unit":"KB/s","values_read":[12.4,8.1,9.7],"values_write":[30.2,22.9,25.0]},"now":{"cpu_pct":2.8,"mem_pct":41.6,"mem_total_mb":4096.0,"mem_used_mb":1704.0,"state":"Running"},"points":3,"range":"1h"},"schema":{"properties":{"cpu":{"properties":{"labels":{"items":{"description":"Sample time, ISO 8601 in UTC.","type":"string"},"type":"array"},"values":{"items":{"description":"CPU usage in percent, one value per label.","type":"number"},"type":"array"}},"required":["labels","values"],"type":"object"},"disk":{"properties":{"unit":{"description":"Always `KB/s`.","type":"string"},"values_read":{"items":{"description":"Disk reads in KB/s.","type":"number"},"type":"array"},"values_write":{"items":{"description":"Disk writes in KB/s.","type":"number"},"type":"array"}},"required":["values_read","values_write","unit"],"type":"object","x-order":["values_read","values_write","unit"]},"memory":{"properties":{"values":{"items":{"description":"Memory usage in percent, one value per label.","type":"number"},"type":"array"}},"required":["values"],"type":"object"},"network":{"properties":{"unit":{"description":"Always `KB/s`.","type":"string"},"values_read":{"items":{"description":"Traffic into the server in KB/s.","type":"number"},"type":"array"},"values_write":{"items":{"description":"Traffic out of the server in KB/s.","type":"number"},"type":"array"}},"required":["values_read","values_write","unit"],"type":"object","x-order":["values_read","values_write","unit"]},"now":{"properties":{"cpu_pct":{"description":"Current CPU usage in percent.","type":"number"},"mem_pct":{"description":"Current memory usage in percent.","type":"number"},"mem_total_mb":{"description":"Memory installed, in MiB.","type":"number"},"mem_used_mb":{"description":"Memory in use, in MiB.","type":"number"},"state":{"description":"Current power state.","type":["string","null"]}},"required":["cpu_pct","mem_pct","mem_used_mb","mem_total_mb","state"],"type":["object","null"],"x-order":["cpu_pct","mem_pct","mem_used_mb","mem_total_mb","state"]},"points":{"description":"Number of samples returned.","type":"integer"},"range":{"description":"Window that was applied.","type":"string"}},"required":["range","points","cpu","memory","network","disk","now"],"type":"object","x-order":["range","points","cpu","memory","network","disk","now"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`. (`vm_not_ready`)","x-error-codes":[{"code":"vm_not_ready","description":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The infrastructure did not answer. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The infrastructure did not answer. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The infrastructure did not answer. Retry in a few seconds."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"CPU/RAM/disk/network over time","tags":["Virtual Machines"],"x-cli":"vm metrics","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/metrics\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"CPU/RAM/đĩa/mạng theo thời gian"}},"/v1/vm/{id}/nics":{"get":{"description":"Lists the network interfaces of the server with their IPv4 and IPv6 addressing. `public_ip` is the address the server is reached on from the internet; it is mapped 1:1 to the private address of the default interface. Results are cached for 20 seconds. Fails with `409 vm_not_ready` while the server has not been created on the infrastructure yet.\n\n**Required scope:** `vm:read`.","operationId":"vm_nics","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792400000,"items":[{"gateway":"10.1.1.1","id":"9a4e1c77-2b0d-4d5e-b3a8-6f1d2e8c0a45","ip6address":"2001:db8:10::25","ip6cidr":"2001:db8:10::/64","ip6gateway":"2001:db8:10::1","ipaddress":"10.1.1.25","isdefault":true,"macaddress":"02:00:2f:7a:00:19","netmask":"255.255.255.0","networkname":"shared-dualstack","traffictype":"Guest"}],"public_ip":"203.0.113.25","static_nat":true},"schema":{"properties":{"at":{"description":"When the data was read (Unix time, seconds, UTC)","type":"integer"},"items":{"items":{"properties":{"gateway":{"description":"IPv4 gateway.","type":["string","null"]},"id":{"description":"Interface identifier.","type":["string","null"]},"ip6address":{"description":"IPv6 address, when IPv6 is enabled.","type":["string","null"]},"ip6cidr":{"description":"IPv6 prefix.","type":["string","null"]},"ip6gateway":{"description":"IPv6 gateway.","type":["string","null"]},"ipaddress":{"description":"Private IPv4 address.","type":["string","null"]},"isdefault":{"description":"Whether this is the default interface.","type":"boolean"},"macaddress":{"description":"MAC address.","type":["string","null"]},"netmask":{"description":"IPv4 netmask.","type":["string","null"]},"networkname":{"description":"Name of the network the interface is attached to.","type":["string","null"]},"traffictype":{"description":"Traffic type of the interface, for example `Guest`.","type":["string","null"]}},"required":["id","ipaddress","netmask","gateway","macaddress","isdefault","networkname","ip6address","ip6cidr","ip6gateway","traffictype"],"type":"object","x-order":["id","ipaddress","netmask","gateway","macaddress","isdefault","networkname","ip6address","ip6cidr","ip6gateway","traffictype"]},"type":"array"},"public_ip":{"description":"Public IPv4 address of the server.","type":["string","null"]},"static_nat":{"description":"Always `true`: the public address is mapped 1:1 to the server.","type":"boolean"}},"required":["items","public_ip","static_nat","at"],"type":"object","x-order":["items","public_ip","static_nat","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`nics`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`nics`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The infrastructure did not answer. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The infrastructure did not answer. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The infrastructure did not answer. Retry in a few seconds."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Network interfaces and IPs","tags":["Virtual Machines"],"x-cli":"vm nics","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/nics\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Card mạng và IP"}},"/v1/vm/{id}/plan-options":{"get":{"description":"Lists the fixed plans this server can switch to: plans in the same region that are on sale to you, have a disk at least as large as the current one and differ from the current plan, cheapest first. Each option carries a ready-made `quote` (the same object Get plan quote returns), whether the change needs the server to be stopped (`requires_stop`), and what kind of change it is.\n\n`blocked` is non-null when plan changes are impossible at the moment, for example because the server runs a custom configuration (use Change custom configuration instead) or is not `active`.\n\n**Required scope:** `vm:read`.","operationId":"vm_plan_options","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"blocked":null,"current":{"cpu":2,"cycle":"monthly","disk_gb":60,"is_custom":false,"name":"Standard 2/4","plan_id":3,"ram_mb":4096},"options":[{"change":"upgrade","cpu":4,"disk_gb":80,"hourly_uusd":9408,"live":false,"monthly_cents":686,"name":"Standard 4/8","plan_id":4,"quote":{"allowed":true,"amount_due_cents":288,"balance_cents":2500,"cycle":"monthly","disk_shrink":false,"from":{"cents":343,"cpu":2,"disk_gb":60,"hourly":"$0.005","hourly_mills":5,"monthly_cents":343,"name":"Standard 2/4","plan_id":3,"ram_mb":4096},"hourly_note":false,"immediate":true,"months":1,"refund_cents":0,"remaining_hours":612,"same_plan":false,"to":{"cents":686,"cpu":4,"disk_gb":80,"hourly":"$0.010","hourly_mills":10,"monthly_cents":686,"name":"Standard 4/8","plan_id":4,"ram_mb":8192},"unused_cents":288},"ram_mb":8192,"requires_stop":true}],"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"schema":{"properties":{"blocked":{"properties":{"code":{"description":"Why plan changes are blocked: `custom_switch_unsupported` (the server runs a custom configuration) or `vm_not_active`.","enum":["custom_switch_unsupported","vm_not_active"],"type":"string"}},"required":["code"],"type":["object","null"]},"current":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cycle":{"description":"Billing cycle slug.","type":"string"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"is_custom":{"description":"`true` when the server runs a custom configuration.","type":"boolean"},"name":{"description":"Current plan name.","type":"string"},"plan_id":{"description":"Current plan identifier.","type":"integer"},"ram_mb":{"description":"Memory in MiB.","type":"integer"}},"required":["plan_id","name","cpu","ram_mb","disk_gb","is_custom","cycle"],"type":"object","x-order":["plan_id","name","cpu","ram_mb","disk_gb","is_custom","cycle"]},"options":{"items":{"properties":{"change":{"description":"Kind of change compared with the current plan.","enum":["upgrade","downgrade","sidegrade"],"type":"string"},"cpu":{"description":"Virtual CPU cores.","type":"integer"},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"hourly_uusd":{"description":"Exact hourly price at your site, in millionths of a US dollar.","type":"integer"},"live":{"description":"Always `false`: plan changes are not applied without a restart.","type":"boolean"},"monthly_cents":{"description":"Price for a 30-day month at your site, in US cents.","type":"integer"},"name":{"description":"Plan name.","type":"string"},"plan_id":{"description":"Plan identifier. Pass it to Change plan.","type":"integer"},"quote":{"anyOf":[{"$ref":"#/components/schemas/VmPlanQuote"},{"type":"null"}]},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"requires_stop":{"description":"`true` when the server is (or may be) running and the change needs it to be stopped and started again.","type":"boolean"}},"required":["plan_id","name","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents","change","live","requires_stop","quote"],"type":"object","x-order":["plan_id","name","cpu","ram_mb","disk_gb","hourly_uusd","monthly_cents","change","live","requires_stop","quote"]},"type":"array"},"vm_id":{"description":"Server identifier.","type":"string"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]}},"required":["vm_id","zone","current","blocked","options"],"type":"object","x-order":["vm_id","zone","current","blocked","options"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Plans this VM can switch to (same zone)","tags":["Virtual Machines"],"x-cli":"vm plan-options","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/plan-options\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Gói đổi được từ máy này (cùng vị trí)"}},"/v1/vm/{id}/plan-quote":{"get":{"description":"Dry run of Change plan: tells you what moving the server to another fixed plan would cost or refund, without changing or charging anything. For prepaid servers the amount is the prorated price difference for the time left in the paid period; for hourly servers the new price simply applies from the next hour (`hourly_note` is `true`). `allowed` says whether Change plan would accept the change right now.\n\n`cycle` lets you preview the price for another billing cycle; it does not change the cycle of the server.\n\n**Required scope:** `vm:read`.","operationId":"vm_plan_quote","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Plan to move to, from the catalog.","example":4,"in":"query","name":"plan_id","required":true,"schema":{"type":"integer"}},{"description":"Billing cycle slug to quote for. Defaults to the cycle of the server.","example":"monthly","in":"query","name":"cycle","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"allowed":true,"amount_due_cents":288,"balance_cents":2500,"cycle":"monthly","disk_shrink":false,"from":{"cents":343,"cpu":2,"disk_gb":60,"hourly":"$0.005","hourly_mills":5,"monthly_cents":343,"name":"Standard 2/4","plan_id":3,"ram_mb":4096},"hourly_note":false,"immediate":true,"months":1,"refund_cents":0,"remaining_hours":612,"same_plan":false,"to":{"cents":686,"cpu":4,"disk_gb":80,"hourly":"$0.010","hourly_mills":10,"monthly_cents":686,"name":"Standard 4/8","plan_id":4,"ram_mb":8192},"unused_cents":288},"schema":{"$ref":"#/components/schemas/VmPlanQuote"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"plan_other_zone","message":"The plan belongs to another region. A server cannot move between regions; create a new server there instead."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan_other_zone`: The plan belongs to another region. A server cannot move between regions; create a new server there instead. `resize_license`: The chosen plan carries an operating-system license the server does not have, or a different one.","x-error-codes":[{"code":"plan_other_zone","description":"The plan belongs to another region. A server cannot move between regions; create a new server there instead."},{"code":"resize_license","description":"The chosen plan carries an operating-system license the server does not have, or a different one."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`plan_id` is missing, unknown, not on sale, a custom configuration, not visible to your site, or `cycle` is not a valid billing cycle. The error names the offending `field`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan_id` is missing, unknown, not on sale, a custom configuration, not visible to your site, or `cycle` is not a valid billing cycle. The error names the offending `field`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`plan_id` is missing, unknown, not on sale, a custom configuration, not visible to your site, or `cycle` is not a valid billing cycle. The error names the offending `field`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Quote before changing plan","tags":["Virtual Machines"],"x-cli":"vm plan-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/plan-quote?plan_id=<plan_id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Báo giá trước khi đổi gói"}},"/v1/vm/{id}/port-forwarding":{"get":{"description":"Lists the port forwarding rules of the server's public address. Servers normally use a dedicated public address that is mapped 1:1 to the server (static NAT): every port already reaches the server, `static_nat` is true and `items` is empty. Control which traffic is allowed with [firewall rules](#operation/vm_firewall_list) instead. The result is cached for about 20 seconds.\n\n**Required scope:** `vm:read`.","operationId":"vm_port_forward_list","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792400000,"items":[],"private_ip":"10.1.2.34","public_ip":"203.0.113.10","static_nat":true},"schema":{"properties":{"at":{"description":"Time the rules were read (Unix time, seconds, UTC)","type":"integer"},"items":{"items":{"$ref":"#/components/schemas/PortForwardRule"},"type":"array"},"private_ip":{"description":"Private address of the server.","type":["string","null"]},"public_ip":{"description":"Public IPv4 address of the server.","type":["string","null"]},"static_nat":{"description":"True when the public address is mapped 1:1 to the server, in which case port forwarding rules cannot be added.","type":"boolean"}},"required":["static_nat","items","public_ip","private_ip","at"],"type":"object","x-order":["static_nat","items","public_ip","private_ip","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server has no public address yet because it is still being provisioned. The error carries the current `state`. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`port_forward`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`port_forward`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The rules could not be read from the network. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The rules could not be read from the network. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The rules could not be read from the network. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Port forwarding rules","tags":["VM Networking"],"x-cli":"vm port-forward list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/port-forwarding\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Luật chuyển cổng"},"post":{"description":"Forwards a public port (or port range) to a port of the server. The public and private ranges must have the same length. The call returns as soon as the change is queued (`job_id`).\n\nWhen the public address is mapped 1:1 to the server (`static_nat` is true in [List port forwarding rules](#operation/vm_port_forward_list)) every port already reaches the server and the call fails with `409 static_nat_enabled`. A server can have at most 50 rules.\n\n**Required scope:** `vm:write`.","operationId":"vm_port_forward_add","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"private_start":80,"protocol":"tcp","public_start":8080},"schema":{"properties":{"private_end":{"description":"Last server port. Defaults to `private_start`. A value outside 1 to 65535 is ignored.","maximum":65535,"minimum":1,"type":"integer"},"private_start":{"description":"First server port, 1 to 65535.","maximum":65535,"minimum":1,"type":"integer"},"protocol":{"description":"Protocol to forward. Case-insensitive.","enum":["tcp","udp"],"type":"string"},"public_end":{"description":"Last public port. Defaults to `public_start`. A value outside 1 to 65535 is ignored.","maximum":65535,"minimum":1,"type":"integer"},"public_start":{"description":"First public port, 1 to 65535.","maximum":65535,"minimum":1,"type":"integer"}},"required":["protocol","public_start","private_start"],"type":"object","x-order":["protocol","public_start","public_end","private_start","private_end"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":1844},"schema":{"properties":{"job_id":{"description":"Identifier of the background job that applies the change. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"static_nat_enabled","message":"The public address is mapped 1:1 to the server, so port forwarding is not needed and cannot be added."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`static_nat_enabled`: The public address is mapped 1:1 to the server, so port forwarding is not needed and cannot be added. `too_many_rules`: The server already has the maximum number of rules (`max_rules`, 50). `vm_not_ready`: The server has no public address yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `vpc_managed`: The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`port_forward`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"static_nat_enabled","description":"The public address is mapped 1:1 to the server, so port forwarding is not needed and cannot be added."},{"code":"too_many_rules","description":"The server already has the maximum number of rules (`max_rules`, 50)."},{"code":"vm_not_ready","description":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"vpc_managed","description":"The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`port_forward`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_protocol","message":"`protocol` is not `tcp` or `udp`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_protocol`: `protocol` is not `tcp` or `udp`. `invalid_port`: A start port is missing or outside 1 to 65535, an end port is lower than its start port, or the two ranges differ in length.","x-error-codes":[{"code":"invalid_protocol","description":"`protocol` is not `tcp` or `udp`."},{"code":"invalid_port","description":"A start port is missing or outside 1 to 65535, an end port is lower than its start port, or the two ranges differ in length."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The network could not be reached or answered with an error. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The network could not be reached or answered with an error. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The network could not be reached or answered with an error. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Add a port-forwarding rule","tags":["VM Networking"],"x-cli":"vm port-forward add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/port-forwarding\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"private_start\":80,\"protocol\":\"tcp\",\"public_start\":8080}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Thêm luật chuyển cổng"}},"/v1/vm/{id}/port-forwarding/{rule_id}":{"delete":{"description":"Removes one port forwarding rule of the server. The call returns as soon as the removal is queued (`job_id`). Get the `rule_id` from [List port forwarding rules](#operation/vm_port_forward_list).\n\n**Required scope:** `vm:write`.","operationId":"vm_port_forward_delete","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Rule identifier as returned by the list operation.","in":"path","name":"rule_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":1845},"schema":{"properties":{"job_id":{"description":"Identifier of the background job that applies the change. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist, is not yours, or has no port forwarding rule with this identifier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist, is not yours, or has no port forwarding rule with this identifier. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist, is not yours, or has no port forwarding rule with this identifier."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server has no public address yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `vpc_managed`: The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`port_forward`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server has no public address yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"vpc_managed","description":"The server belongs to a Private Cloud, whose traffic rules are managed through the Private Cloud network ACL instead."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`port_forward`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`rule_id` is not a valid rule identifier (lowercase hexadecimal digits and hyphens, at most 64 characters)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rule_id` is not a valid rule identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`rule_id` is not a valid rule identifier (lowercase hexadecimal digits and hyphens, at most 64 characters)."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The network could not be reached or answered with an error. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The network could not be reached or answered with an error. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The network could not be reached or answered with an error. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Delete a port-forwarding rule","tags":["VM Networking"],"x-cli":"vm port-forward delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/port-forwarding/<rule_id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Xoá luật chuyển cổng"}},"/v1/vm/{id}/price":{"get":{"description":"Returns the price this server is billed at right now and the price its next renewal will cost. Prices are exact integers: `hourly_uusd` is in millionths of a US dollar and the `*_cents` fields are in US cents. A prepaid server keeps the price it paid for until the period ends, so after the site lowers its list price `renewal_cents` can be lower than `cycle_cents`.\n\nNothing is charged. Use [Quote a plan change](#operation/vm_change_quote) and [Quote a billing-cycle change](#operation/vm_cycle_quote) to price a change.\n\n**Required scope:** `vm:read`.","operationId":"vm_price","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"billed_until":null,"cycle":"monthly","cycle_cents":343,"cycles":{"monthly":343,"yearly":3705},"hourly":"$0.004704","hourly_uusd":4704,"is_custom":false,"monthly_cents":343,"paid_until":1795600000,"renewal_cents":343,"renewal_hourly":"$0.004704","renewal_hourly_uusd":4704},"schema":{"properties":{"billed_until":{"description":"End of the hour already billed. null for prepaid servers (Unix time, seconds, UTC)","type":["integer","null"]},"cycle":{"description":"Billing cycle slug: `hourly`, or a prepaid cycle such as `monthly` or `yearly`.","type":"string"},"cycle_cents":{"description":"Price of one period of the current cycle as it was paid, in US cents. 0 for hourly servers.","type":"integer"},"cycles":{"additionalProperties":true,"description":"Full price of one period of each prepaid billing cycle for this server, in US cents, keyed by cycle slug (for example `{\"monthly\": 480, \"yearly\": 5184}`). Use these numbers rather than deriving them from the hourly price: in international regions the hourly price carries an hourly surcharge that monthly and longer cycles do not.","type":"object"},"hourly":{"description":"The same price as a decimal string, for display, e.g. `$0.004704`.","type":"string"},"hourly_uusd":{"description":"Exact price per hour the server is billed at, in millionths of a US dollar (4704 = US$0.004704).","type":"integer"},"is_custom":{"description":"True when the server uses a custom size instead of a fixed plan.","type":"boolean"},"monthly_cents":{"description":"The hourly price for a 730-hour month, in US cents.","type":"integer"},"paid_until":{"description":"End of the period already paid for. null for hourly servers (Unix time, seconds, UTC)","type":["integer","null"]},"renewal_cents":{"description":"What the next renewal of one period would cost at today's prices, in US cents. 0 for hourly servers.","type":"integer"},"renewal_hourly":{"description":"The same price as a decimal string.","type":"string"},"renewal_hourly_uusd":{"description":"Hourly price that will apply after the next renewal, in millionths of a US dollar.","type":"integer"}},"required":["is_custom","hourly_uusd","hourly","monthly_cents","cycle","cycle_cents","renewal_cents","renewal_hourly_uusd","renewal_hourly","paid_until","billed_until","cycles"],"type":"object","x-order":["is_custom","hourly_uusd","hourly","monthly_cents","cycle","cycle_cents","renewal_cents","renewal_hourly_uusd","renewal_hourly","paid_until","billed_until","cycles"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Current price of the VM (hourly, cycle, renewal)","tags":["Virtual Machines"],"x-cli":"vm price","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/price\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Giá hiện tại của máy (theo giờ, chu kỳ, giá gia hạn)"}},"/v1/vm/{id}/reboot":{"post":{"description":"Restarts the server (a soft reboot signalled to the operating system). A stopped server is started instead. The call returns immediately with a `job_id`.\n\n**Required scope:** `vm:write`.","operationId":"vm_reboot","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":4812},"schema":{"$ref":"#/components/schemas/VmActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Reboot the VM","tags":["Virtual Machines"],"x-cli":"vm reboot","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/reboot\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Khởi động lại"}},"/v1/vm/{id}/reinstall":{"post":{"description":"**Erases the server's system disk** and installs the operating system again, either the one it already runs or, when `template_id` is given, a different image from the catalog. Everything on the system disk is lost and cannot be recovered; additional data volumes are not touched. The server keeps its plan, IP address and billing, and nothing is charged or refunded.\n\nThe call returns as soon as the job is queued (`job_id`); follow it with [List VM jobs](#operation/vm_jobs). While it runs the server is restarted and unreachable. When the installation finishes a new administrator password is sent to the account's e-mail address; if none could be produced, use Reset password. A server that still has snapshots cannot be reinstalled (`409 has_snapshots`): delete them first.\n\n**Required scope:** `vm:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_reinstall","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"template_id":11},"schema":{"properties":{"template_id":{"description":"Image to install, from the catalog `templates`. Omit it, or send the image the server already uses, to reinstall the same operating system.","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":1903},"schema":{"$ref":"#/components/schemas/VmJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or `template_id` is not an integer. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON or `template_id` is not an integer. The error carries a `detail`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or `template_id` is not an integer. The error carries a `detail`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"has_snapshots","message":"The server still has snapshots. The error carries their `count`. Delete them, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`has_snapshots`: The server still has snapshots. The error carries their `count`. Delete them, then retry. `vm_not_active`: The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`reinstall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"has_snapshots","description":"The server still has snapshots. The error carries their `count`. Delete them, then retry."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`reinstall`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`template_id` is not an image you can install on this server. The error carries `field` = `template_id`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `template_id` is not an image you can install on this server. The error carries `field` = `template_id`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`template_id` is not an image you can install on this server. The error carries `field` = `template_id`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The server's snapshots could not be checked, so nothing was started. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's snapshots could not be checked, so nothing was started. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The server's snapshots could not be checked, so nothing was started. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:destroy"]}],"summary":"Reinstall the OS (WIPES the disk)","tags":["Virtual Machines"],"x-cli":"vm reinstall","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/reinstall\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"template_id\":11}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:destroy","x-summary-vi":"Cài lại hệ điều hành (XOÁ SẠCH đĩa)"}},"/v1/vm/{id}/renew":{"post":{"description":"Renews a prepaid server for one or more periods of its billing cycle. The price of all periods (the price of one period, times `periods`; a site price cut since the last renewal is applied) is taken from the wallet immediately and a paid invoice is created; `paid_until` moves forward from the current end date, or from now if the server has already expired. The wallet is checked first, so a failed renewal charges nothing.\n\nIt does not create a job: the new date is in the response. Total prepaid time is capped at 36 months, so `periods` can be at most 12 for a monthly cycle, 3 for a yearly one and 1 for the 2-year and 3-year cycles. Hourly servers have nothing to renew (`409 hourly_no_renew`); switch them to a prepaid cycle with [Change the billing cycle](#operation/vm_change_cycle). The body is optional and defaults to one period. At most 10 renewals per minute are accepted per client address.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_renew","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"periods":1},"schema":{"properties":{"periods":{"default":1,"description":"Number of billing periods to renew, at least 1. The upper limit depends on the cycle (see above) and is returned as `max` in the error when exceeded.","maximum":12,"minimum":1,"type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"charged_cents":343,"invoice_id":1042,"months":1,"paid_until":1798200000,"periods":1},"schema":{"properties":{"charged_cents":{"description":"Amount taken from the wallet, in US cents.","type":"integer"},"invoice_id":{"description":"Identifier of the invoice created for the renewal. See the Billing endpoints.","type":"integer"},"months":{"description":"Months added in total.","type":"integer"},"paid_until":{"description":"New end of the paid period (Unix time, seconds, UTC)","type":"integer"},"periods":{"description":"Number of periods renewed.","type":"integer"}},"required":["charged_cents","paid_until","invoice_id","periods","months"],"type":"object","x-order":["charged_cents","paid_until","invoice_id","periods","months"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or `periods` is not an integer. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON or `periods` is not an integer. The error carries a `detail`. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or `periods` is not an integer. The error carries a `detail`."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance does not cover the renewal. The error carries `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance does not cover the renewal. The error carries `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance does not cover the renewal. The error carries `need_cents` and `balance_cents`."}]},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"hourly_no_renew","message":"The server is billed by the hour and has no period to renew."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`hourly_no_renew`: The server is billed by the hour and has no period to renew. `renewal_in_progress`: Another renewal of this server was processed in the same second. Nothing was charged; read the new `paid_until` before renewing again. `vm_not_active`: The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"hourly_no_renew","description":"The server is billed by the hour and has no period to renew."},{"code":"renewal_in_progress","description":"Another renewal of this server was processed in the same second. Nothing was charged; read the new `paid_until` before renewing again."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`periods` is below 1 or above the maximum for the cycle. The error carries `field` = `periods` and `max`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `periods` is below 1 or above the maximum for the cycle. The error carries `field` = `periods` and `max`. `cycle_not_available_in_zone`: The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`periods` is below 1 or above the maximum for the cycle. The error carries `field` = `periods` and `max`."},{"code":"cycle_not_available_in_zone","description":"The billing cycle is not sold in the server's region (for example long prepaid cycles in some regions). The error carries `cycles`, the cycle slugs the region sells; they are also listed as `cycles` on the catalog `zones`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 renewals in a minute from the same client address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 renewals in a minute from the same client address."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"provider_unavailable","message":"The site cannot accept new charges at the moment. Nothing was charged; retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site cannot accept new charges at the moment. Nothing was charged; retry later. (`provider_unavailable`)","x-error-codes":[{"code":"provider_unavailable","description":"The site cannot accept new charges at the moment. Nothing was charged; retry later."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Renew a prepaid VM (charges the wallet)","tags":["Virtual Machines"],"x-cli":"vm renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"periods\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Gia hạn máy trả trước (trừ tiền ví)"}},"/v1/vm/{id}/reset-password":{"post":{"description":"Generates a new administrator password for the server. A running server is stopped, the password is reset, and the server is started again, so expect a short downtime. The new password is never returned by the API: it is e-mailed to the account holder once the job is `done`. Keep a copy of your SSH key as the alternative way in.\n\n**Required scope:** `vm:console`.","operationId":"vm_reset_password","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":4812},"schema":{"$ref":"#/components/schemas/VmActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Reset the admin password","tags":["Virtual Machines"],"x-cli":"vm reset-password","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/reset-password\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Đặt lại mật khẩu quản trị"}},"/v1/vm/{id}/scale":{"get":{"description":"Returns everything needed to build a resize form for one server in a single call: its current size and price, the limits and unit prices of your site, what it can do without a restart, the reasons a resize is not possible right now, and your wallet balance. It changes nothing and costs nothing.\n\n`feature` is false when the site does not sell resizing; the write operations of this section then fail with `403 feature_disabled`. A resize also needs the site to sell custom configurations, because the new size is priced like a custom configuration.\n\n**Required scope:** `vm:read`.","operationId":"vm_scale_get","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"autoscale_feature":true,"balance_cents":2500,"billed_until":1790003600,"blocked":[],"caps":{"cpu_hotplug":true,"hotplug":true,"ram_hotplugs_max":16,"ram_hotplugs_used":0,"running":true,"windows":false},"feature":true,"hours_per_month":730,"limits":{"cpu":{"max":32,"min":1,"step":1},"disk_gb":{"max":1000,"min":50,"step":10},"ram_gb":{"max":64,"min":1,"step":1},"ram_mb_step":1024,"unit_uusd_h":{"cpu":2740,"disk_gb":110,"ram_gb":1370}},"pending_revert":false,"state":"base","vm":{"cpu":2,"cs_state":"Running","cycle":"hourly","disk_gb":50,"hostname":"web-1","hourly_uusd":16460,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","monthly_cents":1202,"plan_id":14,"ram_mb":4096,"state":"active"}},"schema":{"$ref":"#/components/schemas/ScaleStatus"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_supported_in_zone","message":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. (`not_supported_in_zone`)","x-error-codes":[{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Scaling status: limits, capabilities, blockers","tags":["Scaling"],"x-cli":"vm scale get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/scale\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Tình trạng co giãn: giới hạn, năng lực, chặn"},"post":{"description":"Resizes a server to the vCPU, RAM and disk you give, now or at a scheduled time. **This operation costs money.** The price of the new size is always computed by the server. For a server billed by the hour, one hour at the new price is charged to your wallet up front and the hourly price changes from then on. For a server on a prepaid billing cycle, the price difference for the rest of the cycle is charged, or refunded (never more than you paid for the cycle) when the new size is cheaper. If the resize fails in the background, the charge is refunded automatically.\n\nThe call returns as soon as the change is accepted; the resize runs as a background job (`job_id`, see [List VM jobs](#operation/vm_jobs)). `live` tells you whether the server keeps running: it is `true` only for an increase of RAM or vCPUs on a running server that has been restarted since live resizing became available, whose image supports hot-plugging and whose disk does not change. Every other change, including any decrease and any disk enlargement, stops and starts the server again, which is a short interruption. A disk can only grow, in steps.\n\nPass `at` to schedule a **decrease**: nothing is charged now, the schedule is stored (one schedule per server; a new one replaces the old) and the resize and its payment or refund happen at that time. Increases cannot be scheduled, and `at` may be at most 7 days ahead. A scheduled call answers `{\"scheduled\": true, \"at\": ...}`.\n\nThe server must be `active`, unlocked, with no other operation running, and the new size must be within the `limits` returned by [Get scaling status](#operation/vm_scale_get). Requests are limited to 1 per minute per server and 5 per minute per account (`429 rate_limited` with `retry_after`). Repeating a request with the same `Idempotency-Key` returns the original response with the header `Idempotency-Replayed: 1` instead of charging again.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_scale_apply","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cpu":2,"disk_gb":50,"ram_mb":8192},"schema":{"properties":{"at":{"description":"Schedule the change for this time (Unix time, seconds, UTC) instead of doing it now. Only decreases can be scheduled, at most 7 days ahead. A value that is not in the future means \"now\".","type":"integer"},"cpu":{"description":"Target number of virtual CPU cores, within `limits.cpu` of Get scaling status.","type":"integer"},"disk_gb":{"description":"Target system disk in GiB. Cannot be lower than the current disk; to keep the disk, send the current value.","type":"integer"},"ram_mb":{"description":"Target memory in MiB. Must be a multiple of 1024 and within `limits.ram_gb`.","type":"integer"}},"required":["cpu","ram_mb","disk_gb"],"type":"object","x-order":["cpu","ram_mb","disk_gb","at"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"at":1790001200,"charged_cents":2,"event_id":211,"from":{"cpu":2,"disk_gb":50,"hourly_uusd":16460,"ram_mb":4096},"job_id":18342,"live":true,"refunded_cents":0,"replay":false,"to":{"cpu":2,"disk_gb":50,"hourly_uusd":21940,"monthly_cents":1602,"ram_mb":8192}},"schema":{"$ref":"#/components/schemas/ScaleChange"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON, or `cpu`, `ram_mb` or `disk_gb` is missing or not a number. Numbers sent as strings are accepted."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON, or `cpu`, `ram_mb` or `disk_gb` is missing or not a number. Numbers sent as strings are accepted. `bad_input`: The size is outside the site limits (`detail` explains which value and the allowed range), or the paid hour was already charged (`detail`: `hour_already_charged`). `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON, or `cpu`, `ram_mb` or `disk_gb` is missing or not a number. Numbers sent as strings are accepted."},{"code":"bad_input","description":"The size is outside the site limits (`detail` explains which value and the allowed range), or the paid hour was already charged (`detail`: `hour_already_charged`)."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the charge. The body carries `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the charge. The body carries `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the charge. The body carries `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `feature_disabled`: The site does not sell resizing, or does not sell custom configurations. `quota_exceeded`: The new size would exceed your account resource quota. The body carries the usage, the limit and the next tier.","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell resizing, or does not sell custom configurations."},{"code":"quota_exceeded","description":"The new size would exceed your account resource quota. The body carries the usage, the limit and the next tier."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in the `active` state."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in the `active` state. `job_running`: Another operation is running on the server. Wait for it to finish. `ram_slots_exhausted`: The server already took 16 live RAM additions since its last start. Restart it (see [Restart for scaling](#operation/vm_scale_reboot)) to continue. `has_snapshots`: The server still has VM snapshots, which must be deleted before it can be resized. The body carries `count`. `idempotency_key_reused`: The key was already used for a different server or a different size. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server. Wait for it to finish."},{"code":"ram_slots_exhausted","description":"The server already took 16 live RAM additions since its last start. Restart it (see [Restart for scaling](#operation/vm_scale_reboot)) to continue."},{"code":"has_snapshots","description":"The server still has VM snapshots, which must be deleted before it can be resized. The body carries `count`."},{"code":"idempotency_key_reused","description":"The key was already used for a different server or a different size."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"ram_step","message":"`ram_mb` is not a multiple of 1024."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`ram_step`: `ram_mb` is not a multiple of 1024. `disk_shrink`: `disk_gb` is lower than the current disk. The body carries the current `disk_gb`. `same_plan`: The requested size equals the current size. `schedule_upscale`: `at` was given for a change that increases a component. Only decreases can be scheduled. `schedule_too_far`: `at` is more than 7 days ahead. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"ram_step","description":"`ram_mb` is not a multiple of 1024."},{"code":"disk_shrink","description":"`disk_gb` is lower than the current disk. The body carries the current `disk_gb`."},{"code":"same_plan","description":"The requested size equals the current size."},{"code":"schedule_upscale","description":"`at` was given for a change that increases a component. Only decreases can be scheduled."},{"code":"schedule_too_far","description":"`at` is more than 7 days ahead."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because of unpaid charges."}]},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"content":{"application/json":{"example":{"error":{"code":"cluster_full","message":"The region has no spare capacity for an increase right now. You were not charged; try again later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cluster_full`: The region has no spare capacity for an increase right now. You were not charged; try again later. `provider_unavailable`: The platform could not accept the change. You were not charged. `site_unavailable`: The site is temporarily unable to charge or resize. You were not charged.","x-error-codes":[{"code":"cluster_full","description":"The region has no spare capacity for an increase right now. You were not charged; try again later."},{"code":"provider_unavailable","description":"The platform could not accept the change. You were not charged."},{"code":"site_unavailable","description":"The site is temporarily unable to charge or resize. You were not charged."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Resize CPU/RAM/disk now or scheduled (charges or refunds)","tags":["Scaling"],"x-cli":"vm scale apply","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/scale\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cpu\":2,\"disk_gb\":50,\"ram_mb\":8192}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Đổi CPU/RAM/đĩa ngay hoặc hẹn giờ (trừ/hoàn tiền)"}},"/v1/vm/{id}/scale/reboot":{"post":{"description":"Restarts the server immediately, or at a time you choose. A server that was last started before live resizing became available needs one restart before CPU and RAM can be changed without interrupting it, and a restart also resets the counter of live RAM additions (a server accepts 16 between restarts). The call does not change the size and has no charge of its own.\n\nOmit `at`, or give a time that is not in the future, to restart now: the call answers `{\"job_id\": ..., \"at\": ...}` and the restart runs as a background job. Give a future `at` (at most 7 days ahead) to schedule it: the call answers `{\"scheduled\": true, \"at\": ...}`; a server has one scheduled restart and a new one replaces the old. A body that is not valid JSON is treated as empty, that is, as an immediate restart.\n\nThe site must sell resizing. The server must be `active` and unlocked. Limited to 2 requests per 5 minutes per server.\n\n**Required scope:** `vm:write`.","operationId":"vm_scale_reboot","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"at":1790090000},"schema":{"properties":{"at":{"description":"Restart at this time (Unix time, seconds, UTC) instead of now. At most 7 days ahead. A value that is not in the future means \"now\".","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"at":1790090000,"scheduled":true},"schema":{"properties":{"at":{"description":"When the restart was queued (immediate) or the time it is scheduled for (Unix time, seconds, UTC)","type":"integer"},"job_id":{"description":"Background job that restarts the server. Present only for an immediate restart.","type":"integer"},"scheduled":{"description":"`true` when the restart was scheduled instead of queued.","type":"boolean"}},"required":["at"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The site does not sell resizing. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell resizing."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in the `active` state."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in the `active` state. `job_running`: A restart of this server is already queued or running. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in the `active` state."},{"code":"job_running","description":"A restart of this server is already queued or running."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"schedule_too_far","message":"`at` is more than 7 days ahead."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`at` is more than 7 days ahead. (`schedule_too_far`)","x-error-codes":[{"code":"schedule_too_far","description":"`at` is more than 7 days ahead."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 2 restarts were requested for this server in 5 minutes. The body carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 2 restarts were requested for this server in 5 minutes. The body carries `retry_after` in seconds."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Reboot (now or scheduled) to unlock CPU/RAM hot-plug","tags":["Scaling"],"x-cli":"vm scale reboot","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/scale/reboot\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"at\":1790090000}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Khởi động lại (ngay hoặc hẹn giờ) để mở cắm nóng CPU/RAM"}},"/v1/vm/{id}/scale/revert":{"post":{"description":"Returns a server that Auto Scaling has grown to its base size. The server is stopped, resized back to the base configuration and started again automatically in the background, which is a short interruption; the price falls back to the base price and any difference is settled automatically. The call only records your request and answers `202` with the current Auto Scaling state, in which `revert_manual` is `true`; follow progress with [Get Auto Scaling](#operation/vm_autoscale_get) (`revert_phase`).\n\nOnly a server that is larger than its base size because of Auto Scaling can be returned (`revert_available` is `true` in the Auto Scaling state). Auto Scaling does not have to be enabled. The site must sell resizing. Limited to 2 requests per 5 minutes per server.\n\n**Required scope:** `vm:plan`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_scale_revert","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"balance_cents":2500,"base":{"cpu":2,"hourly_uusd":16460,"ram_mb":4096},"blocked":[],"caps":{"down_pct":[5,60],"down_secs":[300,7200],"max_cpu":8,"max_ram_mb":16384,"max_steps_day":4,"up_pct":[50,95],"up_secs":[120,1800]},"cooling_since":null,"current":{"cpu":4,"hourly_uusd":32920,"ram_mb":8192},"enabled":true,"extra":null,"feature":true,"last_error":null,"last_error_at":null,"pending_revert":true,"prepaid":false,"ram_stats_at":1790001150,"ram_used_mb":3100,"revert_at":1790001200,"revert_available":false,"revert_manual":true,"revert_phase":null,"rule":{"down_pct":30,"down_secs":900,"up_pct":80,"up_secs":300},"state":"scaled","target":{"cpu":4,"hourly_uusd":32920,"monthly_cents":2403,"ram_mb":8192}},"schema":{"$ref":"#/components/schemas/AutoscaleState"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The site does not sell resizing. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell resizing."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"nothing_to_revert","message":"The server is already at its base size, or was not grown by Auto Scaling."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`nothing_to_revert`: The server is already at its base size, or was not grown by Auto Scaling. `revert_in_progress`: A return to base size was already requested and has not finished. `vm_not_active`: The server is not in the `active` state. `job_running`: Another operation is running on the server. Wait for it to finish. `has_snapshots`: The server still has VM snapshots, which must be deleted before it can be resized. The body carries `count`. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"nothing_to_revert","description":"The server is already at its base size, or was not grown by Auto Scaling."},{"code":"revert_in_progress","description":"A return to base size was already requested and has not finished."},{"code":"vm_not_active","description":"The server is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server. Wait for it to finish."},{"code":"has_snapshots","description":"The server still has VM snapshots, which must be deleted before it can be resized. The body carries `count`."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`resize_live`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 2 requests for this server in 5 minutes. The body carries `retry_after` in seconds. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 2 requests for this server in 5 minutes. The body carries `retry_after` in seconds."}]}},"security":[{"bearerAuth":["vm:plan"]}],"summary":"Return the VM to its base size after Auto Scaling (reboots)","tags":["Scaling"],"x-cli":"vm scale revert","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/scale/revert\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:plan","x-summary-vi":"Trả máy về cấu hình gốc sau Auto Scaling (có khởi động lại)"}},"/v1/vm/{id}/screenshot":{"get":{"description":"Takes a picture of the server's screen (what its console shows) as a PNG data URL. It always answers 200: when no picture can be taken the body is `{available: false, reason}` instead of an error, so you can poll it safely. `reason` is `vm_not_running` (the server is not powered on), `vm_locked`, `capture_failed` (try again shortly) or `not_configured` (screenshots are not offered on this site).\n\nThe picture is scaled to the requested width and cached for about 15 seconds. At most 10 new captures per minute are allowed per client address; beyond that the call fails with `429 rate_limited`. Taking a screenshot is recorded in the server's event log, at most once per hour.\n\n**Required scope:** `vm:console`.","operationId":"vm_screenshot","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Width of the picture in pixels: 340, 680 or 1024. Any other value gives 680.","in":"query","name":"w","required":false,"schema":{"default":680,"enum":[340,680,1024],"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"height":384,"image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVQAAAC0CAIAAABY","source_height":720,"source_width":1280,"taken_at":1795100000,"width":680},"schema":{"properties":{"available":{"description":"Whether a picture was taken.","type":"boolean"},"height":{"description":"Height of the returned picture in pixels.","type":"integer"},"image":{"description":"The picture as a `data:image/png;base64,...` URL. Present only when `available` is true.","type":"string"},"reason":{"description":"Why there is no picture. Present only when `available` is false.","enum":["not_configured","vm_locked","vm_not_running","capture_failed"],"type":"string"},"source_height":{"description":"Height of the screen before scaling.","type":"integer"},"source_width":{"description":"Width of the screen before scaling.","type":"integer"},"taken_at":{"description":"When the picture was taken (Unix time, seconds, UTC)","type":"integer"},"width":{"description":"Width of the returned picture in pixels.","type":"integer"}},"required":["available"],"type":"object","x-order":["available","reason","image","width","height","source_width","source_height","taken_at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 uncached captures in a minute from the same client address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 uncached captures in a minute from the same client address."}]}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Screenshot of the running VM","tags":["Virtual Machines"],"x-cli":"vm screenshot","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/screenshot\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Ảnh màn hình của máy đang chạy"}},"/v1/vm/{id}/snapshot-policies":{"get":{"description":"Lists the automatic snapshot schedules of one server, oldest first, with the limits that apply. At each due time the server takes a snapshot; before that the oldest automatic snapshots beyond `keep` are deleted. A run is skipped, and the reason recorded in `last_error`, when the server cannot take a snapshot or already holds the maximum number of snapshots. Add a schedule with [Add a snapshot schedule](#operation/vm_snapshot_schedule_add).\n\n**Required scope:** `vm:read`.","operationId":"vm_snapshot_schedule_list","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":1795100000,"cron":"weekly 1 03:30","dow":1,"enabled":true,"hour":3,"id":17,"keep":2,"kind":"weekly","last_error":null,"last_run_at":null,"minute":30,"next_run_at":1795663800,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"keep_max":3,"max":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SnapshotSchedule"},"type":"array"},"keep_max":{"description":"Largest allowed `keep`: the number of snapshots one server may hold.","type":"integer"},"max":{"description":"Maximum number of schedules one server may have.","type":"integer"}},"required":["items","max","keep_max"],"type":"object","x-order":["items","max","keep_max"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Automatic snapshot schedules of one VM","tags":["Snapshots"],"x-cli":"vm snapshot schedule list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/snapshot-policies\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Lịch chụp tự động của một máy"},"post":{"description":"Adds an automatic snapshot schedule to a server and answers 201 with the new schedule. Describe the time either with `kind`, `hour`, `minute` (and `dow` for weekly), or with a single `cron` string such as `daily 03:00` or `weekly 1 03:30`; when `cron` is present the other time fields are ignored. All times are UTC. A `kind` other than `weekly` means daily.\n\nA server may have a limited number of schedules (`max` in [List snapshot schedules of a VM](#operation/vm_snapshot_schedule_list)), and `keep` cannot exceed the number of snapshots a server may hold. Adding a schedule does not take a snapshot now; use the snapshot create operation for that. Works on a server in any state except a locked one.\n\n**Required scope:** `vm:write`.","operationId":"vm_snapshot_schedule_add","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"dow":1,"hour":3,"keep":2,"kind":"weekly","minute":30},"schema":{"properties":{"cron":{"description":"The whole schedule as text: `daily HH:MM` or `weekly D HH:MM`. Overrides `kind`, `hour`, `minute` and `dow`.","type":"string"},"dow":{"default":1,"description":"Day of the week for weekly schedules: 1 (Monday) to 7 (Sunday).","maximum":7,"minimum":1,"type":"integer"},"hour":{"description":"Hour of the day (UTC). Required unless `cron` is given.","maximum":23,"minimum":0,"type":"integer"},"keep":{"description":"How many automatic snapshots to keep, from 1 to the site maximum (`keep_max`). Default 3, or the maximum if that is lower.","type":"integer"},"kind":{"description":"How often to run. Default `daily`.","enum":["daily","weekly"],"type":"string"},"minute":{"description":"Minute of the hour. Required unless `cron` is given.","maximum":59,"minimum":0,"type":"integer"}},"type":"object","x-order":["kind","hour","minute","dow","keep","cron"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"item":{"created_at":1795100000,"cron":"weekly 1 03:30","dow":1,"enabled":true,"hour":3,"id":17,"keep":2,"kind":"weekly","last_error":null,"last_run_at":null,"minute":30,"next_run_at":1795663800,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}},"schema":{"properties":{"item":{"$ref":"#/components/schemas/SnapshotSchedule"}},"required":["item"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON, or a field has the wrong type or is out of the 0-255 range. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON, or a field has the wrong type or is out of the 0-255 range. The error carries a `detail`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON, or a field has the wrong type or is out of the 0-255 range. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"schedule_limit","message":"The server already has the maximum number of schedules. The error carries the `limit`. Delete one first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`schedule_limit`: The server already has the maximum number of schedules. The error carries the `limit`. Delete one first. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"schedule_limit","description":"The server already has the maximum number of schedules. The error carries the `limit`. Delete one first."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The time is not valid (`field` = `cron`), or `keep` is outside 1 to the site maximum (`field` = `keep`, with `min` and `max`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The time is not valid (`field` = `cron`), or `keep` is outside 1 to the site maximum (`field` = `keep`, with `min` and `max`). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The time is not valid (`field` = `cron`), or `keep` is outside 1 to the site maximum (`field` = `keep`, with `min` and `max`)."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Add an automatic snapshot schedule (daily/weekly)","tags":["Snapshots"],"x-cli":"vm snapshot schedule add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/snapshot-policies\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"dow\":1,\"hour\":3,\"keep\":2,\"kind\":\"weekly\",\"minute\":30}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Thêm lịch chụp tự động (hằng ngày/hằng tuần)"}},"/v1/vm/{id}/snapshot-policies/{pid}":{"delete":{"description":"Deletes an automatic snapshot schedule. Snapshots it already took are kept; delete them separately if you no longer need them. A schedule that does not exist, or belongs to another server or account, answers 404.\n\n**Required scope:** `vm:write`.","operationId":"vm_snapshot_schedule_delete","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Snapshot schedule identifier as returned by the list operation.","in":"path","name":"pid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"ok":true},"schema":{"properties":{"ok":{"description":"Always `true` on success.","type":"boolean"}},"required":["ok"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not yours, or it has no schedule with this identifier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not yours, or it has no schedule with this identifier. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not yours, or it has no schedule with this identifier."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Delete an automatic snapshot schedule","tags":["Snapshots"],"x-cli":"vm snapshot schedule delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/snapshot-policies/<pid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Xoá lịch chụp tự động"}},"/v1/vm/{id}/snapshots":{"get":{"description":"Lists the snapshots of the server, with how many more you may take. `meta.can_create` is true only when the limit is not reached, no snapshot job is queued or running, and the server is active and not locked. The result is cached for about 20 seconds.\n\n`pending_job` is true while a snapshot is being taken, deleted or restored.\n\n**Required scope:** `vm:read`.","operationId":"vm_snapshot_list","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created":"2026-10-18T21:14:07+0000","created_at":1792358047,"current":true,"description":"Before the 24.04 upgrade","id":"0c5d1e7a-6b3f-4a9e-8d21-7f4b2c9e1a60","name":"before-upgrade","physicalsize":2147483648,"state":"Ready","type":"Disk","virtualsize":42949672960}],"meta":{"can_create":true,"count":1,"limit":3,"remaining":2},"pending_job":false},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Snapshot"},"type":"array"},"meta":{"properties":{"can_create":{"description":"Whether [Create a snapshot](#operation/vm_snapshot_create) would be accepted right now.","type":"boolean"},"count":{"description":"Number of snapshots the server has.","type":"integer"},"limit":{"description":"Maximum number of snapshots per server.","type":"integer"},"remaining":{"description":"How many more snapshots you can take (`limit` minus `count`, never below zero).","type":"integer"}},"required":["count","limit","remaining","can_create"],"type":"object","x-order":["count","limit","remaining","can_create"]},"pending_job":{"description":"True while a snapshot job (create, delete or restore) is queued or running.","type":"boolean"}},"required":["items","meta","pending_job"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`. (`vm_not_ready`)","x-error-codes":[{"code":"vm_not_ready","description":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The existing snapshots could not be read. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The existing snapshots could not be read. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The existing snapshots could not be read. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"List snapshots","tags":["Snapshots"],"x-cli":"vm snapshot list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/snapshots\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Danh sách bản chụp"},"post":{"description":"Takes a snapshot of the whole server. The call returns as soon as the job is queued (`job_id`); the snapshot shows up in [List snapshots](#operation/vm_snapshot_list) with state `Creating` and becomes `Ready` when the job is done. Taking a snapshot can take a minute or more depending on the disk size.\n\nBoth fields are optional. `name` keeps only letters, digits, spaces, `-`, `_` and `.` (at most 60 characters); when empty it defaults to the server's hostname plus the current UTC time. Once the server holds `meta.limit` snapshots the call fails with `409 snapshot_limit`.\n\n**Required scope:** `vm:write`.","operationId":"vm_snapshot_create","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"description":"Before the 24.04 upgrade","name":"before-upgrade"},"schema":{"properties":{"description":{"description":"Free-text description, at most 200 characters; control characters are dropped.","type":"string"},"name":{"description":"Snapshot name. Characters other than letters, digits, space, `-`, `_` and `.` are dropped; at most 60 characters are kept.","type":"string"}},"type":"object","x-order":["name","description"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":1901},"schema":{"properties":{"job_id":{"description":"Identifier of the background job. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or has a field of the wrong type. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"snapshot_limit","message":"The server already has the maximum number of snapshots. The error carries the `limit`. Delete one first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`snapshot_limit`: The server already has the maximum number of snapshots. The error carries the `limit`. Delete one first. `vm_not_ready`: The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"snapshot_limit","description":"The server already has the maximum number of snapshots. The error carries the `limit`. Delete one first."},{"code":"vm_not_ready","description":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The existing snapshots could not be read. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The existing snapshots could not be read. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The existing snapshots could not be read. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Create a snapshot","tags":["Snapshots"],"x-cli":"vm snapshot create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/snapshots\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"description\":\"Before the 24.04 upgrade\",\"name\":\"before-upgrade\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Tạo bản chụp"}},"/v1/vm/{id}/snapshots/{sid}":{"delete":{"description":"Deletes one snapshot of the server. The call returns as soon as the deletion is queued (`job_id`). A snapshot that does not belong to this server answers `404`.\n\n**Required scope:** `vm:write`.","operationId":"vm_snapshot_delete","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Snapshot identifier as returned by the list operation.","in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":1902},"schema":{"properties":{"job_id":{"description":"Identifier of the background job. Follow it with [List VM jobs](#operation/vm_jobs).","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist, is not yours, or has no snapshot with this identifier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist, is not yours, or has no snapshot with this identifier. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist, is not yours, or has no snapshot with this identifier."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`sid` is not a valid snapshot identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). The error carries `field` = `snapshot_id`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`sid` is not a valid snapshot identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). The error carries `field` = `snapshot_id`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`sid` is not a valid snapshot identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). The error carries `field` = `snapshot_id`."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The existing snapshots could not be read. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The existing snapshots could not be read. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The existing snapshots could not be read. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Delete a snapshot","tags":["Snapshots"],"x-cli":"vm snapshot delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vm/<id>/snapshots/<sid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Xoá bản chụp"}},"/v1/vm/{id}/snapshots/{sid}/restore":{"post":{"description":"**Overwrites the server's disk with a snapshot.** The server is stopped, its disk goes back to the state it had when the snapshot was taken, and the server is started again. Everything written since the snapshot was taken is lost and cannot be recovered. Use a backup or take a fresh snapshot first if you may need the current state.\n\nThe call returns as soon as the job is queued (`job_id`); follow it with [List VM jobs](#operation/vm_jobs). While the job runs the server is unreachable. The body is ignored.\n\n**Required scope:** `vm:restore`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vm_snapshot_restore","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Snapshot identifier as returned by the list operation.","in":"path","name":"sid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":1906},"schema":{"$ref":"#/components/schemas/VmJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not yours, or it has no snapshot with this identifier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not yours, or it has no snapshot with this identifier. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not yours, or it has no snapshot with this identifier."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`. `vm_not_active`: The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vm_not_ready","description":"The server does not exist on the platform yet because it is still being provisioned. The error carries the current `state`."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is provisioning, failed or being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`snapshot`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`sid` is not a valid snapshot identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). The error carries `field` = `snapshot_id`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `sid` is not a valid snapshot identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). The error carries `field` = `snapshot_id`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`sid` is not a valid snapshot identifier (lowercase hexadecimal digits and hyphens, at most 64 characters). The error carries `field` = `snapshot_id`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"Snapshots are not available on this site. The error carries `feature` = `snapshots`."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The server's snapshots could not be read. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's snapshots could not be read. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The server's snapshots could not be read. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:restore"]}],"summary":"Restore the VM to a snapshot (stops, overwrites the disk, restarts)","tags":["Snapshots"],"x-cli":"vm snapshot restore","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/snapshots/<sid>/restore\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"vm:restore","x-summary-vi":"Khôi phục máy về bản chụp (tắt máy, ghi đè đĩa, bật lại)"}},"/v1/vm/{id}/ssh-key":{"post":{"description":"Replaces the SSH key installed on the server with one of your saved keys (see List SSH keys). A running server is stopped, the key is installed, and the server is started again, so expect a short downtime; the previous key stops working. The server is recorded as using the new key once the job is `done`.\n\n**Required scope:** `vm:console`.","operationId":"vm_ssh_key_attach","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"ssh_key_id":7},"schema":{"properties":{"ssh_key_id":{"description":"Identifier of one of your saved SSH keys.","type":"integer"}},"required":["ssh_key_id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":4812},"schema":{"$ref":"#/components/schemas/VmActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The server does not exist or is not yours, or the SSH key does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server does not exist or is not yours, or the SSH key does not exist or is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The server does not exist or is not yours, or the SSH key does not exist or is not yours."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry. `same_key`: The server already uses this key. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`ssh_key_reset`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."},{"code":"same_key","description":"The server already uses this key."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`ssh_key_reset`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`ssh_key_id` is missing or not a positive integer."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`ssh_key_id` is missing or not a positive integer. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`ssh_key_id` is missing or not a positive integer."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Attach an SSH key to the VM","tags":["Virtual Machines"],"x-cli":"vm ssh-key attach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/ssh-key\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ssh_key_id\":7}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Gắn khoá SSH vào máy"}},"/v1/vm/{id}/ssh-token":{"post":{"description":"Issues a one-time ticket for the SSH web terminal of a running Linux server. Open a WebSocket to `websocket_url` with the ticket as the `token` query parameter (`<websocket_url>?token=<token>`) within `expires_in` seconds (300). The ticket can be used for one connection only; reconnecting needs a new ticket. Over the socket, send JSON text frames such as `{\"type\":\"input\",\"data\":\"ls\\n\"}`, `{\"type\":\"resize\",\"cols\":120,\"rows\":30}` and, when the gateway asks for credentials (`auth_required`), `{\"type\":\"auth\",\"username\":\"...\",\"password\":\"...\"}`; output arrives as `{\"type\":\"output\",\"data\":\"...\"}` frames.\n\nThe server must be active, running and have an address. Requests are limited to 20 per minute per client address. `has_credentials` tells you whether a saved password or key will be used automatically; if not, the gateway asks for the password.\n\n**Required scope:** `vm:console`.","operationId":"vm_ssh_token","parameters":[{"description":"VM identifier (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"default_username":"ubuntu","expires_in":300,"has_credentials":true,"ip_address":"203.0.113.10","port":22,"token":"ofw_ssh_9f3c1b7a5d2e4f60718293a4b5c6d7e8","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","vm_name":"web-1","websocket_url":"wss://cloud.example.com/ssh-ws"},"schema":{"properties":{"default_username":{"description":"Login name the terminal proposes for this server.","type":"string"},"expires_in":{"description":"Seconds the ticket stays valid (300).","type":"integer"},"has_credentials":{"description":"True when the gateway can log in without asking for a password.","type":"boolean"},"ip_address":{"description":"Address the terminal connects to.","type":"string"},"port":{"description":"SSH port of the server.","type":"integer"},"token":{"description":"One-time ticket. A secret: it opens a terminal on the server.","type":"string"},"vm_id":{"description":"Identifier of the server.","type":"string"},"vm_name":{"description":"Display name of the server.","type":"string"},"websocket_url":{"description":"WebSocket address of the terminal gateway.","type":"string"}},"required":["token","expires_in","websocket_url","default_username","port","vm_id","vm_name","ip_address","has_credentials"],"type":"object","x-order":["token","expires_in","websocket_url","default_username","port","vm_id","vm_name","ip_address","has_credentials"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not in the `active` state. The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not in the `active` state. The error carries the current `state`. `vm_not_running`: The server is not running. The error carries `cs_state`, the power state the platform reports. `vm_not_ready`: The server has no address to connect to yet.","x-error-codes":[{"code":"vm_not_active","description":"The server is not in the `active` state. The error carries the current `state`."},{"code":"vm_not_running","description":"The server is not running. The error carries `cs_state`, the power state the platform reports."},{"code":"vm_not_ready","description":"The server has no address to connect to yet."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:console"]}],"summary":"Get a one-time SSH WebSocket token","tags":["Console and AI Agent"],"x-cli":"vm ssh-token","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/ssh-token\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:console","x-summary-vi":"Xin vé SSH WebSocket (dùng một lần)"}},"/v1/vm/{id}/start":{"post":{"description":"Powers the server on. The call returns immediately with a `job_id`; the server is running once the job is `done` and `cs_state` is `Running`. Starting a server that is already running succeeds without effect. Powering on is refused while the server is locked.\n\n**Required scope:** `vm:write`.","operationId":"vm_start","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":4812},"schema":{"$ref":"#/components/schemas/VmActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Start the VM","tags":["Virtual Machines"],"x-cli":"vm start","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/start\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Bật máy"}},"/v1/vm/{id}/stop":{"post":{"description":"Shuts the server down gracefully (an ACPI power-button signal, so the operating system can close files and services). If the guest does not shut down in time, it is powered off forcibly. The call returns immediately with a `job_id`. A stopped prepaid server stays billed; a stopped hourly server is still billed hourly because its resources remain reserved.\n\n**Required scope:** `vm:write`.","operationId":"vm_stop","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"job_id":4812},"schema":{"$ref":"#/components/schemas/VmActionAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_active","message":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_active`: The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`. `job_running`: Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry.","x-error-codes":[{"code":"vm_not_active","description":"The server is not `active` yet (for example still `provisioning`, or already being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another background job is queued or running on this server. Wait for it to finish (see List a VM's jobs) and retry."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked (see `lock_reason` on the server). The error carries `reason`, `destroy_after` and `locked_at`. Top up the wallet or contact support, then retry."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Stop the VM (graceful)","tags":["Virtual Machines"],"x-cli":"vm stop","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/stop\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Tắt máy (êm)"}},"/v1/vm/{id}/template-options":{"get":{"description":"Lists the operating-system templates this server can be reinstalled with (Change OS): templates available in the server's region for its source, in display order. Pass an `id` from this list as `template_id` to the reinstall action; any other value is rejected.\n\n**Required scope:** `vm:read`.","operationId":"vm_template_options","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"category":"","display_name":"Ubuntu 24.04","icon":"ubuntu","id":12,"min":null,"os_family":"ubuntu","os_version":"24.04","size_gb":20,"username":"ubuntu"}]},"schema":{"properties":{"items":{"items":{"properties":{"category":{"description":"`desktop` for a VM Desktop image, empty for a standard image.","type":"string"},"display_name":{"description":"Name shown to users, for example `Ubuntu 24.04`.","type":"string"},"icon":{"description":"Icon key of the operating system, when set.","type":["string","null"]},"id":{"description":"Template identifier, used as `template_id` when reinstalling.","type":"integer"},"min":{"properties":{"cpu":{"description":"Smallest number of vCPU cores this template can be installed on.","type":"integer"},"disk_gb":{"description":"Smallest system disk in GiB.","type":"integer"},"ram_mb":{"description":"Smallest memory in MiB.","type":"integer"}},"required":["cpu","ram_mb","disk_gb"],"type":["object","null"],"x-order":["cpu","ram_mb","disk_gb"]},"os_family":{"description":"Operating-system family, for example `ubuntu`, `debian` or `windows`.","type":"string"},"os_version":{"description":"Operating-system version, when known.","type":["string","null"]},"size_gb":{"description":"Minimum system disk size in GiB, when known.","type":["integer","null"]},"username":{"description":"Default login user name of the template.","type":"string"}},"required":["id","display_name","os_family","os_version","username","icon","size_gb","min","category"],"type":"object","x-order":["id","display_name","os_family","os_version","username","icon","size_gb","min","category"]},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Available templates for this VM","tags":["Virtual Machines"],"x-cli":"vm template-options","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/template-options\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Templates khả dụng của máy"}},"/v1/vm/{id}/toggle-ipv6":{"post":{"description":"Switches the server between dual-stack (IPv4 and IPv6) and IPv4 only. The server is moved to the other network, which interrupts its public connectivity for a few minutes; it may be restarted at the end, and its public IPv4 address can change. Firewall rules are kept. If the server is already in the requested mode the job finishes without changing anything, but still counts for the cooldown. A server inside a Private Cloud always has IPv6 and cannot be switched (`409 vpc_managed`).\n\nOnly one switch is allowed per cooldown window (60 minutes by default, set by the site); inside it the call fails with `429 ipv6_toggle_cooldown`. A server that still has snapshots cannot be switched (`409 has_snapshots`). The call returns as soon as the job is queued (`job_id`); follow it with [List VM jobs](#operation/vm_jobs). The result shows in the server's `enable_ipv6` and `ipv6` fields.\n\n**Required scope:** `vm:write`.","operationId":"vm_toggle_ipv6","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"enable":true},"schema":{"properties":{"enable":{"description":"`true` to enable IPv6 (dual-stack), `false` for IPv4 only. When omitted the current mode is flipped.","type":"boolean"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"job_id":1905},"schema":{"$ref":"#/components/schemas/VmJobAccepted"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or `enable` is not a boolean. The error carries a `detail`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or `enable` is not a boolean. The error carries a `detail`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or `enable` is not a boolean. The error carries a `detail`."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"has_snapshots","message":"The server still has snapshots. The error carries their `count`. Delete them, then retry."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`has_snapshots`: The server still has snapshots. The error carries their `count`. Delete them, then retry. `vpc_managed`: The server is in a Private Cloud, where IPv6 is always on. `vm_not_active`: The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`. `job_running`: Another operation is already running on this server. Wait for it to finish, then retry. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`ipv6`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"has_snapshots","description":"The server still has snapshots. The error carries their `count`. Delete them, then retry."},{"code":"vpc_managed","description":"The server is in a Private Cloud, where IPv6 is always on."},{"code":"vm_not_active","description":"The server is not in the `active` state (for example it is still provisioning, has failed or is being deleted). The error carries the current `state`."},{"code":"job_running","description":"Another operation is already running on this server. Wait for it to finish, then retry."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`ipv6`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time). (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because the wallet ran out of funds. The error carries `reason` (`no_funds`, `expired`, `admin` or `abuse`), `destroy_after` and `locked_at` (Unix time)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: The server was switched too recently. The error carries `retry_after` (seconds) and `retry_after_minutes` until the next switch is allowed. (`ipv6_toggle_cooldown`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"ipv6_toggle_cooldown","description":"The server was switched too recently. The error carries `retry_after` (seconds) and `retry_after_minutes` until the next switch is allowed."}]},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The server's snapshots could not be checked, so nothing was started. Retry in a few moments."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server's snapshots could not be checked, so nothing was started. Retry in a few moments. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The server's snapshots could not be checked, so nothing was started. Retry in a few moments."}]}},"security":[{"bearerAuth":["vm:write"]}],"summary":"Enable/disable IPv6 (dual-stack or IPv4 only)","tags":["Virtual Machines"],"x-cli":"vm toggle-ipv6","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vm/<id>/toggle-ipv6\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enable\":true}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:write","x-summary-vi":"Bật/tắt IPv6 (Dual-Stack hoặc IPv4 thuần)"}},"/v1/vm/{id}/volumes":{"get":{"description":"Lists the disks attached to the server: the system disk and any data disks, with size and state. Results are cached for 20 seconds. Fails with `409 vm_not_ready` while the server has not been created on the infrastructure yet.\n\n**Required scope:** `vm:read`.","operationId":"vm_volumes","parameters":[{"description":"VM identifier (UUID) as returned by List VMs.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"at":1792400000,"items":[{"created":"2026-10-19T08:00:12+0000","device_id":0,"id":"5d0c2b7e-93a1-4b6f-8e2d-71c4a9f03b58","name":"ROOT-1042","size_bytes":64424509440,"size_gb":60,"state":"Ready","storage_type":"shared","type":"ROOT"}]},"schema":{"properties":{"at":{"description":"When the data was read (Unix time, seconds, UTC)","type":"integer"},"items":{"items":{"properties":{"created":{"description":"Creation time as reported by the infrastructure.","type":["string","null"]},"device_id":{"description":"Device position: 0 is the system disk.","type":["integer","null"]},"id":{"description":"Disk identifier on the infrastructure.","type":["string","null"]},"name":{"description":"Disk name.","type":["string","null"]},"size_bytes":{"description":"Size in bytes.","type":["integer","null"]},"size_gb":{"description":"Size in GiB.","type":["integer","null"]},"state":{"description":"Disk state, for example `Ready`.","type":["string","null"]},"storage_type":{"description":"Storage class, for example `shared`.","type":["string","null"]},"type":{"description":"`ROOT` for the system disk, `DATADISK` for data disks.","type":["string","null"]}},"required":["id","name","type","size_gb","size_bytes","state","device_id","storage_type","created"],"type":"object","x-order":["id","name","type","size_gb","size_bytes","state","device_id","storage_type","created"]},"type":"array"}},"required":["items","at"],"type":"object","x-order":["items","at"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vm_not_ready","message":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_not_ready`: The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"vm_not_ready","description":"The server has not been created on the infrastructure yet (still provisioning, or creation failed). The error carries the current `state`."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"content":{"application/json":{"example":{"error":{"code":"cloudstack_error","message":"The infrastructure did not answer. Retry in a few seconds."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The infrastructure did not answer. Retry in a few seconds. (`cloudstack_error`)","x-error-codes":[{"code":"cloudstack_error","description":"The infrastructure did not answer. Retry in a few seconds."}]}},"security":[{"bearerAuth":["vm:read"]}],"summary":"Volumes of the VM","tags":["Virtual Machines"],"x-cli":"vm volumes","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vm/<id>/volumes\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vm:read","x-summary-vi":"Ổ đĩa của máy"}},"/v1/volumes":{"get":{"description":"Lists the data volumes of your account, attached or not, with the limits and the price of the smallest volume. Deleted volumes are not listed.\n\nThe answer has the shape `{items, meta, price}`: `items` are the volumes of the requested page, `meta` carries the paging details and the site limits (smallest and largest size, size step, volumes allowed per account and per server) and `price` is the unit price of your site, computed for the smallest allowed volume. Use [Quote a volume](#operation/volume_quote) for another size.\n\n**Required scope:** `volume:read`.","operationId":"volume_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page, at most 100. Larger values are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. Unknown values fall back to `created_at`.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","name","size_gb","state","paid_cents"],"type":"string"}},{"description":"Sort direction. Anything other than `asc` means `desc`.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Only volumes attached to this server (UUID).","in":"query","name":"vm_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"busy":false,"cents_per_month":248,"created_at":1789990000,"debt_since":null,"device_id":1,"error_code":null,"hourly_uusd":3400,"hours_per_month":730,"id":4172,"last_error":null,"name":"data-1","paid_cents":41,"rate_uusd_gb_hour":34,"size_gb":100,"state":"Attached","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"}],"meta":{"dir":"desc","last_page":1,"max_gb":2000,"max_per_account":20,"max_per_vm":5,"min_gb":10,"page":1,"per_page":20,"sort":"created_at","step_gb":10,"total":1},"price":{"cents_per_hour":0,"cents_per_month":25,"hours_per_month":730,"rate_uusd_gb_hour":34,"size_gb":10,"uusd_per_hour":340}},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BlockVolume"},"type":"array"},"meta":{"description":"Paging details and site limits.","properties":{"dir":{"description":"Sort direction actually applied.","enum":["asc","desc"],"type":"string"},"last_page":{"description":"Number of the last page; 0 when there are no volumes.","type":"integer"},"max_gb":{"description":"Largest allowed volume size in GB.","type":"integer"},"max_per_account":{"description":"Most volumes one account may have.","type":"integer"},"max_per_vm":{"description":"Most volumes that may be attached to one server.","type":"integer"},"min_gb":{"description":"Smallest allowed volume size in GB.","type":"integer"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied.","type":"integer"},"sort":{"description":"Sort field actually applied.","type":"string"},"step_gb":{"description":"Sizes must be the smallest size plus a multiple of this step, in GB.","type":"integer"},"total":{"description":"Number of volumes matching the filter, across all pages.","type":"integer"}},"required":["total","page","per_page","last_page","sort","dir","max_per_account","max_per_vm","min_gb","max_gb","step_gb"],"type":"object","x-order":["total","page","per_page","last_page","sort","dir","max_per_account","max_per_vm","min_gb","max_gb","step_gb"]},"price":{"$ref":"#/components/schemas/VolumePrice"}},"required":["items","meta","price"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:read"]}],"summary":"List data volumes (paged, sortable)","tags":["Block Storage"],"x-cli":"volume list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/volumes\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"volume:read","x-summary-vi":"Danh sách ổ dữ liệu (phân trang, sắp xếp)"},"post":{"description":"Creates an empty data volume, and optionally attaches it to one of your servers when it is ready. **This operation costs money, but nothing is charged at creation.** Billing starts when the volume becomes `Ready` and runs per GB-hour until the volume is deleted (also while it is detached); whole cents are taken from your wallet as they accrue. You need a positive wallet balance to create a volume.\n\nThe call answers `202` with the new volume (state `Creating`) and the background `job_id`; poll [Get a volume](#operation/volume_get) until it is `Ready` (or `Attached`). The volume is empty and unformatted: after attaching, create a file system on it inside the server. The size must be between the smallest and largest size of the site, on the size step (see [List volumes](#operation/volume_list)).\n\n`name` keeps only letters, digits, `-`, `_` and `.` (at most 40 characters); without a name the volume is called `data-N`. When `vm_id` is given the server must be yours, active, unlocked and without another operation running; it must not already hold the maximum number of volumes, and when it has backups the site may not allow attaching (`409 has_backups`).\n\nRepeating a request with the same `Idempotency-Key` returns the original response with the header `Idempotency-Replayed: 1` instead of creating a second volume. A repeat that reaches the service by another route (for example with another API key of the same account) is answered `200` with `idempotent_replay: true` and `job_id: null`.\n\n**Required scope:** `volume:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"volume_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"name":"data-1","size_gb":100,"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"name":{"description":"Name of the volume; letters, digits, `-`, `_` and `.` only (other characters are dropped), at most 40 characters. Defaults to `data-N`.","type":"string"},"size_gb":{"description":"Size in GB: between the smallest and largest size of the site, on the size step.","type":"integer"},"vm_id":{"description":"Attach the volume to this server (UUID) as soon as it is ready.","type":"string"}},"required":["size_gb"],"type":"object","x-order":["size_gb","name","vm_id"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"job_id":18420,"volume":{"busy":true,"cents_per_month":248,"created_at":1789990000,"debt_since":null,"device_id":null,"error_code":null,"hourly_uusd":3400,"hours_per_month":730,"id":4172,"last_error":null,"name":"data-1","paid_cents":0,"rate_uusd_gb_hour":34,"size_gb":100,"state":"Creating","vm_id":null}},"schema":{"properties":{"idempotent_replay":{"description":"Present and `true` when the answer repeats an earlier request with the same `Idempotency-Key`. Such an answer has status 200.","type":"boolean"},"job_id":{"description":"Background job that creates the volume; null on an idempotent replay.","type":["integer","null"]},"volume":{"$ref":"#/components/schemas/BlockVolume"}},"required":["volume","job_id"],"type":"object","x-order":["volume","job_id","idempotent_replay"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or a field has the wrong type."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON or a field has the wrong type. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or a field has the wrong type."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is zero or negative. The body carries `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is zero or negative. The body carries `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is zero or negative. The body carries `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The new volume would exceed your account resource quota. The body carries the usage, the limit and the next tier. (`quota_exceeded`)","x-error-codes":[{"code":"quota_exceeded","description":"The new volume would exceed your account resource quota. The body carries the usage, the limit and the next tier."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"`vm_id` does not exist or is not yours."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vm_id` does not exist or is not yours. (`not_found`)","x-error-codes":[{"code":"not_found","description":"`vm_id` does not exist or is not yours."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"volume_limit","message":"You already have the maximum number of volumes (`scope`: `account`) or the server already holds the maximum (`scope`: `vm`). The body carries `limit`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`volume_limit`: You already have the maximum number of volumes (`scope`: `account`) or the server already holds the maximum (`scope`: `vm`). The body carries `limit`. `has_backups`: The server has backups and the site does not allow attaching volumes to such servers. `vm_not_active`: The server in `vm_id` is not in the `active` state. `job_running`: Another operation is running on the server in `vm_id`. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"volume_limit","description":"You already have the maximum number of volumes (`scope`: `account`) or the server already holds the maximum (`scope`: `vm`). The body carries `limit`."},{"code":"has_backups","description":"The server has backups and the site does not allow attaching volumes to such servers."},{"code":"vm_not_active","description":"The server in `vm_id` is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server in `vm_id`."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server in `vm_id` is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server in `vm_id` is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server in `vm_id` is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 volumes were requested in a minute by this account from this address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 volumes were requested in a minute by this account from this address."}]},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage, or Block Storage is not set up yet (`why`: `no_offering`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage, or Block Storage is not set up yet (`why`: `no_offering`). (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage, or Block Storage is not set up yet (`why`: `no_offering`)."}]}},"security":[{"bearerAuth":["volume:create"]}],"summary":"Create a data volume (billed per GB-hour)","tags":["Block Storage"],"x-cli":"volume create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/volumes\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"data-1\",\"size_gb\":100,\"vm_id\":\"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"volume:create","x-summary-vi":"Tạo ổ dữ liệu (tính tiền theo GB-giờ)"}},"/v1/volumes/quote":{"get":{"description":"Returns the price of a volume of the given size at your site, per hour and per month, without creating anything and without charging. The price is per GB-hour, so the monthly figure is only an estimate for a volume kept for a whole month. Omit `size_gb` to quote the smallest allowed size.\n\n**Required scope:** `volume:read`.","operationId":"volume_quote","parameters":[{"description":"Volume size in GB: between the smallest and largest size of the site, in steps of the size step (see `meta` of List volumes). Defaults to the smallest size.","example":100,"in":"query","name":"size_gb","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"cents_per_hour":0,"cents_per_month":248,"hours_per_month":730,"rate_uusd_gb_hour":34,"size_gb":100,"uusd_per_hour":3400},"schema":{"$ref":"#/components/schemas/VolumePrice"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:read"]}],"summary":"Quote a data volume by size","tags":["Block Storage"],"x-cli":"volume quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/volumes/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"volume:read","x-summary-vi":"Báo giá ổ dữ liệu theo dung lượng"}},"/v1/volumes/{vid}":{"delete":{"description":"Deletes a volume and **destroys its data permanently**. If the volume is attached it is detached first. Billing stops when the deletion is done.\n\nThe call normally answers `202` with the background `job_id`; poll [Get a volume](#operation/volume_get) until it answers `404`. A volume that was never actually created on the platform is removed on the spot and the call answers `200` with `{\"deleted\": true, \"job_id\": null}`. The volume must not be busy with another operation; when it is attached, its server must be active, unlocked and without another operation running.\n\n**Required scope:** `volume:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"volume_delete","parameters":[{"description":"Volume identifier (integer) as returned by List volumes.","in":"path","name":"vid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"job_id":18436},"schema":{"properties":{"deleted":{"description":"Present and `true` when the volume was removed immediately (status 200).","type":"boolean"},"job_id":{"description":"Background job that deletes the volume; null when the volume was removed immediately.","type":["integer","null"]}},"required":["job_id"],"type":"object","x-order":["job_id","deleted"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"volume_busy","message":"Another operation on the volume has not finished. The body carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`volume_busy`: Another operation on the volume has not finished. The body carries the current `state`. `vm_not_active`: The server the volume is attached to is not in the `active` state. `job_running`: Another operation is running on the server the volume is attached to. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"volume_busy","description":"Another operation on the volume has not finished. The body carries the current `state`."},{"code":"vm_not_active","description":"The server the volume is attached to is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server the volume is attached to."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server the volume is attached to is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server the volume is attached to is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server the volume is attached to is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 delete requests in a minute from this account and address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 delete requests in a minute from this account and address."}]},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:destroy"]}],"summary":"Delete a data volume (data is lost permanently)","tags":["Block Storage"],"x-cli":"volume delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/volumes/<vid>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"volume:destroy","x-summary-vi":"Xoá ổ dữ liệu (mất dữ liệu vĩnh viễn)"},"get":{"description":"Returns one volume with its state, the server it is attached to, its price and what it has cost so far. Poll this operation after a create, attach, detach, resize or delete call until `busy` is false; a deleted volume answers `404`.\n\n**Required scope:** `volume:read`.","operationId":"volume_get","parameters":[{"description":"Volume identifier (integer) as returned by List volumes.","in":"path","name":"vid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"busy":false,"cents_per_month":248,"created_at":1789990000,"debt_since":null,"device_id":1,"error_code":null,"hourly_uusd":3400,"hours_per_month":730,"id":4172,"last_error":null,"name":"data-1","paid_cents":41,"rate_uusd_gb_hour":34,"size_gb":100,"state":"Attached","vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"$ref":"#/components/schemas/BlockVolume"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:read"]}],"summary":"Get one data volume","tags":["Block Storage"],"x-cli":"volume get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/volumes/<vid>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"volume:read","x-summary-vi":"Chi tiết một ổ dữ liệu"}},"/v1/volumes/{vid}/attach":{"post":{"description":"Attaches a detached volume to one of your servers. The call answers `202` with the background `job_id`; poll [Get a volume](#operation/volume_get) until its state is `Attached`, then format and mount it inside the server. Attaching costs nothing; the volume is billed the same attached or not.\n\nThe volume must be `Ready` (not attached, not busy) and the server must belong to your account and to the same site as the volume. The server must be active, unlocked, without another operation running, must not already hold the maximum number of volumes, and when it has backups the site may not allow attaching. A missing or unknown `vm_id` is answered `404 not_found`.\n\n**Required scope:** `volume:write`.","operationId":"volume_attach","parameters":[{"description":"Volume identifier (integer) as returned by List volumes.","in":"path","name":"vid","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"vm_id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10"},"schema":{"properties":{"vm_id":{"description":"Server (UUID) to attach the volume to.","type":"string"}},"required":["vm_id"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"job_id":18434},"schema":{"properties":{"job_id":{"description":"Background job that attaches the volume.","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or a field has the wrong type."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or a field has the wrong type. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or a field has the wrong type."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The volume does not exist or is not yours, or `vm_id` is missing, unknown or belongs to another account."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The volume does not exist or is not yours, or `vm_id` is missing, unknown or belongs to another account. (`not_found`)","x-error-codes":[{"code":"not_found","description":"The volume does not exist or is not yours, or `vm_id` is missing, unknown or belongs to another account."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"volume_busy","message":"Another operation on the volume has not finished. The body carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`volume_busy`: Another operation on the volume has not finished. The body carries the current `state`. `volume_attached`: The volume is already attached. The body carries the `vm_id` it is attached to. `volume_limit`: The server already holds the maximum number of volumes. The body carries `limit`. `has_backups`: The server has backups and the site does not allow attaching volumes to such servers. `vm_not_active`: The server is not in the `active` state. `job_running`: Another operation is running on the server. `not_supported_in_zone`: The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected.","x-error-codes":[{"code":"volume_busy","description":"Another operation on the volume has not finished. The body carries the current `state`."},{"code":"volume_attached","description":"The volume is already attached. The body carries the `vm_id` it is attached to."},{"code":"volume_limit","description":"The server already holds the maximum number of volumes. The body carries `limit`."},{"code":"has_backups","description":"The server has backups and the site does not allow attaching volumes to such servers."},{"code":"vm_not_active","description":"The server is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server."},{"code":"not_supported_in_zone","description":"The server runs in a region whose infrastructure does not offer this feature, so it is refused for this server. The error carries `capability` (`volumes`); check the server's `capabilities` before offering the action. Servers in other regions are not affected."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 attach requests in a minute from this account and address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 attach requests in a minute from this account and address."}]},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:write"]}],"summary":"Attach a volume to a VM","tags":["Block Storage"],"x-cli":"volume attach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/volumes/<vid>/attach\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"vm_id\":\"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"volume:write","x-summary-vi":"Gắn ổ vào máy ảo"}},"/v1/volumes/{vid}/detach":{"post":{"description":"Detaches a volume from its server. The data on the volume is kept and **the volume is still billed per GB-hour** while detached; delete it to stop the charges. Unmount the volume inside the server first so no data is lost. The call answers `202` with the background `job_id`; poll [Get a volume](#operation/volume_get) until its state is `Ready`.\n\nThe volume must be attached and not busy; the server it is attached to must be active, unlocked and without another operation running, and when it has backups the site may not allow detaching.\n\n**Required scope:** `volume:write`.","operationId":"volume_detach","parameters":[{"description":"Volume identifier (integer) as returned by List volumes.","in":"path","name":"vid","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"job_id":18435},"schema":{"properties":{"job_id":{"description":"Background job that detaches the volume.","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"volume_busy","message":"Another operation on the volume has not finished. The body carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`volume_busy`: Another operation on the volume has not finished. The body carries the current `state`. `volume_detached`: The volume is not attached to a server. `has_backups`: The server has backups and the site does not allow detaching volumes from such servers. `vm_not_active`: The server is not in the `active` state. `job_running`: Another operation is running on the server.","x-error-codes":[{"code":"volume_busy","description":"Another operation on the volume has not finished. The body carries the current `state`."},{"code":"volume_detached","description":"The volume is not attached to a server."},{"code":"has_backups","description":"The server has backups and the site does not allow detaching volumes from such servers."},{"code":"vm_not_active","description":"The server is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 detach requests in a minute from this account and address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 detach requests in a minute from this account and address."}]},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:write"]}],"summary":"Detach a volume from its VM (data kept, still billed)","tags":["Block Storage"],"x-cli":"volume detach","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/volumes/<vid>/detach\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"volume:write","x-summary-vi":"Tháo ổ khỏi máy ảo (dữ liệu giữ nguyên, vẫn tính tiền)"}},"/v1/volumes/{vid}/resize":{"post":{"description":"Enlarges a volume. **This operation costs money**: from the moment the resize is done the volume is billed per GB-hour at the new size. A volume can only grow, never shrink; a new size equal to or below the current one is rejected. The data on the volume is kept, but the file system has to be extended inside the server afterwards.\n\nThe call answers `202` with the background `job_id`; poll [Get a volume](#operation/volume_get) until `busy` is false. The volume must not be busy with another operation. When it is attached, its server must be active, unlocked and without another operation running. The new size must lie within the site limits and on the size step, and the added space must fit your account resource quota.\n\n**Required scope:** `volume:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"volume_resize","parameters":[{"description":"Volume identifier (integer) as returned by List volumes.","in":"path","name":"vid","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"size_gb":200},"schema":{"properties":{"size_gb":{"description":"New size in GB. Must be larger than the current size, within the site limits and on the size step.","type":"integer"}},"required":["size_gb"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"job_id":18433},"schema":{"properties":{"job_id":{"description":"Background job that resizes the volume.","type":"integer"}},"required":["job_id"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or `size_gb` is not a number."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: The body is not valid JSON or `size_gb` is not a number. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or `size_gb` is not a number."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The extra space would exceed your account resource quota. The body carries the usage, the limit and the next tier. (`quota_exceeded`)","x-error-codes":[{"code":"quota_exceeded","description":"The extra space would exceed your account resource quota. The body carries the usage, the limit and the next tier."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"volume_busy","message":"Another operation on the volume has not finished. The body carries the current `state`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`volume_busy`: Another operation on the volume has not finished. The body carries the current `state`. `vm_not_active`: The server the volume is attached to is not in the `active` state. `job_running`: Another operation is running on the server the volume is attached to. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"volume_busy","description":"Another operation on the volume has not finished. The body carries the current `state`."},{"code":"vm_not_active","description":"The server the volume is attached to is not in the `active` state."},{"code":"job_running","description":"Another operation is running on the server the volume is attached to."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`. `shrink_not_supported`: `size_gb` is not larger than the current size. The body carries `current_gb`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`size_gb` is outside the allowed range or not on the size step. The body carries `field`, `min_gb`, `max_gb` and `step_gb`."},{"code":"shrink_not_supported","description":"`size_gb` is not larger than the current size. The body carries `current_gb`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vm_locked","message":"The server the volume is attached to is locked, for example because of unpaid charges."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The server the volume is attached to is locked, for example because of unpaid charges. (`vm_locked`)","x-error-codes":[{"code":"vm_locked","description":"The server the volume is attached to is locked, for example because of unpaid charges."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 10 resize requests in a minute from this account and address. (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 10 resize requests in a minute from this account and address."}]},"501":{"content":{"application/json":{"example":{"error":{"code":"feature_disabled","message":"The site does not sell Block Storage."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site does not sell Block Storage. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"The site does not sell Block Storage."}]}},"security":[{"bearerAuth":["volume:create"]}],"summary":"Enlarge a data volume (grow only, costs money)","tags":["Block Storage"],"x-cli":"volume resize","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/volumes/<vid>/resize\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"size_gb\":200}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"volume:create","x-summary-vi":"Tăng dung lượng ổ (chỉ tăng, tốn tiền)"}},"/v1/vpc":{"get":{"description":"Lists your Private Clouds, oldest first by default. Deleted Private Clouds are hidden unless you filter with `state=deleted`, which shows those deleted in the last 30 days. Besides the page, the response tells you whether Private Cloud is enabled for you (`enabled`) and whether you may create another one now (`can_create`: enabled and below your limit).\n\nThe list items omit `note` and `tiers`; use [Get a Private Cloud](#operation/vpc_get) for the full object.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_list","parameters":[{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. `plan` and `mbps` both sort by bandwidth.","in":"query","name":"sort","required":false,"schema":{"default":"created_at","enum":["created_at","name","state","mbps","plan","public_ip"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"asc","enum":["asc","desc"],"type":"string"}},{"description":"Only Private Clouds in this state. `all` (the default) lists every state except `deleted`.","in":"query","name":"state","required":false,"schema":{"default":"all","enum":["all","active","locked","provisioning","failed","deleted"],"type":"string"}},{"description":"Case-insensitive search in the name, the public IP address and the CIDR.","in":"query","name":"q","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_create":false,"enabled":true,"items":[{"bandwidth":{"effective_mbps":100,"label":"Unmetered traffic · 100 Mbps dedicated","mbps":100,"unmetered":true},"billing":{"auto_renew":true,"cycle":"monthly","cycle_cents":384,"months":1,"paid_until":1795000000},"can":{"acl":true,"add_tier":true,"change_plan":true,"create_vm":true,"delete":false},"cidr":"10.128.0.0/16","created_at":1792400000,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":[{"cidr":"2001:db8:10:1::/64","tier":"default"}],"lock":null,"name":"prod-net","op":null,"plan":{"id":2,"mbps":100,"name":"100 Mbps","slug":"100m"},"pricing":{"hourly_uusd":5257,"monthly_cents":384},"public_error":null,"public_ip":"203.0.113.25","ready_at":1792400180,"router":"Running","state":"active","tier_count":1,"updated_at":1792400180,"vm_count":2,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}],"page":1,"per_page":25,"total":1},"schema":{"properties":{"can_create":{"description":"Whether you can create another Private Cloud now (enabled and below `max_per_account`).","type":"boolean"},"enabled":{"description":"Whether Private Cloud is enabled for your account.","type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/Vpc"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","enabled","can_create"],"type":"object","x-order":["items","total","page","per_page","enabled","can_create"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page`, `per_page`, `sort`, `dir` or `state` is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page`, `per_page`, `sort`, `dir` or `state` is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page`, `per_page`, `sort`, `dir` or `state` is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"List Private Clouds","tags":["Private Cloud"],"x-cli":"vpc list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Danh sách Private Cloud"},"post":{"description":"Orders a new Private Cloud: a private /16 network with a default tier, a virtual router with one public IP address for outbound traffic, default Network ACL rules (SSH, RDP and ICMP in, everything out) and a dedicated unmetered bandwidth plan. The call returns `202` at once with the Private Cloud in state `provisioning` and an `op`; poll [Get a Private Cloud](#operation/vpc_get) until `state` is `active` (normally a few minutes) or `failed`.\n\nA prepaid `cycle` (e.g. `monthly`) is charged from your wallet immediately. Hourly billing (the default) starts when the Private Cloud becomes active, but the order needs a balance that covers at least `min_hours` hours of the plan price. A creation that fails is refunded in full. Each account may own `limits.max_per_account` Private Clouds (default 1; more fail with `403 vpc_limit`) and may place at most 3 orders in 24 hours (`429 rate_limited`). Check conditions and price first with [Quote a Private Cloud](#operation/vpc_quote). Fails with `403 vpc_disabled` while Private Cloud is not enabled for your account.\n\n**Required scope:** `vpc:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpc_create","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cycle":"monthly","name":"prod-net","plan":"100m"},"schema":{"properties":{"cycle":{"description":"Billing cycle slug from the catalog. Default `hourly`. Any other cycle is prepaid and charged now.","type":"string"},"name":{"description":"Name of the Private Cloud, 3-40 characters: lowercase letters, digits and hyphens, starting with a letter and not ending with a hyphen. Leading and trailing spaces are removed and capitals are lowercased. It must be unique among your Private Clouds.","maxLength":40,"minLength":3,"type":"string"},"plan":{"description":"Plan `slug` from the catalog, e.g. `100m`. The numeric plan `id` is accepted too.","type":"string"}},"required":["name","plan"],"type":"object","x-order":["name","plan","cycle"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"op":{"id":41,"kind":"create","state":"queued"},"vpc":{"bandwidth":{"effective_mbps":100,"label":"Unmetered traffic · 100 Mbps dedicated","mbps":100,"unmetered":true},"billing":{"auto_renew":true,"cycle":"monthly","cycle_cents":384,"months":1,"paid_until":1795000000},"can":{"acl":false,"add_tier":false,"change_plan":false,"create_vm":false,"delete":false},"cidr":"10.128.0.0/16","created_at":1792400000,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":[],"lock":null,"name":"prod-net","note":null,"op":{"created_at":1792400000,"finished_at":null,"id":41,"kind":"create","public_error":null,"state":"queued","step":"queued"},"plan":{"id":2,"mbps":100,"name":"100 Mbps","slug":"100m"},"pricing":{"hourly_uusd":5257,"monthly_cents":384},"public_error":null,"public_ip":null,"ready_at":null,"router":null,"state":"provisioning","tier_count":1,"tiers":[{"can_delete":false,"cidr":"10.128.1.0/24","created_at":1792400000,"gateway":"10.128.1.1","id":"7b1e2c44-52d0-4f6b-8a3e-90d1c6a5e2f1","index":1,"ipv6_cidr":null,"ipv6_gateway":null,"is_default":true,"name":"default","state":"provisioning","vm_count":0}],"updated_at":1792400000,"vm_count":0,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"op":{"$ref":"#/components/schemas/VpcOpRef"},"vpc":{"$ref":"#/components/schemas/Vpc"}},"required":["vpc","op"],"type":"object","x-order":["vpc","op"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, `plan` is missing or not a string or number (the error carries `field: \"plan\"`), or `cycle` is not a known or enabled billing cycle (`detail`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, `plan` is missing or not a string or number (the error carries `field: \"plan\"`), or `cycle` is not a known or enabled billing cycle (`detail`). `name_invalid`: `name` does not follow the naming rules. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, `plan` is missing or not a string or number (the error carries `field: \"plan\"`), or `cycle` is not a known or enabled billing cycle (`detail`)."},{"code":"name_invalid","description":"`name` does not follow the naming rules."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is below the balance the order needs. The error carries `need_cents` and `balance_cents` (US cents)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is below the balance the order needs. The error carries `need_cents` and `balance_cents` (US cents). (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is below the balance the order needs. The error carries `need_cents` and `balance_cents` (US cents)."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `vpc_disabled`: Private Cloud is not enabled on this site for your account. `vpc_limit`: You already own the maximum number of Private Clouds. The error carries `max`. `email_unverified`: Verify your e-mail address first. `limit_reached`: The site has reached its own resource limit; contact support.","x-error-codes":[{"code":"vpc_disabled","description":"Private Cloud is not enabled on this site for your account."},{"code":"vpc_limit","description":"You already own the maximum number of Private Clouds. The error carries `max`."},{"code":"email_unverified","description":"Verify your e-mail address first."},{"code":"limit_reached","description":"The site has reached its own resource limit; contact support."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"name_taken","message":"You already have a Private Cloud with this name."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`name_taken`: You already have a Private Cloud with this name. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"name_taken","description":"You already have a Private Cloud with this name."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"plan_unavailable","message":"The plan does not exist or is not on sale."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan_unavailable`: The plan does not exist or is not on sale. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"plan_unavailable","description":"The plan does not exist or is not on sale."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"sales_disabled","message":"New orders are paused on this site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`sales_disabled`: New orders are paused on this site. `site_unavailable`: The site is not accepting orders at the moment.","x-error-codes":[{"code":"sales_disabled","description":"New orders are paused on this site."},{"code":"site_unavailable","description":"The site is not accepting orders at the moment."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: You already placed 3 orders in the last 24 hours. The error carries `retry_after` (seconds). (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"You already placed 3 orders in the last 24 hours. The error carries `retry_after` (seconds)."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"capacity","message":"The platform has no room for another Private Cloud right now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`capacity`: The platform has no room for another Private Cloud right now. `cidr_exhausted`: No network ranges are left for new Private Clouds; contact support. `provider_unavailable`: The site operator cannot accept new orders at the moment. Retry later. `tenant_unavailable`: Your account is not ready yet. Retry in a few minutes.","x-error-codes":[{"code":"capacity","description":"The platform has no room for another Private Cloud right now."},{"code":"cidr_exhausted","description":"No network ranges are left for new Private Clouds; contact support."},{"code":"provider_unavailable","description":"The site operator cannot accept new orders at the moment. Retry later."},{"code":"tenant_unavailable","description":"Your account is not ready yet. Retry in a few minutes."}]}},"security":[{"bearerAuth":["vpc:create"]}],"summary":"Create a Private Cloud (prepaid cycles charge the wallet)","tags":["Private Cloud"],"x-cli":"vpc create","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpc\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cycle\":\"monthly\",\"name\":\"prod-net\",\"plan\":\"100m\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpc:create","x-summary-vi":"Tạo Private Cloud (trả trước kỳ thì trừ tiền ví ngay)"}},"/v1/vpc/catalog":{"get":{"description":"Returns what you can order: the bandwidth plans (dedicated, unmetered Mbps) with their price for every billing cycle, the billing cycles, the region where Private Clouds are built, and the limits that apply to your account (`limits.used` of `limits.max_per_account` Private Clouds already created). Prices are the retail prices of the site you call, in US dollars. Nothing is created or charged.\n\nUse [Quote a Private Cloud](#operation/vpc_quote) to price one plan and check your balance before ordering. Fails with `403 vpc_disabled` while Private Cloud is not enabled for your account.\n\n**Required scope:** `catalog:read`.","operationId":"vpc_catalog","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"cycles":[{"discount_pct":0.0,"months":0,"name":"Hourly","slug":"hourly"},{"discount_pct":0.0,"months":1,"name":"Monthly","slug":"monthly"},{"discount_pct":10.0,"months":12,"name":"1 year","slug":"yearly"}],"features":{"ipv6_per_tier":"/64","network_acl":true,"router":"single","unmetered":true},"hours_per_month":730,"limits":{"max_acl_rules":50,"max_per_account":1,"max_tiers":3,"max_vms":50,"min_hours_to_create":24,"used":0},"plans":[{"cycles":[{"cycle":"hourly","cycle_cents":0,"discount_pct":0.0,"months":0,"name":"Hourly"},{"cycle":"monthly","cycle_cents":384,"discount_pct":0.0,"months":1,"name":"Monthly"},{"cycle":"yearly","cycle_cents":4147,"discount_pct":10.0,"months":12,"name":"1 year"}],"hourly_uusd":5257,"id":2,"label":"Unmetered traffic · 100 Mbps dedicated","mbps":100,"monthly_cents":384,"name":"100 Mbps","slug":"100m"}],"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"schema":{"properties":{"cycles":{"items":{"$ref":"#/components/schemas/VpcCycle"},"type":"array"},"features":{"properties":{"ipv6_per_tier":{"description":"Size of the IPv6 subnet every tier receives, e.g. `/64`.","type":"string"},"network_acl":{"description":"Network ACL rules are available.","type":"boolean"},"router":{"description":"`single`: one virtual router and one public IP address per Private Cloud.","type":"string"},"unmetered":{"description":"Always `true`: no transfer quota.","type":"boolean"}},"required":["unmetered","ipv6_per_tier","router","network_acl"],"type":"object","x-order":["unmetered","ipv6_per_tier","router","network_acl"]},"hours_per_month":{"description":"Hours in a billing month (730), used for `monthly_cents`.","type":"integer"},"limits":{"properties":{"max_acl_rules":{"description":"Maximum ACL rules you can add per Private Cloud (platform rules do not count).","type":"integer"},"max_per_account":{"description":"How many Private Clouds one account may own at the same time.","type":"integer"},"max_tiers":{"description":"Maximum tiers per Private Cloud, including the default tier.","type":"integer"},"max_vms":{"description":"Maximum servers per Private Cloud.","type":"integer"},"min_hours_to_create":{"description":"Hours of plan price your wallet balance must cover to order a Private Cloud.","type":"integer"},"used":{"description":"How many you own now (Private Clouds being created or deleted count, deleted and failed ones do not).","type":"integer"}},"required":["max_per_account","used","max_tiers","max_vms","max_acl_rules","min_hours_to_create"],"type":"object","x-order":["max_per_account","used","max_tiers","max_vms","max_acl_rules","min_hours_to_create"]},"plans":{"items":{"$ref":"#/components/schemas/VpcPlan"},"type":"array"},"zone":{"anyOf":[{"$ref":"#/components/schemas/Zone"},{"type":"null"}]}},"required":["plans","cycles","zone","limits","features","hours_per_month"],"type":"object","x-order":["plans","cycles","zone","limits","features","hours_per_month"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Private Cloud is not enabled on this site for your account. (`vpc_disabled`)","x-error-codes":[{"code":"vpc_disabled","description":"Private Cloud is not enabled on this site for your account."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Private Cloud catalog: bandwidth plans, cycles, limits","tags":["Private Cloud"],"x-cli":"vpc catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục Private Cloud: gói băng thông, chu kỳ, giới hạn"}},"/v1/vpc/quote":{"get":{"description":"Prices one plan for one billing cycle and tells you whether you can order it right now, without creating or charging anything. `quote` holds the prices; `funds` compares your wallet with the balance an order needs (`need_cents`: the first charge, or `min_hours` hours of the plan price for hourly billing, whichever is larger); `checks` lists the other ordering conditions; `can_create` is `true` only when every condition passes.\n\nOrder with [Create a Private Cloud](#operation/vpc_create) using the same `plan` and `cycle`. Fails with `403 vpc_disabled` while Private Cloud is not enabled for your account.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_quote","parameters":[{"description":"Plan to price: the plan `slug` (e.g. `100m`) or its numeric `id`, both from the catalog.","example":"100m","in":"query","name":"plan","required":true,"schema":{"type":"string"}},{"description":"Billing cycle slug from the catalog, e.g. `hourly`, `monthly`, `yearly`.","in":"query","name":"cycle","required":false,"schema":{"default":"hourly","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_create":true,"checks":{"email_verified":true,"provider_ok":true,"sales_enabled":true,"vpc":{"max":1,"total_ok":true,"used":0}},"funds":{"balance_cents":2500,"enough":true,"first_charge_cents":384,"min_hours":24,"need_cents":384},"plan":{"cycles":[{"cycle":"hourly","cycle_cents":0,"discount_pct":0.0,"months":0,"name":"Hourly"},{"cycle":"monthly","cycle_cents":384,"discount_pct":0.0,"months":1,"name":"Monthly"},{"cycle":"yearly","cycle_cents":4147,"discount_pct":10.0,"months":12,"name":"1 year"}],"hourly_uusd":5257,"id":2,"label":"Unmetered traffic · 100 Mbps dedicated","mbps":100,"monthly_cents":384,"name":"100 Mbps","slug":"100m"},"quote":{"cycle":"monthly","cycle_cents":384,"cycle_name":"Monthly","discount_pct":0.0,"first_charge_cents":384,"hourly_uusd":5257,"mbps":100,"monthly_cents":384,"months":1,"plan_id":2}},"schema":{"properties":{"can_create":{"description":"`true` when an order with this plan and cycle would be accepted right now.","type":"boolean"},"checks":{"properties":{"email_verified":{"description":"Your e-mail address is verified (or verification is not required).","type":"boolean"},"provider_ok":{"description":"The site operator can accept a new order.","type":"boolean"},"sales_enabled":{"description":"New orders are being accepted.","type":"boolean"},"vpc":{"properties":{"max":{"description":"Maximum per account.","type":"integer"},"total_ok":{"description":"The platform still has room for another Private Cloud.","type":"boolean"},"used":{"description":"Private Clouds you own now.","type":"integer"}},"required":["used","max","total_ok"],"type":"object","x-order":["used","max","total_ok"]}},"required":["sales_enabled","email_verified","vpc","provider_ok"],"type":"object","x-order":["sales_enabled","email_verified","vpc","provider_ok"]},"funds":{"properties":{"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"enough":{"description":"Whether `balance_cents` covers `need_cents`.","type":"boolean"},"first_charge_cents":{"description":"Amount charged immediately by the order, in US cents (0 for hourly billing).","type":"integer"},"min_hours":{"description":"Hours of plan price a balance must cover for hourly billing.","type":"integer"},"need_cents":{"description":"Balance an order needs, in US cents.","type":"integer"}},"required":["balance_cents","need_cents","enough","first_charge_cents","min_hours"],"type":"object","x-order":["balance_cents","need_cents","enough","first_charge_cents","min_hours"]},"plan":{"$ref":"#/components/schemas/VpcPlan"},"quote":{"$ref":"#/components/schemas/VpcQuote"}},"required":["plan","quote","funds","checks","can_create"],"type":"object","x-order":["plan","quote","funds","checks","can_create"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`cycle` is not a known or enabled billing cycle. The error carries a `detail` text."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`cycle` is not a known or enabled billing cycle. The error carries a `detail` text. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`cycle` is not a known or enabled billing cycle. The error carries a `detail` text."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Private Cloud is not enabled on this site for your account. (`vpc_disabled`)","x-error-codes":[{"code":"vpc_disabled","description":"Private Cloud is not enabled on this site for your account."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"plan_unavailable","message":"`plan` is missing, unknown or not on sale."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan_unavailable`: `plan` is missing, unknown or not on sale. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before.","x-error-codes":[{"code":"plan_unavailable","description":"`plan` is missing, unknown or not on sale."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Quote a Private Cloud + required balance (no charge)","tags":["Private Cloud"],"x-cli":"vpc quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/quote?plan=<plan>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Báo giá Private Cloud + số dư cần (không trừ tiền)"}},"/v1/vpc/{id}":{"delete":{"description":"Deletes a Private Cloud with its tiers and ACL rules, and releases its public IP address. Every server in it must be deleted first (`409 vpc_has_vms`), and you confirm by sending the exact name of the Private Cloud. The call returns `202` and the Private Cloud moves to `deleting`, then `deleted`.\n\nUnused time of a prepaid period is refunded to your wallet when the deletion finishes; `refund_cents_estimate` is the amount calculated now (always 0 for hourly billing). Use [Preview before deleting](#operation/vpc_delete_preview) to see what will be removed. A Private Cloud locked by support (`lock.reason` of `admin` or `abuse`) cannot be deleted.\n\n**Required scope:** `vpc:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpc_delete","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":"prod-net"},"schema":{"properties":{"confirm":{"description":"The exact name of the Private Cloud, as a safeguard against deleting the wrong one.","type":"string"}},"required":["confirm"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"deleted":true,"op":{"id":58,"kind":"delete","state":"queued"},"refund_cents_estimate":301},"schema":{"properties":{"deleted":{"description":"Always `true`: the deletion was accepted and is in progress.","type":"boolean"},"op":{"$ref":"#/components/schemas/VpcOpRef"},"refund_cents_estimate":{"description":"Wallet refund for the unused prepaid time, in US cents, calculated at the time of the request. The final amount is credited when the deletion completes.","type":"integer"}},"required":["deleted","refund_cents_estimate","op"],"type":"object","x-order":["deleted","refund_cents_estimate","op"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object. `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vpc_busy","message":"Another operation is running, or the Private Cloud is not `active` or `locked`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vpc_busy`: Another operation is running, or the Private Cloud is not `active` or `locked`. `vpc_has_vms`: Servers are still in the Private Cloud. Delete them first. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vpc_busy","description":"Another operation is running, or the Private Cloud is not `active` or `locked`."},{"code":"vpc_has_vms","description":"Servers are still in the Private Cloud. Delete them first."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`confirm` is missing or is not the name of the Private Cloud (the error carries `field: \"confirm\"`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: `confirm` is missing or is not the name of the Private Cloud (the error carries `field: \"confirm\"`). `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"bad_input","description":"`confirm` is missing or is not the name of the Private Cloud (the error carries `field: \"confirm\"`)."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vpc_locked","message":"Support locked the Private Cloud. It can be deleted after support unlocks it."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Support locked the Private Cloud. It can be deleted after support unlocks it. (`vpc_locked`)","x-error-codes":[{"code":"vpc_locked","description":"Support locked the Private Cloud. It can be deleted after support unlocks it."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:destroy"]}],"summary":"Delete the Private Cloud (no VMs left)","tags":["Private Cloud"],"x-cli":"vpc delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vpc/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":\"prod-net\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpc:destroy","x-summary-vi":"Xoá Private Cloud (không còn VM)"},"get":{"description":"Returns one Private Cloud with its tiers, billing, current operation and what you can do with it now (`can`). A Private Cloud you deleted stays readable, with state `deleted`, for 30 days. Use the list calls for the parts that grow: [tiers](#operation/vpc_tier_list), [ACL rules](#operation/vpc_acl_list), [servers](#operation/vpc_vms) and [public IPs](#operation/vpc_ips).\n\n**Required scope:** `vpc:read`.","operationId":"vpc_get","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"vpc":{"bandwidth":{"effective_mbps":100,"label":"Unmetered traffic · 100 Mbps dedicated","mbps":100,"unmetered":true},"billing":{"auto_renew":true,"cycle":"monthly","cycle_cents":384,"months":1,"paid_until":1795000000},"can":{"acl":true,"add_tier":true,"change_plan":true,"create_vm":true,"delete":false},"cidr":"10.128.0.0/16","created_at":1792400000,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":[{"cidr":"2001:db8:10:1::/64","tier":"default"}],"lock":null,"name":"prod-net","note":"Production network","op":null,"plan":{"id":2,"mbps":100,"name":"100 Mbps","slug":"100m"},"pricing":{"hourly_uusd":5257,"monthly_cents":384},"public_error":null,"public_ip":"203.0.113.25","ready_at":1792400180,"router":"Running","state":"active","tier_count":1,"tiers":[{"can_delete":false,"cidr":"10.128.1.0/24","created_at":1792400000,"gateway":"10.128.1.1","id":"7b1e2c44-52d0-4f6b-8a3e-90d1c6a5e2f1","index":1,"ipv6_cidr":"2001:db8:10:1::/64","ipv6_gateway":"2001:db8:10:1::1","is_default":true,"name":"default","state":"active","vm_count":2}],"updated_at":1792400180,"vm_count":2,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"vpc":{"$ref":"#/components/schemas/Vpc"}},"required":["vpc"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Get one Private Cloud","tags":["Private Cloud"],"x-cli":"vpc get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Chi tiết Private Cloud"},"patch":{"description":"Changes the name, the note or the automatic renewal of a Private Cloud. Nothing is charged and the network is not touched. Send only the fields you want to change. It works in every state except `deleting`, `deleted` and `failed`.\n\nTurning `auto_renew` on also retries unlocking a Private Cloud that was locked because its prepaid period ended or its bill was unpaid; when your balance covers it, the charge is taken from the wallet and the Private Cloud is unlocked.\n\n**Required scope:** `vpc:write`.","operationId":"vpc_update","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"auto_renew":false,"name":"prod-net-2","note":"Production network"},"schema":{"properties":{"auto_renew":{"description":"Whether a prepaid cycle renews automatically from the wallet when it ends.","type":"boolean"},"name":{"description":"New name, same rules as when creating. It must be unique among your Private Clouds.","maxLength":40,"minLength":3,"type":"string"},"note":{"description":"New note, up to 500 characters (longer text is cut). An empty string or null clears the note.","maxLength":500,"type":["string","null"]}},"type":"object","x-order":["name","note","auto_renew"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"vpc":{"bandwidth":{"effective_mbps":100,"label":"Unmetered traffic · 100 Mbps dedicated","mbps":100,"unmetered":true},"billing":{"auto_renew":false,"cycle":"monthly","cycle_cents":384,"months":1,"paid_until":1795000000},"can":{"acl":true,"add_tier":true,"change_plan":true,"create_vm":true,"delete":false},"cidr":"10.128.0.0/16","created_at":1792400000,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":[{"cidr":"2001:db8:10:1::/64","tier":"default"}],"lock":null,"name":"prod-net-2","note":"Production network","op":null,"plan":{"id":2,"mbps":100,"name":"100 Mbps","slug":"100m"},"pricing":{"hourly_uusd":5257,"monthly_cents":384},"public_error":null,"public_ip":"203.0.113.25","ready_at":1792400180,"router":"Running","state":"active","tier_count":1,"tiers":[{"can_delete":false,"cidr":"10.128.1.0/24","created_at":1792400000,"gateway":"10.128.1.1","id":"7b1e2c44-52d0-4f6b-8a3e-90d1c6a5e2f1","index":1,"ipv6_cidr":"2001:db8:10:1::/64","ipv6_gateway":"2001:db8:10:1::1","is_default":true,"name":"default","state":"active","vm_count":2}],"updated_at":1792410000,"vm_count":2,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"vpc":{"$ref":"#/components/schemas/Vpc"}},"required":["vpc"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, or `auto_renew` is not a boolean."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, or `auto_renew` is not a boolean. `name_invalid`: `name` does not follow the naming rules.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, or `auto_renew` is not a boolean."},{"code":"name_invalid","description":"`name` does not follow the naming rules."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"name_taken","message":"You already have another Private Cloud with this name."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`name_taken`: You already have another Private Cloud with this name. `vpc_busy`: The Private Cloud is being deleted, or is deleted or failed.","x-error-codes":[{"code":"name_taken","description":"You already have another Private Cloud with this name."},{"code":"vpc_busy","description":"The Private Cloud is being deleted, or is deleted or failed."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:write"]}],"summary":"Rename / notes / auto-renew","tags":["Private Cloud"],"x-cli":"vpc update","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PATCH \"https://api.onie.net/v1/vpc/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"auto_renew\":false,\"name\":\"prod-net-2\",\"note\":\"Production network\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:write","x-summary-vi":"Đổi tên / ghi chú / tự gia hạn"}},"/v1/vpc/{id}/acl":{"get":{"description":"Lists the Network ACL rules of a Private Cloud in ascending order of `number`. The ACL applies to all tiers. A new Private Cloud starts with rules that allow SSH (22), RDP (3389) and ICMP in and everything out for IPv4 and IPv6, plus platform rules (numbers 1-8, `system: true`): rule 1 allows traffic to the Private Cloud's own range and rules 2-6 block outbound traffic to other private address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10 and 169.254.0.0/16). Traffic that matches no rule is denied in both directions (`default_policy`). `max` is the number of rules you may add; platform rules do not count.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_acl_list","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"default_policy":{"egress":"deny","ingress":"deny"},"items":[{"action":"allow","cidr":"10.128.0.0/16","created_at":1792400000,"direction":"egress","end_port":null,"error":null,"id":"0a9c3e51-7f24-4d68-8b1a-5c6e2d7f9013","is_default":true,"note":"Platform: VPC network","number":1,"protocol":"all","start_port":null,"state":"active","system":true},{"action":"allow","cidr":"0.0.0.0/0","created_at":1792400000,"direction":"ingress","end_port":22,"error":null,"id":"5d8b1f27-4c90-4a3e-9e62-1b7a0c4d8e55","is_default":true,"note":"SSH","number":10,"protocol":"tcp","start_port":22,"state":"active","system":false},{"action":"allow","cidr":"0.0.0.0/0","created_at":1792401000,"direction":"ingress","end_port":443,"error":null,"id":"e4a07b9c-61d2-4c58-b3f1-2d8a9c5e7016","is_default":false,"note":"HTTPS","number":100,"protocol":"tcp","start_port":443,"state":"active","system":false}],"max":50,"total":3},"schema":{"properties":{"default_policy":{"properties":{"egress":{"description":"What happens to outbound traffic that matches no rule: `deny`.","type":"string"},"ingress":{"description":"What happens to inbound traffic that matches no rule: `deny`.","type":"string"}},"required":["ingress","egress"],"type":"object","x-order":["ingress","egress"]},"items":{"items":{"$ref":"#/components/schemas/VpcAclRule"},"type":"array"},"max":{"description":"Maximum number of rules you can add to one Private Cloud.","type":"integer"},"total":{"description":"Number of rules, platform rules included.","type":"integer"}},"required":["items","total","max","default_policy"],"type":"object","x-order":["items","total","max","default_policy"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Network ACL rules","tags":["Private Cloud"],"x-cli":"vpc acl list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/acl\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Luật Network ACL"},"post":{"description":"Adds a Network ACL rule. The rule is applied in the background: the call returns `202` with the rule in state `pending`, and it filters traffic once its state is `active`. Rules are evaluated in ascending order of `number` and the first match decides, so give a `deny` a lower number than the `allow` it must override. Without `number` the rule is numbered after your last rule below 900 in steps of 10; numbers 1-8 are reserved for platform rules and numbers 900-901 hold the default \"allow all outbound\" rules.\n\nValidation: `direction` `ingress` or `egress`; `protocol` `tcp`, `udp`, `icmp` or `all`; for `tcp` and `udp` a `start_port` of 1-65535 and an `end_port` not below it (ports are ignored for `icmp` and `all`); `cidr` an IPv4 or IPv6 CIDR with prefix length; `action` `allow` or `deny`. Values are case-insensitive. An invalid rule answers `422 acl_invalid` with `field` naming the first wrong field. A Private Cloud holds at most `max` rules (`403 acl_limit`) and you can add at most 60 rules per hour (`429 rate_limited`).\n\n**Required scope:** `vpc:write`.","operationId":"vpc_acl_add","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"action":"allow","cidr":"0.0.0.0/0","direction":"ingress","end_port":443,"note":"HTTPS","number":100,"protocol":"tcp","start_port":443},"schema":{"properties":{"action":{"description":"What to do with matching traffic. Default `allow`.","enum":["allow","deny"],"type":"string"},"cidr":{"description":"IPv4 or IPv6 range to match, with prefix length, e.g. `203.0.113.0/24`, `0.0.0.0/0` or `::/0`. IPv6 is lowercased.","type":"string"},"direction":{"description":"`ingress` for traffic entering the Private Cloud (the CIDR is the source), `egress` for traffic leaving it (the CIDR is the destination). Default `ingress`.","enum":["ingress","egress"],"type":"string"},"end_port":{"description":"Last port, 1-65535, not below `start_port`. Defaults to `start_port` (a single port). Ignored for `icmp` and `all`.","maximum":65535,"minimum":1,"type":"integer"},"note":{"description":"Label shown in the list, up to 100 characters (control characters are removed, longer text is cut).","maxLength":100,"minLength":0,"type":"string"},"number":{"description":"Priority 1-9999; lower numbers are evaluated first. 1-8 are reserved. It must not be used by another rule. Omit it to let the API pick the next free number.","maximum":9999,"minimum":1,"type":"integer"},"protocol":{"description":"Protocol to match.","enum":["tcp","udp","icmp","all"],"type":"string"},"start_port":{"description":"First port, 1-65535. Required for `tcp` and `udp`; ignored for `icmp` and `all`.","maximum":65535,"minimum":1,"type":"integer"}},"required":["protocol","cidr"],"type":"object","x-order":["direction","protocol","start_port","end_port","cidr","action","note","number"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"op":{"id":45,"kind":"acl_sync","state":"queued"},"rule":{"action":"allow","cidr":"0.0.0.0/0","created_at":1792401000,"direction":"ingress","end_port":443,"error":null,"id":"e4a07b9c-61d2-4c58-b3f1-2d8a9c5e7016","is_default":false,"note":"HTTPS","number":100,"protocol":"tcp","start_port":443,"state":"pending","system":false}},"schema":{"properties":{"op":{"anyOf":[{"$ref":"#/components/schemas/VpcOpRef"},{"type":"null"}]},"rule":{"$ref":"#/components/schemas/VpcAclRule"}},"required":["rule","op"],"type":"object","x-order":["rule","op"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not a JSON object. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: The Private Cloud already has the maximum number of rules. The error carries `max`. (`acl_limit`)","x-error-codes":[{"code":"acl_limit","description":"The Private Cloud already has the maximum number of rules. The error carries `max`."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"acl_invalid","message":"`number` is already used by another rule (the error carries `field: \"number\"`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`acl_invalid`: `number` is already used by another rule (the error carries `field: \"number\"`). `vpc_busy`: The Private Cloud is not `active` or `locked`.","x-error-codes":[{"code":"acl_invalid","description":"`number` is already used by another rule (the error carries `field: \"number\"`)."},{"code":"vpc_busy","description":"The Private Cloud is not `active` or `locked`."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"acl_invalid","message":"A field is wrong. The error carries `field`: `direction`, `protocol`, `action`, `cidr`, `start_port` (missing for tcp/udp), `port` (outside 1-65535 or end below start) or `number` (outside 1-9999 or reserved 1-8)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is wrong. The error carries `field`: `direction`, `protocol`, `action`, `cidr`, `start_port` (missing for tcp/udp), `port` (outside 1-65535 or end below start) or `number` (outside 1-9999 or reserved 1-8). (`acl_invalid`)","x-error-codes":[{"code":"acl_invalid","description":"A field is wrong. The error carries `field`: `direction`, `protocol`, `action`, `cidr`, `start_port` (missing for tcp/udp), `port` (outside 1-65535 or end below start) or `number` (outside 1-9999 or reserved 1-8)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 60 rules were added in the last hour. The error carries `retry_after` (seconds). (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 60 rules were added in the last hour. The error carries `retry_after` (seconds)."}]}},"security":[{"bearerAuth":["vpc:write"]}],"summary":"Add a Network ACL rule","tags":["Private Cloud"],"x-cli":"vpc acl add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpc/<id>/acl\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"action\":\"allow\",\"cidr\":\"0.0.0.0/0\",\"direction\":\"ingress\",\"end_port\":443,\"note\":\"HTTPS\",\"number\":100,\"protocol\":\"tcp\",\"start_port\":443}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:write","x-summary-vi":"Thêm luật Network ACL"}},"/v1/vpc/{id}/acl/{rule}":{"delete":{"description":"Deletes a Network ACL rule, including the default rules created with the Private Cloud. The rule stops filtering traffic within a few seconds; the call returns `202` while it is removed in the background. Platform rules (`system: true`) cannot be deleted (`403 acl_system_rule`). Deleting is never rate limited, so you can always remove a dangerous rule at once.\n\n**Required scope:** `vpc:write`.","operationId":"vpc_acl_delete","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Network ACL rule identifier as returned by List ACL rules.","in":"path","name":"rule","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"deleted":true},"schema":{"properties":{"deleted":{"description":"Always `true`: the deletion was accepted.","type":"boolean"}},"required":["deleted"],"type":"object"}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This is a platform rule and cannot be deleted. (`acl_system_rule`)","x-error-codes":[{"code":"acl_system_rule","description":"This is a platform rule and cannot be deleted."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vpc_busy","message":"The rule is already being deleted."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The rule is already being deleted. (`vpc_busy`)","x-error-codes":[{"code":"vpc_busy","description":"The rule is already being deleted."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:write"]}],"summary":"Delete a Network ACL rule","tags":["Private Cloud"],"x-cli":"vpc acl delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vpc/<id>/acl/<rule>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpc:write","x-summary-vi":"Xoá luật Network ACL"}},"/v1/vpc/{id}/bandwidth":{"get":{"description":"Returns inbound and outbound traffic of all public addresses of the Private Cloud (router address, server addresses and the IPv6 prefixes of the tiers) as a time series in Mbit/s, with the bandwidth cap of the plan and utilisation statistics. Traffic is not metered or billed; the chart only helps you choose a plan. `series` holds one `[time, inbound_mbps, outbound_mbps]` point every `step` seconds; \"inbound\" is traffic towards your addresses, \"outbound\" traffic from them.\n\nIf measurements are temporarily unavailable `available` is `false` and the series is zero. The `1h` window is cached for about 20 seconds and limited to 20 calls per minute per account.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_bandwidth","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Time window ending now. Points are 60 s apart for `1h`, 300 s for `24h`, 1800 s for `7d` and 3600 s for `30d`.","in":"query","name":"range","required":false,"schema":{"default":"24h","enum":["1h","24h","7d","30d"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"available":true,"from":1792410000,"ip_count":2,"limit_mbps":100,"range":"24h","series":[[1792410000,1.25,0.8],[1792410300,3.5,2.1],[1792410600,0.0,0.0]],"stats":{"avg_in_mbps":3.12,"avg_out_mbps":1.4,"avg_util_pct":3.1,"in_bytes":33696000000,"out_bytes":15120000000,"peak_in_mbps":42.5,"peak_out_mbps":18.3,"peak_util_pct":42.5},"step":300,"to":1792496400,"unmetered":true},"schema":{"properties":{"available":{"description":"`false` when no measurement could be read for this window.","type":"boolean"},"from":{"description":"Start of the window (Unix time, seconds, UTC)","type":"integer"},"ip_count":{"description":"Number of addresses and prefixes measured.","type":"integer"},"limit_mbps":{"description":"Bandwidth cap of the plan in Mbit/s (1 while the Private Cloud is locked). Use it as the reference line of a chart.","type":"integer"},"range":{"description":"The window that was returned.","type":"string"},"series":{"items":{"description":"`[unix_time, inbound_mbps, outbound_mbps]`: the time in seconds and the two rates in Mbit/s (decimals).","items":{"type":"number"},"type":"array"},"type":"array"},"stats":{"properties":{"avg_in_mbps":{"description":"Average inbound rate, Mbit/s.","type":"number"},"avg_out_mbps":{"description":"Average outbound rate, Mbit/s.","type":"number"},"avg_util_pct":{"description":"Average of the busier direction as a percentage of `limit_mbps`.","type":"number"},"in_bytes":{"description":"Total inbound traffic in the window, bytes.","type":"integer"},"out_bytes":{"description":"Total outbound traffic in the window, bytes.","type":"integer"},"peak_in_mbps":{"description":"Highest inbound rate in the window, Mbit/s.","type":"number"},"peak_out_mbps":{"description":"Highest outbound rate in the window, Mbit/s.","type":"number"},"peak_util_pct":{"description":"Peak of the busier direction as a percentage of `limit_mbps`.","type":"number"}},"required":["peak_in_mbps","peak_out_mbps","avg_in_mbps","avg_out_mbps","peak_util_pct","avg_util_pct","in_bytes","out_bytes"],"type":"object","x-order":["peak_in_mbps","peak_out_mbps","avg_in_mbps","avg_out_mbps","peak_util_pct","avg_util_pct","in_bytes","out_bytes"]},"step":{"description":"Seconds between points of `series`.","type":"integer"},"to":{"description":"End of the window (Unix time, seconds, UTC)","type":"integer"},"unmetered":{"description":"Always `true`: traffic is not billed.","type":"boolean"}},"required":["range","step","from","to","limit_mbps","unmetered","available","ip_count","series","stats"],"type":"object","x-order":["range","step","from","to","limit_mbps","unmetered","available","ip_count","series","stats"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`range` is not one of `1h`, `24h`, `7d`, `30d` (the error carries `field: \"range\"`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`range` is not one of `1h`, `24h`, `7d`, `30d` (the error carries `field: \"range\"`). (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`range` is not one of `1h`, `24h`, `7d`, `30d` (the error carries `field: \"range\"`)."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: More than 20 `1h` requests in a minute. The error carries `retry_after` (seconds). (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"More than 20 `1h` requests in a minute. The error carries `retry_after` (seconds)."}]}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Bandwidth chart (Mbps, plan limit)","tags":["Private Cloud"],"x-cli":"vpc bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Biểu đồ băng thông (Mbps, trần gói)"}},"/v1/vpc/{id}/billing":{"get":{"description":"Returns what this Private Cloud costs and the wallet entries it caused: the creation charge, hourly charges or renewals, plan-change charges and refunds. `spent_month_cents` and `spent_total_cents` are net amounts (charges minus refunds) for the current calendar month and for the whole life of the Private Cloud. Each item's `amount_cents` is signed: negative when money left your wallet, positive for a refund. Newest first by default.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_billing","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by. `at` orders by time.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","amount_cents"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"billing":{"auto_renew":true,"billed_until":null,"cycle":"monthly","cycle_cents":384,"months":1,"paid_until":1795000000},"items":[{"amount_cents":-384,"at":1792400000,"id":9021,"kind":"new","memo":"Private Cloud prod-net - 100 Mbps (Monthly)"}],"page":1,"per_page":25,"pricing":{"hourly_uusd":5257,"mbps":100,"monthly_cents":384},"spent_month_cents":384,"spent_total_cents":384,"total":1},"schema":{"properties":{"billing":{"properties":{"auto_renew":{"description":"Whether a prepaid cycle renews automatically.","type":"boolean"},"billed_until":{"description":"Time up to which hourly charges have been posted; null for prepaid cycles or before the first charge (Unix time, seconds, UTC)","type":["integer","null"]},"cycle":{"description":"Billing cycle slug.","type":"string"},"cycle_cents":{"description":"Price of one cycle in US cents; 0 for hourly.","type":"integer"},"months":{"description":"Months in the cycle; 0 for hourly.","type":"integer"},"paid_until":{"description":"End of the paid period; null for hourly billing (Unix time, seconds, UTC)","type":["integer","null"]}},"required":["cycle","months","paid_until","auto_renew","cycle_cents","billed_until"],"type":"object","x-order":["cycle","months","paid_until","auto_renew","cycle_cents","billed_until"]},"items":{"items":{"properties":{"amount_cents":{"description":"Signed amount in US cents: negative = charged, positive = refunded.","type":"integer"},"at":{"description":"When the entry was posted (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Wallet entry identifier.","type":"integer"},"kind":{"description":"What it was for: `new` (order), `hour` (hourly charge), `cycle` (renewal), `plan` (plan change) or `refund`.","type":"string"},"memo":{"description":"Description of the entry.","type":["string","null"]}},"required":["id","at","kind","amount_cents","memo"],"type":"object","x-order":["id","at","kind","amount_cents","memo"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"pricing":{"properties":{"hourly_uusd":{"description":"Current price per hour in millionths of a US dollar.","type":"integer"},"mbps":{"description":"Plan bandwidth in Mbit/s.","type":"integer"},"monthly_cents":{"description":"The same price for a 730-hour month in US cents.","type":"integer"}},"required":["hourly_uusd","monthly_cents","mbps"],"type":"object","x-order":["hourly_uusd","monthly_cents","mbps"]},"spent_month_cents":{"description":"Net amount spent in the current calendar month, US cents.","type":"integer"},"spent_total_cents":{"description":"Net amount spent since the Private Cloud was ordered, US cents.","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page","pricing","billing","spent_month_cents","spent_total_cents"],"type":"object","x-order":["items","total","page","per_page","pricing","billing","spent_month_cents","spent_total_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page`, `per_page`, `sort` or `dir` is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page`, `per_page`, `sort` or `dir` is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page`, `per_page`, `sort` or `dir` is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Private Cloud billing","tags":["Private Cloud"],"x-cli":"vpc billing","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/billing\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Chi phí Private Cloud"}},"/v1/vpc/{id}/delete-preview":{"get":{"description":"Shows what [Delete a Private Cloud](#operation/vpc_delete) would do, without changing anything: how many servers and tiers are inside, the public IP that would be released, the wallet refund for unused prepaid time, and whether the deletion is allowed now. `confirm` is the exact text to send as the `confirm` field.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_delete_preview","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_delete":true,"confirm":"prod-net","locked_by_admin":false,"public_ip":"203.0.113.25","refund_cents":301,"tier_count":1,"vm_count":0},"schema":{"properties":{"can_delete":{"description":"`true` when deleting is allowed now: state `active` or `locked`, no servers, and not locked by support. A running operation is not considered here but blocks the delete itself with `409 vpc_busy`.","type":"boolean"},"confirm":{"description":"The exact name to send as `confirm`.","type":"string"},"locked_by_admin":{"description":"`true` when support locked the Private Cloud; it can only be deleted after support unlocks it.","type":"boolean"},"public_ip":{"description":"Public IPv4 address that would be released; null if none was assigned.","type":["string","null"]},"refund_cents":{"description":"Estimated wallet refund for unused prepaid time in US cents (0 for hourly billing).","type":"integer"},"tier_count":{"description":"Tiers that would be removed.","type":"integer"},"vm_count":{"description":"Servers still in the Private Cloud. Must be 0 before deleting.","type":"integer"}},"required":["vm_count","tier_count","public_ip","refund_cents","can_delete","locked_by_admin","confirm"],"type":"object","x-order":["vm_count","tier_count","public_ip","refund_cents","can_delete","locked_by_admin","confirm"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Preview before deleting","tags":["Private Cloud"],"x-cli":"vpc delete-preview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/delete-preview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Xem trước khi xoá"}},"/v1/vpc/{id}/events":{"get":{"description":"Returns the activity log of a Private Cloud, newest first by default: who did what and when (orders, renames, plan changes, tier and ACL changes, locks and unlocks, deletion). `actor` is `you` for changes made with your account or API keys, `admin` for support staff and `system` for automatic actions such as billing.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_events","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"description":"Field to sort by.","in":"query","name":"sort","required":false,"schema":{"default":"at","enum":["at","kind","actor"],"type":"string"}},{"description":"Sort direction.","in":"query","name":"dir","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"actor":"you","args":{"action":"allow","cidr":"0.0.0.0/0","dir":"ingress","num":"100","proto":"tcp"},"at":1792401000,"id":12,"key":"vpc.acl_added","kind":"acl_add","msg":"ACL rule #100 ingress tcp 0.0.0.0/0 allow"},{"actor":"you","args":{"cycle":"monthly","mbps":"100","name":"prod-net"},"at":1792400000,"id":3,"key":"vpc.ordered","kind":"create","msg":"Ordered Private Cloud prod-net: 100 Mbps (monthly)"}],"page":1,"per_page":25,"total":2},"schema":{"properties":{"items":{"items":{"properties":{"actor":{"description":"Who caused the event.","enum":["you","admin","system"],"type":"string"},"args":{"additionalProperties":true,"description":"Raw values to fill into the message named by `key` (string values). An empty object when `key` is `null`.","type":"object"},"at":{"description":"When it happened (Unix time, seconds, UTC)","type":"integer"},"id":{"description":"Event identifier; increases with time.","type":"integer"},"key":{"description":"Stable message code (for example `vpc.ready`); `null` for entries written before message codes existed. With `args` it lets you show the message in your own language.","type":["string","null"]},"kind":{"description":"Short event type, e.g. `create`, `update`, `plan_change`, `tier_add`, `acl_add`, `lock`, `delete`.","type":"string"},"msg":{"description":"Human-readable description in English.","type":"string"}},"required":["id","at","kind","actor","msg","key","args"],"type":"object","x-order":["id","at","kind","actor","msg","key","args"]},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page`, `per_page`, `sort` or `dir` is not valid."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page`, `per_page`, `sort` or `dir` is not valid. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page`, `per_page`, `sort` or `dir` is not valid."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Private Cloud event log","tags":["Private Cloud"],"x-cli":"vpc events","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/events\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Nhật ký Private Cloud"}},"/v1/vpc/{id}/ips":{"get":{"description":"Lists the public IPv4 addresses that belong to the Private Cloud: the address of the virtual router, used for outbound traffic of servers without their own address (`kind` `snat`), and the public address of each server that has one (`kind` `vm`). Traffic of all these addresses counts toward the plan bandwidth shown by [Get bandwidth](#operation/vpc_bandwidth).\n\n**Required scope:** `vpc:read`.","operationId":"vpc_ips","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"hostname":null,"ip":"203.0.113.25","kind":"snat","nat":"source_nat","vm_id":null},{"hostname":"web-1","ip":"203.0.113.77","kind":"vm","nat":"static_nat","vm_id":"9e41c7d2-0b38-4f5a-a6d4-3c8e1f2b7a90"}],"total":2},"schema":{"properties":{"items":{"items":{"properties":{"hostname":{"description":"Hostname of that server; null for `snat`.","type":["string","null"]},"ip":{"description":"Public IPv4 address.","type":"string"},"kind":{"description":"`snat`: the router address shared by the Private Cloud. `vm`: an address assigned to one server.","enum":["snat","vm"],"type":"string"},"nat":{"description":"`source_nat`: outbound-only translation shared by the Private Cloud. `static_nat`: 1:1 address of one server.","enum":["source_nat","static_nat"],"type":"string"},"vm_id":{"description":"Server identifier for `vm` addresses; null for `snat`.","type":["string","null"]}},"required":["ip","kind","vm_id","hostname","nat"],"type":"object","x-order":["ip","kind","vm_id","hostname","nat"]},"type":"array"},"total":{"description":"Number of addresses.","type":"integer"}},"required":["items","total"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Public IPs of the Private Cloud","tags":["Private Cloud"],"x-cli":"vpc ips","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/ips\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"IP public của Private Cloud"}},"/v1/vpc/{id}/ops":{"get":{"description":"Lists the operations of a Private Cloud (creation, plan changes, tier and ACL changes, deletion), newest first. Use it to follow an `op` returned by a write call: it is finished when `state` is `done`, `failed` or `cancelled`. At most one operation is open at a time.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_ops","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Items per page. Values above the maximum are clamped.","in":"query","name":"per_page","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"created_at":1792401000,"finished_at":1792401012,"id":45,"kind":"acl_sync","public_error":null,"state":"done","step":"done"},{"created_at":1792400000,"finished_at":1792400180,"id":41,"kind":"create","public_error":null,"state":"done","step":"done"}],"page":1,"per_page":25,"total":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VpcOp"},"type":"array"},"page":{"description":"Current page number (1-based).","type":"integer"},"per_page":{"description":"Page size actually applied (the server clamps `per_page` to its maximum).","type":"integer"},"total":{"description":"Total number of items matching the filters, across all pages.","type":"integer"}},"required":["items","total","page","per_page"],"type":"object","x-order":["items","total","page","per_page"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"`page` or `per_page` is not an integer."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`page` or `per_page` is not an integer. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"`page` or `per_page` is not an integer."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Private Cloud operations","tags":["Private Cloud"],"x-cli":"vpc ops","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/ops\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Thao tác của Private Cloud"}},"/v1/vpc/{id}/plan":{"post":{"description":"Changes the dedicated bandwidth plan of the Private Cloud. The new bandwidth is applied to every tier in the background (the Private Cloud shows an open `change_plan` operation until it is done). On a prepaid cycle the price difference for the remaining paid period is charged from your wallet (upgrade) or refunded to it (downgrade) at once; on hourly billing the new price applies from the next billed hour. The response reports `charged_cents` and `refunded_cents`.\n\nPreview the amounts with [Quote a plan change](#operation/vpc_plan_quote). The Private Cloud must be `active` with no other operation running, you may change plan at most 6 times in 24 hours, and the call fails with `403 vpc_disabled` while Private Cloud is not enabled for your account.\n\n**Required scope:** `vpc:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpc_plan_change","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"plan":"500m"},"schema":{"properties":{"plan":{"description":"Target plan `slug` from the catalog, e.g. `500m`. The numeric plan `id` is accepted too. It must differ from the current plan.","type":"string"}},"required":["plan"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"charged_cents":1920,"op":{"id":52,"kind":"change_plan","state":"queued"},"refunded_cents":0,"vpc":{"bandwidth":{"effective_mbps":500,"label":"Unmetered traffic · 500 Mbps dedicated","mbps":500,"unmetered":true},"billing":{"auto_renew":true,"cycle":"monthly","cycle_cents":2302,"months":1,"paid_until":1795000000},"can":{"acl":true,"add_tier":false,"change_plan":false,"create_vm":true,"delete":false},"cidr":"10.128.0.0/16","created_at":1792400000,"id":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","ipv6":[{"cidr":"2001:db8:10:1::/64","tier":"default"}],"lock":null,"name":"prod-net","note":"Production network","op":{"created_at":1792410000,"finished_at":null,"id":52,"kind":"change_plan","public_error":null,"state":"queued","step":"queued"},"plan":{"id":3,"mbps":500,"name":"500 Mbps","slug":"500m"},"pricing":{"hourly_uusd":31539,"monthly_cents":2302},"public_error":null,"public_ip":"203.0.113.25","ready_at":1792400180,"router":"Running","state":"active","tier_count":1,"tiers":[{"can_delete":false,"cidr":"10.128.1.0/24","created_at":1792400000,"gateway":"10.128.1.1","id":"7b1e2c44-52d0-4f6b-8a3e-90d1c6a5e2f1","index":1,"ipv6_cidr":"2001:db8:10:1::/64","ipv6_gateway":"2001:db8:10:1::1","is_default":true,"name":"default","state":"active","vm_count":2}],"updated_at":1792410000,"vm_count":2,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"charged_cents":{"description":"Amount charged from the wallet now, in US cents (0 when nothing is due or for hourly billing).","type":"integer"},"op":{"$ref":"#/components/schemas/VpcOpRef"},"refunded_cents":{"description":"Amount refunded to the wallet now, in US cents.","type":"integer"},"vpc":{"$ref":"#/components/schemas/Vpc"}},"required":["vpc","op","charged_cents","refunded_cents"],"type":"object","x-order":["vpc","op","charged_cents","refunded_cents"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, `plan` is missing (the error carries `field: \"plan\"`), or the billing cycle of the Private Cloud can no longer be priced (`detail`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, `plan` is missing (the error carries `field: \"plan\"`), or the billing cycle of the Private Cloud can no longer be priced (`detail`). `idempotency_key_required`: The `Idempotency-Key` header is missing or longer than 200 characters.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, `plan` is missing (the error carries `field: \"plan\"`), or the billing cycle of the Private Cloud can no longer be priced (`detail`)."},{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet balance is below `need_cents` of the plan quote. The error carries `need_cents` and `balance_cents` (US cents)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet balance is below `need_cents` of the plan quote. The error carries `need_cents` and `balance_cents` (US cents). (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet balance is below `need_cents` of the plan quote. The error carries `need_cents` and `balance_cents` (US cents)."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: Private Cloud is not enabled on this site for your account. (`vpc_disabled`)","x-error-codes":[{"code":"vpc_disabled","description":"Private Cloud is not enabled on this site for your account."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"vpc_busy","message":"Another operation is running, or the Private Cloud is not `active`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`vpc_busy`: Another operation is running, or the Private Cloud is not `active`. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"vpc_busy","description":"Another operation is running, or the Private Cloud is not `active`."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"plan_unavailable","message":"The plan does not exist or is not on sale."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan_unavailable`: The plan does not exist or is not on sale. `bad_input`: `plan` is the plan the Private Cloud already has (`detail: \"same plan\"`). `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"plan_unavailable","description":"The plan does not exist or is not on sale."},{"code":"bad_input","description":"`plan` is the plan the Private Cloud already has (`detail: \"same plan\"`)."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vpc_locked","message":"The Private Cloud is locked; settle the bill or contact support first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The Private Cloud is locked; settle the bill or contact support first. (`vpc_locked`)","x-error-codes":[{"code":"vpc_locked","description":"The Private Cloud is locked; settle the bill or contact support first."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: You already changed the plan 6 times in the last 24 hours. The error carries `retry_after` (seconds). (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"You already changed the plan 6 times in the last 24 hours. The error carries `retry_after` (seconds)."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"provider_unavailable","message":"The site operator cannot accept the change at the moment. Retry later."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The site operator cannot accept the change at the moment. Retry later. (`provider_unavailable`)","x-error-codes":[{"code":"provider_unavailable","description":"The site operator cannot accept the change at the moment. Retry later."}]}},"security":[{"bearerAuth":["vpc:create"]}],"summary":"Change bandwidth plan (costs money)","tags":["Private Cloud"],"x-cli":"vpc plan-change","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpc/<id>/plan\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"plan\":\"500m\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpc:create","x-summary-vi":"Đổi gói băng thông (tốn tiền)"}},"/v1/vpc/{id}/plan-quote":{"get":{"description":"Shows what changing the bandwidth plan of this Private Cloud to `plan` would cost, without changing anything. For a prepaid cycle the difference for the rest of the paid period is charged (`charge_cents`) or refunded (`refund_cents`); for hourly billing nothing is charged now and the new hourly price applies from the next billed hour, but moving to a more expensive plan needs a balance covering 24 hours of the new price. `enough` tells whether your balance covers `need_cents`.\n\nApply it with [Change the bandwidth plan](#operation/vpc_plan_change).\n\n**Required scope:** `vpc:read`.","operationId":"vpc_plan_quote","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Target plan: the plan `slug` (e.g. `500m`) or numeric `id`, from the catalog.","example":"500m","in":"query","name":"plan","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"applies":"immediately","balance_cents":2500,"charge_cents":1920,"enough":true,"from":{"hourly_uusd":5257,"mbps":100,"plan_id":2},"hourly_note":false,"need_cents":1920,"quote":{"cycle":"monthly","cycle_cents":2302,"cycle_name":"Monthly","discount_pct":0.0,"first_charge_cents":2302,"hourly_uusd":31539,"mbps":500,"monthly_cents":2302,"months":1,"plan_id":3},"refund_cents":0,"to":{"cycles":[{"cycle":"hourly","cycle_cents":0,"discount_pct":0.0,"months":0,"name":"Hourly"},{"cycle":"monthly","cycle_cents":2302,"discount_pct":0.0,"months":1,"name":"Monthly"}],"hourly_uusd":31539,"id":3,"label":"Unmetered traffic · 500 Mbps dedicated","mbps":500,"monthly_cents":2302,"name":"500 Mbps","slug":"500m"}},"schema":{"properties":{"applies":{"description":"When the new bandwidth takes effect. Always `immediately`.","type":"string"},"balance_cents":{"description":"Your wallet balance in US cents.","type":"integer"},"charge_cents":{"description":"Amount that would be charged now, in US cents.","type":"integer"},"enough":{"description":"Whether `balance_cents` covers `need_cents`.","type":"boolean"},"from":{"properties":{"hourly_uusd":{"description":"Current price per hour in millionths of a US dollar.","type":"integer"},"mbps":{"description":"Current bandwidth in Mbit/s.","type":"integer"},"plan_id":{"description":"Current plan identifier.","type":"integer"}},"required":["plan_id","mbps","hourly_uusd"],"type":"object","x-order":["plan_id","mbps","hourly_uusd"]},"hourly_note":{"description":"`true` when the Private Cloud is billed by the hour: `charge_cents` and `refund_cents` are then 0 and the new price applies from the next billed hour.","type":"boolean"},"need_cents":{"description":"Balance required to make the change, in US cents.","type":"integer"},"quote":{"$ref":"#/components/schemas/VpcQuote"},"refund_cents":{"description":"Amount that would be refunded now, in US cents.","type":"integer"},"to":{"$ref":"#/components/schemas/VpcPlan"}},"required":["from","to","quote","charge_cents","refund_cents","need_cents","balance_cents","enough","applies","hourly_note"],"type":"object","x-order":["from","to","quote","charge_cents","refund_cents","need_cents","balance_cents","enough","applies","hourly_note"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The billing cycle of the Private Cloud can no longer be priced. The error carries a `detail` text."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The billing cycle of the Private Cloud can no longer be priced. The error carries a `detail` text. (`bad_input`)","x-error-codes":[{"code":"bad_input","description":"The billing cycle of the Private Cloud can no longer be priced. The error carries a `detail` text."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"plan_unavailable","message":"`plan` is missing, unknown or not on sale."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan` is missing, unknown or not on sale. (`plan_unavailable`)","x-error-codes":[{"code":"plan_unavailable","description":"`plan` is missing, unknown or not on sale."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"Quote a bandwidth plan change","tags":["Private Cloud"],"x-cli":"vpc plan-quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/plan-quote?plan=<plan>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Báo giá đổi gói băng thông"}},"/v1/vpc/{id}/tiers":{"get":{"description":"Lists the tiers (subnets) of a Private Cloud, the default tier first, with the number of servers in each. `max` is the most tiers a Private Cloud may have, the default tier included. Deleted and failed tiers are not listed.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_tier_list","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"can_delete":false,"cidr":"10.128.1.0/24","created_at":1792400000,"gateway":"10.128.1.1","id":"7b1e2c44-52d0-4f6b-8a3e-90d1c6a5e2f1","index":1,"ipv6_cidr":"2001:db8:10:1::/64","ipv6_gateway":"2001:db8:10:1::1","is_default":true,"name":"default","state":"active","vm_count":2},{"can_delete":false,"cidr":"10.128.2.0/24","created_at":1792403600,"gateway":"10.128.2.1","id":"c2d9a1f0-3b64-4e0a-9f75-6a1d2e8b4c33","index":2,"ipv6_cidr":null,"ipv6_gateway":null,"is_default":false,"name":"web","state":"provisioning","vm_count":0}],"max":3,"total":2},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VpcTier"},"type":"array"},"max":{"description":"Maximum number of tiers per Private Cloud.","type":"integer"},"total":{"description":"Number of tiers.","type":"integer"}},"required":["items","total","max"],"type":"object","x-order":["items","total","max"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"List tiers (subnets)","tags":["Private Cloud"],"x-cli":"vpc tier list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/tiers\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Danh sách tier (subnet)"},"post":{"description":"Adds a tier (a /24 IPv4 subnet with its own IPv6 /64) to the Private Cloud. The tier is created in the background: the call returns `202` with the new tier in state `provisioning`; it can host servers once it is `active`. Adding a tier costs nothing. A Private Cloud holds at most `max` tiers (see List tiers); beyond that the call fails with `403 tier_limit`.\n\nThe Private Cloud must be `active` with no other operation running, you can add or remove at most 10 tiers per Private Cloud in 24 hours, and the call fails with `403 vpc_disabled` while Private Cloud is not enabled for your account.\n\n**Required scope:** `vpc:write`.","operationId":"vpc_tier_add","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"index":2,"name":"web"},"schema":{"properties":{"index":{"description":"Subnet number 2-254: the tier gets the `/24` with this third octet inside the Private Cloud range (index 3 of `10.128.0.0/16` is `10.128.3.0/24`). Omit it to use the lowest free number. Index 1 is the default tier.","maximum":254,"minimum":2,"type":"integer"},"name":{"description":"Tier name, 2-32 characters: lowercase letters, digits and hyphens, starting with a letter and not ending with a hyphen. It must be unique in the Private Cloud.","maxLength":32,"minLength":2,"type":"string"}},"required":["name"],"type":"object","x-order":["name","index"]}}},"required":true},"responses":{"202":{"content":{"application/json":{"example":{"op":{"id":44,"kind":"tier_add","state":"queued"},"tier":{"can_delete":false,"cidr":"10.128.2.0/24","created_at":1792403600,"gateway":"10.128.2.1","id":"c2d9a1f0-3b64-4e0a-9f75-6a1d2e8b4c33","index":2,"ipv6_cidr":null,"ipv6_gateway":null,"is_default":false,"name":"web","state":"provisioning","vm_count":0}},"schema":{"properties":{"op":{"$ref":"#/components/schemas/VpcOpRef"},"tier":{"$ref":"#/components/schemas/VpcTier"}},"required":["tier","op"],"type":"object","x-order":["tier","op"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"The body is not a JSON object, or `index` is not an integer from 2 to 254 (the error carries `field: \"index\"`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: The body is not a JSON object, or `index` is not an integer from 2 to 254 (the error carries `field: \"index\"`). `name_invalid`: `name` does not follow the naming rules.","x-error-codes":[{"code":"bad_input","description":"The body is not a JSON object, or `index` is not an integer from 2 to 254 (the error carries `field: \"index\"`)."},{"code":"name_invalid","description":"`name` does not follow the naming rules."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: `vpc_disabled`: Private Cloud is not enabled on this site for your account. `tier_limit`: The Private Cloud already has the maximum number of tiers. The error carries `max`.","x-error-codes":[{"code":"vpc_disabled","description":"Private Cloud is not enabled on this site for your account."},{"code":"tier_limit","description":"The Private Cloud already has the maximum number of tiers. The error carries `max`."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"name_taken","message":"Another tier of this Private Cloud has this name."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`name_taken`: Another tier of this Private Cloud has this name. `bad_input`: `index` is already used by another tier (the error carries `field: \"index\"`). `vpc_busy`: Another operation is running, or the Private Cloud is not `active`.","x-error-codes":[{"code":"name_taken","description":"Another tier of this Private Cloud has this name."},{"code":"bad_input","description":"`index` is already used by another tier (the error carries `field: \"index\"`)."},{"code":"vpc_busy","description":"Another operation is running, or the Private Cloud is not `active`."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"vpc_locked","message":"The Private Cloud is locked; settle the bill or contact support first."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The Private Cloud is locked; settle the bill or contact support first. (`vpc_locked`)","x-error-codes":[{"code":"vpc_locked","description":"The Private Cloud is locked; settle the bill or contact support first."}]},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Too many requests - wait and retry"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`rate_limited`: too many requests. Wait `Retry-After` seconds. Specific to this operation: Too many tier changes in the last 24 hours. The error carries `retry_after` (seconds). (`rate_limited`)","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"x-error-codes":[{"code":"rate_limited","description":"Too many tier changes in the last 24 hours. The error carries `retry_after` (seconds)."}]}},"security":[{"bearerAuth":["vpc:write"]}],"summary":"Add a tier","tags":["Private Cloud"],"x-cli":"vpc tier add","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpc/<id>/tiers\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"index\":2,\"name\":\"web\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:write","x-summary-vi":"Thêm tier"}},"/v1/vpc/{id}/tiers/{tier}":{"delete":{"description":"Deletes a tier that has no servers left. The tier moves to `deleting` and is removed in the background (`202` with an `op`). A tier that never became ready (state `failed`, not listed) is discarded at once and answered with `200` and `{\"deleted\": true}`. The default tier cannot be deleted.\n\n**Required scope:** `vpc:write`.","operationId":"vpc_tier_delete","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Tier (subnet) identifier as returned by List tiers.","in":"path","name":"tier","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"example":{"op":{"id":47,"kind":"tier_del","state":"queued"}},"schema":{"properties":{"deleted":{"description":"Present and `true` only when a tier that never became ready was discarded immediately (status 200, no `op`).","type":"boolean"},"op":{"$ref":"#/components/schemas/VpcOpRef"}},"type":"object","x-order":["op","deleted"]}}},"description":"Accepted. The work continues in the background.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"bad_input","message":"This is the default tier (`detail: \"default tier\"`), which cannot be deleted."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`bad_input`: This is the default tier (`detail: \"default tier\"`), which cannot be deleted. `vpc_busy`: Another operation is running, the tier is not `active`, or the Private Cloud is not `active` or `locked`. `vpc_has_vms`: Servers are still in the tier. Delete or move them first.","x-error-codes":[{"code":"bad_input","description":"This is the default tier (`detail: \"default tier\"`), which cannot be deleted."},{"code":"vpc_busy","description":"Another operation is running, the tier is not `active`, or the Private Cloud is not `active` or `locked`."},{"code":"vpc_has_vms","description":"Servers are still in the tier. Delete or move them first."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:write"]}],"summary":"Delete a tier (no VMs left)","tags":["Private Cloud"],"x-cli":"vpc tier delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vpc/<id>/tiers/<tier>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpc:write","x-summary-vi":"Xoá tier (không còn VM)"}},"/v1/vpc/{id}/vms":{"get":{"description":"Lists the servers that are in the Private Cloud, newest first, with the tier each one is in. Servers you deleted are not listed. To put a server in a Private Cloud, choose the network and tier when you create it.\n\n**Required scope:** `vpc:read`.","operationId":"vpc_vms","parameters":[{"description":"Private Cloud identifier as returned by List Private Clouds.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"cpu":2,"cs_state":"Running","disk_gb":60,"display_name":"web-1","hostname":"web-1","id":"9e41c7d2-0b38-4f5a-a6d4-3c8e1f2b7a90","ipv6":"2001:db8:10:1::a","joined_at":1792402000,"private_ip":"10.128.1.10","public_ip":"203.0.113.77","ram_mb":4096,"state":"active","tier":"default"}],"total":1},"schema":{"properties":{"items":{"items":{"properties":{"cpu":{"description":"Virtual CPU cores.","type":"integer"},"cs_state":{"description":"Power state reported by the compute platform, e.g. `Running`; null until known.","type":["string","null"]},"disk_gb":{"description":"System disk in GiB.","type":"integer"},"display_name":{"description":"Server display name.","type":"string"},"hostname":{"description":"Server hostname.","type":"string"},"id":{"description":"Server identifier (UUID) for the `/v1/vm/:id` calls.","type":"string"},"ipv6":{"description":"IPv6 address from the IPv6 /64 of its tier.","type":["string","null"]},"joined_at":{"description":"When the server joined the Private Cloud (Unix time, seconds, UTC)","type":"integer"},"private_ip":{"description":"Private IPv4 address inside its tier.","type":["string","null"]},"public_ip":{"description":"Public IPv4 address, when the server has one.","type":["string","null"]},"ram_mb":{"description":"Memory in MiB.","type":"integer"},"state":{"description":"Server state, e.g. `provisioning`, `active`, `stopped`, `locked`.","type":"string"},"tier":{"description":"Name of the tier the server is in.","type":"string"}},"required":["id","hostname","display_name","state","cs_state","public_ip","private_ip","ipv6","tier","cpu","ram_mb","disk_gb","joined_at"],"type":"object","x-order":["id","hostname","display_name","state","cs_state","public_ip","private_ip","ipv6","tier","cpu","ram_mb","disk_gb","joined_at"]},"type":"array"},"total":{"description":"Number of servers listed.","type":"integer"}},"required":["items","total"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpc:read"]}],"summary":"VMs in the Private Cloud","tags":["Private Cloud"],"x-cli":"vpc vms","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpc/<id>/vms\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpc:read","x-summary-vi":"Máy ảo trong Private Cloud"}},"/v1/vpn/catalog":{"get":{"description":"Returns the VPN price book for your site: the price per IP at each order size, the bandwidth tiers, the add-ons and billing cycles, plus the regions with the number of free IPs. Only the `dedicated` tier can be ordered; `shared` and `private` stay in the response for compatibility but have empty `ip_breaks`. All prices are in millionths of a US dollar (1 USD = 1 000 000).\n\nPrice a concrete order with [Quote a VPN order for your account](#operation/vpn_quote). The same price book without account context is at [Get VPN prices](#operation/catalog_vpn).\n\n**Required scope:** `catalog:read`.","operationId":"vpn_catalog","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"addons":[{"key":"concurrency","name":"High Concurrency","uusd_month":10090000}],"cycles":[{"days":0,"discount_pct":0.0,"months":1,"name":"Monthly","price_bp":0,"slug":"monthly"},{"days":0,"discount_pct":30.0,"months":12,"name":"Yearly","price_bp":0,"slug":"yearly"}],"dedicated":{"bw_breaks":[{"gb":250,"uusd_month":0},{"gb":1000,"uusd_month":13460000},{"gb":0,"uusd_month":61890000}],"ip_breaks":[{"min_ip":1,"uusd_ip_month":958000},{"min_ip":10,"uusd_ip_month":843000}],"max_ips":10000,"min_ips":1},"default_zone_id":1,"pool_free":120,"private":{"bw_breaks":[{"gb":250,"uusd_month":0}],"ip_breaks":[],"max_ips":15000,"min_ips":1},"shared":{"bw_breaks":[{"gb":250,"uusd_month":0}],"ip_breaks":[],"max_ips":15000,"min_ips":1},"zones":[{"available":true,"city":"Ho Chi Minh City","country":"VN","free_ips":120,"id":1,"is_default":true,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}]},"schema":{"properties":{"addons":{"items":{"$ref":"#/components/schemas/VpnAddonPrice"},"type":"array"},"cycles":{"items":{"$ref":"#/components/schemas/VpnCyclePrice"},"type":"array"},"dedicated":{"$ref":"#/components/schemas/VpnTierPricing"},"default_zone_id":{"description":"Region used when an order omits `zone_id`; null when there is none.","type":["integer","null"]},"pool_free":{"description":"Total free IPs that can be ordered, over the regions listed in `zones`.","type":"integer"},"private":{"$ref":"#/components/schemas/VpnTierPricing"},"shared":{"$ref":"#/components/schemas/VpnTierPricing"},"zones":{"items":{"properties":{"available":{"description":"Whether the region has at least one free IP.","type":"boolean"},"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"free_ips":{"description":"Number of free IPs that can be ordered in the region.","type":"integer"},"id":{"description":"Region identifier. Pass it as `zone_id` when ordering.","type":"integer"},"is_default":{"description":"Whether this is the default region of the site.","type":"boolean"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"}},"required":["id","slug","name","name_en","country","city","is_default","available","free_ips"],"type":"object","x-order":["id","slug","name","name_en","country","city","is_default","available","free_ips"]},"type":"array"}},"required":["shared","private","dedicated","addons","cycles","pool_free","zones","default_zone_id"],"type":"object","x-order":["shared","private","dedicated","addons","cycles","pool_free","zones","default_zone_id"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"423":{"content":{"application/json":{"example":{"error":{"code":"site_unavailable","message":"Your reseller site is currently unavailable."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your reseller site is currently unavailable. (`site_unavailable`)","x-error-codes":[{"code":"site_unavailable","description":"Your reseller site is currently unavailable."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"VPN IPv4 catalog: plans, cycles, zones and free IPs","tags":["Catalog"],"x-cli":"vpn catalog","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/catalog\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Danh mục VPN IPv4: gói, chu kỳ, vùng, còn IP"}},"/v1/vpn/endpoints":{"get":{"description":"Returns the endpoints of all your `active` VPN IPv4 plans in one flat list, ready to feed an app that lets the user pick an IP. The response contains the proxy passwords.\n\nConnect to `ip:port_socks` with a SOCKS5 client, or to `ip:port_http` with an HTTP proxy client, and authenticate with `username` and `password`; traffic leaves from the endpoint IP. Endpoints in state `provisioning` are still being set up and may not accept connections yet. Plans that are not `active` contribute no endpoints. The list is not paginated.\n\n**Required scope:** `vpn:read`.","operationId":"vpn_endpoint_list","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"capabilities":{"addons":true,"http":true,"ip_auth":true,"ip_auth_protocols":["http","socks5"],"metering":"directional","protocols":["http","socks5","udp"],"socks5":true,"udp":true},"city":"Ho Chi Minh City","country":"VN","id":3101,"ip":"198.51.100.24","password":"9f2c4e7a1b3d","port_http":65002,"port_socks":65001,"port_udp":65003,"state":"active","subscription_id":1042,"username":"k3m9x2p7qa"},{"capabilities":{"addons":true,"http":true,"ip_auth":true,"ip_auth_protocols":["http","socks5"],"metering":"directional","protocols":["http","socks5","udp"],"socks5":true,"udp":true},"city":null,"country":"VN","id":3102,"ip":"198.51.100.25","password":"5b7d1a9e3c2f","port_http":65005,"port_socks":65004,"port_udp":65006,"state":"active","subscription_id":1042,"username":"t8w4n6c2ze"}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VpnEndpoint"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"All endpoints of active plans (IP, ports, user/pass)","tags":["VPN and Proxy"],"x-cli":"vpn endpoint list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/endpoints\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Mọi endpoint của gói đang chạy (IP, cổng, user/pass)"}},"/v1/vpn/quote":{"post":{"description":"Prices a VPN order at your site's price without creating anything and without charging. The response is the price breakdown in millionths of a US dollar plus `amount_cents`, the amount an order would take from your wallet. If the order is not valid (for example too many IPs, or a bandwidth tier or cycle that does not exist) the call still returns `200`: `errors` lists the problems and `amount_cents` is null.\n\nThe region is checked as it would be for an order: when your site has several VPN regions and no default, `zone_id` is required. Orders for the retired `shared` and `private` tiers or for retired add-ons are refused with `tier_retired` or `addon_retired`. You can send up to 240 quotes a minute per account.\n\n**Required scope:** `catalog:read`.","operationId":"vpn_quote","parameters":[],"requestBody":{"content":{"application/json":{"example":{"addons":["concurrency"],"bandwidth_gb":1000,"cycle":"monthly","ip_count":10,"tier":"dedicated","zone_id":1},"schema":{"$ref":"#/components/schemas/VpnQuoteRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"addon_lines":[["High Concurrency",10090000]],"addons_uusd_month":10090000,"amount_cents":3198,"bandwidth_gb":1000,"bandwidth_uusd_month":13460000,"cycle":"monthly","days":0,"discount_pct":0.0,"effective_monthly_uusd":31980000,"errors":[],"ip_count":10,"ips_uusd_month":8430000,"list_monthly_uusd":33120000,"list_unit_uusd_month":958000,"monthly_uusd":31980000,"months":1,"tier":"dedicated","total_uusd":31980000,"trial":{"applies":false,"deduct_cents":0,"reason":"cycle"},"unit_uusd_month":843000,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}},"schema":{"properties":{"addon_lines":{"items":{"description":"Pair `[name, uusd_month]`: the add-on name and its monthly price in millionths of a US dollar.","maxItems":2,"minItems":2,"type":"array"},"type":"array"},"addons_uusd_month":{"description":"Add-on part of the monthly price, in millionths of a US dollar.","type":"integer"},"amount_cents":{"description":"Amount the order would take from the wallet, in US cents. Null when `errors` is not empty.","type":["integer","null"]},"bandwidth_gb":{"description":"Monthly bandwidth in GB that was priced (0 = unlimited).","type":"integer"},"bandwidth_uusd_month":{"description":"Bandwidth part of the monthly price, in millionths of a US dollar.","type":"integer"},"cycle":{"description":"Billing cycle slug that was priced.","type":"string"},"days":{"description":"Length of the cycle in days for day-based cycles (daily, weekly); 0 for monthly cycles.","type":"integer"},"discount_pct":{"description":"Cycle discount applied to the total, in percent (0 for day-based cycles).","type":"number"},"effective_monthly_uusd":{"description":"`total_uusd` converted to a per-month figure, for display only, in millionths of a US dollar.","type":"integer"},"errors":{"items":{"description":"Reason the order is not valid, for example an IP count or bandwidth tier outside what is on sale. Empty when the quote is valid. The wording may change; do not parse it.","type":"string"},"type":"array"},"ip_count":{"description":"Number of IPs priced. When the request was outside the allowed range the value is clamped to the nearest limit and `errors` explains why.","type":"integer"},"ips_uusd_month":{"description":"IP part of the monthly price (`unit_uusd_month` x `ip_count`), in millionths of a US dollar.","type":"integer"},"list_monthly_uusd":{"description":"Monthly price at list (non-volume) unit prices, for strike-through display, in millionths of a US dollar.","type":"integer"},"list_unit_uusd_month":{"description":"Price of one IP per month at the smallest order size, before volume pricing, in millionths of a US dollar.","type":"integer"},"monthly_uusd":{"description":"Monthly price before the cycle discount (IPs + bandwidth + add-ons), in millionths of a US dollar.","type":"integer"},"months":{"description":"Length of the cycle in months (0 for day-based cycles).","type":"integer"},"tier":{"description":"Tier that was priced: `shared`, `private` or `dedicated`.","type":"string"},"total_uusd":{"description":"Total for one full cycle after the cycle discount, in millionths of a US dollar. This is the amount an order would be charged.","type":"integer"},"trial":{"description":"Trial credit for this order. The trial pays for one 1-day order per service (VPN / Proxy IPv4 and Proxy IPv6) while it is active.","properties":{"applies":{"description":"True when the order would be paid (fully or partly) from your active trial credit.","type":"boolean"},"deduct_cents":{"description":"Part of `amount_cents` the trial credit would pay, in US cents; the rest comes from the wallet.","type":"integer"},"left_cents":{"description":"Trial credit still available, in US cents (only when the credit is active and the order qualifies).","type":"integer"},"reason":{"description":"Why the credit does not apply: `inactive` no active trial credit, `used` this service already used its trial order, `cycle` only the 1-day plan is covered, `off` not offered on this site, `invalid` the quote has errors.","enum":["invalid","off","inactive","used","plan","cycle"],"type":"string"}},"required":["applies","deduct_cents"],"type":"object"},"unit_uusd_month":{"description":"Price of one IP per month at this order size, in millionths of a US dollar.","type":"integer"},"zone":{"$ref":"#/components/schemas/Zone"}},"required":["tier","ip_count","bandwidth_gb","cycle","months","days","unit_uusd_month","list_unit_uusd_month","ips_uusd_month","bandwidth_uusd_month","addons_uusd_month","addon_lines","monthly_uusd","list_monthly_uusd","discount_pct","total_uusd","effective_monthly_uusd","errors","amount_cents","zone","trial"],"type":"object","x-order":["tier","ip_count","bandwidth_gb","cycle","months","days","unit_uusd_month","list_unit_uusd_month","ips_uusd_month","bandwidth_uusd_month","addons_uusd_month","addon_lines","monthly_uusd","list_monthly_uusd","discount_pct","total_uusd","effective_monthly_uusd","errors","amount_cents","zone","trial"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON or a required field is missing (`detail` says which)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON or a required field is missing (`detail` says which). (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON or a required field is missing (`detail` says which)."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"zone_not_found","message":"The region does not exist or is not available to your site."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The region does not exist or is not available to your site. (`zone_not_found`)","x-error-codes":[{"code":"zone_not_found","description":"The region does not exist or is not available to your site."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is outside what can be ordered, e.g. an unknown `tier` or `ip_count` below 1. `errors` lists the reason."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: A field is outside what can be ordered, e.g. an unknown `tier` or `ip_count` below 1. `errors` lists the reason. `tier_retired`: The `shared` and `private` tiers are no longer sold; use `dedicated`. `addon_retired`: An add-on in the request is no longer sold. `zone_required`: Your site has several VPN regions and no default; `zones` in the error lists them. Send `zone_id`. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before.","x-error-codes":[{"code":"invalid_argument","description":"A field is outside what can be ordered, e.g. an unknown `tier` or `ip_count` below 1. `errors` lists the reason."},{"code":"tier_retired","description":"The `shared` and `private` tiers are no longer sold; use `dedicated`."},{"code":"addon_retired","description":"An add-on in the request is no longer sold."},{"code":"zone_required","description":"Your site has several VPN regions and no default; `zones` in the error lists them. Send `zone_id`."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."}]},"423":{"content":{"application/json":{"example":{"error":{"code":"site_unavailable","message":"Your reseller site is currently unavailable."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Your reseller site is currently unavailable. (`site_unavailable`)","x-error-codes":[{"code":"site_unavailable","description":"Your reseller site is currently unavailable."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Quote a VPN IPv4 order at your site's price (nothing is purchased)","tags":["Catalog"],"x-cli":"vpn quote","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/quote\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"addons\":[\"concurrency\"],\"bandwidth_gb\":1000,\"cycle\":\"monthly\",\"ip_count\":10,\"tier\":\"dedicated\",\"zone_id\":1}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Báo giá VPN IPv4 theo giá của site (không đặt mua)"}},"/v1/vpn/subscriptions":{"get":{"description":"Lists your VPN IPv4 plans, newest first, with status, expiry and the number of endpoints of each plan. The list is not paginated. Plans you removed from your list and orders that were rejected before any payment are left out.\n\nEndpoint addresses, ports and passwords are not part of this list; call [Get a VPN plan](#operation/vpn_subscription_get) or [List VPN endpoints](#operation/vpn_endpoint_list) for them. Proxy IPv6 plans are listed by [List Proxy IPv6 plans](#operation/proxy6_subscription_list).\n\n**Required scope:** `vpn:read`.","operationId":"vpn_subscription_list","parameters":[{"description":"Set to `true` (or `1`) to also list plans that you removed from your list in the dashboard.","in":"query","name":"include_hidden","required":false,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"activated_at":1787400012,"addons":[],"auto_renew":true,"bandwidth_gb":1000,"canceled_at":null,"capabilities":{"addons":true,"http":true,"ip_auth":true,"ip_auth_all":true,"ip_auth_protocols":["http","socks5"],"metering":"directional","protocols":["http","socks5","udp"],"socks5":true,"udp":true,"udp_all":true},"created_at":1787400000,"cycle":"monthly","endpoint_count":2,"expires_at":1792584012,"fail_reason":null,"hidden_at":null,"id":1042,"ip_count":2,"ip_released_at":null,"keep_until":null,"monthly_uusd":11960000,"months":1,"period_days":0,"renew_cents":1196,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":11960000,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VpnSubscription"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"List VPN IPv4 plans","tags":["VPN and Proxy"],"x-cli":"vpn subscription list","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Danh sách gói VPN IPv4"},"post":{"description":"Buys a VPN IPv4 plan. The price is charged to the wallet and the IP addresses are allocated and activated at once. If activation fails after payment the amount is refunded automatically. Only `dedicated` IPs are on sale. Get valid tiers, quotas and cycles from the VPN catalog first. On sites run by resellers the charge is the site's retail price. Needs the wallet to cover the price (otherwise 402).\n\nSend an `Idempotency-Key` header: calling again with the same key returns the original purchase instead of buying twice. A `202 Accepted` answer means the payment is still being finalized; the plan appears in your list when done.\n\n**Required scope:** `vpn:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpn_subscription_buy","parameters":[{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"addons":[],"bandwidth_gb":250,"cycle":"monthly","ip_count":2,"tier":"dedicated"},"schema":{"properties":{"addons":{"description":"Add-ons to include (at most 16).","items":{"description":"Add-on key, e.g. `ipauth`.","type":"string"},"type":"array"},"bandwidth_gb":{"description":"Monthly bandwidth quota in GB; 0 for unlimited. Must be one of the quotas in the catalog.","type":"integer"},"cycle":{"description":"Billing cycle slug from the catalog: `daily`, `weekly`, `monthly` or `yearly`.","type":"string"},"ip_count":{"description":"Number of IP addresses, at least 1.","type":"integer"},"tier":{"description":"IP type. Only `dedicated` can be bought; the others return 422 `tier_retired`.","enum":["dedicated","private","shared"],"type":"string"},"zone":{"description":"Location slug, as an alternative to `zone_id`.","type":"string"},"zone_id":{"description":"Location to buy in. Omit to use the default; 422 `zone_required` lists the choices when you must pick.","type":"integer"}},"required":["tier","ip_count","bandwidth_gb","cycle"],"type":"object","x-order":["tier","ip_count","bandwidth_gb","cycle","addons","zone_id","zone"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"charged_cents":840,"endpoints":[{"city":"Ho Chi Minh City","country":"VN","id":31,"ip":"198.51.100.71","password":"s3cr3t-pass","port_http":20032,"port_socks":20031,"port_udp":20033,"state":"active","subscription_id":12,"username":"u12a"}],"invoice_id":77,"invoice_number":"INV-000077","subscription":{"activated_at":1760000020,"addons":["ipauth"],"auto_renew":true,"bandwidth_gb":250,"canceled_at":null,"created_at":1760000000,"cycle":"monthly","expires_at":1762592000,"fail_reason":null,"hidden_at":null,"id":12,"ip_count":2,"ip_released_at":null,"monthly_uusd":8400000,"months":1,"period_days":0,"renew_cents":840,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":8400000}},"schema":{"properties":{"charged_cents":{"description":"Amount charged in US cents.","type":"integer"},"endpoints":{"description":"The allocated endpoints; empty while the order is still pending.","items":{"additionalProperties":true,"description":"Connection endpoint with `ip`, ports, `username` and `password`.","type":"object"},"type":"array"},"invoice_id":{"description":"Invoice identifier.","type":["integer","null"]},"invoice_number":{"description":"Invoice number.","type":["string","null"]},"pending":{"description":"True when the answer is 202 and the payment is still being finalized.","type":"boolean"},"replayed":{"description":"True when this is the stored result of an earlier call with the same Idempotency-Key.","type":"boolean"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","endpoints","charged_cents"],"type":"object","x-order":["subscription","endpoints","charged_cents","invoice_id","invoice_number","pending","replayed"]}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This site does not sell VPN plans. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"This site does not sell VPN plans."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"pool_exhausted","message":"Not enough free IP addresses; the body says whether you were charged and refunded (`charged`, `refunded`)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`pool_exhausted`: Not enough free IP addresses; the body says whether you were charged and refunded (`charged`, `refunded`). `idempotency_key_reused`: The Idempotency-Key was already used for a different order in the last 24 hours. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"pool_exhausted","description":"Not enough free IP addresses; the body says whether you were charged and refunded (`charged`, `refunded`)."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was already used for a different order in the last 24 hours."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"tier_retired","message":"That IP type is no longer sold."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`tier_retired`: That IP type is no longer sold. `addon_retired`: An add-on in the order is no longer sold. `zone_required`: Several locations are available; pass `zone_id`. The body lists them. `cycle_unavailable`: The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"tier_retired","description":"That IP type is no longer sold."},{"code":"addon_retired","description":"An add-on in the order is no longer sold."},{"code":"zone_required","description":"Several locations are available; pass `zone_id`. The body lists them."},{"code":"cycle_unavailable","description":"The operator has switched this billing cycle off for this service, so a NEW order (or a change TO that cycle) is refused before anything is charged. The error carries `service`, `cycle` and `available` (the cycles still sold). Services already running on that cycle keep billing and renewing as before."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"refund_pending","message":"The payment was taken and the automatic refund failed; do not retry, contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The payment was taken and the automatic refund failed; do not retry, contact support. (`refund_pending`)","x-error-codes":[{"code":"refund_pending","description":"The payment was taken and the automatic refund failed; do not retry, contact support."}]},"503":{"content":{"application/json":{"example":{"error":{"code":"maintenance","message":"Orders are paused for maintenance."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Orders are paused for maintenance. (`maintenance`)","x-error-codes":[{"code":"maintenance","description":"Orders are paused for maintenance."}]}},"security":[{"bearerAuth":["vpn:create"]}],"summary":"Buy a VPN IPv4 plan (charges the wallet)","tags":["VPN and Proxy"],"x-cli":"vpn subscription buy","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"addons\":[],\"bandwidth_gb\":250,\"cycle\":\"monthly\",\"ip_count\":2,\"tier\":\"dedicated\"}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:create","x-summary-vi":"Mua gói VPN IPv4 (trừ tiền ví)"}},"/v1/vpn/subscriptions/{id}":{"delete":{"description":"Removes a finished plan from your list. Only plans that are canceled, expired or failed and whose IP addresses have been released can be removed. The plan and its invoices are kept for the records; it just stops appearing in the list unless you pass `include_hidden=1`. Repeating the call succeeds with `already: true`.\n\n**Required scope:** `vpn:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpn_subscription_delete","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"already":false,"hidden_at":1760700000,"id":12,"ok":true},"schema":{"properties":{"already":{"description":"True when the plan had been removed before this call.","type":"boolean"},"hidden_at":{"description":"When the plan was hidden (Unix time, seconds, UTC)","type":["integer","null"]},"id":{"description":"Plan identifier.","type":"integer"},"ok":{"description":"Always `true`.","type":"boolean"}},"required":["ok","id","hidden_at","already"],"type":"object","x-order":["ok","id","hidden_at","already"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_hideable","message":"The plan is still active or still holds IP addresses."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_hideable`: The plan is still active or still holds IP addresses. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_hideable","description":"The plan is still active or still holds IP addresses."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","message":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation. (`idempotency_key_reused`)","x-error-codes":[{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:destroy"]}],"summary":"Remove a canceled or expired VPN IPv4 plan from your list","tags":["VPN and Proxy"],"x-cli":"vpn subscription delete","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X DELETE \"https://api.onie.net/v1/vpn/subscriptions/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\""}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:destroy","x-summary-vi":"Xoá gói VPN IPv4 đã huỷ/hết hạn khỏi danh sách"},"get":{"description":"Returns one VPN IPv4 plan with its endpoints. Each endpoint carries the IP address, the SOCKS5 and HTTP ports (and the UDP port when that IP offers UDP — see `capabilities`), and the user name and **password** to connect with, so this response is sensitive. `subscription.capabilities` summarises what the plan's IPs support. The renewal history and the bandwidth-upgrade history are included (the 50 most recent entries of each, newest first).\n\nOnly endpoints of an `active` plan accept connections. When a plan is canceled or its IP addresses are released, `endpoints` is empty. An id that belongs to another account, or to a Proxy IPv6 plan, returns `404`.\n\n**Required scope:** `vpn:read`.","operationId":"vpn_subscription_get","parameters":[{"description":"Plan identifier, as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"bw_upgrades":[{"charged_cents":807,"created_at":1788000000,"days_left":18,"from_gb":250,"id":12,"new_renew_cents":1196,"seq":1,"status":"done","to_gb":1000}],"endpoints":[{"capabilities":{"addons":true,"http":true,"ip_auth":true,"ip_auth_protocols":["http","socks5"],"metering":"directional","protocols":["http","socks5","udp"],"socks5":true,"udp":true},"city":"Ho Chi Minh City","country":"VN","id":3101,"ip":"198.51.100.24","password":"9f2c4e7a1b3d","port_http":65002,"port_socks":65001,"port_udp":65003,"state":"active","subscription_id":1042,"username":"k3m9x2p7qa"},{"capabilities":{"addons":true,"http":true,"ip_auth":true,"ip_auth_protocols":["http","socks5"],"metering":"directional","protocols":["http","socks5","udp"],"socks5":true,"udp":true},"city":null,"country":"VN","id":3102,"ip":"198.51.100.25","password":"5b7d1a9e3c2f","port_http":65005,"port_socks":65004,"port_udp":65006,"state":"active","subscription_id":1042,"username":"t8w4n6c2ze"}],"renewals":[{"charged_cents":1196,"created_at":1789900000,"from":1789992012,"id":87,"months":1,"periods":1,"seq":1,"status":"done","to":1792584012}],"subscription":{"activated_at":1787400012,"addons":[],"auto_renew":true,"bandwidth_gb":1000,"canceled_at":null,"capabilities":{"addons":true,"http":true,"ip_auth":true,"ip_auth_all":true,"ip_auth_protocols":["http","socks5"],"metering":"directional","protocols":["http","socks5","udp"],"socks5":true,"udp":true,"udp_all":true},"created_at":1787400000,"cycle":"monthly","expires_at":1792584012,"fail_reason":null,"hidden_at":null,"id":1042,"ip_count":2,"ip_released_at":null,"keep_until":null,"monthly_uusd":11960000,"months":1,"period_days":0,"renew_cents":1196,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":11960000,"zone":{"city":"Ho Chi Minh City","country":"VN","id":1,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","slug":"hcm-1"}}},"schema":{"properties":{"bw_upgrades":{"items":{"$ref":"#/components/schemas/VpnBandwidthUpgrade"},"type":"array"},"endpoints":{"items":{"$ref":"#/components/schemas/VpnEndpoint"},"type":"array"},"renewals":{"items":{"$ref":"#/components/schemas/VpnPlanRenewal"},"type":"array"},"subscription":{"$ref":"#/components/schemas/VpnSubscription"}},"required":["subscription","endpoints","renewals","bw_upgrades"],"type":"object","x-order":["subscription","endpoints","renewals","bw_upgrades"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:read"]}],"summary":"Get one VPN IPv4 plan + endpoints (with passwords)","tags":["VPN and Proxy"],"x-cli":"vpn subscription get","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:read","x-summary-vi":"Chi tiết gói VPN IPv4 + endpoint (có mật khẩu)"}},"/v1/vpn/subscriptions/{id}/addons":{"get":{"description":"Lists the add-ons currently active on the plan and the add-ons you can still buy, with the prorated price of adding each one now. `can_add` is false, with a `reason`, when add-ons cannot be bought right now.\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_addons","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"available":[{"charge_now_cents":807,"days_left":24,"key":"concurrency","name":"High Concurrency","uusd_month":10090000}],"can_add":true,"current_addons":["ipauth"],"reason":null},"schema":{"properties":{"available":{"items":{"properties":{"charge_now_cents":{"description":"Amount charged now in US cents, prorated for the remaining days.","type":"integer"},"days_left":{"description":"Days left in the current period.","type":"integer"},"key":{"description":"Add-on key to pass to the add call.","type":"string"},"name":{"description":"Display name.","type":"string"},"uusd_month":{"description":"Monthly price in millionths of a US dollar.","type":"integer"}},"required":["key","name","uusd_month","days_left","charge_now_cents"],"type":"object","x-order":["key","name","uusd_month","days_left","charge_now_cents"]},"type":"array"},"can_add":{"description":"Whether add-ons can be bought now.","type":"boolean"},"current_addons":{"items":{"description":"Add-on key already on the plan.","type":"string"},"type":"array"},"reason":{"description":"Why not, when `can_add` is false.","type":["string","null"]}},"required":["current_addons","available","can_add","reason"],"type":"object","x-order":["current_addons","available","can_add","reason"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Active add-ons and add-ons you can still buy, with mid-term prices","tags":["VPN and Proxy"],"x-cli":"vpn subscription addons","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/addons\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Tiện ích đang bật và tiện ích còn mua được, kèm giá giữa kỳ"},"post":{"description":"Adds add-ons to the plan in the middle of a period. The price is prorated for the days left and charged now; the add-ons are included in later renewals. Retired add-ons are rejected. See [List add-ons](#operation/vpn_subscription_addons) for the keys and prices.\n\n**Required scope:** `vpn:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpn_subscription_add_addons","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"add":["concurrency"]},"schema":{"properties":{"add":{"description":"Keys of the add-ons to add (at least one).","items":{"description":"Add-on key.","type":"string"},"type":"array"}},"required":["add"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"change":{"added":["concurrency"],"charged_cents":807,"created_at":1760500000,"days_left":24,"fail_reason":null,"id":1,"seq":1,"status":"done","subscription_id":12},"invoice_id":86,"invoice_number":"INV-000086","subscription":{"activated_at":1760000020,"addons":["ipauth"],"auto_renew":true,"bandwidth_gb":250,"canceled_at":null,"created_at":1760000000,"cycle":"monthly","expires_at":1762592000,"fail_reason":null,"hidden_at":null,"id":12,"ip_count":2,"ip_released_at":null,"monthly_uusd":8400000,"months":1,"period_days":0,"renew_cents":840,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":8400000}},"schema":{"properties":{"change":{"properties":{"added":{"items":{"description":"Add-on key that was added.","type":"string"},"type":"array"},"charged_cents":{"description":"Amount charged in US cents.","type":"integer"},"created_at":{"description":"When the change was requested (Unix time, seconds, UTC)","type":"integer"},"days_left":{"description":"Days left in the period when the change was bought.","type":"integer"},"fail_reason":{"description":"Short failure code.","type":["string","null"]},"id":{"description":"Change identifier.","type":"integer"},"seq":{"description":"Sequence number of the change within the plan.","type":"integer"},"status":{"description":"`done`, or `pending` while the payment is being finalized.","type":"string"},"subscription_id":{"description":"Plan identifier.","type":"integer"}},"required":["id","subscription_id","seq","added","days_left","charged_cents","status","fail_reason","created_at"],"type":"object","x-order":["id","subscription_id","seq","added","days_left","charged_cents","status","fail_reason","created_at"]},"invoice_id":{"description":"Invoice identifier.","type":["integer","null"]},"invoice_number":{"description":"Invoice number.","type":["string","null"]},"pending":{"description":"True when the answer is 202 and the payment is still being finalized.","type":"boolean"},"replayed":{"description":"True when this is the stored result of an earlier call with the same Idempotency-Key.","type":"boolean"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","change"],"type":"object","x-order":["subscription","change","invoice_id","invoice_number","pending","replayed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This site does not sell VPN plans. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"This site does not sell VPN plans."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_upgradable","message":"The plan cannot take add-ons now."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_upgradable`: The plan cannot take add-ons now. `nothing_to_add`: The plan already has all the requested add-ons. `in_progress`: A renewal or upgrade of this plan is still being processed. `idempotency_key_reused`: The Idempotency-Key was already used for a different order in the last 24 hours. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_upgradable","description":"The plan cannot take add-ons now."},{"code":"nothing_to_add","description":"The plan already has all the requested add-ons."},{"code":"in_progress","description":"A renewal or upgrade of this plan is still being processed."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was already used for a different order in the last 24 hours."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"unknown_addon","message":"An add-on key does not exist."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`unknown_addon`: An add-on key does not exist. `addon_retired`: An add-on is no longer sold. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"unknown_addon","description":"An add-on key does not exist."},{"code":"addon_retired","description":"An add-on is no longer sold."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"refund_pending","message":"The payment was taken and the automatic refund failed; do not retry, contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The payment was taken and the automatic refund failed; do not retry, contact support. (`refund_pending`)","x-error-codes":[{"code":"refund_pending","description":"The payment was taken and the automatic refund failed; do not retry, contact support."}]}},"security":[{"bearerAuth":["vpn:create"]}],"summary":"Add features to a plan mid-term (charges the wallet)","tags":["VPN and Proxy"],"x-cli":"vpn subscription add-addons","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/addons\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"add\":[\"concurrency\"]}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:create","x-summary-vi":"Thêm tiện ích giữa kỳ (trừ tiền ví)"}},"/v1/vpn/subscriptions/{id}/addons/remove":{"post":{"description":"Schedules add-ons for removal at the next renewal. Nothing is refunded and the add-ons keep working until the plan renews. Send an empty list to cancel a scheduled removal.\n\n**Required scope:** `vpn:write`.","operationId":"vpn_subscription_remove_addons","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"remove":["concurrency"]},"schema":{"properties":{"remove":{"description":"Keys of the add-ons to remove. Empty to clear the scheduled removal.","items":{"description":"Add-on key.","type":"string"},"type":"array"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"pending_remove":["concurrency"]},"schema":{"properties":{"pending_remove":{"items":{"description":"Add-on key scheduled for removal.","type":"string"},"type":"array"}},"required":["pending_remove"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Schedule removal of add-ons at the next renewal (no refund)","tags":["VPN and Proxy"],"x-cli":"vpn subscription remove-addons","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/addons/remove\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"remove\":[\"concurrency\"]}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Hẹn bỏ tiện ích từ lần gia hạn kế tiếp (không hoàn tiền)"}},"/v1/vpn/subscriptions/{id}/auth-ips":{"get":{"description":"Returns the IP addresses and networks that may use the plan without a user name and password. The limit is 3 entries, or 1000 with the `ipauth` add-on.\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_auth_ips","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":["203.0.113.5/32"],"limit":3},"schema":{"properties":{"items":{"items":{"description":"Authorized address in CIDR notation, e.g. `203.0.113.5/32`.","type":"string"},"type":"array"},"limit":{"description":"Maximum number of entries.","type":"integer"}},"required":["items","limit"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"IPs authorized to use the plan without user and password","tags":["VPN and Proxy"],"x-cli":"vpn subscription auth-ips","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/auth-ips\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"IP được uỷ quyền dùng gói không cần user và mật khẩu"},"put":{"description":"Replaces the whole list of authorized IPs. Addresses and networks must be valid CIDR; networks wider than /16 (IPv4) or /32 (IPv6) are rejected, and so is a list longer than the limit (3, or 1000 with the `ipauth` add-on). Nothing is saved when any entry is invalid. Anyone connecting from an authorized address can use the proxies without credentials, so keep the list short. Which protocols work without a password depends on the IP: see `capabilities.ip_auth_protocols` of each endpoint (an IP that lists only `http` still needs the username and password for SOCKS5).\n\n**Required scope:** `vpn:write`.","operationId":"vpn_subscription_set_auth_ips","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"cidrs":["203.0.113.5","198.51.100.0/24"]},"schema":{"properties":{"cidrs":{"description":"The complete new list. An empty list removes all authorizations.","items":{"description":"IPv4 or IPv6 address, optionally with a prefix length.","type":"string"},"type":"array"}},"required":["cidrs"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"items":["198.51.100.0/24","203.0.113.5/32"],"limit":3},"schema":{"properties":{"items":{"items":{"description":"Normalized CIDR, sorted and de-duplicated.","type":"string"},"type":"array"},"limit":{"description":"Maximum number of entries.","type":"integer"}},"required":["items","limit"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"The body is not valid JSON."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The body is not valid JSON. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"The body is not valid JSON."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"auth_ips_invalid","message":"An entry is not a valid address, or the network is too wide."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`auth_ips_invalid`: An entry is not a valid address, or the network is too wide. `auth_ips_limit`: The list is longer than the allowed limit.","x-error-codes":[{"code":"auth_ips_invalid","description":"An entry is not a valid address, or the network is too wide."},{"code":"auth_ips_limit","description":"The list is longer than the allowed limit."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Replace the list of authorized IPs of a plan","tags":["VPN and Proxy"],"x-cli":"vpn subscription set-auth-ips","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/vpn/subscriptions/<id>/auth-ips\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cidrs\":[\"203.0.113.5\",\"198.51.100.0/24\"]}'"}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Thay toàn bộ danh sách IP được uỷ quyền của gói"}},"/v1/vpn/subscriptions/{id}/auto-renew":{"put":{"description":"Turns auto-renew on or off. When on, the plan renews itself from the wallet shortly before it expires (and during the grace period after expiry). Turning it on for a plan that is already due renews it immediately; `renew` then reports what happened. Turning it off always works.\n\n**Required scope:** `vpn:write`.","operationId":"vpn_subscription_set_auto_renew","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"enabled":true},"schema":{"properties":{"enabled":{"description":"`true` to renew automatically, `false` to stop.","type":"boolean"}},"required":["enabled"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"changed":true,"renew":null,"subscription":{"activated_at":1760000020,"addons":["ipauth"],"auto_renew":true,"bandwidth_gb":250,"canceled_at":null,"created_at":1760000000,"cycle":"monthly","expires_at":1762592000,"fail_reason":null,"hidden_at":null,"id":12,"ip_count":2,"ip_released_at":null,"monthly_uusd":8400000,"months":1,"period_days":0,"renew_cents":840,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":8400000}},"schema":{"properties":{"changed":{"description":"Whether the setting was different from before.","type":"boolean"},"renew":{"description":"Outcome of the immediate renewal, or null when none was attempted.","enum":["renewed","replayed","no_funds","skipped","failed",null],"type":["string","null"]},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","changed","renew"],"type":"object","x-order":["subscription","changed","renew"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_renewable","message":"Auto-renew cannot be turned on for a plan that can no longer be renewed."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Auto-renew cannot be turned on for a plan that can no longer be renewed. (`not_renewable`)","x-error-codes":[{"code":"not_renewable","description":"Auto-renew cannot be turned on for a plan that can no longer be renewed."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Turn auto-renew on or off (turning it on can renew from the wallet at once)","tags":["VPN and Proxy"],"x-cli":"vpn subscription set-auto-renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X PUT \"https://api.onie.net/v1/vpn/subscriptions/<id>/auto-renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\":true}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Bật/tắt tự gia hạn (bật có thể gia hạn ngay từ ví)"}},"/v1/vpn/subscriptions/{id}/bandwidth":{"get":{"description":"Lists the bandwidth tiers you can upgrade this plan to, with the amount that would be charged now (prorated for the days left) and the renewal price afterwards. `can_upgrade` is false, with a `reason`, when the plan cannot be upgraded right now. Use [Upgrade bandwidth](#operation/vpn_subscription_upgrade_bandwidth) to buy a tier.\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_bandwidth","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_upgrade":true,"current_gb":250,"options":[{"adder_month_uusd":13460000,"charge_now_cents":1077,"days_left":24,"gb":1000,"label":"1000 GB","new_renew_cents":2186}],"reason":null},"schema":{"properties":{"can_upgrade":{"description":"Whether an upgrade is possible now.","type":"boolean"},"current_gb":{"description":"Current quota in GB (0 = unlimited).","type":"integer"},"options":{"items":{"properties":{"adder_month_uusd":{"description":"Monthly price of the tier in millionths of a US dollar.","type":"integer"},"charge_now_cents":{"description":"Amount charged now in US cents, prorated for the remaining days.","type":"integer"},"days_left":{"description":"Days left in the current period.","type":"integer"},"gb":{"description":"Quota of the tier in GB.","type":"integer"},"label":{"description":"Display label of the tier.","type":"string"},"new_renew_cents":{"description":"Renewal price per period after the upgrade, in US cents.","type":"integer"}},"required":["gb","label","adder_month_uusd","charge_now_cents","new_renew_cents","days_left"],"type":"object","x-order":["gb","label","adder_month_uusd","charge_now_cents","new_renew_cents","days_left"]},"type":"array"},"reason":{"description":"Why not: `feature_disabled`, `tenant_unavailable`, `not_active`, `expired`, `in_progress` or `no_higher_tier`.","type":["string","null"]}},"required":["current_gb","options","can_upgrade","reason"],"type":"object","x-order":["current_gb","options","can_upgrade","reason"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Bandwidth tiers you can upgrade to, with prices","tags":["VPN and Proxy"],"x-cli":"vpn subscription bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Các mốc băng thông có thể nâng lên, kèm giá"},"post":{"description":"Upgrades the monthly bandwidth quota to a higher tier in the middle of a period. The difference is charged now, prorated for the days left, and the renewal price rises accordingly. Only higher tiers are accepted. See [List bandwidth options](#operation/vpn_subscription_bandwidth) for the available tiers and prices.\n\n**Required scope:** `vpn:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpn_subscription_upgrade_bandwidth","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"gb":1000},"schema":{"properties":{"gb":{"description":"The new quota in GB; must be one of the tiers returned by the options call and higher than the current quota.","type":"integer"}},"required":["gb"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"invoice_id":85,"invoice_number":"INV-000085","subscription":{"activated_at":1760000020,"addons":["ipauth"],"auto_renew":true,"bandwidth_gb":250,"canceled_at":null,"created_at":1760000000,"cycle":"monthly","expires_at":1762592000,"fail_reason":null,"hidden_at":null,"id":12,"ip_count":2,"ip_released_at":null,"monthly_uusd":8400000,"months":1,"period_days":0,"renew_cents":840,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":8400000},"upgrade":{"charged_cents":1077,"created_at":1760500000,"days_left":24,"from_gb":250,"id":2,"new_renew_cents":2186,"seq":1,"status":"done","to_gb":1000}},"schema":{"properties":{"invoice_id":{"description":"Invoice identifier.","type":["integer","null"]},"invoice_number":{"description":"Invoice number.","type":["string","null"]},"pending":{"description":"True when the answer is 202 and the payment is still being finalized.","type":"boolean"},"replayed":{"description":"True when this is the stored result of an earlier call with the same Idempotency-Key.","type":"boolean"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"},"upgrade":{"properties":{"charged_cents":{"description":"Amount charged in US cents.","type":"integer"},"created_at":{"description":"When the upgrade was requested (Unix time, seconds, UTC)","type":"integer"},"days_left":{"description":"Days left in the period when the upgrade was bought.","type":"integer"},"from_gb":{"description":"Previous quota in GB.","type":"integer"},"id":{"description":"Upgrade identifier.","type":"integer"},"new_renew_cents":{"description":"Renewal price per period after the upgrade, in US cents.","type":"integer"},"seq":{"description":"Sequence number of the upgrade within the plan.","type":"integer"},"status":{"description":"`done`, or `pending` while the payment is being finalized.","type":"string"},"to_gb":{"description":"New quota in GB.","type":"integer"}},"required":["id","seq","from_gb","to_gb","days_left","charged_cents","new_renew_cents","status","created_at"],"type":"object","x-order":["id","seq","from_gb","to_gb","days_left","charged_cents","new_renew_cents","status","created_at"]}},"required":["subscription","upgrade"],"type":"object","x-order":["subscription","upgrade","invoice_id","invoice_number","pending","replayed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This site does not sell VPN plans. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"This site does not sell VPN plans."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_upgradable","message":"The plan cannot be upgraded now (not active, or the tier has no price)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_upgradable`: The plan cannot be upgraded now (not active, or the tier has no price). `not_higher`: The tier is not higher than the current quota. `in_progress`: A renewal or upgrade of this plan is still being processed. `idempotency_key_reused`: The Idempotency-Key was already used for a different order in the last 24 hours. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_upgradable","description":"The plan cannot be upgraded now (not active, or the tier has no price)."},{"code":"not_higher","description":"The tier is not higher than the current quota."},{"code":"in_progress","description":"A renewal or upgrade of this plan is still being processed."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was already used for a different order in the last 24 hours."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`gb` is not an available tier."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `gb` is not an available tier. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`gb` is not an available tier."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"refund_pending","message":"The payment was taken and the automatic refund failed; do not retry, contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The payment was taken and the automatic refund failed; do not retry, contact support. (`refund_pending`)","x-error-codes":[{"code":"refund_pending","description":"The payment was taken and the automatic refund failed; do not retry, contact support."}]}},"security":[{"bearerAuth":["vpn:create"]}],"summary":"Upgrade the bandwidth tier mid-term (charges the wallet)","tags":["VPN and Proxy"],"x-cli":"vpn subscription upgrade-bandwidth","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/bandwidth\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"gb\":1000}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:create","x-summary-vi":"Nâng băng thông giữa kỳ (trừ tiền ví)"}},"/v1/vpn/subscriptions/{id}/billing":{"get":{"description":"Lists every invoice that belongs to the plan: purchase, renewals, bandwidth upgrades and add-ons, newest first. Invoices issued to a previous owner (after a transfer) are marked `previous_owner` and their buyer details are redacted.\n\n**Required scope:** `billing:read`.","operationId":"vpn_subscription_billing","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"invoices":[{"account_id":5,"buyer_json":"{}","created_at":1760000020,"currency":"USD","due_at":null,"id":77,"kind":"receipt","ledger_ref":"vpn-buy-12","note":null,"number":"INV-000077","paid_at":1760000020,"seller_json":"{}","status":"paid","subtotal_cents":840,"total_cents":840,"updated_at":1760000020,"vm_id":null}]},"schema":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/VpnPlanInvoice"},"type":"array"}},"required":["invoices"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["billing:read"]}],"summary":"Invoices that belong to a VPN IPv4 plan","tags":["VPN and Proxy"],"x-cli":"vpn subscription billing","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/billing\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"billing:read","x-summary-vi":"Hoá đơn thuộc gói VPN IPv4"}},"/v1/vpn/subscriptions/{id}/cancel":{"post":{"description":"Cancels the plan immediately. The proxies stop working and the IP addresses go back to the pool. **Nothing is refunded**, even if time remains. To prevent accidents you must repeat the plan id in `confirm`. Canceling an already canceled plan succeeds and reports `already: true`. Look at [Preview cancellation](#operation/vpn_subscription_cancel_preview) first.\n\n**Required scope:** `vpn:destroy`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpn_subscription_cancel","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"confirm":12},"schema":{"properties":{"confirm":{"description":"The plan id, as a number or a string such as `12` or `#12`. Must match the id in the path."}},"required":["confirm"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"already":false,"endpoints_revoked":2,"ips_released":2,"refund_cents":0,"subscription":{"activated_at":1760000020,"addons":[],"auto_renew":false,"bandwidth_gb":250,"canceled_at":1760600000,"created_at":1760000000,"cycle":"monthly","expires_at":1762592000,"fail_reason":null,"hidden_at":null,"id":12,"ip_count":2,"ip_released_at":1760600000,"monthly_uusd":8400000,"months":1,"period_days":0,"renew_cents":840,"renew_max_periods":0,"renewable":false,"status":"canceled","tier":"dedicated","total_uusd":8400000}},"schema":{"properties":{"already":{"description":"True when the plan had been canceled before this call.","type":"boolean"},"endpoints_revoked":{"description":"Number of endpoints that were switched off.","type":"integer"},"ips_released":{"description":"Number of IP addresses returned to the pool.","type":"integer"},"refund_cents":{"description":"Always 0.","type":"integer"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","already","endpoints_revoked","ips_released","refund_cents"],"type":"object","x-order":["subscription","already","endpoints_revoked","ips_released","refund_cents"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_cancelable","message":"The plan is in a state that cannot be canceled (for example a failed order)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_cancelable`: The plan is in a state that cannot be canceled (for example a failed order). `in_progress`: A renewal or upgrade is still being processed; try again shortly. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_cancelable","description":"The plan is in a state that cannot be canceled (for example a failed order)."},{"code":"in_progress","description":"A renewal or upgrade is still being processed; try again shortly."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"confirm_mismatch","message":"`confirm` does not match the plan id."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`confirm_mismatch`: `confirm` does not match the plan id. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"confirm_mismatch","description":"`confirm` does not match the plan id."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:destroy"]}],"summary":"Cancel a VPN IPv4 plan now (no refund; IPs are released)","tags":["VPN and Proxy"],"x-cli":"vpn subscription cancel","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/cancel\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"confirm\":12}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:destroy","x-summary-vi":"Huỷ ngay gói VPN IPv4 (không hoàn tiền; IP về kho)"}},"/v1/vpn/subscriptions/{id}/cancel-preview":{"get":{"description":"Shows what canceling the plan would do, without changing anything: whether it can be canceled, how many IPs would be released, and that no refund is given.\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_cancel_preview","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"can_cancel":true,"can_hide":false,"expires_at":1762592000,"ips_released":2,"keep_until":null,"reason":null,"refund_cents":0,"status":"active"},"schema":{"$ref":"#/components/schemas/VpnCancelPreview"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Preview of canceling a VPN IPv4 plan","tags":["VPN and Proxy"],"x-cli":"vpn subscription cancel-preview","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/cancel-preview\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Xem trước khi huỷ gói VPN IPv4"}},"/v1/vpn/subscriptions/{id}/config":{"get":{"description":"Downloads the connection list of the plan as a plain-text file in the chosen format. The file contains the user name and password of every active endpoint, so treat it like a secret. Formats: `socks` / `http` (URL lines), `socks_plain` / `http_plain` (`host:port:user:pass` lines for scraping and anti-detect tools), `json`, `clash`, `singbox` and `v2rayn` (base64 subscription).\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_config","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Output format.","in":"query","name":"format","required":false,"schema":{"default":"socks","enum":["socks","http","socks_plain","http_plain","json","clash","singbox","v2rayn"],"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"description":"The configuration file.","type":"string"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`format` is not one of the supported formats."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`format` is not one of the supported formats. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`format` is not one of the supported formats."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Download the connection list (SOCKS5/HTTP, plain, Clash, sing-box, v2rayN)","tags":["VPN and Proxy"],"x-cli":"vpn subscription config","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/config\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Tải danh sách kết nối (SOCKS5/HTTP, thuần, Clash, sing-box, v2rayN)"}},"/v1/vpn/subscriptions/{id}/feed/rotate":{"post":{"description":"Issues a new subscription-feed link and invalidates the previous one. The feed is a public URL (no API key needed) that VPN apps download to get the plan's proxies, so anyone holding it can use the plan: treat the token as a secret and rotate it if it leaks.\n\n**Required scope:** `vpn:write`.","operationId":"vpn_subscription_rotate_feed","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"path":"/v1/vpn/feed/Zk3q9rVx0aLm2PwTnB7cYdHs5uJgEoXf","token":"Zk3q9rVx0aLm2PwTnB7cYdHs5uJgEoXf"},"schema":{"properties":{"path":{"description":"Path of the feed URL on this site, `/v1/vpn/feed/{token}`. Append `?format=v2rayn|clash|singbox`.","type":"string"},"token":{"description":"The feed token.","type":"string"}},"required":["token","path"],"type":"object","x-order":["token","path"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Issue a new subscription-feed link (the old link dies)","tags":["VPN and Proxy"],"x-cli":"vpn subscription rotate-feed","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/feed/rotate\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":true,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Cấp link đăng ký (feed) mới — link cũ chết"}},"/v1/vpn/subscriptions/{id}/ip-reports":{"get":{"description":"Lists the blacklist reports you filed for the IP addresses of the plan, newest first (up to 100). Use [Report IPs](#operation/vpn_subscription_report_ip) to file one.\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_reports","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"items":[{"admin_note":null,"created_at":1760001000,"decided_at":null,"dnsbl_lists":["zen.example-rbl.org"],"dnsbl_status":"listed","endpoint_id":31,"id":4,"ip":"198.51.100.71","new_ip":null,"note":"Mail rejected by a blocklist","reason":"dnsbl","site":null,"status":"open","subscription_id":12,"zone_id":1}],"max_open":10},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VpnIpReport"},"type":"array"},"max_open":{"description":"Maximum number of open reports per plan.","type":"integer"}},"required":["items","max_open"],"type":"object"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Blacklist reports you filed for the plan's IPs","tags":["VPN and Proxy"],"x-cli":"vpn subscription reports","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/ip-reports\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Báo cáo IP bị blacklist bạn đã gửi cho gói"},"post":{"description":"Reports IP addresses of the plan that are blacklisted or blocked by a site, asking for replacements. Each IP is checked against public blacklists immediately and the result is attached to the report. A reviewer then replaces the IP with a clean one in the same location (no charge) or rejects the report with a reason. Limits: one open report per IP and at most 10 open reports per plan. The call can take several seconds because the blacklist lookup runs live. Send an `Idempotency-Key` to retry safely.\n\n**Required scope:** `vpn:write`.","operationId":"vpn_subscription_report_ip","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"endpoint_ids":[31],"note":"Mail rejected by a blocklist","reason":"dnsbl"},"schema":{"properties":{"endpoint_ids":{"description":"Endpoints (IPs) to report, 1 to 10 of them.","items":{"description":"Endpoint identifier.","type":"integer"},"type":"array"},"note":{"description":"Free-text description, up to 500 characters.","type":"string"},"reason":{"description":"Why the IPs are reported.","enum":["dnsbl","site_block","other"],"type":"string"},"site":{"description":"Name of the site that blocks the IP. Required in practice for `site_block`.","type":"string"}},"required":["endpoint_ids","reason"],"type":"object","x-order":["endpoint_ids","reason","site","note"]}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"items":[{"admin_note":null,"created_at":1760001000,"decided_at":null,"dnsbl_lists":["zen.example-rbl.org"],"dnsbl_status":"listed","endpoint_id":31,"id":4,"ip":"198.51.100.71","new_ip":null,"note":"Mail rejected by a blocklist","reason":"dnsbl","site":null,"status":"open","subscription_id":12,"zone_id":1}]},"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VpnIpReport"},"type":"array"}},"required":["items"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_active","message":"The plan is not active."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_active`: The plan is not active. `report_open`: Every selected IP already has an open report. `too_many_reports`: The plan already has the maximum number of open reports. `conflict`: The IP changed meanwhile, or no clean replacement IP is available.","x-error-codes":[{"code":"not_active","description":"The plan is not active."},{"code":"report_open","description":"Every selected IP already has an open report."},{"code":"too_many_reports","description":"The plan already has the maximum number of open reports."},{"code":"conflict","description":"The IP changed meanwhile, or no clean replacement IP is available."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"A field is missing, malformed or out of range."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A field is missing, malformed or out of range. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"A field is missing, malformed or out of range."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:write"]}],"summary":"Report blacklisted IPs of a plan for replacement","tags":["VPN and Proxy"],"x-cli":"vpn subscription report-ip","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/ip-reports\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"endpoint_ids\":[31],\"note\":\"Mail rejected by a blocklist\",\"reason\":\"dnsbl\"}'"}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:write","x-summary-vi":"Báo cáo IP bị blacklist của gói để đổi IP"}},"/v1/vpn/subscriptions/{id}/renew":{"post":{"description":"Renews the plan for one or more periods at the price fixed when it was bought (not the current catalog price). The amount is charged to the wallet and the expiry moves forward. Active plans, and expired plans that still hold their IPs, can be renewed. Only one renewal or upgrade can be in progress at a time.\n\n**Required scope:** `vpn:create`. **Requires the `Idempotency-Key` header** because this operation charges money or cannot be repeated safely.","operationId":"vpn_subscription_renew","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Unique string you choose for this logical operation (at most 200 characters; a UUID works well). Sending the same key again returns the ORIGINAL result instead of repeating the operation, so a retry after a timeout never charges or deletes twice. Reusing a key for a different operation (another method or path) fails with `422 idempotency_key_reused`, so use a fresh key per operation.","example":"3f6c1d0e-8a52-4b57-9a41-0c2f6e9d7b10","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"periods":1},"schema":{"properties":{"periods":{"description":"Number of periods to buy, from 1 up to `renew_max_periods` of the plan. Defaults to 1.","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"invoice_id":91,"invoice_number":"INV-000091","renewal":{"charged_cents":840,"created_at":1762000000,"from":1762592000,"id":3,"months":1,"periods":1,"seq":1,"status":"done","to":1765184000},"subscription":{"activated_at":1760000020,"addons":["ipauth"],"auto_renew":true,"bandwidth_gb":250,"canceled_at":null,"created_at":1760000000,"cycle":"monthly","expires_at":1762592000,"fail_reason":null,"hidden_at":null,"id":12,"ip_count":2,"ip_released_at":null,"monthly_uusd":8400000,"months":1,"period_days":0,"renew_cents":840,"renew_max_periods":12,"renewable":true,"status":"active","tier":"dedicated","total_uusd":8400000}},"schema":{"properties":{"invoice_id":{"description":"Invoice identifier.","type":["integer","null"]},"invoice_number":{"description":"Invoice number.","type":["string","null"]},"pending":{"description":"True when the answer is 202 and the payment is still being finalized.","type":"boolean"},"renewal":{"$ref":"#/components/schemas/VpnRenewal"},"replayed":{"description":"True when this is the stored result of an earlier call with the same Idempotency-Key.","type":"boolean"},"subscription":{"$ref":"#/components/schemas/VpnPlanSummary"}},"required":["subscription","renewal"],"type":"object","x-order":["subscription","renewal","invoice_id","invoice_number","pending","replayed"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_required","message":"The `Idempotency-Key` header is missing or longer than 200 characters."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The `Idempotency-Key` header is missing or longer than 200 characters. (`idempotency_key_required`)","x-error-codes":[{"code":"idempotency_key_required","description":"The `Idempotency-Key` header is missing or longer than 200 characters."}]},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"content":{"application/json":{"example":{"error":{"code":"insufficient_funds","message":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`. (`insufficient_funds`)","x-error-codes":[{"code":"insufficient_funds","description":"The wallet cannot cover the price; the body has `need_cents` and `balance_cents`."}]},"403":{"content":{"application/json":{"example":{"error":{"code":"scope_required","message":"The key lacks the scope `vm:read` for GET /v1/vm"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`scope_required`: the key lacks the scope this operation needs. `endpoint_not_public`: the path is not available to API keys. Account-level refusals (for example a blocked account) also use 403. Specific to this operation: This site does not sell VPN plans. (`feature_disabled`)","x-error-codes":[{"code":"feature_disabled","description":"This site does not sell VPN plans."}]},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"409":{"content":{"application/json":{"example":{"error":{"code":"not_renewable","message":"The plan cannot be renewed in its current state."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`not_renewable`: The plan cannot be renewed in its current state. `renewal_in_progress`: Another renewal of this plan is still being processed. `idempotency_key_reused`: The Idempotency-Key was already used for a different order in the last 24 hours. `idempotency_in_progress`: Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result.","x-error-codes":[{"code":"not_renewable","description":"The plan cannot be renewed in its current state."},{"code":"renewal_in_progress","description":"Another renewal of this plan is still being processed."},{"code":"idempotency_key_reused","description":"The Idempotency-Key was already used for a different order in the last 24 hours."},{"code":"idempotency_in_progress","description":"Another request with the same `Idempotency-Key` is still running. Wait a moment and send the same key again to receive its result."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`periods` is out of range; the body has `max`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`invalid_argument`: `periods` is out of range; the body has `max`. `idempotency_key_reused`: This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation.","x-error-codes":[{"code":"invalid_argument","description":"`periods` is out of range; the body has `max`."},{"code":"idempotency_key_reused","description":"This `Idempotency-Key` was already used for a different operation. Use a fresh key for each distinct operation."}]},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"content":{"application/json":{"example":{"error":{"code":"refund_pending","message":"The payment was taken and the automatic refund failed; do not retry, contact support."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The payment was taken and the automatic refund failed; do not retry, contact support. (`refund_pending`)","x-error-codes":[{"code":"refund_pending","description":"The payment was taken and the automatic refund failed; do not retry, contact support."}]}},"security":[{"bearerAuth":["vpn:create"]}],"summary":"Renew a VPN IPv4 plan (charges the wallet)","tags":["VPN and Proxy"],"x-cli":"vpn subscription renew","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl -X POST \"https://api.onie.net/v1/vpn/subscriptions/<id>/renew\" \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Idempotency-Key: $(uuidgen)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"periods\":1}'"}],"x-destructive":true,"x-idempotent":true,"x-scope":"vpn:create","x-summary-vi":"Gia hạn gói VPN IPv4 (trừ tiền ví)"}},"/v1/vpn/subscriptions/{id}/traffic":{"get":{"description":"Returns real traffic of the plan: a time series for charting, the latest rate, the usage of the current billing period against the quota, and the busiest endpoints. Minute buckets are available for `1h` and `6h`, hourly buckets for `24h`, `7d` and `30d`, daily buckets for `month` (last 30 days) and monthly buckets for `all` (all time, with the usage of each past billing period in `periods`). Minute data is kept for 48 hours and hourly data for 40 days; `data_from` tells where the series really starts. The `live` rate is an average over the last stored minute. Limited to 30 calls per minute per account.\n\n**Required scope:** `vpn:detail`.","operationId":"vpn_subscription_traffic","parameters":[{"description":"Plan identifier as returned by the list operation.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Time range of the series.","in":"query","name":"range","required":false,"schema":{"default":"24h","enum":["1h","6h","24h","7d","30d","month","all"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"bucket_secs":3600,"data_from":1757500000,"endpoints":[{"id":31,"ip":"198.51.100.71","last_seen":1760003500,"rx_bytes":30000000,"total_bytes":35000000,"tx_bytes":5000000}],"granularity":"hour","live":{"age_secs":20,"at":1760003540,"conns":7,"rx_bps":900000.0,"tx_bps":120000.0,"window_secs":60},"metering":"directional","range":"24h","series":[{"conns":18,"peak_rx_bps":1250000.0,"peak_tx_bps":340000.0,"rx_bps":1250000.0,"rx_bytes":562500000,"t":1760000000,"tx_bps":340000.0,"tx_bytes":153000000}],"usage":{"pct":0.03,"period_end":1762492000,"period_start":1759900000,"quota_bytes":250000000000,"rx_bytes":52428800,"total_bytes":62914560,"tx_bytes":10485760}},"schema":{"$ref":"#/components/schemas/VpnTraffic"}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"content":{"application/json":{"example":{"error":{"code":"not_found","message":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose). (`not_found`)","x-error-codes":[{"code":"not_found","description":"The resource does not exist, or it belongs to another account (the two cases are indistinguishable on purpose)."}]},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_argument","message":"`range` is not one of 1h, 6h, 24h, 7d, 30d, month, all."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`range` is not one of 1h, 6h, 24h, 7d, 30d, month, all. (`invalid_argument`)","x-error-codes":[{"code":"invalid_argument","description":"`range` is not one of 1h, 6h, 24h, 7d, 30d, month, all."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["vpn:detail"]}],"summary":"Real traffic chart and usage of a VPN IPv4 plan","tags":["VPN and Proxy"],"x-cli":"vpn subscription traffic","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/vpn/subscriptions/<id>/traffic\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"vpn:detail","x-summary-vi":"Biểu đồ và mức dùng lưu lượng thật của gói VPN IPv4"}},"/v1/zones":{"get":{"description":"Lists the regions your site sells from, with the availability of each service in each region: virtual machines (`vm`), VPN IPs (`vpn`, with the number of free IPs) and object storage (`s3`). Use a region `id` as `zone_id` when ordering. Add `service` to keep only the regions where that service is on sale.\n\n`default_zone_id` is the region used when an order omits `zone_id`; it is always one of the listed regions, or null when the list is empty. The response may be cached for 15 seconds.\n\n**Required scope:** `catalog:read`.","operationId":"catalog_zones","parameters":[{"description":"Only return regions where this service is sold. For `vm` and `s3` the region must also be ready to take orders; for `vpn` every region that sells VPN is returned, so check `vpn.available`. Omit to return every region.","example":"vm","in":"query","name":"service","required":false,"schema":{"enum":["vm","vpn","s3"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"default_zone_id":1,"zones":[{"city":"Ho Chi Minh City","country":"VN","id":1,"is_default":true,"name":"Ho Chi Minh City","name_en":"Ho Chi Minh City","s3":{"available":true},"services":["vm","vpn","s3"],"slug":"hcm-1","vm":{"available":true},"vpn":{"available":true,"free_ips":120}}]},"schema":{"properties":{"default_zone_id":{"description":"Default region; null when no region is listed.","type":["integer","null"]},"zones":{"items":{"properties":{"city":{"description":"City.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"id":{"description":"Region identifier. Pass it as `zone_id` when ordering.","type":"integer"},"is_default":{"description":"Whether this is the default region of the site.","type":"boolean"},"name":{"description":"Display name.","type":"string"},"name_en":{"description":"English display name.","type":["string","null"]},"s3":{"properties":{"available":{"description":"Whether object storage can be ordered in this region right now.","type":"boolean"}},"required":["available"],"type":"object"},"services":{"items":{"description":"Service sold in the region, such as `vm`, `vpn` or `s3`.","type":"string"},"type":"array"},"slug":{"description":"Short name, e.g. `hcm-1`.","type":"string"},"vm":{"properties":{"available":{"description":"Whether servers can be created in this region right now.","type":"boolean"}},"required":["available"],"type":"object"},"vpn":{"properties":{"available":{"description":"Whether the region sells VPN IPs and has at least one free IP.","type":"boolean"},"free_ips":{"description":"Number of free VPN IPs that can be ordered in the region.","type":"integer"}},"required":["available","free_ips"],"type":"object"}},"required":["id","slug","name","name_en","country","city","is_default","services","vm","vpn","s3"],"type":"object","x-order":["id","slug","name","name_en","country","city","is_default","services","vm","vpn","s3"]},"type":"array"}},"required":["zones","default_zone_id"],"type":"object","x-order":["zones","default_zone_id"]}}},"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"content":{"application/json":{"example":{"error":{"code":"invalid_service","message":"`service` is not `vm`, `vpn` or `s3`."}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`service` is not `vm`, `vpn` or `s3`. (`invalid_service`)","x-error-codes":[{"code":"invalid_service","description":"`service` is not `vm`, `vpn` or `s3`."}]},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"bearerAuth":["catalog:read"]}],"summary":"Sale zones and per-service availability","tags":["Catalog"],"x-cli":"catalog zones","x-codeSamples":[{"label":"cURL","lang":"Shell","source":"curl \"https://api.onie.net/v1/zones\" \\\n  -H \"Authorization: Bearer $API_KEY\""}],"x-destructive":false,"x-idempotent":false,"x-scope":"catalog:read","x-summary-vi":"Vùng đang bán và độ sẵn sàng theo dịch vụ"}}},"security":[{"bearerAuth":[]}],"servers":[{"url":"https://api.onie.net"}],"tags":[{"description":"Plans, regions, operating systems and prices you can order from. These calls are read-only and cost nothing. Prices are the retail prices of the site you call, in USD.","name":"Catalog"},{"description":"Create, inspect and operate virtual servers: power actions, plan changes, metrics, billing of a single server, and deletion. Creating a server, changing its plan and deleting it are destructive or charge the wallet and require an `Idempotency-Key`.\n\n**Lifecycle.** A new server starts in `provisioning`, becomes `active` when it is ready, and moves to `deleting` and `deleted` when you delete it. A server that cannot be paid for (or that an administrator suspended) becomes `locked`: it keeps its data for a grace period (`destroy_after`) but refuses every action except top-ups and deletion-related reads. If deployment fails the server becomes `failed` and the order is refunded. Power state (`Running`, `Stopped`...) is reported separately in `cs_state` and is only meaningful while the server is `active`.\n\n**Asynchronous actions.** Start, stop, reboot, password reset, SSH-key change, plan change and deletion return a `job_id` immediately. Follow it with List a VM's jobs, or poll Get a VM until `job_running` is `false`. Only one job can run on a server at a time; a second action meanwhile fails with `409 job_running`.","name":"Virtual Machines"},{"description":"Firewall rules and port forwarding rules of a virtual server. Changes are applied in the background: the write operations answer immediately with a `job_id`, which you follow with [List VM jobs](#operation/vm_jobs). Rules are read live from the network and cached for about 20 seconds, so a list can lag slightly behind a change you have just made.","name":"VM Networking"},{"description":"Point-in-time snapshots of a whole virtual server. Each server can hold a limited number of snapshots (`meta.limit`, 3 by default). Taking or deleting a snapshot runs in the background: the write operations answer immediately with a `job_id`, which you follow with [List VM jobs](#operation/vm_jobs). While a server has snapshots, changing its plan, reinstalling it or resizing its disk is refused with `409 has_snapshots`, so delete them first. Snapshots can be switched off for a site; every operation then answers `501 feature_disabled`.","name":"Snapshots"},{"description":"One-time tickets for the graphical (VNC) console and the SSH web terminal, shareable terminal links, and the AI SSH agent that runs commands on a server for you. Tickets and share tokens are secrets: anyone who holds one can open the console until it expires, so never log them or put them in a URL you share publicly.","name":"Console and AI Agent"},{"description":"SSH public keys stored in your account. Only the public half is stored here, so nothing secret is ever returned. Attach a stored key to a server with [Attach an SSH key to the VM](#operation/vm_ssh_key_attach), or choose one when you create a server. An account can store at most 20 keys.","name":"SSH Keys"},{"description":"Read-only access to your wallet, invoices, payments, orders and current usage. Money can only be added, and payment methods only be changed, from the dashboard; no API key can do it. Unless a field says otherwise, amounts are integers in US cents (`*_cents`). Prices per hour are given in millionths of a dollar (`*_uusd*`) or thousandths of a dollar (`*_mills*`).","name":"Billing"},{"description":"Inspect and manage the DDoS Shield of your account: protected IPs, blocking rules, attack events, edge traffic, blackholes, web protection and AI analysis, and the agent installed on your own server. Reading needs the `shield:read` scope, changing rules and settings needs `shield:write`, and controlling the agent needs `shield:agent`. Every path contains your tenant identifier, which is shown on the Account page of the dashboard; a key can only reach the tenant of the account that owns it. Protected IPs are managed for you and cannot be added or removed through the API. Rules created by automatic attack mitigation are visible but read-only.","name":"DDoS Shield"},{"description":"Managed Kubernetes clusters: a free, fully managed control plane plus worker nodes that you pick from a fixed list of worker plans. Workers are billed like servers (by the hour while they run, or up front for monthly and longer billing cycles) and the control plane costs nothing. Creating, scaling, starting, stopping and deleting a cluster are asynchronous: the call answers `202 Accepted` with an operation, and the cluster reports `state` and `op` while the work runs. Creating, scaling and deleting charge or release wallet money, so they require an `Idempotency-Key`. A cluster is `provisioning` until it is built, then `active` or `stopped`; it becomes `locked` when the wallet or the site blocks it, and `deleting` then `deleted` when removed. Kubernetes is hidden on sites that do not sell it. On such a site the catalog, quote, create and scale calls answer `403 k8s_disabled`, while existing clusters can still be listed, started, stopped, deleted and their kubeconfig downloaded.","name":"Kubernetes"},{"description":"Private Cloud networks with their own dedicated, unmetered bandwidth plan. A Private Cloud is a private network (a /16 range) split into tiers (/24 subnets, each with its own IPv6 /64), protected by Network ACL rules, with one virtual router and one public IP address for outbound traffic. Servers are placed in a tier when you create them.\n\nCreating, changing the plan, adding or removing tiers, editing ACL rules and deleting are asynchronous: the call answers `202` with an `op` and the Private Cloud settles in the background, so poll [Get a Private Cloud](#operation/vpc_get) or [List operations](#operation/vpc_ops). Only one operation runs at a time; a second change meanwhile fails with `409 vpc_busy`.\n\nOrdering calls (catalog, quote, create, change plan, add tier) answer `403 vpc_disabled` while Private Cloud is not enabled for your account. Existing Private Clouds stay readable, their ACL can be edited and they can be deleted. Amounts ending in `_cents` are US cents; amounts ending in `_uusd` are millionths of a US dollar per hour; timestamps are Unix seconds. Hidden on sites that do not sell Private Cloud.","name":"Private Cloud"},{"description":"Monthly traffic quota of your services and the Add-ons that raise it. Every server, container cluster, object-storage account and VPN plan has a quota per billing period; unmetered services (for example servers inside a Private Cloud network) have none. Reading is free. Buying an Add-on adds terabytes to the current billing period of one service, charges your wallet and requires an `Idempotency-Key`. In this section 1 TB means 2^40 bytes and 1 GB means 2^30 bytes.","name":"Bandwidth"},{"description":"Operating system images and ISO images of your account. Import an image from a URL, create one from a stopped server, rename it, delete it, or attach and detach an ISO. A template image that is `Ready` can be used as the operating system when you create a server. Stored images are billed per GB-hour from the moment they are ready. Image management can be switched off on a site; every call in this section then fails with 501 `feature_disabled`.","name":"Images"},{"description":"VPN IPv4 and Proxy IPv6 plans. The `vpn:read` scope gives an app or script what it needs to connect: the plans, IP addresses, ports, user names and passwords. Separate scopes cover plan details such as traffic and configuration files (`vpn:detail`), changing settings (`vpn:write`), buying, renewing and upgrading (`vpn:create`, costs money) and cancelling (`vpn:destroy`). The responses contain live proxy credentials, so treat them as secrets and give each key only the scopes it needs. Hidden on sites that do not sell VPN or proxies.","name":"VPN and Proxy"},{"description":"Change the size of a server (vCPU, RAM, disk) now or on a schedule, and let Auto Scaling grow it when the load is high. Resizing is charged or refunded for the price difference, and every operation that costs money requires an `Idempotency-Key`. Available only on sites that sell resizing; when it is switched off the write operations fail with `403 feature_disabled`.","name":"Scaling"},{"description":"Extra data volumes you can attach to a server. A volume is billed per GB-hour from the moment it is ready until it is deleted, also while it is detached, and keeps its data when detached. Creating and enlarging a volume costs money and, like deleting one, requires an `Idempotency-Key`. Available only on sites that sell Block Storage; when it is switched off every operation fails with `501 feature_disabled`.","name":"Block Storage"},{"description":"Backups of a virtual server disk, taken on demand or automatically on a schedule and kept on separate backup storage. Backup is switched on per server. Storage is billed per GB-hour of the space a backup really uses, taken from the wallet balance; deleting a backup stops its charge. If the account falls into debt (a negative wallet balance, or servers locked for lack of funds) its backups are deleted automatically and its schedules are switched off, so keep the balance positive. Restoring a backup overwrites the server disk. Destroying a server also deletes its backups. Operations that change something run in the background and return a `job_id` (follow it with the VM jobs call). When the site does not sell Backup, every operation fails with `501 feature_disabled`.","name":"Backups"},{"description":"Your account at a glance and read-only access to your API keys: profile, dashboard overview, activity timeline, bandwidth, notifications, resource quota, printable invoices and DDoS analyses. The only call here that changes anything is marking notifications as read. Editing the profile, password, e-mail or two-factor settings, and creating, editing or revoking API keys, are not available through the API and can only be done from the dashboard.","name":"Account"},{"description":"S3-compatible object storage. An **account** owns **buckets**, buckets hold **objects**, and **access keys** let S3 clients (AWS CLI, SDKs, rclone) connect to it. These operations manage accounts, buckets, access keys, usage reports and share links, and can issue short-lived signed URLs for uploading and downloading objects. To move large amounts of data, use the S3 protocol itself with an access key.\n\nUsage is billed pay-as-you-go from your wallet: stored data above the free allowance and downloaded data are charged, uploads are free, and downloads covered by a monthly download quota or bandwidth add-on are not charged. Object storage prices and costs are expressed in Vietnamese dong (VND). The secret of an access key is shown once, when the key is created or rotated, and cannot be retrieved later. Available on the main site only.","name":"Object Storage"},{"description":"Rent NVIDIA GPU servers by the hour or for a fixed billing cycle, and manage them afterwards. The section is available on sites that sell GPUs; elsewhere ordering fails with `sales_disabled`.\n\n**How an order works.** Choose a GPU model, a template (the operating system image) and a disk size from the GPU catalog. [Quote the rental](#operation/gpu_quote) to fix the price for 180 seconds without paying anything, then [create the instance](#operation/gpu_create) with the `quote_id`: the first period is charged to your wallet and the instance starts in state `queued`. Poll [Get a GPU instance](#operation/gpu_get) until `state` is `active`, then connect over SSH to `public_ip` on the host port listed under `ports[\"22/tcp\"]`, or open the web terminal with [Get an SSH ticket](#operation/gpu_ssh_token).\n\n**Billing.** An `hourly` instance is paid one hour ahead, every hour, from the wallet. While it is stopped only the disk is billed (`storage_hourly_uusd`). The other cycles (`monthly`, `quarterly`, `semiannual`, `yearly`, `2y`, `3y`) are paid up front with a discount and renew automatically until you delete the instance, running or not. When the wallet cannot pay, a running instance is stopped and becomes `locked`; a locked instance is deleted after 7 days unless you add funds and start it.\n\n**Commands are asynchronous.** Start, stop, reboot, recycle and delete answer at once with `{\"ok\": true, \"pending\": true}`. The work continues in the background: follow `state` and `intent` on the instance. While a command is running, other commands answer `409 invalid_state`.","name":"GPU Cloud"},{"description":"Open and follow support tickets of your account. A ticket is a conversation between you and the support team: you create it with a subject and a first message, either side can reply, and you can close it when it is solved. Opening a ticket is limited to 5 per hour per account. On sites operated by a reseller the ticket goes to that reseller's support queue, and it is not available when the reseller has turned tickets off.","name":"Support Tickets"},{"description":"Read-only view of your affiliate programme: your referral code and link, the customers you referred, the commissions they generated and your payout history. Joining the programme, converting commission into wallet credit and withdrawing cash are only available in the web console. The programme is only offered on the main site; on reseller sites these calls return `feature_disabled`.","name":"Affiliate"},{"description":"Read-only view of requests to move a server or a VPN plan to another account. A transfer needs the owner to confirm by e-mail and the recipient to accept, so creating, accepting, declining or cancelling one is only possible in the web console by a signed-in person. These calls let you follow the progress of the requests you sent and the ones addressed to you, and check in advance whether a service can be transferred.","name":"Service Transfers"},{"description":"Dedicated Servers are physical machines assigned to your account. You can read their hardware, network settings, health, sensors, hardware log and bandwidth, rename them, change their power state and open a remote console. You never see the management controller of a machine, only the machine.\n\nThe list calls only return servers assigned to you; any other identifier answers `404 not_found`. Changing power state and opening a console are asynchronous and protected by two switches: a system-wide switch (`dedicated_ops_disabled` while it is off) and a lock on each server (`dedicated_server_locked`). The `actions` object of [Get a Dedicated Server](#operation/dedicated_get) tells you which buttons are available and why not. Power commands answer `202` with an `op`; poll [Get an operation](#operation/dedicated_op). Only one operation runs at a time on a server (`409 dedicated_busy`). A suspended subscription is read-only (`423 dedicated_suspended`).\n\nTimestamps are Unix seconds. Byte counters are bytes. Hardware log times are corrected for the controller's clock (`clock_adjusted`). Hidden on sites that do not sell Dedicated Servers.","name":"Dedicated Servers"},{"description":"Announce your own IPv4 or IPv6 prefix over BGP and use it on your VMs. Two types: `leased` (a prefix you lease from an IP provider) and `own` (a prefix your organisation holds at a RIR/LIR). Flow: register the prefix and origin ASN → publish an RPKI ROA, an IRR route/route6 object and the verification token (`byoip-verify=<token>`) in the prefix whois (or in the aut-num of your ASN) at the RIR — RIPE, APNIC, ARIN, AFRINIC or LACNIC database; objects in RADB/ALTDB and other open IRRs do not count as proof → the platform verifies automatically every 10 minutes for up to 7 days (you are not charged before verification passes; a prefix that is already announced on the Internet goes to a manual review) → the prefix is announced and a private L2 network with gateway `.1`/`::1` is created → attach it to a VM (a second NIC) and configure the addresses shown in `setup`. Accepted sizes: IPv4 /24–/22, IPv6 /48–/32 (configurable per site, see `GET /v1/byoip/catalog`).","name":"Bring Your Own IP"}],"x-rate-limit":{"headers":["X-RateLimit-Limit","X-RateLimit-Remaining","X-RateLimit-Reset","Retry-After"],"per_account_per_minute":300,"per_key_per_minute":120},"x-tagGroups":[{"name":"Reference","tags":["Catalog"]},{"name":"Compute","tags":["Virtual Machines","Snapshots","Console and AI Agent","SSH Keys","Images","Scaling","GPU Cloud","Dedicated Servers"]},{"name":"Networking","tags":["VM Networking","DDoS Shield","Private Cloud","Bandwidth","VPN and Proxy","Bring Your Own IP"]},{"name":"Account","tags":["Billing","Account","Support Tickets","Affiliate","Service Transfers"]},{"name":"Containers","tags":["Kubernetes"]},{"name":"Storage","tags":["Block Storage","Backups","Object Storage"]}]}