> For the complete documentation index, see [llms.txt](https://docs.seemoredata.io/external-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seemoredata.io/external-docs/fundamentals/our-features/cortex-code-cost-control.md).

# Cortex Code Cost Control

## Overview

Cortex Code Cost Control gives you full visibility into **Snowflake Cortex Code spend** and lets you **set daily credit budgets** to keep AI usage within planned limits — at both the **account default** and **individual user** level.

The page separates limits by usage channel (**Snowsight**, **CLI**, and **Desktop**), so you can apply different policies depending on how users access Cortex Code.

{% hint style="info" %}
**Required role to configure limits:** [Editor](/external-docs/fundamentals/settings/user-roles.md) or higher.

Users with lower roles can view current limits and usage but cannot set or change credit limits.
{% endhint %}

***

## What Problem It Solves

Snowflake Cortex Code (code-generation AI) can generate significant and unpredictable compute spend. Without guardrails:

* Individual users may consume disproportionate credits without realizing it.
* There is no easy way to enforce different policies across how users access Cortex Code — interactive (Snowsight), programmatic (CLI), or the desktop app (Desktop).
* Cost spikes are discovered only after the fact, in the monthly bill.

Cortex Code Cost Control addresses all three by providing **real-time cost monitoring** and **enforceable daily budgets**.

***

## Key Capabilities

### Cost Monitoring

* **Cost trend chart** — view Cortex Code spend over time with configurable date range and granularity (day / week / month).
* **Cost by user** — pie chart breaking down total Cortex Code cost per user for the selected period.
* **Per-user metrics** — total cost, average daily cost, and projected annual cost for every Snowflake user.

### Budget Controls

* **Account default daily budget** — set a single daily credit cap that applies to all users by default, separately for Snowsight, CLI, and Desktop.
* **Per-user overrides** — override the account default for specific users with one of four modes:
  * **Default** — inherit the account-level budget.
  * **Blocked** — prevent the user from using Cortex Code on the selected channel.
  * **Unlimited** — remove any credit cap for the user.
  * **Limited** — set a custom daily credit amount (displayed in USD when pricing data is available).

<figure><img src="/files/YjOrsQX6211x88dox7Xb" alt=""><figcaption><p>Cortex Code Cost Control — users table with daily credit budget controls</p></figcaption></figure>

***

## Prerequisites

Cortex Code Cost Control relies on **Seemore helper procedures** deployed in your Snowflake account. If they are not present, the page will show a setup prompt with a link to the installation guide.

Make sure you have completed the steps in [Create Snowflake User and Privileges](/external-docs/fundamentals/getting-set-up/setting-integrations/snowflake/create-snowflake-user-and-privileges.md) and that the Seemore database objects are deployed for the relevant Snowflake integration.

{% hint style="info" %}
Only users with the **Editor** role in Seemore can modify limits. Viewers can browse costs and limits but cannot change them.
{% endhint %}

***

## How to Use

{% stepper %}
{% step %}

### Select a Snowflake Integration

Open **Cortex Code Cost Control** from the sidebar. If you have multiple Snowflake integrations, choose the one you want to manage from the integration dropdown.
{% endstep %}

{% step %}

### Choose the Usage Channel

Use the **Snowsight / CLI / Desktop** toggle to switch between channels. Limits and cost data update independently for each channel.
{% endstep %}

{% step %}

### Review Cost Trends

Adjust the date range and granularity to see overall Cortex Code spend and per-user breakdown in the trend and pie charts.
{% endstep %}

{% step %}

### Set the Account Default Budget

In the users table toolbar, set the **Account default daily user budget**. This value applies to every user who does not have an explicit override.
{% endstep %}

{% step %}

### Configure Per-User Overrides

For any user in the table, change their **Daily credit budget** to Default, Blocked, Unlimited, or Limited with a custom amount.
{% endstep %}
{% endstepper %}

***

## How Limits Work

| Limit value                 | Meaning                                                                                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Default** (user only)     | Inherits the account-level daily budget for the active channel.                                                                                        |
| **Blocked** (`0` credits)   | The user cannot consume Cortex Code credits on the selected channel.                                                                                   |
| **Unlimited** (`-1`)        | No daily cap — the user can use Cortex Code without restriction.                                                                                       |
| **Limited** (custom amount) | A specific number of credits per day. When pricing data is available, you can enter the limit in USD and Seemore converts it to credits automatically. |

Limits are enforced via three Snowflake parameters:

* `CORTEX_CODE_SNOWSIGHT_DAILY_EST_CREDIT_LIMIT_PER_USER`
* `CORTEX_CODE_CLI_DAILY_EST_CREDIT_LIMIT_PER_USER`
* `CORTEX_CODE_DESKTOP_DAILY_EST_CREDIT_LIMIT_PER_USER`

***

## FAQ

* **Does changing a limit take effect immediately?**\
  Yes. Limit changes are applied optimistically in the UI and persisted to your Snowflake account within seconds.
* **Can I set different limits for Snowsight, CLI, and Desktop?**\
  Yes. Switch the channel toggle and configure each independently.
* **What happens if the Seemore helper procedures are missing?**\
  The page displays an empty state with a link to the setup guide. No cost data or limit controls are available until the procedures are deployed.
* **Who can change limits?**\
  Only Seemore users with the **Editor** role. Viewers can see costs and current limits but cannot modify them.
