This page describes features extending the AI Gateway, which provides a unified API for accessing multiple AI providers. To learn more, see AI Gateway.
Contacts are orq.ai entities used to track project expenses, token usage, to learn more, see Contact Tracking.
Quick Start
Configuration
| Parameter | Type | Required | Description | 
|---|---|---|---|
| id | string | Yes | Unique contact identifier | 
| display_name | string | No | Human-readable contact name | 
| email | string | No | Contact email address | 
| metadata | object | No | Custom key-value pairs for contact data | 
| logo_url | string | No | URL to contact’s profile image | 
| tags | string[] | No | Classification tags for contact segmentation | 
Use Cases
| Scenario | Contact 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 Contact Resolution
Batch Contact Processing
Contact Analytics
Usage Tracking
Personalization Context
Performance Optimization
Contact Data Caching
Metadata Optimization
Troubleshooting
| Issue | Cause | Solution | 
|---|---|---|
| Contact not appearing in analytics | Missing or invalid contact ID | Ensure contact.id is provided and unique | 
| Metadata not updating | Contact cache not refreshed | Clear contact cache or reduce TTL | 
| Performance degradation | Too much metadata per request | Limit metadata to essential fields only | 
| Duplicate contacts | Inconsistent ID format | Standardize contact ID generation | 
Validation Examples
Best Practices
- Consistent IDs: Use predictable contact 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 contact data handling meets privacy requirements
- Performance: Cache contact profiles to reduce database lookups
- Validation: Always validate contact data before sending requests
Limitations
| Limitation | Description | Workaround | 
|---|---|---|
| Contact 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 contact | Use hierarchical tagging strategy | 
| Email Validation | Basic format validation only | Implement additional validation client-side | 
| Data Persistence | Contact data not stored permanently | Maintain contact profiles in your system |