Skip to main content
You can use JSON Schema to define the structure of JSON objects returned by the model. We support most features from the JSON Schema 2020-12 specification across all of our products. We follow the specification unless otherwise noted.
The request will fail if you pass a JSON Schema that contains keywords or combinations of keywords that are not supported. The error message will specify the unsupported construct. Don’t hesitate to reach out to us to request support.

Quick reference

items can also be used for tuple validation along with additionalItems per the draft 2019-09 specification. We recommend using prefixItems for tuple validation and items for homogeneous arrays or extra items beyond the prefixItems tuple.

Unsupported regular expressions

The pattern keyword supports most common regex features. The following are not supported:
  • Word boundaries (\b)
  • Backreferences (\1, (?P=open))
  • Conditional matches ((?(1)a|b))
  • Lookaheads (foo(?=bar))
  • Lookbehinds ((?<=foo)bar)
  • Atomic groups ((?>pattern))
  • Recursion ((?R), (?1))
  • Named captures ((?P<name>pattern))
  • Inline modifiers ((?i)case-insensitive)
  • Subroutines (\g<1>)
  • Branch resets ((?|pattern1|pattern2))
  • Inline comments ((?#comment))
  • Code callouts ((*MARK:name))
  • Version checks ((*VERSION))
  • Whitespace-insensitive patterns ((?x)pattern # comment)

Next steps