Use Cases
- Extract structured fields from news articles, such as title, time, and link.
- Perform sentiment analysis on product reviews, including polarity, intensity, and keywords.
- Generate recommendation lists from transaction or browsing history, such as products, reasons, prices, and promotional information.
Supported Models
- Most online language models support JSON mode; VL models currently do not.
- Model capabilities are continuously updated. For the latest support information, refer to the model detail page in Models.
Output Format
The platform supports controlling model output format throughresponse_format. This includes:
- JSON mode (
json_object): Usejson_objectwhen you only need the model to return valid JSON. - Strict schema (
json_schema): Usejson_schemawhen the output must follow a fixed structure.
JSON Mode
JSON mode lets the model return a JSON string instead of free-form text.Strict Schema
If you need the model to output data in a specific structure, you can pass in a JSON Schema. The model is then constrained to the field names, types, and required fields you define, reducing post-processing costs.Best Practices
- Define output constraints clearly: In your prompt, state that the model should output JSON only and should not include explanatory text.
- Strengthen schema constraints: When using
json_schema, clearly define field names, types, required fields, optional fields, examples, and “no extra fields” when applicable. - Reduce randomness: Use a lower
temperature, such as 0.2-0.5, to reduce randomness and drift. - Prefer non-streaming responses: Prefer
stream=False. If you use streaming, wait until all chunks are received before callingjson.loads. - Control output length: Set a reasonable
max_completion_tokensvalue to avoid truncating the JSON object. - Handle parsing failures: If parsing fails, retry with stricter constraints and record the raw output for troubleshooting.
- Validate external JSON: We recommend handling edge cases where the model returns incomplete or invalid JSON on the application side. Validate the JSON returned by the model before using it, and avoid concatenating untrusted content directly into SQL queries or code paths.

