836f733a2e
- Add get_api_key() and require_api_key() to auth.py - Add generic key-value settings storage to SettingsStore - Add test_api_key_auth to verify the implementation - Uses secrets.compare_digest for timing-safe comparison - Auto-generates API key on first use and stores in settings DB
186 lines
14 KiB
Plaintext
186 lines
14 KiB
Plaintext
═══════════════════════════════════════════════════════════════════════════
|
|
Token Analysis: Session ses_1fbc61a9effehz5Mmv2vbgjhMt
|
|
Model: deepseek-v4-flash
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
|
|
WARNINGS
|
|
───────────────────────────────────────────────────
|
|
- Pricing for 'openrouter/deepseek/deepseek-v4-flash' was not found in models.json. Cost estimates use the default fallback rates ($1/M input, $3/M output, no cache pricing).
|
|
|
|
TOKEN BREAKDOWN BY CATEGORY
|
|
─────────────────────────────────────────────────────────────────────────
|
|
Estimated using tokenizer analysis of message content:
|
|
|
|
Input Categories:
|
|
SYSTEM ████████████████████████░░░░░░ 79.0% (15,386)
|
|
USER ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.1% (210)
|
|
TOOLS ██████░░░░░░░░░░░░░░░░░░░░░░░░ 19.9% (3,877)
|
|
|
|
Subtotal: 19,473 estimated input tokens
|
|
Note: inferred system/overhead values are heuristic estimates from API telemetry.
|
|
|
|
Output Categories:
|
|
ASSISTANT ██████████████░░░░░░░░░░░░░░░░ 47.9% (114)
|
|
REASONING ████████████████░░░░░░░░░░░░░░ 52.1% (124)
|
|
|
|
Subtotal: 238 estimated output tokens
|
|
|
|
Local Total: 19,711 tokens (estimated)
|
|
|
|
TOOL USAGE BREAKDOWN
|
|
─────────────────────────────────────────────────────────────────────────
|
|
task █████████████████████████████░ 97.7% (3,786) 1x
|
|
mystatus █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.3% (91) 1x
|
|
|
|
TOP CONTRIBUTORS
|
|
─────────────────────────────────────────────────────────────────────────
|
|
• System (inferred from API telemetry) 15,386 tokens (78.1%)
|
|
• task 3,786 tokens (19.2%)
|
|
• Assistant#1 93 tokens (0.5%)
|
|
• mystatus 91 tokens (0.5%)
|
|
• Reasoning#3 81 tokens (0.4%)
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
MOST RECENT API CALL
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
Raw telemetry from last API response:
|
|
Input (fresh): 19,473 tokens
|
|
Cache read: 0 tokens
|
|
Output: 363 tokens
|
|
Reasoning: 81 tokens
|
|
Provider total: 19,917 tokens
|
|
Cost: $0.0029
|
|
─────────────────────────────────────
|
|
Total: 19,917 tokens
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
SESSION TOTALS (All 3 API calls)
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
Assistant messages observed: 4 (structural count)
|
|
|
|
Total tokens processed across the entire session (for cost calculation):
|
|
|
|
Input tokens: 52,509 (fresh tokens across all calls)
|
|
Cache read: 4,736 (cached tokens across all calls)
|
|
Cache write: 0 (tokens written to cache)
|
|
Output tokens: 488 (all model responses)
|
|
Reasoning tokens: 124 (thinking/reasoning)
|
|
─────────────────────────────────────
|
|
Session Total: 57,857 tokens (for billing)
|
|
Cache read calls: 1 / 3
|
|
Cache write calls: 0 / 3
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
SESSION COST
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
Token usage breakdown:
|
|
Input tokens: 52,509
|
|
Output tokens: 488
|
|
Reasoning tokens: 124
|
|
Cache read: 4,736
|
|
|
|
─────────────────────────────────────────────────────────────────────────
|
|
ACTUAL COST (from API): $0.0077
|
|
Estimated cost: $0.0543 (+609.9% diff)
|
|
|
|
Note: Actual cost from OpenCode includes provider-specific pricing
|
|
and 200K+ context adjustments.
|
|
|
|
══════════════════════════════════════════════════════════════════════════
|
|
AVAILABLE SKILLS (always-available context)
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
These skills were recovered from the skill tool metadata available to this session.
|
|
|
|
Skill Description Tokens
|
|
───────────────────────────────────────────────────────────────────────
|
|
verification-before-c… Use when about to claim work is complete, fi… ~47
|
|
finishing-a-developme… Use when implementation is complete, all tes… ~46
|
|
receiving-code-review Use when receiving code review feedback, bef… ~40
|
|
using-git-worktrees Use when starting feature work that needs is… ~40
|
|
brainstorming You MUST use this before any creative work -… ~39
|
|
using-superpowers Use when starting any conversation - establi… ~31
|
|
dispatching-parallel-… Use when facing 2+ independent tasks that ca… ~28
|
|
auto-commit Use when you are making multiple edits or co… ~25
|
|
executing-plans Use when you have a written implementation p… ~25
|
|
requesting-code-review Use when completing tasks, implementing majo… ~24
|
|
systematic-debugging Use when encountering any bug, test failure,… ~24
|
|
writing-plans Use when you have a spec or requirements for… ~23
|
|
writing-skills Use when creating new skills, editing existi… ~22
|
|
subagent-driven-devel… Use when executing implementation plans with… ~19
|
|
test-driven-developme… Use when implementing any feature or bugfix,… ~19
|
|
───────────────────────────────────────────────────────────────────────
|
|
Total: ~452 tokens (15 skills available)
|
|
|
|
Note: Full skill tool description is ~657 tokens (includes boilerplate).
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
AVAILABLE SUBAGENTS (in task tool definition)
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
These subagents are embedded in the task tool description and consume tokens on every API call.
|
|
|
|
Subagent Description Tokens
|
|
───────────────────────────────────────────────────────────────────────
|
|
explore Fast agent specialized for exploring codebases. U… ~105
|
|
general General-purpose agent for researching complex que… ~28
|
|
───────────────────────────────────────────────────────────────────────
|
|
Total: ~133 tokens (2 subagents available)
|
|
|
|
Note: Full task tool description is ~983 tokens (includes instructions/examples).
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
TOOL DEFINITION COSTS (Estimated from argument analysis)
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
Tool Est. Tokens Args Complexity
|
|
───────────────────────────────────────────────────────────────────
|
|
task ~370 3 simple
|
|
tokenscope ~310 1 simple
|
|
mystatus ~280 0 simple
|
|
───────────────────────────────────────────────────────────────────
|
|
Total: ~ 960 tokens (3 enabled tools)
|
|
|
|
Note: Estimates inferred from tool call arguments in this session.
|
|
Actual schema tokens may vary +/-20%.
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
CACHE EFFICIENCY
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
Token Distribution:
|
|
Cache Read: 4,736 tokens ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8.3%
|
|
Fresh Input: 52,509 tokens ████████████████████████████░░ 91.7%
|
|
───────────────────────────────────────────────────────────────────
|
|
Cache Hit Rate: 8.3% (cache read / (cache read + fresh input))
|
|
|
|
Cost Analysis (deepseek-v4-flash @ $1.00/M input, $0.00/M cache read, $0.00/M cache write):
|
|
Without caching: $0.0572 (57,245 tokens x $1.00/M)
|
|
With caching: $0.0525 (fresh x $1.00/M + cache read x $0.00/M + cache write x $0.00/M)
|
|
───────────────────────────────────────────────────────────────────
|
|
Cost Savings: $0.0047 (8.3% reduction)
|
|
Effective Rate: $0.92/M tokens (vs. $1.00/M standard)
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
SUBAGENT COSTS (2 child sessions, 16 API calls)
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
explore $0.0359 (372,189 tokens, 8 calls)
|
|
explore $0.0422 (359,195 tokens, 8 calls)
|
|
─────────────────────────────────────────────────────────────────────────
|
|
Subagent Total: $0.0781 (731,384 tokens, 16 calls)
|
|
|
|
═══════════════════════════════════════════════════════════════════════════
|
|
SUMMARY
|
|
─────────────────────────────────────────────────────────────────────────
|
|
|
|
Cost Tokens API Calls
|
|
Main session: $ 0.0077 57,857 3
|
|
Subagents: $ 0.0781 731,384 16
|
|
─────────────────────────────────────────────────────────────────────────
|
|
TOTAL: $ 0.0858 789,241 19
|
|
|
|
═══════════════════════════════════════════════════════════════════════════ |