- Symptom
- Invalid schema for response_format: schema must be a JSON Schema of 'type: "object"', got 'type: "string"'.The structured outputs example from the docs fails after installing the latest zod
- Cause
- Before 6.7.0 the SDK converted schemas with a library that only understood Zod 3, so Zod 4 objects turned into a wrong schema.
- Fix
- Upgrade openai to 6.7.0 or later, or pin zod to version 3.
- Apply
npm install openai@^6.7.0- Affected
- openai-node earlier than 6.7.0 with zod 4; fixed in 6.7.0, 2025-10-24
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders