Output schema max_string_length: descriptions use a 120,000 budget
A big Format output_schema can fail with max_string_length although no field is long. The 120,000-character budget covers every key, name and string in it.

If a large output_schema fails with 400 output_schema_invalid and the rule max_string_length, the schema went over a document-wide budget of 120,000 characters. The budget is summed over every property name, key and string value in the whole document, so no single field has to be long (Structured output). Shorten the description annotations first, then use $defs so a repeated shape is written once.
The four size limits
A schema can pass the other three and still fail the last one. A long description on each of 400 properties is the usual cause.
| Limit | Value | rule on violation |
|---|---|---|
| Nesting depth | 10 levels | max_depth |
| Total properties | 5000, across the whole document | max_properties |
| Enum values | 1000 per enum | max_enum_values |
| Total string length | 120,000 characters | max_string_length |
How to get under the budget
Sume reports every violation in one 400, so a schema over two limits shows both in details.violations[]. Switch on rule, not on the message text.
- Cut
descriptiontext to what the agent needs to fill the field. Keep it to one short sentence. - Move a repeated object shape into root
$defsand point to it with$ref. The shape is counted once. - Drop
examplesandtitleannotations. They are allowed, and they use the budget. - Split a very large Format output into two runs with a smaller schema each, and continue with
previous_run_id.
Count it before you send it
The check is cheap to mirror. This script counts the characters of every key and string value in a schema file, so you see the total before the API does.
import json, sys
def total(node):
if isinstance(node, dict):
return sum(len(k) + total(v) for k, v in node.items())
if isinstance(node, list):
return sum(total(v) for v in node)
if isinstance(node, str):
return len(node)
return 0
schema = json.load(open(sys.argv[1]))
print(total(schema), "of 120000")Sources
Related posts
More in Formats
- Output schema node with only a description: missing_type violation
A property with only a description is legal JSON Schema, but Sume rejects it with missing_type. Give it a type, a $ref or an anyOf, and move constraints.
- Output schema required_completeness: list every property in required
Sume's strict output_schema wants every declared property in required, and no required entry without a property. Make a field optional with a null union.
- Output schema type float or date rejected: unsupported_type
Sume's output_schema accepts seven types only. A float, date or any type gets the rule unsupported_type. Map each to number, string with format, or an enum.
- Poll a Sume bulk queue every 10 seconds: read limits by plan
How often can you poll a Sume bulk queue? Reads are 40 times the write limit, so a 10-second poll fits every plan. The math, and when to back off.
Written by Sume