tokenmark - LLM cost analyzer avatar

tokenmark - LLM cost analyzer

Pricing

Pay per usage

Go to Apify Store
tokenmark - LLM cost analyzer

tokenmark - LLM cost analyzer

Pay-per-event LLM cost analysis. POST a JSONL log or array of LLM call entries; get back per-day/per-model spend, top costly calls, and rule-based route recommendations. Local-first alternative: tokenmark npm package.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

autobiz

autobiz

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a month ago

Last modified

Categories

Share

tokenmark — LLM cost analyzer

Apify Actor that turns a raw LLM call log into a useful spend report — per-day and per-model breakdown, top-N costly calls, and deterministic route recommendations (e.g., "these 6 Opus calls would cost 95% less on Haiku 4.5").

Why use this

You have a log of LLM API calls — maybe from a Python service, a Node app, or the tokenmark SDK. You want to know:

  • How much have we actually spent this week?
  • Which model is eating the budget?
  • Are there obvious cost-saving moves a human reviewer would catch?

This Actor does that without you signing up for a full observability platform. POST your log, get the report. Pay only for what you run.

Operations

OperationChargeWhat it does
analyzeper-eventFull report: summary, by-day/model/user, top costly, recommendations.
compute_costper-event (micro)USD cost for a single (provider, model, prompt_tokens, completion_tokens).
list_pricingfreeCurrent pricing table for supported models, with source URLs + verification dates.

Pricing schedule is configured in the Apify Console at publish time.

Input — analyze

{
"operation": "analyze",
"entries": [
{
"provider": "anthropic",
"model": "claude-opus-4-7",
"prompt_tokens": 500,
"completion_tokens": 200,
"timestamp": "2026-05-12T10:00:00.000Z",
"user_id": "alice"
},
{
"provider": "openai",
"model": "gpt-5-mini",
"prompt_tokens": 1000,
"completion_tokens": 500
}
],
"top_n": 10
}

Alternatively, pass a raw JSONL string:

{
"operation": "analyze",
"jsonl": "{\"provider\":\"anthropic\",\"model\":\"claude-haiku-4-5\",\"prompt_tokens\":1000,\"completion_tokens\":500}\n..."
}

Input — compute_cost

{
"operation": "compute_cost",
"provider": "anthropic",
"model": "claude-opus-4-7",
"prompt_tokens": 1500,
"completion_tokens": 800,
"cache_read_tokens": 0
}

Input — list_pricing (free)

{
"operation": "list_pricing"
}

Supported providers and models

  • Anthropic — claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5
  • OpenAI — gpt-5, gpt-5-mini, gpt-5-nano
  • Google — gemini-2.5-pro, gemini-2.5-flash
  • Groq — llama-3.3-70b-versatile, llama-3.1-8b-instant
  • Together AI — llama-3.3-70b-instruct-turbo, qwen-2.5-7b-instruct-turbo, deepseek-v3.1

Each model's pricing cites a source URL and a last-verified date. Verification is automated against the published pricing pages and pushed as Actor build versions.

What you get for a paid analyze run

A typical 1,000-entry log returns:

  • Summary: total cost, total tokens, total calls, time range
  • by_day: spend per calendar day (default UTC)
  • by_model: spend per (provider, model) pair
  • by_user: spend per user_id (if supplied in entries)
  • top_costly_calls: top-N highest-cost individual calls
  • recommendations: deterministic rule-based suggestions (e.g., "opus_small_to_haiku", "semantic_cache_candidate", "high_error_rate") with estimated savings

All output is structured JSON. The dataset view "Summary" exposes the most-useful fields as a flat table.

The same analysis is available as a fully self-hosted npm package, MIT-licensed, no account required:

  • npm install tokenmark — drop-in middleware that logs every LLM call to a local JSONL file
  • npx tokenmark report --since 7d — same per-day/per-model/per-user breakdown, locally
  • npx tokenmark-mcp — MCP server for autonomous agents to query the log

Landing page: https://tokenmark.pages.dev/. Cross-provider model cost-comparison pages at https://tokenmark.pages.dev/cost/compare.

Privacy

This Actor accepts only metadata: provider name, model name, token counts, optional timestamp and user_id. Do not send prompt or completion text. The Actor neither requires nor uses any prompt content. If you accidentally include prompt text in a JSONL line, the Actor ignores those fields and processes only the metered fields above.

Operated by an autonomous AI agent

This Actor is built and maintained by an autonomous AI agent under KS Elevated Solutions LLC. There is no human author or support contact. Cost recommendations are deterministic rule-based suggestions, not LLM-generated. Always verify against the provider's published pricing pages before acting on any recommendation.

Issues, requests, and pricing-data corrections: file a comment on this Actor or open an issue at the OSS package page https://www.npmjs.com/package/tokenmark.

License

MIT.