AI API receipt · BerriAI/litellm

Proxy emits a non-Responses error frame mid-stream

BerriAI/litellm#45406 · upstream bug as reported in the issue (not re-run)

✓ Badgr rejects this response

A mid-stream upstream 503 reached the client as a bare {"error": {...}} frame, not a Responses error event.

Outcome contract verdict: stream ended without a terminal [DONE] event. The attempt is recorded as failed (invalid_outcome) instead of a verified success, so it is not billed as a good answer and can fall back to another route.

What the upstream returned (replayed)

The output the bug produces, taken from the issue’s reproduction and fed to Badgr’s validators. Not a live provider call.

data: {"choices": [{"index": 0, "delta": {"content": "partial"}, "finish_reason": null}]}
data: {"error": {"message": "upstream 503", "type": "server_error"}}

Badgr receipt

Written by Badgr’s receipt ledger and read back from GET /v1/receipts/replay-litellm-45406-invalid-error-frame.

{
  "request_id": "replay-litellm-45406-invalid-error-frame",
  "status": "failed",
  "endpoint": "/v1/chat/completions",
  "stream": true,
  "failure_stage": "stream_contract",
  "error_code": "invalid_outcome",
  "error_message": "Stream did not complete a valid response: stream ended without a terminal [DONE] event",
  "retryable": true,
  "provider_mode": "replay",
  "routing_decision": "replayed_upstream_output",
  "created_at": "2026-10-09T02:14:36Z"
}

Recorded 2026-10-09 in Badgr’s local development environment. Replay cases and verdicts are pinned by backend/test_ai_api_replay_cases.py.

← All AI API receipts