To make an API return a summary in a fixed four-field object, define those four keys and their value types in a JSON Schema, then use the endpoint’s json_schema response format where supported. This is different from JSON mode: the API reference describes json_schema as enabling Structured Outputs intended to match the supplied schema, while json_object ensures valid JSON without the same schema-conformance guarantee. The title does not determine what the four fields should be; choose them to match the object your application actually needs.
Decide the four-field contract before writing the schema
Start with the consumer of the response: name each key exactly, choose its type, and decide whether empty values are acceptable. For example, a reporting app might expect a short summary, a list of key points, a sentiment label, and action items. Those are illustrative names—not API-prescribed fields. Use different names or types if your application requires them.
As an Amazon Associate I earn from qualifying purchases.
Also decide how your code should handle missing information. A string might be allowed to be empty, or the schema might need to restrict its possible values; an array might allow zero items. These choices affect downstream behavior, so do not leave the model to invent keys or infer the contract from a prompt.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Represent the contract in JSON Schema
The following is a schematic response-format fragment showing four properties. It is not a complete API request, and its example fields are not an official or universally suitable schema. Confirm the request envelope and supported schema keywords for the endpoint and SDK you use.
#1 Best Overall
{
"text": {
"format": {
"type": "json_schema",
"name": "four_field_summary",
"strict": true,
"schema": {
"type": "object",
"properties": {
"summary": { "type": "string" },
"key_points": { "type": "array", "items": { "type": "string" } },
"sentiment": { "type": "string" },
"action_items": { "type": "array", "items": { "type": "string" } }
},
"required": ["summary", "key_points", "sentiment", "action_items"],
"additionalProperties": false
}
}
}
}
In this illustration, the root is an object; properties describes the four keys and their types; required lists all four; and additionalProperties: false expresses that no other keys belong in the object. The example assumes those schema features are accepted in the selected strict mode—verify that against the current supported subset before relying on it. The response-format reference documents a name, schema, optional description, and strictness setting; it limits the format name to 64 characters and allows letters, digits, underscores, and dashes.
Choose schema-constrained output or JSON mode
Use json_schema when the application needs a particular object shape and the selected model supports it. The API reference says this response format enables Structured Outputs intended to match the supplied schema. By comparison, the older json_object mode ensures valid JSON; that is useful when parseable JSON is enough, but it is not the documented equivalent of matching an explicit schema. See the OpenAI API response-format reference for the current distinction and format details.
Strictness is a separate choice within schema output. Setting strict: true requests strict schema adherence, but strict mode supports only a subset of JSON Schema. Avoid depending on advanced schema constructs until you have confirmed that the API accepts them. The Structured Outputs guide describes the supported feature set.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsImplement the response handling at the application boundary
- Define the contract. Record the exact four keys, value types, empty-value policy, and downstream handling for missing or ambiguous source information.
- Encode that contract. Add the object, property schemas, required-key behavior, and additional-property policy using features supported by the selected API mode.
- Select the response format. Use the endpoint’s documented
json_schemaformat when supported. Usejson_objectonly when valid JSON, rather than a fixed schema shape, meets the requirement. - Read the current response representation. Parse the returned text or structured output according to the current endpoint or SDK documentation; do not assume this schematic fragment is a full request or response example.
- Handle non-result outcomes. Account for refusals, incomplete responses, API errors, and parsing or validation failures as described for the endpoint. A successful HTTP response alone does not establish that your application has a usable summary.
- Validate and test locally. At the application boundary, check that all four keys are present and values have the expected types. Exercise empty and ambiguous inputs, and test the failure paths your application depends on.
Verify version and model support before shipping
API examples are implementation details, not timeless guarantees. Check the current create-response documentation and the SDK documentation for the endpoint envelope, response parsing, model support, and strict-mode schema subset in your actual integration. The example above illustrates the schema concept; it is not a tested endpoint-specific four-field implementation.
Quick Recap
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




