API

Structured outputs

Privatemode supports structured outputs for chat completion requests using the same response_format parameter as the OpenAI Chat Completions API. See OpenAI's structured outputs guide for details.

Note

When generating JSON output, always instruct the model to output JSON as in the example below. Otherwise, some models may emit endless whitespace until the token limit is hit. If that still happens, set frequency_penalty above 0.0 (for example 0.1) to discourage repetitive tokens. Also make sure to set max_completion_tokens to avoid too long generations.

Example prompt when generating JSON.

{
  "role": "user",
  "content": "Summarize the meeting into JSON with topic and action items. ..."
}