Skip to main content
Access comprehensive logs of all your API requests and swarm executions. The /v1/account/logs endpoint returns your completion history, newest first: each entry holds the stored response of one completion and when it was created. (The older /v1/swarm/logs path is a deprecated alias for the same endpoint.) To fetch one past result instead of the whole history, use GET /v1/job/{job_id}.
Logs are filtered to exclude any entries containing client IP addresses for privacy protection. The endpoint returns the logs of every API key on your account, including revoked keys, and nothing from other accounts.

Quick Start

Understanding Log Response

The logs endpoint returns structured information about your API usage. Each log entry is a stored record with a category (e.g. completion) and a data payload containing the completion response that was logged:
The top-level count is the exact total number of matching log entries across every API key on the account, including revoked ones. It is not len(logs): the logs array is capped at the 1000 newest entries, so count exceeds it once an account passes 1000 requests. Each entry’s api_key is redacted to its last 4 characters. The shape of data depends on what was logged: agent completions carry usage.total_cost, while swarm completions carry usage.total_cost plus a usage.billing_info breakdown, swarm_name, and execution_time. Entries containing client IP data, telemetry, and raw request inputs are excluded.

Log Analysis and Filtering

Log Export and Backup

Log Monitoring Dashboard

Privacy and Security

Data Protection

  • IP Address Filtering: All client IP addresses are automatically filtered from logs
  • PII Protection: Personal identifiable information is not logged
  • Secure Storage: Logs are stored securely with encryption at rest
  • Access Control: Only accessible with an API key on your account

Compliance

  • GDPR Compliant: Adheres to data protection regulations
  • Audit Trail: Maintains complete audit trail of API usage
  • Data Retention: Logs retained for compliance and debugging purposes
  • Access Logging: All log access is itself logged for security

Best Practices

Log Management

  1. Regular Monitoring: Check logs regularly for unusual patterns
  2. Error Analysis: Investigate error spikes promptly
  3. Cost Tracking: Monitor API costs and optimize usage
  4. Performance Analysis: Track response times and identify bottlenecks
  5. Security Monitoring: Watch for unauthorized access attempts

Data Analysis

  1. Trend Analysis: Identify usage patterns and growth trends
  2. Error Pattern Recognition: Detect recurring issues
  3. Cost Optimization: Find opportunities to reduce API costs
  4. Performance Optimization: Identify slow endpoints and optimize
  5. Capacity Planning: Plan for future usage growth

Automation

  1. Alert Setup: Set up alerts for high error rates or costs
  2. Automated Reports: Generate regular usage reports
  3. Anomaly Detection: Automatically detect unusual patterns
  4. Cost Controls: Implement automatic cost limiting
  5. Performance Monitoring: Continuous performance tracking

Troubleshooting

Common Issues

Empty Logs Response
Missing Log Entries
  • Logs are filtered for privacy (no IP addresses)
  • Some requests may not be logged due to high volume
  • Check your API key permissions
Performance Issues
Cost Analysis