Skip to main content
Documentation menu

Operations

Costs & budgets

/cost (also /usage), the TUI footer, and chanto insights show USD totals. JSON/stream-json results and server usage and turn events expose total_cost_usd; price_unknown marks totals containing unpriced calls. Provider-reported cost (including OpenRouter usage.cost) takes precedence. The bundled table uses exact model IDs and standard token rates; unknown IDs show tokens and price unknown. Local Ollama, LM Studio and llama.cpp calls are free. Subscription/custom endpoints without token prices need overrides. Prices also come from a list published at https://chanto.sh/prices.json, so they can change without a new release: Chanto keeps the last copy in ~/.chanto/cache/prices.json and fetches it at most once a day in the background (a plain GET that sends nothing about you; off with [updates] check = false or CHANTO_NO_UPDATE_CHECK=1). Your [pricing] overrides come first, then that list, then the built-in table. Cached input and cache writes are deducted from ordinary input before pricing. Rates are USD per million tokens; overrides without cache rates use the input rate for those tokens.

toml
max_cost_usd = 2.0              # per session; --max-cost overrides this
max_cost_usd_per_day = 10.0     # across sessions under CHANTO_HOME

[pricing."deepseek/deepseek-flash"]
input = 0.14
output = 0.28
cached_input = 0.014
# cache_write = 0.14

# Omit this section to keep telemetry off.
[telemetry]
otlp_endpoint = "http://localhost:4318"
service_name = "chanto"
[telemetry.headers]
Authorization = "Bearer collector-token"

Budgets note at 50% and 80% and stop at 100% (see Managing spend for [spend]'s session, day and month budgets). Interactive sessions ask whether to continue beyond the configured limits for that session. A call already in flight may exceed a limit; checks run before calls and after completed calls, before running requested tools. Concurrent calls already in flight can also overshoot. Unknown prices do not count as zero-priced calls: the partial total is explicitly marked unknown and cannot enforce a complete dollar budget. Daily spend uses the current local calendar date and the model-call log.

chanto logs prints ~/.chanto/logs/chanto-YYYY-MM-DD.log; chanto logs --tail follows it across daily rotation. CHANTO_HOME relocates all Chanto data. JSON lines contain time, level, session ID, event and data: model calls record provider, model, input/output/cache tokens, cost, latency (seconds), and status; tool calls record name, duration (seconds), and ok; permission decisions record tool name and allow/deny/stop; errors record status. Prompts, responses, tool arguments and error bodies are excluded. Values pass through secret redaction even when transcript redaction is disabled. Files are created at mode 0600 on Unix. Writes remove Chanto log files older than the last 14 calendar days. --debug or CHANTO_LOG=debug mirrors structured records to stderr. Logs are local and independent of telemetry.

Opt-in export sends OTLP/HTTP JSON to /v1/traces and /v1/metrics under the configured endpoint. Exactly these fields are sent: service name, event name (model_call or tool_call), random trace/span IDs, start/end timestamps, provider, model, input/output/cached/cache-write token counts, USD cost when known, latency or duration, status or ok, and tool name. Model/token/cost metrics and duration metrics carry those same attributes. No session IDs, filesystem paths, prompts, responses, tool arguments, errors or credential values are exported. Configured headers authenticate requests; they are never included in payloads or logs. Export failure logs only the signal name and does not fail a turn; requests time out after two seconds per signal. /privacy-settings shows whether export is enabled. No OpenTelemetry dependencies are required.

Bundled prices are a snapshot, not an invoice; use overrides when your contract, region, routing, batch/service tier, long-context or caching policy differs. Primary price references: OpenAI, Anthropic, Gemini, DeepSeek, xAI, Mistral, Groq, Cerebras, Together, Fireworks, MiniMax, DashScope, OpenCode, Moonshot, Baseten, Vercel.

ChatGPT plans, the Z.ai, Kimi Code and MiniMax M Plan coding plans, and routed/deployment-specific Hugging Face, NVIDIA and other models without a bundled exact rate use returned cost or explicit overrides; otherwise they show price unknown. The table never borrows another provider's price for these endpoints. Anthropic Sonnet 4/4.5 requests above 200K input tokens apply the published long-context multiplier. Anthropic cache writes use the default five-minute cache rate; custom one-hour policies require a pricing override.

Edit this page on GitHub Report a problem

Commands, settings, errors: type a few words.