- Per-user cost attribution and cross-charging to tenants or customers.
- Enforcing per-user rate limits to prevent abuse.
- Identifying which users generate the most load or cost.
- Linking LLM usage to your existing user analytics for cohort analysis.
Associate requests with Identity identifiers for user-level observability and analytics.
Identities are orq.ai entities used to track project expenses, token usage, to learn more, see Identity Tracking.
Quick Start
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identity identifier |
display_name | string | No | Human-readable identity name |
email | string | No | Identity email address |
metadata | object[] | No | Array of objects with custom key-value pairs |
logo_url | string | No | URL to identity’s profile image |
tags | string[] | No | Classification tags for identity segmentation |
Use Cases
| Scenario | Identity ID Strategy | Metadata Example |
|---|---|---|
| User Analytics | user-{userId} | [{"plan": "pro", "usage_tier": "high"}] |
| Customer Support | support-{ticketId} | [{"priority": "high", "issue_type": "billing"}] |
| A/B Testing | test-{userId}-{variant} | [{"experiment": "pricing-v2", "variant": "b"}] |
| Multi-tenant | tenant-{orgId}-{userId} | [{"org": "acme-corp", "role": "admin"}] |
Implementation Examples
User Session Tracking
Support Ticket Integration
Multi-Language Support
Advanced Patterns
Dynamic Identity Resolution
Batch Identity Processing
Identity Analytics
Usage Tracking
Personalization Context
Performance Optimization
Identity Data Caching
Metadata Optimization
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Identity not appearing in analytics | Missing or invalid identity ID | Ensure identity.id is provided and unique |
| Metadata not updating | Identity cache not refreshed | Clear identity cache or reduce TTL |
| Performance degradation | Too much metadata per request | Limit metadata to essential fields only |
| Duplicate identities | Inconsistent ID format | Standardize identity ID generation |
Validation Examples
Best Practices
- Consistent IDs: Use predictable identity ID patterns across your application
- Essential Metadata: Include only relevant metadata to minimize payload size
- Tag Strategy: Use tags for filtering and segmentation, not detailed data
- Privacy Compliance: Ensure identity data handling meets privacy requirements
- Performance: Cache identity profiles to reduce database lookups
- Validation: Always validate identity data before sending requests
Limitations
| Limitation | Description | Workaround |
|---|---|---|
| Identity ID Length | Maximum 255 characters | Use shorter, meaningful identifiers |
| Metadata Size | Recommended maximum 20 fields | Group related data into nested objects |
| Tag Count | Maximum 10 tags per identity | Use hierarchical tagging strategy |
| Email Validation | Basic format validation only | Implement additional validation client-side |
| Data Persistence | Identity data not stored permanently | Maintain identity profiles in your system |