Skip to content
English

Verify Model and Usage

Use call logs and five checks to verify the model, token usage, and cost of each call.

Every call is recorded in the console’s call log, listing the model, input, output, cache read, and cache write token usage, as well as the cost.

The following checks compare against the public format of the Anthropic API to detect differences in returned fields and format.

CheckExpected ResultWhat to Watch For
1. Returned model fieldMatches the requested model IDReturns a different model name, or the field is missing
2. Cache readThe same request meeting cache conditions is sent twice within the cache validity period; the second cache_read_input_tokens is greater than 0Always 0, or no cache fields in usage
3. Tool call IDThe id of the tool_use block starts with toolu_Other formats, or the model does not call tools as required
4. Streaming event ordermessage_start, content_block_start, content_block_delta, message_delta, and message_stop appear in sequenceOnly OpenAI-format data: blocks, or events missing or out of order
5. Real task comparisonUse a fixed task and compare results with the official API or other trusted sourcesResults noticeably worse, abnormal refusals, or frequent truncation

These checks can only detect differences in fields and format; they cannot alone confirm the model actually in use. model fields can be rewritten, and formats can be imitated.

Completing the First Four Checks with a Script

Section titled “Completing the First Four Checks with a Script”

Requires bash, curl, and jq. The script makes five small calls, one of which writes approximately 18,000 tokens to cache, billed at the normal price.

verify.sh
#!/usr/bin/env bash
# 用法:ONEZHE_API_KEY=sk-你的API密钥 bash verify.sh [模型ID]
set -euo pipefail
BASE="https://1zheai.com"
MODEL="${1:-claude-sonnet-5-5}"
H=(-H "x-api-key: $ONEZHE_API_KEY" -H "anthropic-version: 2023-06-01" -H "content-type: application/json")
echo "== 1. model 字段"
curl -s "$BASE/v1/messages" "${H[@]}" \
-d "$(jq -n --arg m "$MODEL" '{model:$m,max_tokens:16,messages:[{role:"user",content:"ping"}]}')" \
| jq 'if .error then .error else {id, model, usage} end'
echo "== 2. 缓存:同一请求发两次,看第二次的 cache_read_input_tokens"
LONG=$(printf '这是一段用来测试缓存的固定文本,内容不重要,长度够就行。%.0s' {1..600})
BODY=$(jq -n --arg m "$MODEL" --arg t "$LONG" '{model:$m,max_tokens:16,
system:[{type:"text",text:$t,cache_control:{type:"ephemeral"}}],
messages:[{role:"user",content:"ping"}]}')
for i in 1 2; do
curl -s "$BASE/v1/messages" "${H[@]}" -d "$BODY" | jq -c 'if .error then .error else .usage end'
done
echo "== 3. 工具调用 ID"
curl -s "$BASE/v1/messages" "${H[@]}" \
-d "$(jq -n --arg m "$MODEL" '{model:$m,max_tokens:256,
tools:[{name:"get_weather",description:"查询城市天气",
input_schema:{type:"object",properties:{city:{type:"string"}},required:["city"]}}],
tool_choice:{type:"auto"},
messages:[{role:"user",content:"北京今天天气怎么样"}]}')" \
| jq -r 'if .error then .error.message else (.content[]? | select(.type=="tool_use") | .id) end'
echo "== 4. 流式事件序列"
curl -sN "$BASE/v1/messages" "${H[@]}" \
-d "$(jq -n --arg m "$MODEL" '{model:$m,max_tokens:32,stream:true,messages:[{role:"user",content:"数到三"}]}')" \
| grep '^event:' | uniq

Check 3 uses tool_choice: auto. 5.x models such as Sonnet 5.5 do not support forcing tool specification ({"type":"tool"} or {"type":"any"}) and will return a 400 does not support forced tool_choice.

The output from testing with claude-sonnet-5-5 on 2026-10-15 is as follows (Check 1 only retains key fields):

text
== 1. model 字段
{
"id": "msg_011Cg3Esh8zeEdLeXAPVALKe",
"model": "claude-sonnet-5-5",
"usage": {
"input_tokens": 518,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"output_tokens": 12,
...
}
}
== 2. 缓存:同一请求发两次,看第二次的 cache_read_input_tokens
{"input_tokens":23,"cache_creation_input_tokens":17920,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":17920,"ephemeral_1h_input_tokens":0},"output_tokens":4,"output_tokens_details":{"thinking_tokens":0},"service_tier":"standard","inference_geo":"global"}
{"input_tokens":23,"cache_creation_input_tokens":0,"cache_read_input_tokens":17920,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":4,"output_tokens_details":{"thinking_tokens":0},"service_tier":"standard","inference_geo":"global"}
== 3. 工具调用 ID
toolu_01UPsdyKX8M9fJTTkDoSKHXA
== 4. 流式事件序列
event: message_start
event: content_block_start
event: ping
event: content_block_delta
event: content_block_stop
event: message_delta
event: message_stop

Whether the ping event appears and where it appears is not fixed and does not affect the judgment.

When thinking is enabled, the returned thinking block includes a signature field, which can also serve as a format check. The syntax for 5.x models differs from 4.x; tested on 2026-10-15:

Modelthinking ParameterResult
claude-sonnet-4-6{"type":"enabled","budget_tokens":1024}Returns a thinking block with thinking text and signature
claude-sonnet-5{"type":"enabled","budget_tokens":1024} or {"type":"adaptive"}Both work
claude-sonnet-5-5{"type":"adaptive"}Works; passing enabled returns 400, indicating only adaptive is supported

The thinking block of 5.x models contains only signature by default, with the thinking text as an empty string. To see the thinking summary, add "display": "summarized":

json
"thinking": {"type": "adaptive", "display": "summarized"}

When using third-party detection websites, it is recommended to create a dedicated API key and delete it after testing.

Send an email to [email protected] with the request time, model ID, complete response content (with the API key removed), and the corresponding check item. The request id in the response content or error message can help locate this call.

Is asking the model "Who are you?" reliable?

Unreliable. The model’s self-introduction is influenced by the system prompt, and under certain prompts it may answer its own version incorrectly. Checking the returned fields and event format is more informative.

Opus is selected — why does Haiku appear in the call logs?

Claude Code uses the Haiku model for some background tasks, and corresponding records will appear in the call log. You can use the ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable to specify the model used for such tasks; see Claude Code integration. If this occurs when not using Claude Code, please send the request time to [email protected].