Hello,
The Wazuh API has no concept of OpenSearch indices. When you paste a POST /wazuh-alerts-4.x-*/_search query into the Wazuh Dev Tools, it tries to send that to localhost:55000, where the Wazuh manager has no idea what to do with it.
The right place for index aggregation queries is to use the Wazuh indexer API from the Wazuh dashboard and navigate to Index Management > Dev Tools. That console posts directly to port 9200 (the OpenSearch/Wazuh Indexer API), and is equivalent to the OpenSearch Dev Tools console.
Wazuh stores triggered alerts in the wazuh-alerts* index in the Wazuh indexer. You can use the Wazuh indexer API to query the alerts via the _search endpoint to search through all alerts in the index and aggregate fields.
Please let me know if you require further clarification on this.