Sessions
This endpoint returns session logs for requests made through AI Runtime Control, including request and response data and metadata, for debugging and audit purposes.
Data model
A session log. Other than `firewall_enabled` (always present), `firewall_*` fields are only present when AI Firewall ran on a request in this session. They're absent (not merely empty) otherwise, so their absence and an empty value mean different things.
created_at | string | The date and time the session was created, in RFC 3339 format. Required. Read-only. | |
firewall_enabled | boolean | Whether AI Firewall was enabled for this session's virtual key. Required. | |
firewall_incomplete_reason | string | Why AI Firewall inspection was incomplete, if applicable. Present only when AI Firewall ran and inspection didn't complete. | |
firewall_outcome | string | The outcome AI Firewall reached for this session. Present only when AI Firewall ran. | |
firewall_policy | string | The AI Firewall policy that was applied. Present only when AI Firewall ran. | |
firewall_stage | string | The AI Firewall stage that produced the outcome (for example, the request or response stage). Present only when AI Firewall ran. | |
id | string | The unique identifier of the session. Required. Read-only. | |
input_tokens | integer | The total input tokens consumed in this session. Required. | |
logs | array | The request and response pairs recorded for this session. Required. | |
model | string | The AI model identifier used. Required. | |
output_tokens | integer | The total output tokens generated in this session. Required. | |
primary_provider | string | The ID of the provider connection originally requested, before any failover occurred. | |
provider | string | The name of the provider connection that ultimately served the session. Required. | |
provider_connection_id | string | The ID of the provider connection that ultimately served the session. Required. | |
requests | integer | The number of requests made in this session. Required. | |
updated_at | string | The date and time the session was last updated, in RFC 3339 format. Required. Read-only. | |
violations | integer | The number of AI Firewall violations detected in this session. Required. | |
virtual_key_id | string | The ID of the virtual key used for this session. Required. | |
virtual_key_name | string | The display name of the virtual key used for this session. | |
attrs | object | Additional attributes recorded for this request/response pair. | |
request | string | The raw request data. | |
response | string | The raw response data. | |
limit | integer | The limit value used when making the request. | |
next_cursor | string | The cursor to use to request the next page of results. null when there are no more results. | |
prev_cursor | string | The cursor to use to request the previous page of results. null when there is no previous page. | |
sort | string | The sort value used when making the request. | |
total | integer | The count of results matching the request. | |
meta | object | Metadata about the request. |