Skip to main content
Standalone, runnable examples for teams building on the OpenHands API with OpenHands Cloud or OpenHands Enterprise. Each page is generated from an example in OpenHands/enterprise-cookbook, where you will find the full source.

Conversation monitoring & reacting

Observe conversations and react to their state.

Conversation Metrics

Retrieve cost and token usage metrics for conversations via CLI tool.

Conversation Tags

Attach key-value metadata to a conversation with tags and read it back from AppConversation.tags.

Finish Callback

Notify an external URL when a conversation finishes using a Stop hook.

React to State WebSocket

React to conversation execution_status changes over WebSocket instead of polling.

Server Info Idle

Poll the idle_time endpoint to detect when a workspace has gone quiet.

Watch Terminal State

Detect confirmed terminal execution_status over WebSocket with proper event handling.

Guardrails

Constrain what the agent can do with hooks.

Command blacklist

Block known-dangerous shell commands with a PreToolUse hook bundled in a plugin. Everything not on the blocklist runs normally.