# Chat Completions debug fixtures v1

Small, synthetic examples for testing a parser or learning to inspect an OpenAI-compatible Chat Completions response. Every value is handwritten. No API key, user data, provider call, live response, timing, usage measurement, or model benchmark is included.

Open the files as text. The `.sse` files are event-stream bodies: keep the blank lines and final line ending intact when copying. No HTTP headers are included. For an error stream, the README states the assumed HTTP status separately. In the local inspector, use `name,count` as the required-field checklist when checking `response-stop-complete.json`, `response-length-valid-but-incomplete.json`, or `response-missing-field.json`.

| File | Inspector result | Expected interpretation |
| --- | --- | --- |
| `response-stop-complete.json` | JSON parses and the API reports stop | `finish_reason: stop`; assistant content parses as JSON and contains `name` and `count`. A syntax check does not verify factual correctness. |
| `response-length-valid-but-incomplete.json` | The response reached its output limit | Content parses, but `finish_reason: length` means the response is still incomplete. Do not accept it as complete. |
| `response-missing-field.json` | JSON parses, but requested fields are missing | Content parses and reports `stop`, but a `name,count` checklist finds `count` absent. This alone does not prove truncation. |
| `truncated-string.json` | Output limit reached; JSON string is unfinished | `finish_reason: length`; the exact checker output is “Output limit reached; JSON string is unfinished.” The text ends inside a quoted string, so it is incomplete, not a normal stop. The checker preserves the exact text and does not strip the prefix or repair the JSON. |
| `response-tool-call.json` | This response requests a tool | `finish_reason: tool_calls` and empty assistant content are a tool request, not a final JSON answer. The example function must not be executed. |
| `content-filter.json` | Content was filtered | Empty assistant content with `finish_reason: content_filter` is a filtering result, not a token-limit diagnosis. Raising `max_tokens` is not the fix. |
| `stream-stop-complete.sse` | JSON parses and the API reports stop | Choice `index: 0` deltas assemble to JSON; a terminal `stop` and `[DONE]` are present. |
| `usage-only.sse` | JSON parses and the API reports stop | A final `choices: []` usage frame before `[DONE]` adds no text and does not make a completed stream fail or become incomplete. |
| `stream-missing-terminal-markers.sse` | Stream capture is incomplete | The copied events contain parseable JSON, but no finish reason or `[DONE]`; completion is unconfirmed. |
| `stream-unfinished-final-event.sse` | Stream capture is incomplete | The final `data:` event lacks its terminating blank line and must not be assembled as a complete event. |
| `stream-midstream-error.sse` | The stream cannot be validated | An OpenRouter-style chunk carries an error and `finish_reason: error` after HTTP 200 has begun; the stream still failed. |

Run the [11-case browser self-test](https://chinagenai.com/downloads/chat-completions-debug-fixtures-v1/selftest) to compare the actual inspector output with each row in this README. A failed case shows its expected and actual result.

The OpenAI Chat Completions and SSE behaviors in this fixture pack were checked against official references on 20 October 2026: [`text/event-stream` framing](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format), the [Chat Completions chunk shape](https://developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events#chat.completion.chunk), and [OpenRouter rate-limit errors during streaming](https://openrouter.ai/docs/api_reference/limits#handling-429-errors). The synthetic chunks include only the fields needed to test the stated behavior; they are a subset of the documented structure, not copies of official examples, and may omit optional metadata such as `created` or `model`. These fixtures do not prove that a provider currently emits every exact sequence shown. Provider-specific fields and error envelopes can differ; recheck the linked documentation before relying on a provider-specific shape.

To compare the examples with the ChinaGenAI local inspector, open <https://chinagenai.com/workbench#response-checker>. It runs in the browser and does not send these files to an API.
