Log the Request ID
Every response carriesX-Request-ID: the one you sent (up to 128 characters, sanitized) or a fresh one (16 random bytes, hex). It correlates a user report, your application log, and a gateway-side lookup without storing content. Set your own on the way in so the IDs match end to end.
Metadata, Not Content
Most production issues are debuggable from:- The request ID.
- The model ID requested.
- HTTP status and
finish_reason(stop,length,tool_calls,error). - Token counts from
usage, latency, whether streaming was used. - The error
codeandmessagefrom the envelope.
Never Log the Credential
Do not log theAuthorization header or the key. Many HTTP libraries dump full headers on error; redact before anything is written. Allowlist the fields you log; a blocklist fails open. See Secure API Key Handling.
Match the Gateway
Nito stores nothing you send or receive: prompts, completions, reasoning, tool payloads, and attachment content are not persisted, and inference responses carryCache-Control: no-store. Logs that capture full content become the one place the data sits at rest. See Data Retention and Visibility.
Checklist
X-Request-IDon every call, set on the way in.- Metadata, not bodies.
Authorizationnever logged; allowlist redaction.- Content logging as a controlled exception.
Related
Request IDs
The
X-Request-ID header.Privacy Overview
The four levels.
Data Retention and Visibility
What is kept, who sees what.
Secure API Key Handling
Keys.

