Skip to content

Instances

Each account can have one active instance at a time. These endpoints launch it, poll it, and tear it down.

POST /api/notebook/request Session or API key

Returns as soon as allocation begins — it does not wait for the instance to be ready. Poll status until ready is true.

ParameterTypeDescription
imagestringOptionalContainer image. Must be enabled in the catalog. Defaults to the platform default image.
instance_typestringOptionaljupyter, gradio, streamlit, comfyui, vllm, sglang, opencode, or custom. Defaults to jupyter.
gpu_countintegerOptional1, 2, or 4. Defaults to 1.
disk_size_gbintegerOptionalFrom 100 GB up to the ceiling for the GPU count: 100 for 1 GPU, 150 for 2, 200 for 4.
resource_profilestringOptionalNamed CPU and memory profile. Defaults to auto.
launch_verification_tokenstringOptionalRequired only when the account has launch verification enabled.
Terminal window
curl -X POST https://radeon-global.anruicloud.com/api/notebook/request \
-H "Authorization: Bearer $RADEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"instance_type": "jupyter", "gpu_count": 1, "disk_size_gb": 100}'
{
"status": "allocating",
"message": "Allocating resources for your instance...",
"email": "you@example.com"
}

Rejected with 400 when the GPU count isn’t 1, 2, or 4; the disk size is outside the allowed range; the image or instance type is unknown or disabled; you already have an active instance; or your credit balance is below the requested GPU count.

GET /api/notebook/status Session or API key

No parameters — it reports on the calling account’s instance.

{
"status": "ready",
"ready": true,
"message": "Your workspace is ready",
"instance_id": "u-1042-9c3f8ab1",
"instance_type": "jupyter",
"url": "https://radeon-global.anruicloud.com/instances/u-1042-9c3f8ab1/",
"app_port": 8888,
"ssh_host": "ssh.anruicloud.com",
"ssh_port": 32014,
"ssh_username": "root",
"ssh_command": "ssh root@ssh.anruicloud.com -p 32014",
"api_base_url": null,
"api_key": null,
"api_model": null
}
FieldDescription
statusnot_found, allocating, loading, initializing, pending, jupyter_starting, running, ready, failed, or unknown.
readytrue only when the instance is fully usable. Gate on this, not on status.
messageHuman-readable progress or failure text.
instance_idIdentifier, of the form u-<user>-<hash>. Appears in URLs.
urlWhere to open the instance in a browser. Requires a session cookie.
phase, reason, detailLower-level scheduling state. Useful when a launch is stuck.
ssh_host, ssh_port, ssh_username, ssh_commandPopulated once the container is running, if SSH was enabled on the template.
api_base_url, api_key, api_modelPopulated only for vllm and sglang instances that are ready. This is where a dedicated endpoint URL comes from.

Poll every few seconds. A cold start pulling a large image, or a vLLM instance downloading weights, can take several minutes.

DELETE /api/notebook/current Session or API key
{
"success": true,
"message": "Instance destroyed",
"destroyed_count": 1
}

Returns success: false with "No active instance found" if there was nothing to destroy — this is not an error, and calling it twice is safe.

Data is deleted with the instance unless the template used persistent storage.

import time, requests
BASE = "https://radeon-global.anruicloud.com"
H = {"Authorization": f"Bearer {KEY}"}
requests.post(f"{BASE}/api/notebook/request", headers=H,
json={"instance_type": "jupyter", "gpu_count": 1}).raise_for_status()
while True:
s = requests.get(f"{BASE}/api/notebook/status", headers=H).json()
if s["ready"]:
print("ready:", s["url"])
break
if s["status"] == "failed":
raise RuntimeError(s.get("message", "launch failed"))
print(s["status"], s.get("message", ""))
time.sleep(5)

Always destroy in a finally block. An instance left running by a crashed script keeps spending credits.