Prerequisites
- Python
3.11or newer - Hermes Agent with plugin support
- A Twexapi API key from the dashboard
hermes-xapi toolset to appear.
Install
Use Hermes’ plugin installer for the public GitHub repo:TWEXAPI_KEY during an interactive install and stores it in ~/.hermes/.env. Non-interactive installs skip the prompt. Set the key in the process environment or ~/.hermes/.env before calling xapi_read.
Install the published PyPI package directly into the Hermes Python environment when you manage package installation yourself:
pip, this path is also valid:
0.1.6. The plugin name is hermes-xapi, and the Python entry point is hermes-xapi = hermes_xapi.
Configure
Set your Twexapi API key before starting Hermes:~/.hermes/.env:
HERMES_XAPI_ENABLE_ACTIONS=false for unattended sessions. Enable actions only for workflows with an explicit approval step:
~/.hermes/.env, run /reload in an interactive CLI session, or restart gateway and cron sessions before calling xapi_read.
Tools
Start with
xapi_explore so the agent can discover the right method, path, parameters, and response shape before it calls an endpoint.
Workflow handoffs
Usexapi_explore first, then choose xapi_read for public reads or xapi_action for approved jobs that create or change state.
Tweet search read
Usexapi_read with /twitter/advanced_search or another catalog-listed search endpoint. Return tweet IDs, text, author usernames, timestamps, engagement metrics, has_more, and next_cursor when present.
Trend research
Usexapi_explore to find trending routes, then call xapi_read for country, topic, content, or trend endpoints.
Follower export
Usexapi_explore to find follower endpoints. Use xapi_read for bounded reads and xapi_action only when the catalog marks the route as private, paid-bulk, or action-like.
Controlled write action
Usexapi_action only after approval. Keep action tools disabled in unattended sessions.
Runtime diagnostics
For scriptable checks, usehermes tools list. Bare hermes tools opens the interactive tool UI and requires a TTY.
xapi_explorecan inspect catalog endpoints without an API key.- Without
TWEXAPI_KEY, a non-mutating Hermes probe exposesxapi_exploreonly. - After
TWEXAPI_KEYis configured and the CLI is reloaded, or the gateway or cron process is restarted,xapi_readcan read/twitter/elonmusk/about. xapi_actionstays hidden or disabled unlessHERMES_XAPI_ENABLE_ACTIONS=true./xstatusand/xtrendsappear in the Hermes plugin command registry.
/xstatus as an interactive slash command. Verify slash commands in an active CLI, TUI, Desktop, or gateway session, and use hermes -z for tool-call probes.
Non-interactive installs cannot prompt for credentials; set TWEXAPI_KEY in the process environment or ~/.hermes/.env.
Slash commands
Safety model
Hermes XAPI reads auth from environment variables and injects it at request time. The model does not receive the API key as a tool argument. The plugin blocks cookie/token helper routes, engagement-purchase routes, auto-cookie posting, profile mutation, list creation, and sentiment routes from the agent catalog. Private reads, paid-bulk endpoints, and write-like endpoints go throughxapi_action, which stays hidden unless HERMES_XAPI_ENABLE_ACTIONS=true.
For unattended jobs, keep action tools disabled and use only xapi_explore plus xapi_read.
API coverage
Hermes XAPI includes 76 agent-callable Twexapi endpoints generated from the OpenAPI contract.Local development
For local plugin development, regenerate the bundled catalog from the Twexapi OpenAPI contract:hermes-xapi repository after the Twexapi OpenAPI file changes.
Verify
After installing, enabling, and settingTWEXAPI_KEY, run:
xapi_action.
Troubleshooting
Relationship to XApiClaw
XApiClaw is the OpenClaw-native npm plugin. Hermes XAPI is the Hermes-native Python plugin. Both use the same Twexapi API contract and expose agent-safe catalog discovery before live endpoint calls.References
- Hermes XAPI GitHub repo
- Hermes XAPI on PyPI
- Hermes Agent
- API Reference in the sidebar
- MCP Server