Response Format
A Response Format of type "json_schema" is an important way to get the most out of an ObjectiveAI Query Completion. It allows you to control the structure of the output, making it machine-readable and parsable into native data structures. It can lead to demonstrable improvement in the quality of the response by controlling the chain of steps that the LLM takes.
The provided Response Format will be used by every "generate" LLM in the Query Model. "select" LLMs will not see it.
Using our custom schema extensions, _confidence and _preserveOrder, you can control when distinct outputs are given the same Confidence ID, increasing their Confidence Score.
_confidence
The _confidence field may be applied to any property in the schema. It is a boolean that defaults to true. If set to false, the property will be omitted when computing the Confidence ID of a choice. This is useful for properties that are not important to the meaning of the output, such as reasoning fields.
{
"messages": [
{
"role": "user",
"content": "What websites can I use to find more clients for my English tutoring business?"
}
],
"model": {
"models": [
{
"id": "openai/gpt-5-nano",
"mode": "generate",
"weight": {
"type": "static",
"weight": 1
}
},
{
"id": "openai/gpt-5-mini",
"mode": "generate",
"weight": {
"type": "static",
"weight": 1
}
},
{
"id": "google/gemini-2.5-flash",
"mode": "generate",
"weight": {
"type": "static",
"weight": 1
}
}
],
"weight": {
"type": "static"
}
},
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "Websites",
"strict": true,
"schema": {
"type": "object",
"properties": {
"1_options": {
"type": "array",
"items": {
"type": "string",
"description": "A website URL"
},
"_confidence": false
},
"2_think_rank_1_option": {
"type": "string",
"description": "The assistant's reasoning about which option is best",
"_confidence": false
},
"3_rank_1_option": {
"type": "string",
"description": "A website URL - the best among the options"
}
},
"required": [
"1_options",
"2_think_rank_1_option",
"3_rank_1_option"
],
"additionalProperties": false
}
}
}
}In this request, we've applied "_confidence": false to the "1_options" and "2_think_rank_1_option" properties. All we care about is the best website.
Let's see what the response looks like, with parsed content:
{
"id": "<query_completion_id>",
"model": "<query_model_id>",
"created": 1760034842,
"object": "chat.completion",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": {
"1_options": [
"https://www.italki.com",
"https://www.preply.com",
"https://www.amazingtalker.com",
"https://www.superprof.com",
"https://www.wyzant.com"
],
"2_think_rank_1_option": "Start with globally popular tutoring platforms (Italki, Preply, AmazingTalker) to reach learners worldwide, then add reputable tutoring marketplaces (Wyzant, Tutor.com, Tutorme, Skooli) for US/English-focused clients, and sprinkle in UK/local options (Tutorful, MyTutor, First Tutors) to capture regional demand. Finally consider local lead-gen sites (Thumbtack, Bark) to attract nearby clients.",
"3_rank_1_option": "https://www.italki.com"
},
"refusal": null
},
"logprobs": null,
"generate_id": "b7f0b2614594b5f0",
"confidence_id": "fd18b9ec86399fc9",
"confidence_weight": 1,
"confidence": 0.6667,
"model": "<query_llm_id>",
"model_index": 0,
"completion_metadata": {
"id": "<chat_completion_id",
"model": "openai/gpt-5-nano",
"created": 1760034842
}
},
{
"index": 1,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": {
"1_options": [
"https://www.italki.com",
"https://preply.com",
"https://www.verbling.com",
"https://www.cambly.com",
"https://www.wyzant.com"
],
"2_think_rank_1_option": "italki is focused specifically on language learners, has a very large global user base, flexible pricing and teacher types (community vs professional), strong profile/review features, and drives high organic learner traffic—making it one of the quickest ways for independent English tutors to find students internationally.",
"3_rank_1_option": "https://www.italki.com"
},
"refusal": null
},
"logprobs": null,
"generate_id": "71fd3ff79c1f5035",
"confidence_id": "fd18b9ec86399fc9",
"confidence_weight": 1,
"confidence": 0.6667,
"model": "<query_llm_id>",
"model_index": 0,
"completion_metadata": {
"id": "<chat_completion_id",
"model": "openai/gpt-5-mini",
"created": 1760034842
}
},
{
"index": 2,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": {
"1_options": [
"https://www.chegg.com/tutors/",
"https://www.tutor.com/",
"https://www.wyzant.com/",
"https://preply.com/",
"https://www.italki.com/"
],
"2_think_rank_1_option": "I will rank Wyzant as the best option because it is specifically designed for local and online tutoring, allowing tutors to set their own rates and schedule. It has a large user base actively seeking tutors for various subjects, including English. While platforms like Preply and iTalki are also excellent for language tutoring, Wyzant offers broader subject coverage and a strong presence in the US market, which is often a key target for English tutors. Chegg and Tutor.com are more institutionalized and might offer less flexibility or lower pay for independent tutors. Upwork and Fiverr are broader freelance platforms where tutoring might be one of many services, so it could be harder to stand out.",
"3_rank_1_option": "https://www.wyzant.com/"
},
"refusal": null
},
"logprobs": null,
"generate_id": "16db86a127600c6c",
"confidence_id": "535b602c738aa15a",
"confidence_weight": 1,
"confidence": 0.3333,
"model": "<query_llm_id>",
"model_index": 0,
"completion_metadata": {
"id": "<chat_completion_id",
"model": "google/gemini-2.5-flash",
"created": 1760034842
}
}
]
}In the response, we can see that while gpt-5-nano and gpt-5-mini differed in their options and in their reasoning, they ultimately arrived at the same website. Due to our configuration of which properties count for Confidence ID, both choices have the same Confidence ID and Confidence Score. That makes https://www.italki.com the winner, with 66.67% Confidence.
_preserveOrder
The _preserveOrder field may be applied to any object or array property in the schema. It is a boolean that defaults to false.
For objects, if not present or set to false, object property keys will be sorted alphabetically. If the order that the LLM writes out the keys is important, set _preserveOrder to true.
For arrays, if not present or set to false, array items will be sorted alphabetically. If the order that the LLM writes out the items is important, such as when ranking, set _preserveOrder to true.
select_deterministic
Query Completion request objects contain the optional field "select_deterministic". When set to true, ObjectiveAI will attempt to generate a choice for each possible output that can be produced by the Schema.
This is a very powerful feature, as it enables the most mission critical applications of Query Completions, when the number of possible outputs is known.
This also enables (and is required for) Query Models which contain only "select" LLMs. Unlike "generate" LLMs, "select" LLMs can vote for more than one option at a time using "select_top_logprobs" as a probability distribution, resulting in much more granular Confidence Scores.
{
"type": "json_schema",
"json_schema": {
"name": "TicketLabel",
"strict": true,
"schema": {
"type": "object",
"properties": {
"severity": {
"type": "string",
"description": "The severity and priority level of the ticket",
"enum": [
"low",
"medium",
"high",
"critical"
]
},
"category": {
"type": "string",
"description": "The category of the ticket",
"enum": [
"billing",
"security",
"database",
"bug",
"feature_request",
"database"
]
}
},
"required": [
"severity",
"category"
],
"additionalProperties": false
}
}
}In the example Response Format, we're asking the AI to classify the support ticket by severity and category. Each possible combination of severity and category will be generated as a choice with "model":"TicketLabel" and the content being the JSON output with that combination.
You could then label the ticket with the severity and category of the choice containing the highest Confidence Score. Or, as another example, you could write some code that takes the single severity with the highest Confidence Score, and every category with a Confidence Score above some threshold.