weightsapi.INFERENCEConsole
Navigation
Strict JSON output

Strict JSON output

Constrain shape and validate every response.

Request a schema#

Use response_format.type: json_schema with json_schema containing name, strict: true and schema. This requires constrained decoding in the serving backend. A text instruction alone is not a strict JSON guarantee.

Validate on your side#

Parse the response and validate it with the same schema. Treat a truncated response, refusal or unsupported schema as a failed result. Do not return partial JSON to a consumer expecting a complete object.

Supported deployments#

The live capability list is authoritative. Until the inference backend has passed schema tests, strict mode is not represented as verified. Unsupported schema mode must fail explicitly.

Request example

curl https://weightsapi.com/v1/chat/completions \
  -H "Authorization: Bearer $WEIGHTSAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "Qwen/Qwen3-32B",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "stream": true
}'