Output schema max_enum_values: 1,000 values per enum, then what

Sume refuses an enum of more than 1,000 values with rule max_enum_values. Use a string with a pattern or format, or split the list into two enums.

3 min readSume
All posts

An enum in a Format output_schema may hold at most 1,000 values. A longer list gets 400 output_schema_invalid with the rule max_enum_values (Structured output). If the list is a catalog of ids, type the field as a string and check membership on your side after you read output.

Three ways out

pattern, format, minLength and maxLength are on the allowlist for strings, so a shape such as ^sku_[a-z0-9]{8}$ can be enforced by Sume. Membership in your catalog cannot.

Source: docs.sume.com, read 2026-10-06.
SituationWhat to do
A closed list under 1,000Keep the enum.
A long catalog of idsUse type: string, optionally with pattern, and validate against your catalog in code.
Two levels, such as category then itemUse one enum for the category and a string for the item.

Check on your side

A schema fixes the shape. It does not prove that a value exists. After you read output, confirm each id against your own list before you act on it.

known = {"sku_a1b2c3d4", "sku_e5f6a7b8"}
output = {"items": [{"sku": "sku_a1b2c3d4"}, {"sku": "sku_zzzzzzzz"}]}
bad = [i["sku"] for i in output["items"] if i["sku"] not in known]
print("unknown ids:", bad)

Sources

Related posts

More in Formats

All Formats posts

Written by Sume