Before copying a curl example, choose your Cloud region. For authenticated calls, it must be the same region as your key. The examples below use MIROBODY_API_BASE:
For SDK examples with a literal Global URL, use the matching China URL when your account is in China. See Regions.
Use text.format on POST /v1/responses to request JSON output. It follows the OpenAI Responses text.format shape and is available only in backbone mode (mode:"model").
text.format requires mode:"model". On the default agent mode it returns 400 unsupported_parameter (param: "text"). The Answers API (/v1/chat/completions) likewise rejects response_format with 400.
json_object
Constrains the output to a syntactically valid JSON object (no schema):
The message text is a JSON string you parse yourself:
json_schema
Requests output that follows a schema you supply. strict: true is forwarded to providers that support native JSON Schema:
Provider fallback
text.format passes through to the underlying model. If the provider rejects native json_schema, Mirobody retries once as json_object with the schema included in the system prompt. That fallback targets the requested shape but does not validate the returned object against your schema. Parse and validate output_text yourself before using it.
See also
- Backbone mode —
mode:"model", the prerequisite for text.format.
- Function calling — for tool-argument shaping, pair
text.format with tool_choice:"required".