跳转到内容
EN

运行部署

POST/agent/v1/deployments/{deployment_id}/run● 支持

请求参数

  • deployment_idstring必填

    path: Deployment id (depl_...), returned by deployments.create or deployments.list.

返回

200

支持手动运行与 cron 调度,使用固定智能体版本创建会话;创建失败记录错误并自动暂停,恢复后继续调度。错过多个时间点只补跑一次。运行列表支持部署、错误、触发类型、时间范围过滤及游标翻页。

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

请求示例

curl
curl -X POST https://api.deepraxis.com/agent/v1/deployments/depl_123/run \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
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/deployments/depl_123/run",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

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

响应示例 200

{
  "id": "drun_7c80cb5b32314569ba2827804ad4ab5f",
  "type": "deployment_run",
  "agent": {
    "type": "agent",
    "id": "agent_ec9fa4f9-2f07-4f50-a61c-c25a7951b3b9",
    "version": 1
  },
  "created_at": "2026-10-22T15:25:48.204Z",
  "deployment_id": "depl_0948554251a246cfa95ffe8ca529cbb6",
  "trigger_context": {
    "type": "manual"
  },
  "session_id": "sesn_5b4d94bd9c37441fb56a2bed89742c59",
  "error": null
}

响应

HTTP 200

Successful response

application/json

名称 类型 说明
id string Unique identifier for this run (drun_...).
agent object A resolved agent reference with a concrete version.
agent.id string Agent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.type string Always agent. A roster member that refers to an agent by id and pinned version.
agent.version number The latest saved version of the agent, the editable head; it differs from active_version after a save with apply false. Starts at 1 and increments each time the agent is modified.
created_at string A timestamp in RFC 3339 format
deployment_id string ID of the deployment that produced this run.
error null | object Why the run failed to create a session. The type identifies the failure; message is human-readable detail.
error.message string Human-readable error description.
error.type string Always environment_archived_error. The selected environment was archived. / Always agent_archived_error. The referenced agent was archived. / Always environment_not_found_error. The selected environment could not be found. / Always vault_not_found_error. A referenced credential vault could not be found. / Always vault_archived_error. A referenced credential vault was archived. / Always file_not_found_error. A referenced file could not be found. / Always memory_store_archived_error. A referenced memory store was archived. / Always skill_not_found_error. A referenced skill could not be found. / Always session_resource_not_found_error. A referenced session resource could not be found. / Always workspace_archived_error. The deployment workspace was archived. / Always organization_disabled_error. The owning organization was disabled. / Always session_rate_limited_error. Session creation exceeded the rate limit. / Always session_creation_rejected_error. Session creation was rejected because its parameters were invalid. / Always unknown_error. An unclassified server error. / Always self_hosted_resources_unsupported_error. The selected self-hosted environment does not support these resources. / Always mcp_egress_blocked_error. The environment network policy blocks a configured MCP server.
session_id null | string Populated on success. Null on creation failure. Exactly one of session_id or error is non-null.
trigger_context object Describes what triggered a deployment run, with trigger-specific metadata.
trigger_context.scheduled_at string A timestamp in RFC 3339 format
trigger_context.type string Always schedule. The cron schedule triggered this run at scheduled_at. / Always manual. An explicit request triggered this run or paused this deployment.
type string Always deployment_run. The result of one manual or scheduled deployment trigger.

运行示例前

先创建部署,用返回的 ID 替换 depl_123。部署运行 ID drun_123 取自运行部署的响应。取消暂停前先暂停部署;测试结束后等待生成的会话空闲并删除会话,再归档部署、环境和智能体。