Skip to content
Start here

Logs

List Gateway Logs
ai_gateway.logs.list(strgateway_id, LogListParams**kwargs) -> SyncV4PagePaginationArray[LogListResponse]
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Get Gateway Log Detail
ai_gateway.logs.get(strid, LogGetParams**kwargs) -> LogGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}
Patch Gateway Log
ai_gateway.logs.edit(strid, LogEditParams**kwargs) -> object
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}
Delete Gateway Logs
ai_gateway.logs.delete(strgateway_id, LogDeleteParams**kwargs) -> LogDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Get Gateway Log Request
ai_gateway.logs.request(strid, LogRequestParams**kwargs) -> object
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request
Get Gateway Log Response
ai_gateway.logs.response(strid, LogResponseParams**kwargs) -> object
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response
ModelsExpand Collapse
class LogListResponse: …
id: str
cached: bool
created_at: datetime
formatdate-time
duration: int
model: str
path: str
provider: str
success: bool
tokens_in: Optional[int]
tokens_out: Optional[int]
collect_log_payload: Optional[bool]

Whether the request and response bodies were eligible to be stored. False when the request sent cf-aig-collect-log-payload: false, logging was off, or the gateway does not store bodies for the request. Null for logs written before this field existed.

cost: Optional[float]
custom_cost: Optional[bool]
metadata: Optional[str]
model_type: Optional[str]
request_content_type: Optional[str]
request_type: Optional[str]
response_content_type: Optional[str]
status_code: Optional[int]
step: Optional[int]
class LogGetResponse: …
id: str
cached: bool
created_at: datetime
formatdate-time
duration: int
model: str
path: str
provider: str
success: bool
tokens_in: Optional[int]
tokens_out: Optional[int]
collect_log_payload: Optional[bool]

Whether the request and response bodies were eligible to be stored. False when the request sent cf-aig-collect-log-payload: false, logging was off, or the gateway does not store bodies for the request. Null for logs written before this field existed.

cost: Optional[float]
custom_cost: Optional[bool]
metadata: Optional[str]
model_type: Optional[str]
request_content_type: Optional[str]
request_head: Optional[str]
request_head_complete: Optional[bool]
request_size: Optional[int]
request_type: Optional[str]
response_content_type: Optional[str]
response_head: Optional[str]
response_head_complete: Optional[bool]
response_size: Optional[int]
status_code: Optional[int]
step: Optional[int]
class LogDeleteResponse: …
success: bool