Skip to content
中文

Delete Session

DELETE/anthropic/v1/sessions/{session_id}● Supported

Official Claude documentation ↗

Request parameters

  • session_idstringrequired

    path: Session ID (path or query parameter).

Returns

501

Deletes an idle or terminated session and its event history after saving a deletion snapshot. The response matches the official shape: 200 with {id, type:"session_deleted"}. A running session returns 409 INVALID_STATE; interrupt it or wait until it ends first. After deletion, retrieval and event listing return 404 and lists omit the session; deleting an already-deleted or unknown session returns 404.

Errors follow the Claude Managed Agents format — see error codes

Request

curl
curl -X DELETE https://api.deepraxis.com/anthropic/v1/sessions/sample_id_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.delete("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.delete("sample_id_123");
console.log(result);

Response 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}); see the docs for the supported subset."
  },
  "request_id": "47063ee6-ba7d-4481-a9ae-a2e93d04e2a7"
}

Response

HTTP 200

Successful response

application/json

Name Type Description
id string
type string