AIDev Cloud API & MCP docs
Let an AI agent (Claude, Cursor, Codex…) or your own script rent, start, stop and terminate AIDev Cloud GPU/CPU machines with a personal token, paid from your AIDev wallet.
1. Getting started
- Turn on two-factor authentication (TOTP) in your account.
- Top up your AIDev wallet at least once.
- Create an agent token (requires your password and a TOTP code). The token is shown only once: save it right away.
Scope
Each token lives at most 90 days, and each account has at most 5 tokens. Rotate or revoke tokens on the same page where you create them.
Machines running Ubuntu, Debian or Windows all work with agents. On Windows, the agent signs in with an SSH key as Administrator and runs commands through PowerShell; you still connect with Remote Desktop using the password shown on the web.
2. Set up MCP
Replace <token> with your agent token (it looks like aidev_pat_…).
The aidev-cloud Skill teaches the agent a safe rental workflow: ask you before spending money, send only public keys, terminate the machine when done.
Download the aidev-cloud Skill3. Sample workflow
An example with an Ubuntu machine. On Windows it is the same, with the user Administrator and commands run through PowerShell.
- 2. Ask the agent: "rent an RTX 3090 machine with the key ~/.ssh/aidev.pub".
- 3. The agent reads the hourly price (pricePerHour, or pricePerHourWithPublicIp when renting with a public IP), checks whether the plan has room (slotState) and waits for your approval.
- 4. The agent polls the machine every 15–30 seconds until status is active and vmStatus is running. On status error it stops: the held money has been returned and nothing is charged.
6. When you are done, tell the agent to "terminate the machine". Only terminating stops the charge.
4. Monthly VPS
The agent can buy and renew your own monthly VPS, paid from your AIDev wallet. Discount codes and QR bank transfers are not available through the agent, and the agent cannot terminate a monthly VPS: that is done on the web only.
- 1. The agent reads the plans (cloud_term_plans_list), then gets a quote (cloud_term_quote): plan, operating system, months, add-ons and total.
- 2. The agent waits until you approve both the total and the terms of service, and only then buys (cloud_term_buy) with expectedTotal equal to the quoted amount.
- 3. If the total changes in between, the order is refused (SHOP_PRICE_CHANGED) and nothing is charged; the agent quotes again and asks you again.
- 4. Renewal (cloud_term_renew) follows the same steps. Turning on auto-renewal (cloud_term_auto_renew_set) means your wallet is charged in later periods, so the agent asks you first too.
- 5. Each token can buy and renew at most 5 times a day (Vietnam time).
Ports and domains: cloud_my_ports_get and cloud_my_ports_set open ports within the machine’s range (send the expectedRevision you just read); cloud_my_domains_list, cloud_my_domain_add, cloud_my_domain_update, cloud_my_domain_remove and cloud_my_site_label_set manage the free vps<number> domain and custom domains (a subdomain needs only a CNAME record pointing at the machine’s fixed name; an apex domain uses an A record plus a TXT record).
5. REST API
- Authentication: the header Authorization: Bearer aidev_pat_…. No cookies or JWT.
- Idempotency-Key: <uuid> is required for renting, terminating, starting, stopping and restarting machines, removing keys, buying, renewing, auto-renewal, changing ports and removing domains. On a timeout, resend the same key with the same body: a second machine is never created. The key is tied to the body; a different body needs a new key.
- Paths carry ids; start, stop and restart send revision in the body, terminate sends ?revision=. Responses are the data of the matching MCP tool.
- Errors come back as { code, message, details, requestId }.
Routes
curl examples
OpenAPI reference
Full OpenAPI document: https://api.aidev.edu.vn/capi/v1/openapi.json
6. Billing and limits
A stopped machine is still billed
Machines are billed by the hour from your AIDev wallet. A powered-off machine is still billed; only terminating stops the charge. When the wallet runs out, the system reclaims the machine, and the data on its disk is lost just as when you terminate it.
- No limit on the number of machines.
- By default 1000 write calls a day (Vietnam time) per token, adjustable on the token management page; reads, refused or failed calls, resends of the same request and terminations do not count toward this limit.
- Start, stop, restart: at most 1 call per minute per machine.
- 120 calls per minute per token.
- CLOUD_LOW_RUNWAY: counting the new machine, the balance covers under 3 hours of running; the agent asks you again and creates the machine only if you agree.
- INSUFFICIENT_FUNDS: top up your wallet on the web, then try again.
- CLOUD_PRICE_CHANGED: the price changed; the agent reads it again and asks you again, and if you agree, it resends with a new Idempotency-Key.
7. Error codes
8. Security
- Never send a private key to an agent or to AIDev: only the public key (.pub) leaves your machine.
- If a token leaks, rotate or revoke it right away on the agent token page.
- After the agent creates a machine, open the machine’s details on the web, look at the "SSH keys on the machine" block and compare the fingerprint with your key.