Logging

Logs offer insights into API usage.

Your logs dashboard displays detailed request logs, including user prompts, model responses, provider details, timestamps, request status, token usage, cost, and duration.

Configuration

By default, logging is enabled for all API requests and captures detailed logs. Use the x-glama-capture-payload header to override these settings per request.

To ensure privacy or compliance, you can disable log collection in your settings. Log preferences can also be modified on a per-request basis.

Per-API Key Log Configuration

To update the default log settings:

Per-Request Logging

Use the x-glama-capture-payload header to bypass the default log settings. If logging is enabled at the gateway level, this header excludes the specific request log. If logging is disabled, the header saves the request log.

Example: Use x-glama-capture-payload to prevent saving a log for a request.

curl -X https://glama.ai/api/gateway/openai/v1/chat/completions \ -H 'Content-Type: application/json' \ -H 'X-Glama-Log-Payload: false' \ -d '{ "model": "gpt-4", "messages": [ {"role": "user", "content": "Hello, World!"} ] }'