Skip to content

AI Hub Configuration

Short guide to send Xianix execution metrics to 99x AI Hub via raise-events in rules.json.

You will not look up node ID or activity ID by hand. Create a webhook in AI Hub and copy the URL it gives you.

See also: Rules Configuration · Onboard a Repository


You need:

  • Access to AI Hub
  • Access to Agent Studio for your tenant (to add secrets and edit Rules)

Pick one:

  1. Open Profile settings.
  2. Create a personal access token.
  3. Name it (for example Local AIDLC script) → + Create.
  4. Copy the token once.

Create personal access token

  1. Open Team → API keys.
  2. Create a team API key.
  3. Name it (for example AIDLC pipeline) → + Create.
  4. Copy the key once.

Create team API key


  1. In AI Hub, open the node that should receive metrics (for example Review).
  2. Open the Webhooks tab.
  3. Select the Activity (for example ai-code-review).
  4. Choose auth and copy the URL AI Hub shows (your IDs will differ):
AuthURL shape
API keyhttps://ai-hub-api.99x.io/metrics/nodes/<nodeId>/node-activities/<activityId>/events
Secret in URLhttps://ai-hub-api.99x.io/metrics/nodes/<nodeId>/node-activities/<activityId>/<whs_…>/events

Examples:

# API key — send X-Api-Key header (step 1 + 3)
https://ai-hub-api.99x.io/metrics/nodes/nd_9lcgvLaCAP/node-activities/na_NfPIrObtec/events
# Secret in URL — secret is the whs_… segment; no auth header
https://ai-hub-api.99x.io/metrics/nodes/nd_9lcgvLaCAP/node-activities/na_NfPIrObtec/whs_a67b5ed1947cde1e8ef62068109f8f0bc2a95ae93bc1d20eccdb83f5ac4b8898/events
  1. Click Create webhook secret when using Secret in URL (or create/copy for API key).
  2. Copy that URL into rules.json as-is. Do not build node / activity IDs by hand.

Create webhook and copy URL


In Agent Studio → Secrets, add:

KeyValue
AIHUB-API-KEYthe personal token or team key from step 1

Add AIHUB-API-KEY secret

Skip this step only if you chose Secret in URL and the secret is already embedded in the copied URL.


On each execution that should report to AI Hub, paste the copied webhook URL into url.

Needs step 1 token + AIHUB-API-KEY secret. URL has no whs_… segment:

"raise-events": [
{
"name": "ai-hub-metrics",
"url": "https://ai-hub-api.99x.io/metrics/nodes/nd_9lcgvLaCAP/node-activities/na_NfPIrObtec/events",
"with-headers": [
{
"name": "X-Api-Key",
"value": "secrets.AIHUB-API-KEY",
"mandatory": true
}
],
"payload": [
{
"correlationId": "{{correlationId}}",
"actors": ["{{plugin-name}}"],
"dimensions": {
"tokens": "{{metrics.tokens.total}}",
"costUsd": "{{metrics.cost-usd}}",
"model": "{{metrics.model}}",
"status": "{{metrics.status}}"
}
}
]
}
]

No X-Api-Key header. URL includes the whs_… secret:

"raise-events": [
{
"name": "ai-hub-metrics",
"url": "https://ai-hub-api.99x.io/metrics/nodes/nd_9lcgvLaCAP/node-activities/na_NfPIrObtec/whs_a67b5ed1947cde1e8ef62068109f8f0bc2a95ae93bc1d20eccdb83f5ac4b8898/events",
"payload": [
{
"correlationId": "{{correlationId}}",
"actors": ["{{plugin-name}}"],
"dimensions": {
"tokens": "{{metrics.tokens.total}}",
"costUsd": "{{metrics.cost-usd}}",
"model": "{{metrics.model}}",
"status": "{{metrics.status}}"
}
}
]
}
]

Save Rules (agent scope).


  1. Trigger one matching webhook execution.
  2. Confirm an event appears on that AI Hub activity.

Events are raised after the run finishes and are best-effort (a failed POST does not fail the run).