Gemini prefixItems tuple schema: Sume rejects it, use an object

Gemini lists prefixItems for tuple-like arrays. Sume's output_schema allowlist omits it and returns unsupported_keyword; model each slot as a named property.

4 min readSume
All posts

A schema that uses prefixItems for a tuple will fail Sume's output_schema check with 400 output_schema_invalid and a violation whose rule is unsupported_keyword. Replace the tuple with an object that names each slot, or with an array of identical items.

Gemini's Structured outputs page lists prefixItems under array values: "a list of schemas for the first N items, allowing for tuple-like structures" (read 2026-10-02). Sume's page describes an allowlist, not a deny list, so a keyword that is not named is a violation rather than something quietly ignored.

Which array keywords does each page list?

Gemini's page lists items, prefixItems, minItems and maxItems for arrays. Sume's allowlist for arrays is minItems and maxItems, with items under Structure; prefixItems is not on it. A Sume array must also declare items, or the violation is missing_items.

Array keywords as listed on the Gemini Structured outputs page and the Sume Structured output docs page, read 2026-10-02.
KeywordGemini pageSume allowlist
itemsListedAccepted
prefixItemsListedNot accepted: unsupported_keyword
minItemsListedAccepted
maxItemsListedAccepted

How do I replace a tuple?

If the first slot is a title and the second is a count, make an object with two named properties. A name is also a better prompt to the run than a position, because the description attached to each property tells the run what belongs there.

If the slots are not different kinds of value, use items with one schema and bound the length with minItems and maxItems. Sume's page notes that minItems is genuinely enforced, so leave it off an array you want to receive partially, such as a list of scenes.

{
  "name": "acme/range/v1",
  "schema": {
    "type": "object",
    "additionalProperties": false,
    "required": ["start_s", "end_s"],
    "properties": {
      "start_s": { "type": "number" },
      "end_s": { "type": "number" }
    }
  }
}

What happens when the schema is rejected?

The rejection happens at submit. Sume's page states that nothing runs, so nothing is charged. The 400 carries details.violations[], each with a JSON-Pointer-style path, a rule and a message. Branch on rule; the page says the message may change.

The same unsupported_keyword rule covers oneOf, allOf, not and if/then/else. Sending both output_schema and response_format is a different error, invalid_request.

What should I check on the receipt?

A run whose schema passed can still finish with output: null. Check output_error before output, and fall back to artifacts[], which is populated either way. See Structured output for the full set of output_error.code values.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume