Theme
Language
·3 min read

JSON mode and structured outputs: which models support what

A model-by-model matrix of JSON mode on GetVibe API, the difference between json_object and json_schema, and a fallback that works on every model: forced tool calls.

JSON mode and structured outputs: which models support what

If your code parses the model's answer, you need JSON that parses on every call. There are three ways to get it on GetVibe API: json_object mode, strict json_schema mode and forced tool calls. Models differ in which of these they support. This article lays out the matrix from our catalog and shows which approach to use where.

The three approaches

  • response_format: {"type": "json_object"}: the model returns valid JSON. You describe the fields in the prompt.
  • response_format: {"type": "json_schema", ...} with strict: true: the model fills exactly the schema you pass. Supported by GPT-5.x and compatible models.
  • Forced tool call (tools plus tool_choice naming one function): the model returns the function arguments as JSON that matches the function's parameter schema. Every text model in our catalog supports tool calling, so this is the portable option.

The matrix

The JSON mode column is caps.jsonMode from https://getvibeapi.com/api/catalog, read on September 25, 2026.

ModelJSON modeTool callingPrice
GPT-6 Lunayesyes$0.0055 input · $0.0274 output per 1M tokens
GPT-6 Solyesyes$0.1096 input · $0.548 output per 1M tokens
GPT-6 Astranoyes$0.548 input · $2.7398 output per 1M tokens
GPT-5.6 Sol (also Luna, Terra)yesyes$0.0667 input · $0.40 output per 1M tokens
Claude Opus 5.5yesyes$0.1067 input · $0.5334 output per 1M tokens
Claude Sonnet 5yesyes$0.3334 input · $1.6667 output per 1M tokens
Gemini 3.1 Proyesyes$0.2515 input · $1.5086 output per 1M tokens
Gemini 3.8 Flash (also 3.7 Flash)noyes$0.0097 input · $0.0483 output per 1M tokens
DeepSeek V4.1 Flashyesyes$0.0112 input · $0.0445 output per 1M tokens
Qwen3.8 Max (also 3.8 Flash)yesyes$0.1543 input · $0.4629 output per 1M tokens
Kimi K3yesyes$0.1715 input · $0.8572 output per 1M tokens
MiniMax M3yesyes$0.0148 input · $0.0591 output per 1M tokens
Tencent Hy4 Previewyesyes$0.0334 input · $0.1001 output per 1M tokens
GLM-5.3 (also 5.3 Flash, 5.2)noyes$0.10 input · $0.3143 output per 1M tokens

For models marked "no", use a forced tool call, or describe the JSON in the prompt and validate it on your side.

What strict mode does on our side

With strict: true in a json_schema request, the gateway routes only to model variants that actually honor the schema. It does this on every attempt, including a switch to a backup. If no suitable variant is available, you get an explicit structured_output_unsupported error instead of plain text where JSON was expected. This guard is based on our measurements and covers only the variants we have measured.

One known case: DeepSeek's own API has no json_schema mode. For DeepSeek models, use json_object, or a forced tool call when you need exactly one shape.

Examples

Strict schema:

from openai import OpenAI
import json

client = OpenAI(base_url="https://getvibeapi.com/v1", api_key="sk-pv-...")
schema = {
    "type": "object",
    "properties": {"name": {"type": "string"}, "score": {"type": "number"}},
    "required": ["name", "score"],
    "additionalProperties": False,
}
resp = client.chat.completions.create(
    model="gpt-6-luna",
    response_format={"type": "json_schema",
                     "json_schema": {"name": "review", "strict": True, "schema": schema}},
    messages=[{"role": "user", "content": "Rate this product: fast delivery, careful packaging"}],
)
print(json.loads(resp.choices[0].message.content))

Forced tool call, which works on models without JSON mode:

resp = client.chat.completions.create(
    model="gemini-3.8-flash",
    tools=[{"type": "function", "function": {"name": "save_review", "parameters": schema}}],
    tool_choice={"type": "function", "function": {"name": "save_review"}},
    messages=[{"role": "user", "content": "Rate this product: fast delivery, careful packaging"}],
)
args = json.loads(resp.choices[0].message.tool_calls[0].function.arguments)

Always validate

Even with JSON mode on, check the parsed object against your schema before you use it, and retry on failure. This matters most on long outputs, where a response cut off at max_tokens is truncated JSON. Check finish_reason: length means the answer was cut short.

Next steps

Read the structured outputs documentation and the tool calling guide, or find a low-cost JSON-capable model in our cheapest LLM APIs list.

JSON modestructured outputsresponse_format json_schemaLLM JSON outputjson_object vs json_schemafunction calling JSON

Try GetVibe API for free

GPT, Claude, Gemini and more through one OpenAI-compatible API. Pay in USD by card or crypto.

Related articles

JSON mode and structured outputs: which models support what | GetVibe API