Structured extraction
Send response_format.json_schema to any OpenAI client and get a filled JSON object back as the assistant message.
POST /v1/chat/completions with response_format.type: "json_schema" runs the extract capability. The model reads the user text and fills your schema. It returns the filled object as the assistant content string, with finish_reason: "stop".
This is the fastest way to add typed extraction to code that already speaks OpenAI. You change the base URL and the model id. You change nothing else.
No API key is required during the launch period. OpenAI SDKs demand an api_key value, so pass any non-empty string.
What the facade does with your request
It joins the user turns
The facade keeps messages with role: "user". It joins several user turns with a blank line. It joins the text parts of array content with a newline.
It drops system prompts
system, developer, assistant and tool messages are discarded. A decision model takes no instructions, so a system prompt changes nothing.
Make the call
The response
The call above returned this. A chat json_schema call measures 0.63 s end to end.
Read content as a string, then parse it. A field the text does not carry comes back as null. Nothing is invented.
Give every property a description. The description is what the extractor looks for in the text. A bare property name works, but a described field wins the right span more often.
Schema support
The facade applies the same rules as the native endpoint. Strings, numbers, integers, booleans, enums, string arrays and nested objects all work. An array-of-objects property is accepted and returned empty for now. oneOf, anyOf, allOf and $ref do not.
Read the full support matrix on the Extract page before you design a schema.
A root schema that is not an object with properties returns 400 invalid_schema, message schema must be an object with properties.
Limits and errors
tools beats response_format. When a request carries both, the facade takes the function-calling path and your schema is never used. Send tool_choice: "none" to keep the extraction path.
A request with no response_format.json_schema and no tools returns 400 unsupported_request:
response_format: {"type":"json_object"} and {"type":"text"} return the same 400. tool_choice: "none" without a json_schema also returns it. Only json_schema does work.