Comparison
Gemini 4 Neon vs GPT-6.2 Sol vs Claude Fable 5.2 vs Opus 5.5: Same-Prompt API Test (Latency, Tokens, Cost)
We tested Gemini 4 Neon, GPT-6.2 Sol, Claude Fable 5.2, Claude Opus 5.5, and GLM-5.3 on HiAPI with the same set of prompts: writing code, complex instructions, and reading a chart. Includes raw output, latency, token usage, and actual cost for each question.
On this page
Conclusion: We tested Gemini 4 Neon, GPT-6.2 Sol, Claude Fable 5.2, Claude Opus 5.5, and GLM-5.3 on HiAPI using the same set of prompts. All five models answered all three questions correctly (writing code, complex instructions, reading a chart); the differences were in speed and cost: GPT-6.2 Sol totaled $0.0008 and 11.9 seconds for the two text questions, while Gemini 4 Neon totaled $0.0660—about 80 times more. For everyday coding and structured tasks, start with Sol; Neon and Sol proactively rejected invalid inputs not specified in the prompt for the code question, and GLM-5.3 had the most complete comments.
Below are the raw output, latency, token usage, and cost calculated at HiAPI prices for each question.

Summary table: cost per question and total cost
| Model | Question 1: Write code | Question 2: Complex instructions | Question 3: Read chart | Q1 + Q2 total | All three total | Total latency |
|---|---|---|---|---|---|---|
| Gemini 4 Neon | $0.0416 | $0.0244 | $0.0208 | $0.0660 | $0.0868 | 36.6 s |
| GPT-6.2 Sol | $0.0005 | $0.0003 | $0.0018 | $0.0008 | $0.0026 | 17.6 s |
| Claude Fable 5.2 | $0.0702 | $0.0282 | Image input not supported | $0.0984 | — | 29.3 s |
| Claude Opus 5.5 | $0.0396 | $0.0298 | $0.0053 | $0.0693 | $0.0746 | 46.4 s |
| GLM-5.3 | $0.0101 | $0.0024 | Image input not supported | $0.0124 | — | 58.1 s |
Cost = token usage returned by the API × HiAPI default-route price (input, cached input, and output priced separately). Prices are as of 2026-11-24 and exclude any promotional discounts. We spot-checked the actual gateway charges and they matched the amounts calculated by this method. Claude Fable 5.2 and GLM-5.3 only accept text input on HiAPI and did not participate in the chart-reading question, so the "Q1 + Q2 total" column is the one that allows direct comparison across all five models.
Test method
- Date: 2026-11-24, all requests went through the HiAPI production endpoint
/v1/chat/completionson the default route. - Parameters: All five models used the same system prompt
You are a helpful assistant.;reasoning_effortwas not passed, so each model used its default thinking level;max_tokenswas uniformly 16000, and no truncation occurred. - Runs: Each model ran each question once, with no cherry-picking of results. All numbers below are single-run results, and latency will vary with load.
- Latency: Client-side time from sending the request to receiving the complete response (non-streaming), with calls made sequentially.
- Scoring: The code question was run against 21 local test cases; the instruction question was checked by a script for JSON format, item count, word count, forbidden words, and order; the chart question was compared digit by digit against the original chart numbers.
Question 1: Write a Python function with comments
The prompt asked for parse_duration(s) that converts strings like "1h30m", "45s", and "1h5m10s" into seconds, where units can only be h, m, s, each appearing once in that order, invalid input raises ValueError, and “add comments where they help a code reviewer.” We prepared 9 valid inputs and 12 invalid inputs (such as "1m1h", "1.5h", "1h 30m").
| Model | Latency | Input tokens | Output tokens (incl. thinking) | Cost | Tests | Comments | Input 1h (full-width digit) |
|---|---|---|---|---|---|---|---|
| Gemini 4 Neon | 16.7 s | 243 | 1,787 | $0.0416 | 21 / 21 | 3 lines | Rejected |
| GPT-6.2 Sol | 6.6 s | 193 | 168 | $0.0005 | 21 / 21 | 1 line + docstring | Rejected |
| Claude Fable 5.2 | 18.5 s | 272 | 3,396 | $0.0702 | 21 / 21 | 2 lines | Returned 3600 |
| Claude Opus 5.5 | 19.8 s | 270 | 3,833 | $0.0396 | 21 / 21 | 5 lines | Returned 3600 |
| GLM-5.3 | 43.8 s | 197 | 3,305 | $0.0101 | 21 / 21 | 9 lines + docstring | Returned 3600 |
All five models passed all 21 tests, and their approaches were the same: a regex ordered h, m, s, plus a separate rejection of empty strings. The differences were in three areas.
- Speed and tokens: GPT-6.2 Sol output only 168 tokens and finished in 6.6 seconds. GLM-5.3 spent 2,912 thinking tokens and took 43.8 seconds. Gemini 4 Neon used 1,532 thinking tokens.
- Edge-case handling: Python's
\dby default matches all Unicode digits, so"1h"(full-width digit) is treated as 1 hour. Neon and Sol both replaced\dwith[0-9], rejecting this input; Fable 5.2, Opus 5.5, and GLM-5.3 returned 3600. The prompt did not explicitly require this, but if the function is to handle user input, the former is safer. Whether a model handles such unspecified edge cases is not consistent: in another round of testing we saw the same model handle it differently. If you need it, put the requirement directly in the prompt. - Comments: See the next section.
Comment style comparison
The prompt specifically asked for comments. Below are the two outputs with the most obvious stylistic differences. Gemini 4 Neon wrote only 3 comment lines, each explaining a non-obvious decision, including why [0-9] is used instead of \d:
import re
# Enforce h -> m -> s order, each appearing at most once.
# Use [0-9] instead of \d to reject non-ASCII Unicode digits.
_DURATION_RE = re.compile(
r"(?:(?P<h>[0-9]+)h)?(?:(?P<m>[0-9]+)m)?(?:(?P<s>[0-9]+)s)?"
)
def parse_duration(s: str) -> int:
stripped = s.strip()
# Explicitly reject empty input since all regex groups are optional
if not stripped:
raise ValueError(f"Invalid duration: {s!r}")
match = _DURATION_RE.fullmatch(stripped)
if match is None:
raise ValueError(f"Invalid duration: {s!r}")
hours = int(match.group("h") or 0)
minutes = int(match.group("m") or 0)
seconds = int(match.group("s") or 0)
return hours * 3600 + minutes * 60 + seconds
GLM-5.3 wrote 9 comment lines and a docstring with doctest examples, listing in the comments every category of input the regex rejects:
import re
# One optional "<int><unit>" block per unit, in the fixed order h, m, s.
# Using fullmatch ensures the entire (stripped) string must be consumed, which
# rejects wrong unit order ("1m1h"), repeated units ("1h1h"), unknown units
# ("1x"), and non-integer/negative numbers ("1.5h", "-2m").
_DURATION_RE = re.compile(
r'(?:(?P<h>\d+)h)?'
r'(?:(?P<m>\d+)m)?'
r'(?:(?P<s>\d+)s)?'
)
def parse_duration(s: str) -> int:
"""Convert a duration string such as "1h30m" to total seconds.
>>> parse_duration("1h30m")
5400
>>> parse_duration("1h5m10s")
3910
>>> parse_duration(" 3m ")
180
"""
if not isinstance(s, str):
raise ValueError(f"duration must be a string, got {type(s).__name__}")
match = _DURATION_RE.fullmatch(s.strip()) # ignore surrounding whitespace
# groups() is (h, m, s); each is a digit string if the unit is present,
# otherwise None. A present group is never an empty string, so any() is
# False only when nothing was parsed (empty / whitespace-only input).
if match is None or not any(match.groups()):
raise ValueError(f"invalid duration: {s!r}")
# Missing units simply contribute 0.
hours, minutes, seconds = (int(v) if v is not None else 0 for v in match.groups())
return hours * 3600 + minutes * 60 + seconds
GPT-6.2 Sol was the most concise, with 1 comment line plus a one-sentence docstring. Claude Fable 5.2 wrote only 2 comment lines. Claude Opus 5.5 wrote 5 lines, mainly explaining why the regex rejects "h" and "1.5h". There is no right or wrong amount of commenting: the Neon and Sol style suits teams that understand regex, while the GLM-5.3 style suits code that needs handover or maintenance by newcomers.
Question 2: Structured output with multiple constraints
The models were given 6 internal changelog entries and asked to select the 3 that affect API users and write them as a JSON-format external release note. Constraints included: output JSON only, exactly 3 items in the original order, each no more than 14 words, the word new must not appear anywhere, the title no more than 6 words, and count the number of excluded entries.
| Model | Latency | Input tokens | Output tokens (incl. thinking) | Cost | All constraints met |
|---|---|---|---|---|---|
| Gemini 4 Neon | 11.5 s | 285 | 1,017 | $0.0244 | Yes |
| GPT-6.2 Sol | 5.3 s | 241 | 74 | $0.0003 | Yes |
| Claude Fable 5.2 | 10.8 s | 356 | 1,312 | $0.0282 | Yes |
| Claude Opus 5.5 | 17.9 s | 354 | 2,856 | $0.0298 | Yes |
| GLM-5.3 | 14.3 s | 244 | 728 | $0.0024 | Yes |
All five models selected the correct 3 items (seed parameter, completed_at timestamp, webhook retry count), and item count, word count, forbidden words, and internal_count = 3 were all correct. GPT-6.2 Sol's output is as follows:
{
"title": "API Release Notes",
"bullets": [
"Use the `seed` parameter to reproduce image generation results.",
"Task status responses now include `completed_at` timestamps.",
"Webhook retries use backoff for up to six attempts instead of three."
],
"internal_count": 3
}
All five models can handle this type of task reliably, so model selection can focus on speed and cost alone: Sol took 5.3 seconds at $0.0003; Fable 5.2 took 10.8 seconds at $0.0282.
Question 3: Read numbers from a bar chart
Given the win-rate chart below, the models were asked to output each opponent's win, draw, and loss percentages in the chart's order (JSON). The chart contains 9 numbers.

| Model | Latency | Input tokens | Output tokens (incl. thinking) | Cost | 9 numbers |
|---|---|---|---|---|---|
| Gemini 4 Neon | 8.4 s | 1,204 | 678 | $0.0208 | All correct |
| GPT-6.2 Sol | 5.7 s | 3,005 | 123 | $0.0018 | All correct |
| Claude Opus 5.5 | 8.7 s | 1,543 | 209 | $0.0053 | All correct |
The 9 numbers and opponent names output by the three models matched exactly, and the order was correct. On HiAPI, Gemini 4 Neon, GPT-6.2 Sol, and Claude Opus 5.5 support image input; Claude Fable 5.2 and GLM-5.3 only support text input.
One thing to note about token usage
- Claude's thinking tokens are counted in output: The
completion_tokensreturned by Fable 5.2 and Opus 5.5 already includes thinking content; the API does not break out thinking tokens separately. For example, Fable 5.2 writing a 22-line function returned 3,396 output tokens. When estimating cost, simply calculate based oncompletion_tokens.
HiAPI pricing
| Model | Input / 1M tokens | Cached input / 1M tokens | Output / 1M tokens |
|---|---|---|---|
| Gemini 4 Neon | $4.54 | $0.23 | $22.68 |
| GPT-6.2 Sol | $0.50 | $0.025 | $2.50 |
| Claude Fable 5.2 | $4.07 | $0.10 | $20.35 |
| Claude Opus 5.5 | $2.04 | $0.10 | $10.18 |
| GLM-5.3 | $0.85 | — | $2.99 |
Prices are for the HiAPI default route as of 2026-11-24, rounded to the nearest cent; the per-question costs in the table are calculated using exact unit prices. Gemini 4 Neon also has a gemini-4-neon@flex route at roughly half the default route's unit price with higher latency, suitable for offline batch jobs (this article did not test @flex). Claude Opus 5.5 also has an @aws route at a higher unit price.
How to choose
| Scenario | First choice | Reason (from this test) |
|---|---|---|
| Everyday coding, structured output, batch text tasks | GPT-6.2 Sol | All three questions correct; fastest and cheapest on every question |
| Code that needs handover and maintenance by newcomers | GLM-5.3 | Most complete comments, listing every rejected input category and including doctest examples |
| Cost-sensitive, not in a hurry | GLM-5.3 or Neon @flex | GLM-5.3 has a low unit price but long thinking time (44 seconds on the code question) |
| Agent orchestration, long-chain tasks | Claude Opus 5.5, escalating hard problems to Fable 5.2 | This test's three questions did not cover long tasks; recommendation based on the two models' official positioning; Fable 5.2's unit price is about 2× Opus 5.5's |
All three questions were short tasks. For tasks such as long context and multi-turn tool calling, the gaps between models are usually larger; we recommend running another round of tests with your own real tasks.
Switching models on HiAPI
All five models can be called through the OpenAI-compatible Chat Completions API; switching models only requires changing the model field. Below is the call pattern used in this test:
import os, time
from openai import OpenAI
client = OpenAI(base_url="https://api.hiapi.ai/v1", api_key=os.environ["HIAPI_API_KEY"])
MODELS = ["gemini-4-neon", "gpt-6.2-sol", "claude-fable-5-2", "claude-opus-5-5", "glm-5.3"]
prompt = "Write a Python function parse_duration(s) that converts '1h30m' to seconds."
for model in MODELS:
t0 = time.time()
resp = client.chat.completions.create(
model=model,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt},
],
max_tokens=16000,
)
print(model, f"{time.time() - t0:.1f}s", resp.usage.prompt_tokens, resp.usage.completion_tokens)
For parameters and usage of each model, see the Gemini 4 Neon, GPT-6.2 Sol, Claude Fable 5.2, Claude Opus 5.5, and GLM-5.3 model pages. Further reading: Claude Fable 5.1 vs Opus 5.5, Gemini 4 Neon Getting Started Guide, GPT-6.2 Sol Developer Guide, GLM-5.3 API Usage Guide.
FAQ
Which is better at writing code, Gemini 4 Neon or GPT-6.2 Sol?
In this code question, both passed all 21 tests and both rejected full-width digit input. Sol took 6.6 seconds vs. Neon's 16.7 seconds; Sol's cost was about 1.2% of Neon's. For everyday coding, start with Sol.
What is the difference between Claude Fable 5.2 and Claude Opus 5.5?
Fable 5.2 targets harder reasoning and long-chain agent tasks, always has thinking enabled, and its unit price is about 2× that of Opus 5.5. On this test's three short tasks, both answered everything correctly and performed similarly. Fable 5.2 only supports text input on HiAPI, while Opus 5.5 supports image input.
Which model is best for writing code?
No single model is best on every dimension. Based on this test: choose GPT-6.2 Sol for speed and cost, GLM-5.3 for detailed comments. Do not expect models to handle edge cases not specified in the prompt on their own; put them directly in the prompt.
Gemini 4 vs GPT-6 vs Claude: which is cheaper?
At HiAPI prices, GPT-6.2 Sol has the lowest input and output unit prices. For this test's two text questions, Sol totaled $0.0008 and Gemini 4 Neon totaled $0.0660. Actual cost also depends on the number of thinking tokens.
Related articles
View all articles →-
Comparison
gpt-6.2-sol vs. comparable models: How developers should choose and migrate
Make a side-by-side decision across three dimensions: capability boundaries, pricing structure, and migration cost
-
Comparison
gpt-6.2-astra Side-by-Side Comparison and Selection Guide: How Developers Can Decide Whether It Is Worth Integrating
-
Comparison
Tripo H3.1 Side-by-Side Comparison and Selection Guide: How to Choose Among Three 3D Generation Paths and How to Save
A developer-oriented trade-off between pricing and capability, starting from input form, geometric refinement, and PBR/texture switches