跳转到内容
EN

更新部署

POST/anthropic/v1/deployments/{deployment_id}● 支持

请求参数

  • deployment_idstring必填

    path: 部署 ID(路径或查询参数)。

  • namestring可选

    Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.

  • agentstring | object可选

    要运行的智能体:智能体 ID 字符串,或对象 {type, id, version?}(见子字段);版本与覆盖规则见操作说明。

    展开子字段 (3)
    • idstring必填

      会话要运行的智能体 ID。

    • typestring必填

      引用类型:agent,或携带内联覆盖的 agent_with_overrides。

      取值 agent
    • versionnumber可选

      固定使用的智能体版本;省略取创建会话时的 active_version(不一定是最新保存版本)。

  • environment_idstring可选

    环境 ID(路径或查询参数)。

  • budgetobject可选

    A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost.

    展开子字段 (2)
    • max_list_costobject必填

      会话可达到的列表价费用上限:{amount, currency:"USD"},amount 以美元为单位,传整数或最多 2 位小数(如 "0.50"),响应固定 2 位小数(如 "20.00")。

    • typestring必填

      预算类型,恒为 limit;传 max_list_cost 等其他值返回 400。

      取值 limit
  • descriptionstring可选

    Description. Omit to preserve; send empty string or null to clear.

  • initial_eventsarray可选

    Initial events. Full replacement. Omit to preserve. Cannot be cleared. At least 1, maximum 50.

  • metadataobject可选

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.

  • resourcesarray可选

    Session resources. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 500.

  • scheduleobject可选

    5-field POSIX cron schedule. Literal wall-clock matching in the configured timezone.

    展开子字段 (3)
    • expressionstring必填

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

    • timezonestring必填

      Required. IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). Validated against the IANA timezone database.

    • typestring必填
      取值 cron
  • 更多参数 (1)
    • vault_idsarray可选

      Vault IDs. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 50.

返回

501

支持部署资源创建、读取、过滤、更新、归档、暂停与恢复,固定智能体版本并返回最多五次未来调度时间;初始事件仅 user.message,资源仅 file,支持 vault_ids,最多 50 个,必须属于本组织且未归档;Secret 以环境变量交给会话的电脑,并按 MCP 服务器地址匹配凭据。支持手动运行与 cron 调度,使用固定智能体版本创建会话;创建失败记录错误并自动暂停,恢复后继续调度。错过多个时间点只补跑一次。运行列表支持部署、错误、触发类型、时间范围过滤及游标翻页。 compat 列表跳过 computer 部署;单资源操作返回 400 并指向 /agent/v1。overrides 在读取时只投影基础引用,带 agent 的更新返回 400。

错误按 Claude Managed Agents 格式返回,参见 错误码

请求示例

curl
curl -X POST https://api.deepraxis.com/anthropic/v1/deployments/deployment_123 \
  -H "x-api-key: $PRAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01"
Python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.deepraxis.com/anthropic",
    api_key="$PRAXIS_API_KEY",
)

# 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
result = client.beta.update("deployment_123", {})
print(result)
TypeScript
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.deepraxis.com/anthropic",
  apiKey: "$PRAXIS_API_KEY",
});

// 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
const result = await client.beta.update("deployment_123", {});
console.log(result);

响应示例 501

{
  "type": "error",
  "error": {
    "type": "not_implemented_error",
    "message": "Not implemented: this Managed Agents operation is not implemented on this platform yet (POST /v1/deployments/{deployment_id}); see the docs for the supported subset."
  },
  "request_id": "36450c46-b63d-41ce-b94c-d6b54e549777"
}

响应

HTTP 200

Successful response

application/json

名称 类型 说明
id string Unique identifier for this deployment.
agent object A resolved agent reference with a concrete version.
agent.id string
agent.type string
agent.version number
archived_at null | string A timestamp in RFC 3339 format
created_at string A timestamp in RFC 3339 format
description null | string Description of what the deployment does.
environment_id string ID of the environment where sessions run.
initial_events array<object> Events sent to each session immediately after creation.
initial_events[].content array<object> Array of content blocks for the user message. / System content blocks to append. Text-only.
initial_events[].type string
initial_events[].description string What the agent should produce. This is the task specification.
initial_events[].rubric object Rubric for grading the quality of an outcome.
initial_events[].max_iterations null | number Eval→revision cycles before giving up. Default 3, max 20.
metadata object Arbitrary key-value metadata. Maximum 16 pairs.
name string Human-readable name.
paused_reason null | object Why a deployment is paused. Non-null exactly when status is paused.
paused_reason.type string
paused_reason.error object The error that triggered an auto-pause. Matches the failed run's error.type.
resources array<object> Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.
resources[].type string
resources[].url string Github URL of the repository
resources[].checkout null | object Branch or commit to check out. Defaults to the repository's default branch.
resources[].mount_path null | string Mount path in the container. Defaults to /workspace/<repo-name>. / Mount path in the container. Defaults to /mnt/session/uploads/<file_id>.
resources[].file_id string ID of a previously uploaded file.
resources[].memory_store_id string The memory store ID (memstore_...). Must belong to the caller's organization and workspace.
resources[].access null | string Access mode for an attached memory store.
resources[].instructions null | string Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
schedule null | object 5-field POSIX cron schedule with computed runtime timestamps.
schedule.expression string 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).
schedule.timezone string IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").
schedule.type string
schedule.last_run_at null | string A timestamp in RFC 3339 format
schedule.upcoming_runs_at array<string> Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (archived_at set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.
status string Lifecycle status of a deployment.
type string
updated_at string A timestamp in RFC 3339 format
vault_ids array<string> Vault IDs supplying stored credentials for sessions created from this deployment.
budget null | object A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost.
budget.max_list_cost object A monetary amount in a specific currency.
budget.type string