---
name: traktoken-query
description: Query current LLM API prices from TrakToken, compare token costs, and calculate scenario-based monthly API spend. Use when the user asks about LLM pricing, token costs, or API cost comparisons. Do not estimate hardware sizing or local-deployment ROI without verified hardware prices and measured throughput.
---

# TrakToken Query Skill

Installed version: `0.2.0`. Canonical source: `https://www.traktoken.com/skills/traktoken.md`.

## Workflow

1. Resolve the requested models without fetching the full catalog:

   ```bash
   curl -sS --get --data-urlencode "q=MODEL_NAME" https://www.traktoken.com/api/prices
   # When exact ids are known:
   curl -sS "https://www.traktoken.com/api/prices?ids=MODEL_ID_1,MODEL_ID_2"
   ```

   Use localhost only when developing the TrakToken repository itself and its local server is running.

2. Validate the response before calculating:
   - Require `success: true`, `schema_version: 2`, and `skill_version`.
   - If `skill_version` differs from installed version `0.2.0`, disclose the mismatch and link `skill_download_url`. Do not silently overwrite local files.
   - Use only entries whose `price_status` is `priced` and whose prices are numbers.
   - Treat `null` prices as "not collected". Never treat them as free or substitute zero.
   - `unpriced_reason` says why a price is missing: `upstream_deprecated` (the data source stopped tracking the model, and the vendor may still sell it at a published price), `upstream_zero`, `upstream_null`, or `upstream_dropped`. None of them mean free. When it is `upstream_deprecated`, tell the user to check the vendor's own pricing page.
   - If multiple versions match, show the candidates or ask which exact model to use. Do not silently choose between reasoning, non-reasoning, dated, or preview variants.
   - Treat `context_window: null` as unknown.

3. Calculate scenario costs. For requests per day:
   - `daily_input = requests * input_tokens_per_request`
   - `daily_output = requests * output_tokens_per_request`
   - `monthly_cost = days * (daily_input / 1_000_000 * input_price + daily_output / 1_000_000 * output_price)`
   - Use the user's billing period. If absent, use 30 days and state that assumption.

4. Present the exact model id, provider, input/output prices per 1M tokens, monthly cost, and `updated_at`. Describe `updated_at` as the dataset fetch time, not proof that the vendor changed its price on that date. State that caching, batch discounts, taxes, exchange rates, and provider-specific tiers are excluded unless supplied.

5. Fail closed:
   - If the endpoint fails, the requested model is missing, or the price is unpriced, say that current pricing cannot be calculated from TrakToken. Do not reuse remembered or example prices.
   - For local-deployment ROI, explain that this Skill currently lacks verified hardware prices and measured throughput. Link to `https://www.traktoken.com/models/open-source#local-roi` for a user-supplied interactive estimate instead of inventing hardware costs or a payback period.

## Output checklist

- Name the data source and fetch date.
- Distinguish exact model variants.
- Show the formula and assumptions.
- Never rank unpriced models as cheapest.
