Agent Events API
Submit telemetry events via HTTP POST to track agent usage.Endpoint
Request Body
Send either a single event object or an array of events (max 100).Single Event
Batch Events
Event Fields
| Field | Type | Required | Description |
|---|---|---|---|
agent | string | ✓ | Agent ID (alphanumeric, optional A-/S- prefix) |
bid | integer | ✓ | Usage cost in micro-cents (1000 = $0.01) |
time | integer | ✓ | Timestamp in epoch milliseconds UTC |
data | object | ✓ | Metadata payload (max 1KB, flat key-value pairs) |
user | string | User ULID (26 chars, auto-filled from Bearer token) | |
mult | integer | Multiplier for future pricing (default: 0) |
Response Formats
All Accepted (202)
Partially Accepted (207)
All Rejected (400)
Authentication Error (401)
Error Codes
| Code | Description |
|---|---|
unknown_agent | Agent ID not registered in system |
invalid_user | User ULID invalid or missing |
missing_required_field | Required field absent from request |
bad_data_size | Data payload exceeds 1KB limit |
validation_error | Schema validation failed |
Examples
cURL
Python
JavaScript
Rate Limits
- Batch size: Maximum 100 events per request
- Payload size: Maximum 1KB per event data field
- Frequency: No explicit rate limits, but use batching for high volumes
Authentication
Bearer tokens are optional. If provided:- Token must be valid and active
- User field auto-filled from token if missing
- Invalid tokens return 401 error
Best Practices
- Batch events when sending multiple events
- Include timestamps - use current epoch milliseconds
- Keep data small - under 1KB per event
- Use descriptive agent IDs - helps with analytics
- Handle errors gracefully - check response status
- Retry on network failures - implement exponential backoff