OpenAI schema error
Fix “schema must have a type key” in OpenAI tools
Repair wrapper confusion and missing object types in OpenAI function tool definitions.
This error often means a schema fragment or wrapper was placed where OpenAI expects parameters. The parameters value itself needs an object schema with an explicit type.
Read the schema and its provider wrapper as one contract. APITC distinguishes target requirements from portable JSON Schema, applies mechanical repairs only when intent is recoverable, and identifies transformations that can change meaning.
Diagnostic procedure
Repair the schema, then recompile.
- 01
Inspect the wrapper
Responses tools use type, name, description, parameters, and optional strict at the same level.
- 02
Add the root type
Ensure parameters starts with type: object, even when properties is empty.
- 03
Inspect fragments
Every object branch and array item should declare its type explicitly.
{"type":"function","name":"search","parameters":{"properties":{"q":{"type":"string"}}}}{"type":"function","name":"search","parameters":{"type":"object","properties":{"q":{"type":"string"}},"required":["q"],"additionalProperties":false},"strict":true}$.inputSchemaClose this objectOpenAI strict requires additionalProperties: false on every object.
$.inputSchemaRequired array is incompleteStrict mode requires every property in required. APITC will make limit nullable.
No account · no upload · no endpoint calledOpen the full tool schema compiler and operating notes →
FAQ
Before you ship
Does APITC upload my schema?
No. Parsing, diagnostics, and compilation run in your browser tab.
Is the compiled result guaranteed to preserve meaning?
Safe repairs are deterministic. When OpenAI cannot express a source constraint, APITC labels the transform as lossy instead of hiding it.
Protocol behavior checked against the OpenAI function calling guide. Recheck your pinned provider/API version before production deployment.