AnthropicClaude 托管智能体
停止工作项
请求自托管执行器停止一条正在执行的任务。
POST
/anthropic/v1/environments/{environment_id}/work/{work_id}/stop○ 未支持请求参数
environment_idstring必填path: 环境 ID(路径或查询参数)。
work_idstring必填path: 路径参数:任务 ID。
environment_idstring必填query: 环境 ID(路径或查询参数)。
forceboolean可选If true, immediately stop work without graceful shutdown
返回
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Work identifier (e.g., 'work_...') |
| acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| created_at | string | RFC 3339 timestamp when work was created |
| data | object | The actual work to be performed (session or health check) |
| data.id | string | Session identifier (e.g., 'session_...') / Health check identifier |
| data.type | string | Type of work data |
| environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| metadata | object | User-provided metadata key-value pairs associated with this work item |
| secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| started_at | null | string | RFC 3339 timestamp when work execution started |
| state | string | Current state of the work item |
| stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| type | string | The type of object (always 'work') |