跳转到内容
EN

更新电脑

先调用「创建计算机」,用返回的计算机 ID 替换 cmp_123。

POST/agent/v1/computers/{computer_id}● 支持

请求参数

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

  • namestring可选

    New display name, 1 to 255 characters after trimming. Omit to keep the current name.

  • environment_idstring可选

    Environment recipe the computer declares (agent.environments.list or agent.environments.create, or a built-in id). A string sets the declaration and is checked as in computers.create: an unknown, foreign or archived environment is refused. null removes the declaration. Omit to leave it unchanged. Only the record changes: the machine is not touched or restarted, so the new declaration applies from the computer's next start; restart the computer once to apply it at once.

返回

200

Praxis 超集:MA 只有会话级临时容器与 memory_stores,没有可长期存续、可浏览的整台电脑。归档后文件仍可读,但不能用于新会话。environment_id 是可空配方引用;电脑在首次使用时启动,sandbox_id 为 SDK 可用的公开 ID。分页包含归档电脑。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

请求示例

curl
# 先调用「创建计算机」,用返回的计算机 ID 替换 cmp_123。
curl https://api.deepraxis.com/agent/v1/computers/cmp_123 \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"updated-computer"}'
Python
# 先调用「创建计算机」,用返回的计算机 ID 替换 cmp_123。
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
    f"{opts['base_url']}/v1/computers/cmp_123",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
    json={"name":"updated-computer"},
)
print(resp.status_code, resp.json())
TypeScript
// 先调用「创建计算机」,用返回的计算机 ID 替换 cmp_123。
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/computers/cmp_123`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({"name":"updated-computer"}),
});
console.log(resp.status, await resp.json());

响应示例 200

{
  "type": "computer",
  "id": "cmp_c4572b7a66114164a0341fe8680360a5",
  "name": "updated-computer",
  "environment_id": null,
  "status": "active",
  "created_at": "2026-10-23T21:19:29.013Z",
  "updated_at": "2026-10-23T21:19:29.305Z",
  "archived_at": null,
  "sandbox_id": null,
  "machine_state": "not_started"
}

响应

HTTP 200

Computer result

application/json

名称 类型 说明
type string Always computer. A computer.
id string Computer id (cmp_...), the computer_id of computer calls.
name string Display name of the computer, 1 to 255 characters.
sandbox_id string | null Public id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
machine_state string not_started means the machine has not been created; first use provisions it. provisioned means a machine has been created, whether running or paused.
environment_id string | null Environment recipe the computer was created with; null when none.
status string active computers can be used by new sessions; archived ones keep their files readable but cannot start new sessions.
created_at string RFC 3339 time at which the computer was created.
updated_at string RFC 3339 time at which the computer was last modified.
archived_at string | null RFC 3339 time at which the computer was archived; null while active.