Data Model
Documents are organized as namespace + key + JSON value, scoped to a workspace.
Each document also tracks
version (integer, auto-incremented), size_bytes, created_at, updated_at, and updated_by.
CLI
--workspace <slug> to target a specific workspace and --json for machine-readable output. List commands also support --fields <fields> for client-side JSON field filtering (implies --json).
REST API
Authentication
All endpoints requireAuthorization: Bearer <api_key> and X-Workspace-Id header (CLI sets this automatically).
Concurrency (CAS)
Reads return anETag header containing the document’s current version. To perform a compare-and-swap write, include If-Match: <version> on your PUT request. If the document has been modified since that version, the API returns 409 CONFLICT.
PATCH uses CAS internally with automatic retries.
Response Headers
Writes include storage usage headers:X-Storage-Used— current total bytes usedX-Storage-Limit— workspace tier limit (when bounded)
updated_by Field
Tracks who last modified a document:
- Agent key writes:
org-slug/agent-name@version - CLI writes:
cli - Direct API writes:
api
Python SDK
- Basic Operations
- Atomic Updates (CAS)
- Error Handling
API Reference
The SDK reads
ORCHAGENT_SERVICE_KEY or ORCHAGENT_API_KEY from environment variables automatically. In sandbox environments these are injected by the gateway — no setup needed.