Documentation · Cost

How Cortex Code cost is calculated

Every number in AgentLedger comes from Snowflake's own usage data or from an explicit, editable price list. This page shows exactly how a request, a session and a pull request get priced.

Model cost

Model cost per request comes from SNOWFLAKE_COCO_USAGE_HISTORY when Snowflake has billed it. Otherwise it is estimated: uncached input, output, cache-write and cache-read tokens multiplied by the model's AI credits per million tokens, from Snowflake's published Cortex Code prices, then converted at your price per AI credit. Admins can edit model prices on the Setup view.

  • Claude Code, Cursor CLI and Gemini CLI sessions are estimated from their token counts and the same editable price list.
  • Side requests, such as session-title generation, count toward the session they follow.
  • Agent SQL is costed from QUERY_ATTRIBUTION_HISTORY at your price per platform credit.
  • Per pull request: requests on the pull request's head branch, from when the previous pull request on that branch closed (or 30 days before this one opened) until this one is merged or closed. Each request is attributed to the branch in effect when it started, so switching branches mid-session is handled.

Models without a price are flagged on the Setup view and in the session list until an admin adds one.

Efficiency score

Each session gets a score from 0 to 100, and the session page shows how each part contributed:

PartDefault weightWhat it measures
Reliability35%The share of model requests and agent SQL queries that succeeded
Cache reuse25%The share of input read from the prompt cache; 90% or more scores full marks
Focus20%Model requests per turn: two or fewer scores full marks, ten or more scores zero
Cost20%Cost per turn against your account's median

Admins can change the weights on the Setup view.

Work types

Each session is tagged with the kinds of work it did. Tags come from metadata only, never from prompts, answers or file contents:

  • Branch names and pull request titles: for example fix/… for bug fixes, feat/… for new features, and keywords for tests, documentation, dependencies, refactors and migrations.
  • SQL the agent ran: queries only means data analysis; DDL or DML means data changes.
  • Tools the agent used: reading files without editing them means code review and exploration; no tools and no SQL means questions.

Data freshness

Data refreshes every hour, and pull requests sync every 15 minutes once GitHub or GitLab is connected. Snowflake delivers traces on a best-effort basis and ACCOUNT_USAGE views can lag by a few hours, so recent Cortex Code activity can take a while to appear. Sessions from the developer CLI arrive within a few minutes. Admins can turn either schedule off under Data refresh on the Setup view.

Next steps