What engineers usually see
- •Stream starts successfully and returns some chunks
- •Suddenly stops mid-sentence or mid-thought
- •No error or completion signal sent
- •Client receives incomplete response without knowing it
Why this is hard to debug
Here's the annoying part: partial responses look totally normal in your logs. Without receipts showing expected vs actual tokens or completion status, you can't spot truncated streams. This leads to silent data quality issues that nobody notices until way later.
Minimal repro
const response = await fetch('https://aibadgr.com/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_OPENAI_KEY'
},
body: JSON.stringify({
model: 'gpt-4o-mini',
messages: [{role: 'user', content: 'Long explanation'}],
stream: true
})
});
const reader = response.body.getReader();
while (true) {
const {done, value} = await reader.read();
if (done) break;
console.log(new TextDecoder().decode(value));
}This request routes through AI Badgr and returns a stable request ID that links to an execution record.
Note: AI Badgr is OpenAI-compatible and works as a drop-in proxy. No SDK changes required — only the base_url changes.
What a per-request execution record makes visible
- Expected vs actual token count
- Stream completion status (finished/stopped/error)
- Finish reason from provider
- Total chunks vs expected chunks
- Timing of unexpected stream termination
Run 1 request → get receipt
Change your base URL to https://aibadgr.com/v1 and run your request.
The response includes an X-Badgr-Request-Id header that links to a receipt showing latency, retries, tokens, cost, and failure stage for that specific execution.
Not the engineer?
Share this page with your dev and ask them to run one request through AI Badgr. That's all that's needed to get the receipt.
This kind of thing only makes sense when you can actually see what happened to a single request from start to finish, instead of trying to piece it together from scattered logs.