跳转到内容
EN

删除会话资源

DELETE/anthropic/v1/sessions/{session_id}/resources/{resource_id}◐ 部分支持

请求参数

  • session_idstring必填

    path: 会话 ID(路径或查询参数)。

  • resource_idstring必填

    path: 路径参数:会话资源 ID。

  • session_idstring必填

    query: 会话 ID(路径或查询参数)。

返回

501

支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。

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

请求示例

curl
curl -X DELETE https://api.deepraxis.com/anthropic/v1/sessions/sample_id_123/resources/resource_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.sessions.resources.delete("resource_123", {"session_id": "sample_id_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.sessions.resources.delete("resource_123", { session_id: "sample_id_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 (DELETE /v1/sessions/{session_id}/resources/{resource_id}); see the docs for the supported subset."
  },
  "request_id": "03907541-e6ef-4327-9a16-51c307f9ca64"
}

响应

HTTP 200

Successful response

application/json

名称 类型 说明
id string
type string