Get usage statistics for a specific rule, including attachment counts by entity type.

## Path parameters

**`org_id`** string required

The organization ID

**`rule_id`** string required

The rule ID

## Returns

Returns usage statistics including attachment counts by entity type.

Request

```bash cURL
curl https://api.aitronos.com/v1/organizations/org_123abc/rules/rule_a1b2c3d4/statistics/usage \
  -H "X-API-Key: $FREDDY_API_KEY"
```


```python Python SDK
from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")

stats = client.rule_statistics.get_usage_statistics("org_abc123", "rule_abc123")
print(f"Total attachments: {stats.data.total_attachments}")
```


```python Python
import requests
import os

api_key = os.environ["FREDDY_API_KEY"]

response = requests.get(
    "https://api.aitronos.com/v1/organizations/org_123abc/rules/rule_a1b2c3d4/statistics/usage",
    headers={"X-API-Key": api_key},
)
print(response.json())
```


```javascript JavaScript
const response = await fetch(
  'https://api.aitronos.com/v1/organizations/org_123abc/rules/rule_a1b2c3d4/statistics/usage',
  { headers: { 'X-API-Key': process.env.FREDDY_API_KEY } }
);
console.log(await response.json());
```

Response

```json
{
  "success": true,
  "data": {
    "rule_id": "rule_a1b2c3d4",
    "total_attachments": 15,
    "attachments_by_type": {
      "assistant": 8,
      "user": 4,
      "model": 2,
      "vector_store": 1,
      "organization": 0
    },
    "active_attachments": 12,
    "inactive_attachments": 3
  }
}
```

## Related Resources

- [Create Rule](/docs/api-reference/rules/create)
- [List Rules](/docs/api-reference/rules/list)