Logging & Tracing
Gateway provides you with the feature to log requests/response and metrics like tokens consumed with each request.
Programatically Access Request Logs
import requests
import json
try:
response = requests.post(
"https://internal.devtest.truefoundry.tech/api/svc/v1/llm-gateway/requests",
headers = {
"Authorization": "Bearer <Paste your API key here. You can generate it from the Settings Page>"
},
json = {
"filter": {
"created_at": [
{
"key": "created_at",
"value": 1731577557568,
"operator": "LT"
},
{
"key": "created_at",
"value": 1731566757568,
"operator": "GTE"
}
]
},
"sort": [
{
"key": "created_at",
"order": "DESC"
}
],
"limit": 25,
"offset": 0
}
)
response.raise_for_status()
print(response.status_code)
print(response.json())
except requests.exceptions.HTTPError as http_error:
print("HTTP error occurred:", http_error)
curl -X 'POST' \
'https://internal.devtest.truefoundry.tech/api/svc/v1/llm-gateway/requests' \
-H 'accept: */*' \
-H 'Authorization: Bearer <Paste your API key here. You can generate it from the Settings Page>' \
-H 'Content-Type: application/json' \
-d '{
"filter": {
"created_at": [
{
"key": "created_at",
"value": 1731577557568,
"operator": "LT"
},
{
"key": "created_at",
"value": 1731566757568,
"operator": "GTE"
}
]
},
"sort": [
{
"key": "created_at",
"order": "DESC"
}
],
"limit": 25,
"offset": 0
}'
Updated about 8 hours ago
Did this page help you?