When using @ai-sdk/openai-compatible with gpt-5.x, streaming responses fail zod validation:
Type validation failed: object: "chat.completion.chunk"
Expected: "response.output_text.delta" | "response.completed" | ...
Config:
"npm": "@ai-sdk/openai-compatible",
"models": { "gpt-5.4": {} }
Version: 1.15.13
Likely cause: transform.ts injects reasoningEffort / reasoningSummary for all gpt-5* model IDs, regardless of npm. These Responses-only params cause the SDK to internally switch to Responses protocol, while the backend returns Chat Completions format — hence the schema mismatch.
When using
@ai-sdk/openai-compatiblewith gpt-5.x, streaming responses fail zod validation:Config:
Version: 1.15.13
Likely cause:
transform.tsinjectsreasoningEffort/reasoningSummaryfor allgpt-5*model IDs, regardless ofnpm. These Responses-only params cause the SDK to internally switch to Responses protocol, while the backend returns Chat Completions format — hence the schema mismatch.