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", ...}withstrict: true: the model fills exactly the schema you pass. Supported by GPT-5.x and compatible models.- Forced tool call (
toolsplustool_choicenaming 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.
| Model | JSON mode | Tool calling | Price |
|---|---|---|---|
| GPT-6 Luna | yes | yes | $0.0055 input · $0.0274 output per 1M tokens |
| GPT-6 Sol | yes | yes | $0.1096 input · $0.548 output per 1M tokens |
| GPT-6 Astra | no | yes | $0.548 input · $2.7398 output per 1M tokens |
| GPT-5.6 Sol (also Luna, Terra) | yes | yes | $0.0667 input · $0.40 output per 1M tokens |
| Claude Opus 5.5 | yes | yes | $0.1067 input · $0.5334 output per 1M tokens |
| Claude Sonnet 5 | yes | yes | $0.3334 input · $1.6667 output per 1M tokens |
| Gemini 3.1 Pro | yes | yes | $0.2515 input · $1.5086 output per 1M tokens |
| Gemini 3.8 Flash (also 3.7 Flash) | no | yes | $0.0097 input · $0.0483 output per 1M tokens |
| DeepSeek V4.1 Flash | yes | yes | $0.0112 input · $0.0445 output per 1M tokens |
| Qwen3.8 Max (also 3.8 Flash) | yes | yes | $0.1543 input · $0.4629 output per 1M tokens |
| Kimi K3 | yes | yes | $0.1715 input · $0.8572 output per 1M tokens |
| MiniMax M3 | yes | yes | $0.0148 input · $0.0591 output per 1M tokens |
| Tencent Hy4 Preview | yes | yes | $0.0334 input · $0.1001 output per 1M tokens |
| GLM-5.3 (also 5.3 Flash, 5.2) | no | yes | $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.
