Back to Blog
EnglishComparison

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.

S
Sophie M
October 11, 2026 / 347 views
Share:
Haiku 5.5 vs Haiku 4.5: Test Strict JSON, False, Zero and Null

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 IDVisible to this credential
claude-haiku-5-5Yes
claude-haiku-4-5Yes
Route / caseHTTP or turnsFinish / outcomeAcceptedObserved output or error
claude-haiku-5-5 / record200stopYes{"id":"HAIKU-COMPARE","active":false,"count":0}
claude-haiku-5-5 / unknown value200stopYes{"age":null}
claude-haiku-4-5 / record200stopNo```json ⏎ { ⏎ "id": "HAIKU-COMPARE", ⏎ "active": false, ⏎ "count": 0 ⏎ } ⏎ ```
claude-haiku-4-5 / unknown value200stopNo```json ⏎ {"age":null} ⏎ ```

Observed successful-envelope response IDs (failed acceptance can still have an ID):

text
msg_011Cgg8TSHJZhYF9uqp1PyEx
msg_011Cgg8TaxCaz1aKH88mv59F
msg_011Cgg8TjzfagX31vur5JMBv
msg_011Cgg8Tv4ekZDycyqHFCg88

Exact output contract: Complete response and declared JSON or marker required

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.

python
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=[])

Catalog visibility and attempted cases: Absent IDs were not silently substituted

Sources checked November 3, 2026: Anthropic model overview. Official descriptions and gateway observations are separate evidence.

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.

Episodes with written show notes →

Topics

ComparisonsComparison

Related Articles

Haiku 5.5 vs DeepSeek V4.1 Flash: Test Scheduling Gaps and No-Slot CasesComparison

Haiku 5.5 vs DeepSeek V4.1 Flash: Test Scheduling Gaps and No-Slot Cases

Two models solve the same available-slot and impossible-slot fixtures using integer minutes and half-open intervals. All four strict JSON checks pass; this is not a general scheduling benchmark.

Oct 9
Haiku 5.5 vs Sonnet 4.6: Recheck JSON, Totals and Supporting IDsComparison

Haiku 5.5 vs Sonnet 4.6: Recheck JSON, Totals and Supporting IDs

Four requests test tied maxima and filtered totals. Markdown wrappers and one unnecessary clarification prevent every reply from passing the declared strict JSON contract.

Oct 8
OpenAI Codex CLI vs Claude Code vs Gemini CLI: AI Terminal Tools ComparedComparison

OpenAI Codex CLI vs Claude Code vs Gemini CLI: AI Terminal Tools Compared

A head-to-head comparison of the three major AI terminal coding tools — OpenAI Codex CLI, Claude Code, and Gemini CLI. Features, pricing, and real-world performance.

Feb 23
Gemini 2.5 Flash Lite vs Qwen3 VL Plus Vision API Benchmark 2026: User-Centric Image Understanding ComparisonComparison

Gemini 2.5 Flash Lite vs Qwen3 VL Plus Vision API Benchmark 2026: User-Centric Image Understanding Comparison

A practical, user-centric benchmark comparing gemini-2.5-flash-lite and qwen3-vl-plus for vision API workloads: real image recognition accuracy, latency, tail latency, cost per successful image, usage signals, failure modes, and production routing advice.

Jun 22
GPT-4.1 Nano vs Qwen3 VL Plus Vision API Benchmark 2026: User-Centric Image Understanding ComparisonComparison

GPT-4.1 Nano vs Qwen3 VL Plus Vision API Benchmark 2026: User-Centric Image Understanding Comparison

A practical, user-centric benchmark comparing gpt-4.1-nano and qwen3-vl-plus for vision API workloads: real image recognition accuracy, latency, tail latency, cost per successful image, usage signals, failure modes, and production routing advice.

Jun 22
Open Source vs Commercial AI Models in 2026: A Developer Decision GuideComparison

Open Source vs Commercial AI Models in 2026: A Developer Decision Guide

Compare open source and commercial AI models across cost, privacy, latency, quality, deployment, licensing, and API operations for real software teams.

Jul 22