Haiku 5.5 vs Haiku 4.5: Test Strict JSON, False, Zero and Null
Two structured text fixtures distinguish exact JSON from fenced objects. Haiku 5.5 passes both; Haiku 4.5 returns matching values inside Markdown fences and fails the raw-JSON contract.

When replacing a model in a structured-output application, preserve the distinctions among false, zero and missing data. This comparison tests those values with a strict JSON consumer on two named Haiku routes.
Crazyrouter was the gateway for this 4-case experiment: 2 cases met the declared complete-output criterion; the results below retain the failures and their limits.
By Sophie M · Tested November 3, 2026
Does Haiku 5.5 preserve the same JSON contract as Haiku 4.5?#
The first fixture requires an ID, active false and count zero. The second requires age null because the source does not supply an age. Both are easy semantic tasks but useful contract checks: missing data should not become an invented zero, and false should not be omitted as if it were empty.
Haiku 5.5 passed both cases. Haiku 4.5 included the expected values inside fenced JSON for both cases, which failed direct parsing. The outcome is a difference in this output contract, not evidence that Haiku 4.5 cannot understand booleans or null.
November 3 experiment and observed results#
The scripts ran on Windows with Python 3.10.2 and synthetic inputs. Gateway generation and catalog requests use https://api.crazyrouter.com; paths and complete payloads appear in the code. Each result describes this run only. A test program exiting successfully means its observations were recorded, not that every model response passed.
| Requested model ID | Visible to this credential |
|---|---|
| claude-haiku-5-5 | Yes |
| claude-haiku-4-5 | Yes |
| Route / case | HTTP or turns | Finish / outcome | Accepted | Observed output or error |
|---|---|---|---|---|
| claude-haiku-5-5 / record | 200 | stop | Yes | {"id":"HAIKU-COMPARE","active":false,"count":0} |
| claude-haiku-5-5 / unknown value | 200 | stop | Yes | {"age":null} |
| claude-haiku-4-5 / record | 200 | stop | No | ```json ⏎ { ⏎ "id": "HAIKU-COMPARE", ⏎ "active": false, ⏎ "count": 0 ⏎ } ⏎ ``` |
| claude-haiku-4-5 / unknown value | 200 | stop | No | ```json ⏎ {"age":null} ⏎ ``` |
Observed successful-envelope response IDs (failed acceptance can still have an ID):
msg_011Cgg8TSHJZhYF9uqp1PyEx
msg_011Cgg8TaxCaz1aKH88mv59F
msg_011Cgg8TjzfagX31vur5JMBv
msg_011Cgg8Tv4ekZDycyqHFCg88

Keep parsing rules fixed during comparison#
The script requires a complete stop and json.loads of the ordinary content field. It does not extract a substring from a fence, repair JSON or accept an explanation before the object. Changing those rules after observing answers would change the measured task.
Both models used an ordinary text prompt, not a dedicated schema-constrained setting. The requested gateway routes are visible in the catalog, but the experiment does not prove native-provider parity or identical internal reasoning settings.
Use a canary dataset before switching a live application#
Add your actual schemas, absent fields, Unicode inputs and multi-record outputs. Keep expected results outside the model response and verify types as well as values in a production schema validator. Monitor failures after rollout and retain the previous route until you can revert deliberately.
This four-request sample does not justify overall quality, latency or cost rankings. It provides a reproducible example of a compatibility regression that can occur even when a person considers both answers correct.
Reproduce the experiment#
Install requests, set CRAZYROUTER_API_KEY in the process environment, save this complete script and run it with Python 3.10 or later. Requests use your authorized credential and can consume usage. Authorization headers are not printed.
import json
import os
import time
import requests
BASE = "https://api.crazyrouter.com/v1"
def catalog(models):
with requests.Session() as s:
s.trust_env=False
r=s.get(BASE+"/models",headers={"Authorization":"Bearer "+os.environ["CRAZYROUTER_API_KEY"]},timeout=(10,40),allow_redirects=False)
r.raise_for_status();names={x["id"] for x in r.json()["data"]}
return {m:m in names for m in models}
def chat(model,prompt,**options):
payload={"model":model,"messages":[{"role":"user","content":prompt}],**options}
record={"model":model,"request":payload};start=time.perf_counter()
try:
with requests.Session() as s:
s.trust_env=False
r=s.post(BASE+"/chat/completions",headers={"Authorization":"Bearer "+os.environ["CRAZYROUTER_API_KEY"]},json=payload,timeout=(10,65),allow_redirects=False)
record["http"]=r.status_code
if r.status_code==200:
d=r.json();c=d["choices"][0];record.update(response_id=d.get("id"),output=c["message"].get("content"),finish=c.get("finish_reason"),usage=d.get("usage",{}))
else:record["error"]="HTTP_"+str(r.status_code)
except (requests.RequestException,ValueError,KeyError,IndexError) as e:record["error"]=type(e).__name__
record["seconds"]=round(time.perf_counter()-start,3)
return record
def parsed(row):
if row.get("finish")!="stop":return None
try:return json.loads(row.get("output") or "null")
except (ValueError,TypeError):return None
def emit(**data):print(json.dumps(data,ensure_ascii=False))
MODELS = ['claude-haiku-5-5', 'claude-haiku-4-5']
CASES = [('record', 'Return only JSON {"id":"HAIKU-COMPARE","active":false,"count":0}.', {'id': 'HAIKU-COMPARE', 'active': False, 'count': 0}), ('unknown value', 'Extract age from: user Casey, age unspecified. Return only JSON {"age":null}.', {'age': None})]
OPTIONS = {}
availability=catalog(MODELS);rows=[]
for model in MODELS:
if not availability[model]:continue
for name,prompt,expected in CASES:
r=chat(model,prompt,**OPTIONS.get(model,{"max_tokens":1024}))
r.update(case=name,expected=expected)
r["passed"]=parsed(r)==expected
rows.append(r)
emit(catalog=availability,requests=rows,criterion="Complete stop plus exact parsed JSON; no fence stripping",local_tests=[])

Sources and related guides#
Sources checked November 3, 2026: Anthropic model overview. Official descriptions and gateway observations are separate evidence.
- Claude Haiku 5.5 API: Verify Messages Responses Before Adopting It
- Haiku 5.5 vs Sonnet 4.6: Recheck JSON, Totals and Supporting IDs
- Claude Jupiter, Opus 4.7 and Sonnet 4.6: Catalog and JSON Recheck
- AI Structured Output in Python: JSON Mode, Schema, and Live Validation
- AI Guardrails in Python: Reject Invalid Outputs After Prompt Injection
FAQ#
Which route passed the strict JSON cases?#
Haiku 5.5 passed two of two in this run.
Were Haiku 4.5’s values wrong?#
The values matched inside Markdown fences; the raw-JSON interface requirement failed.
Why test null?#
It preserves an unknown value instead of inventing a number.
Was a schema-constrained mode used?#
No. These were ordinary text requests.
Does this prove a general upgrade advantage?#
No. Four small calls establish only this observed contract behavior.
What should a production validator add?#
Explicit field types, required fields, extra-field rules and domain constraints.
Last actually tested: November 3, 2026. This API-dependent article is due for review December 3, 2026.
Implementation Guides
Podcast
AI Dev Tools: The Crazyrouter Podcast
Short episodes for developers on AI APIs, gateways, cost control and coding tools.
Latest episodes
EP196 · Oct 29, 2026 · 6:53
AI API Security Posture — Turn Controls Into Continuous Evidence
A practical guide to AI API security posture: inventory exposure, verify controls continuously, protect keys and data, constrain tools, and turn security assumptions into evidence that operators can act on.
EP195 · Oct 28, 2026 · 7:21
AI API Policy Drift — Detect When Production Rules Stop Matching Intent
A practical guide to policy drift in AI APIs: version routing and safety rules, detect stale enforcement, compare intended and observed behavior, and restore control before small gaps become incidents.





