Overview
Visca AI Gateway allows you to attach custom metadata to every API request, enabling detailed tracking, analytics, and debugging across your entire AI infrastructure.Request Tracking
Track requests with custom identifiers and user information
Cost Attribution
Attribute costs to specific users, teams, or projects
Usage Analytics
Analyze usage patterns by any custom dimension
Debugging
Debug issues with detailed request context
Adding Metadata
Attach metadata to any request using themetadata field:
Metadata Fields
Identifier for the end user making the request
Session or conversation identifier
Environment (production, staging, development, etc.)
Feature or product area generating the request
Application or API version
Organization or tenant identifier for multi-tenant apps
Team or department identifier
Any additional custom fields specific to your use case
Querying by Metadata
Retrieve analytics filtered by metadata:Use Cases
- Multi-Tenant SaaS
- A/B Testing
- Internal Tools
- Customer Support
Analytics Dashboard
View real-time analytics filtered by metadata in the dashboard:1
Navigate to Analytics
Go to the Analytics section in your dashboard
2
Select Metadata Dimension
Choose which metadata field to filter or group by
3
Apply Filters
Add multiple filters to drill down into specific segments
4
Export Data
Export filtered data as CSV or JSON for further analysis
Best Practices
Use Consistent Naming
Use Consistent Naming
- Use snake_case for field names - Keep field names short but descriptive - Document your metadata schema for your team - Avoid spaces and special characters in field names
Balance Detail and Performance
Balance Detail and Performance
- Include essential tracking information only - Avoid deeply nested objects
- Keep metadata payload under 1KB - Don’t include sensitive information (passwords, tokens, PII)
Structure for Analysis
Structure for Analysis
- Use hierarchical identifiers (org_id → team_id → user_id) - Include timestamps if tracking sessions - Add version numbers to track changes over time - Use standardized values for categorical fields
Security Considerations
Security Considerations
- Never include API keys or secrets in metadata - Hash or encrypt sensitive identifiers if necessary - Follow GDPR/privacy regulations for user data - Use organization IDs instead of user names
Metadata Retention
Metadata is retained for 90 days on all plans. Enterprise plans can configure
custom retention periods up to 2 years.
Limits
Maximum number of metadata fields per request
Maximum length of metadata field names
Maximum length of metadata field values
Maximum total size of metadata payload