This directory contains mock API responses used by AI proxy test cases. Instead of duplicating response data in each .t file, tests reference fixture files via the X-AI-Fixture request header.
fixtures/ ├── openai/ # Standard OpenAI API responses ├── anthropic/ # Anthropic Messages API responses ├── protocol-conversion/ # Provider-specific SSE edge cases for protocol conversion ├── vertex-ai/ # Google Vertex AI responses ├── aliyun/ # Aliyun content moderation responses ├── prometheus/ # Minimal responses for metrics tests └── README.md # This file
.json)Complete JSON response bodies, exactly as returned by the provider. Supports {{model}} template — replaced at serve time with the model from the request body.
.sse)Raw Server-Sent Events text with preserved event types and ordering. Served with Content-Type: text/event-stream.
Tests point the upstream at the built-in test server (port 1980) and specify which fixture to serve via the X-AI-Fixture header:
=== TEST: Chat with OpenAI fixture --- request POST /v1/chat/completions {"model":"test","messages":[{"role":"user","content":"hello"}]} --- more_headers X-AI-Fixture: openai/chat-basic.json --- response_body_like "content":"Hello! How can I help you?"
Use X-AI-Fixture-Status to override the HTTP status code:
--- more_headers X-AI-Fixture: openai/chat-basic.json X-AI-Fixture-Status: 429 --- error_code: 429
Fixtures containing {{model}} have it replaced with the model from the request body at serve time. Used by rate-limiting tests to verify model passthrough.
data: [DONE]\n\n (OpenAI) or event: message_stop\n (Anthropic)X-AI-Fixture: <path-relative-to-fixtures/>