All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

AI Gateway - Log AI Gateway request metadata without storing payloads

3mo ago

Source

CloudflareAI Gateway - Log AI Gateway request metadata without storing payloadscloudflare.com
Snippet from the RSS feed
AI Gateway now supports the cf-aig-collect-log-payload header, which controls whether request and response bodies are stored in logs. By default, this header is set to true and payloads are stored alongside metadata. Set this header to false to skip payload storage while still logging metadata such as token counts, model, provider, status code, cost, and duration. This is useful when you need usage metrics but do not want to persist sensitive prompt or response data. curl $ACCOUNT_ID / $GATEWAY_ID /openai/chat/completions \ --header "Authorization: Bearer $TOKEN " \ --header 'Content-Type: application/json' \ --header 'cf-aig-collect-log-payload: false' \ --data '{ "model": "gpt-4o-mini", "messages": [ { "role": "user", "content": "What is the email address and phone number of user123?" } ] }' For more information, refer to Logging .

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.