insert_log
Log AI request and response data into Portkey for tracking and analytics. Capture details like endpoints, providers, headers, bodies, and response metrics to monitor API interactions.
Instructions
Insert a log entry (or multiple entries) into Portkey for tracking AI requests and responses
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_url | No | The endpoint URL being called | |
| request_provider | No | AI provider name (e.g., 'openai', 'anthropic') | |
| request_method | No | HTTP method used (defaults to 'post') | post |
| request_headers | No | Request headers as key-value pairs | |
| request_body | No | Request payload/body | |
| response_status | No | HTTP response status code (defaults to 200) | |
| response_headers | No | Response headers as key-value pairs | |
| response_body | No | Response payload/body | |
| response_time | No | Response latency in milliseconds | |
| streaming_mode | No | Whether the response was streamed | |
| metadata_organization | No | Organization identifier for the log | |
| metadata_user | No | User identifier for the log | |
| metadata_trace_id | No | Trace ID for distributed tracing | |
| metadata_span_id | No | Span ID for tracing | |
| metadata_span_name | No | Span name for tracing | |
| metadata_parent_span_id | No | Parent span ID for tracing | |
| metadata_custom | No | Additional custom metadata key-value pairs |