Skip to content

Examples

Four runnable scripts shipped under examples/ in the source tree, drawn from common compliance use cases. Each reads its API key from ANTHROPIC_COMPLIANCE_ACCESS_KEY and takes simple CLI flags — run any of them with --help for the available options.

Script Use case Key type
activity_audit.py Audit user activity over a time window, optionally filtered by user or activity type. NDJSON output. Either (sk-ant-api01-... or sk-ant-admin01-...)
ediscovery_export.py Export chats org-wide (or for named users with --user), including messages, as JSON files. Compliance access (sk-ant-api01-...)
file_pull.py Download every user-uploaded file attached to a project. Streamed to disk. Compliance access (sk-ant-api01-...)
session_export.py Export Cowork / Claude Code / Claude Science session transcripts over a time window, one JSON file per session. Compliance access (sk-ant-api01-...)

The scripts are intentionally small enough to read in one sitting — treat them as the canonical examples of how to wire up each resource group.