The descriptions below detail the fields available for ai_gateway_events.
Type: bool
Request cached.
Type: string
Requested endpoint.
Type: string
The AI Gateway that generated the log message.
Type: object
User defined metadata attached to the request.
Type: object
Provider-independent cost and usage metrics for the request, for example {"cost":0.0042,"durationMs":1234}.
Type: string
Model that served the request. For the model the caller asked for, refer to RequestedModel.
Type: string
Requested provider name.
Type: bool
Request rate limited.
Type: object
Encrypted Request body in the format {"type":"encrypted","data":"base64"}.
Type: string
Model name the caller requested, for example cloudflare/auto. This can differ from Model when AI Gateway routes the request to another model.
Type: object
Encrypted Response body in the format {"type":"encrypted","data":"base64"}.
Type: string
Smart routing decision ID, matching the cf-aig-routing-decision-id response header. Empty when no routing decision was made.
Type: string
Reason smart routing selected the model, matching the cf-aig-routing-reason response header. Empty when no routing decision was made.
Type: int
Response status code.
Type: int or string
Time the log event was recorded, after the request completed.
Type: string
User-Agent header sent by the client, truncated to 512 characters.