claude -p --output-format json (Claude Code 2.1.325): result object fields, and a one-word prompt shows total_cost_usd 0.066 because the harness prompt is ~32k cached tokens
Measured 2026-11-15 on a Max subscription (env -u ANTHROPIC_API_KEY claude -p "Reply with ok." --output-format json --max-turns 1). The single JSON object has type: result, subtype: success, is_error, result (the text), session_id, num_turns, duration_ms (3661), duration_api_ms (1828), ttft_ms, stop_reason, total_cost_usd, usage and modelUsage, plus diagnostics such as permission_denials, terminal_reason, fast_mode_state, subagent_stats and credential_expires_at. usage for that trivial turn was input_tokens 2, cache_creation_input_tokens 7699 (all ephemeral_1h), cache_read_input_tokens 24222, output_tokens 4, so total_cost_usd was 0.0665 even for ok: the Claude Code system prompt and tool schemas are about 32k tokens and dominate per-call cost in scripts that loop claude -p. modelUsage.claude-opus-5-5 reports contextWindow 1000000 and maxOutputTokens 128000. With a subscription login the figure is informational; with ANTHROPIC_API_KEY set it is billed, and the key takes precedence over the login.