---
schema_version: "1"
id: 7736ac40a8cf235a2d0176c7bf3ab6b96aca361b25f35305190c12b2828458d0
title: Billing Considerations for Code Extension
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_billing_considerations_code_extension.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_billing_considerations_code_extension.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 68bec3f85d5a8159d6b34a49da26b4ca4ff9d04f57721ff58860c4b5049d3e22
description: Using code extension in Data 360 impacts the consumption of credits used for billing for orgs operating Data 360 under a Data Cloud license.
products:
  - Data 360
release: "264"
---
# Billing Considerations for Code Extension

Using code extension in Data 360 impacts the consumption of credits used for billing for orgs operating Data 360 under a Data Cloud license.

Use Digital Wallet to check which consumption cards are active in your org, find out how many credits are available on each card, and determine how many credits have been consumed in each usage type.

If you have certain licenses or editions, such as a Data 360 Profiles license or Agentforce 1 Edition, some types of usage aren’t metered. Check your licenses and review license documentation for more information.

## Data 360 Usage

When you use Data 360 for data collection and processing, your org consumes credits from either the Data Services consumption card or the Flex Credits consumption card.

- If your contract included Data Service Credits, those are consumed for all Data 360 usage.
- If you run out of Data Service Credits, your org is billed at your Data Service Credit overage rate for the remainder of your term unless more credits are added.
- If you have Flex Credits for Data 360, those credits are consumed instead.

Data Services and Flex Credits organize data services within different usage type groupings. For more information, see [Data Services Billable Usage Types for Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_data_usage_types.htm&type=5&language=en_US) and [Flex Credits Usage Types for Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_flex_credits_for_data360.htm&type=5&language=en_US). To check multipliers for each usage type, see the [Multipliers for Data Services Rate Card](https://www.salesforce.com/data/rates/multipliers/) or the [Agentforce & Data 360 Flex Credits Rate Card](https://www.salesforce.com/agentforce/rates/). The cost of each credit is determined by your contract.

When a code extension function invokes predictive or generative models, billing is recorded in parallel across two meters: a compute meter for code execution and a model-usage meter (for example, Inferences for predictive model output).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png)

Note When a batch data transform created from a code extension is deployed and run within Data 360, usage is metered only under the Code Extension usage type, not under the Batch Data Transforms usage type.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20%">
          <col style="width:20%">
          <col style="width:40%">
          <col style="width:20%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d207128e92">Digital Wallet Card</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d207128e95">Usage Type</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d207128e98">Usage Type Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d207128e101">Notes</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Data Services</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Code Extension</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">Usage in this type is measured in Compute Units. The
              number of Compute Units consumed per hour depends on the compute size selected. The total
              number of Compute Units is calculated based on the hourly consumption rate and the total
              compute time your code consumes. </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">See the sections later for details on compute size and hourly
              consumption rate.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Flex Credits</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Data 360 Code Extension</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              Usage in this type is measured in Compute Units. The number of Compute Units consumed
              per hour depends on the compute size selected. The total number of Compute Units is
              calculated based on the hourly consumption rate and the total compute time your code
              consumes.</td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">Credits are only consumed in this usage type when your org
              doesn’t have any Data Services credits.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Data Services</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Inferences</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">Usage is calculated based on the number of unique
              inferences produced by a predictive model. A single inference includes one prediction and,
              optionally, one or more prescriptions and one or more top predictors. Inferences are
              consumed for any predictive AI model used, whether internal (built in Einstein Studio AI) or
              external (Bring Your Own Model).</td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">This usage is considered when a code extension function invokes an
              Einstein Studio predictive model during execution. Billed in parallel
              with Code Extension compute usage.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Einstein Requests</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Starter Prompts</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              <p>Usage is calculated based on two factors: the number of direct requests to the LLM via
                the LLM gateway, and whether the gateway uses a Bring Your Own Large Language Model
                (BYOLLM).</p>
              <p>Each starter prompt includes the processing of up to 2,000 tokens. Prompt usage is
                counted in chunks of 2,000 tokens, rounded up. Prompts that exceed this limit will be
                metered as multiple prompts, with each additional 2,000-token chunk counting as a new
                prompt. For example, a prompt with a total of 6,500 input and output tokens will be metered
                as 4 prompts. </p>
              <p style="margin-bottom:0;">Tokens are units of data processed by the AI models.</p>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">This usage is considered when a code extension function invokes a
              generative model through LLM Gateway. Billed in parallel with Code
              Extension compute usage.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Einstein Requests</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">
              <p>Standard Prompts</p>
              <p>Basic Prompts</p>
              <p style="margin-bottom:0;">Advanced Prompts</p>
            </td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              <p>Usage is calculated based on two factors: the number of direct requests to the LLM via
                the LLM gateway, and whether the gateway uses a Salesforce managed large language model.
                The specific category depends on the model that is used. See <a href="https://help.salesforce.com/s/articleView?id=ai.generative_ai_large_language_model_support.htm&amp;type=5&amp;language=en_US" target="_blank">Large Language Model Support</a> to find out which usage
                types apply.</p>
              <p>All Standard, Basic, and Advanced prompts process up to 2,000 tokens per prompt. Token
                usage is rounded up in 2,000-token increments. All Standard, Basic, and Advanced prompts
                that exceed this limit will be metered as multiple prompts, with each additional
                2,000-token chunk counting as a new prompt. For example, a prompt with a total of 6,500
                input and output tokens will be metered as 4 prompts.</p>
              <p>Tokens are units of data processed by the AI models. </p>
              <div>
                <div class="slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium">
                  <div class="slds-media slds-media_responsive">
                    <div class="slds-media__figure"><span class="slds-icon_container slds-icon_container_circle slds-icon-note-note"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png" alt="Note"></span></div>
                    <div class="slds-media__body" style="padding-top:.5rem;padding-bottom:.5rem;"><span class="slds-text-title_caps">Note</span> Advanced Prompts were launched with a designated multiplier listed in the Agentforce
                      <a href="https://www.salesforce.com/agentforce/rates/" target="_blank">Flex Credits Rate Card</a>. Salesforce will start metering the use of Advanced
                      Prompts on July 21, 2026.
                    </div>
                  </div>
                </div>
              </div>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">This usage is considered when a code extension function invokes a
              generative model through LLM Gateway. Billed in parallel with Code
              Extension compute usage.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Flex Credits</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Starter Prompts</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              <p>Usage is calculated based on two factors: the number
                of direct requests to the LLM via the LLM gateway, and whether the gateway uses a Bring Your
                Own Large Language Model (BYOLLM).</p>
              <p>Each starter prompt includes the processing of up to
                2,000 tokens. Prompt usage is counted in chunks of 2,000 tokens, rounded up. Prompts that
                exceed this limit will be metered as multiple prompts, with each additional 2,000-token
                chunk counting as a new prompt. For example, a prompt with a total of 6,500 input and
                output tokens will be metered as 4 prompts.</p>
              <p style="margin-bottom:0;">Tokens are units of data processed by the
                AI models.</p>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">Credits are only consumed in this usage type when your org doesn’t
              have any Einstein Requests credits.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Flex Credits</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">
              <p>Standard Prompts</p>
              <p>Basic Prompts</p>
              <p style="margin-bottom:0;">Advanced Prompts</p>
            </td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              <p>Usage is calculated based on two factors:
                the number of direct requests to the LLM via the LLM gateway, and whether the gateway uses a
                Salesforce managed large language model. The specific category depends on the model that is
                used. See Large <a href="https://help.salesforce.com/s/articleView?id=ai.generative_ai_large_language_model_support.htm&amp;language=en_US" target="_blank">Language Model Support</a> to find out which usage types
                apply. </p>
              <p>All Standard, Basic, and Advanced prompts process up to 2,000 tokens per prompt.
                Token usage is rounded up in 2,000-token increments. All Standard, Basic, and Advanced
                prompts that exceed this limit will be metered as multiple prompts, with each additional
                2,000-token chunk counting as a new prompt. For example, a prompt with a total of 6,500
                input and output tokens will be metered as 4 prompts. </p>
              <p>Tokens are units of data
                processed by the AI models. </p>
              <div>
                <div class="slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium">
                  <div class="slds-media slds-media_responsive">
                    <div class="slds-media__figure"><span class="slds-icon_container slds-icon_container_circle slds-icon-note-note"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png" alt="Note"></span></div>
                    <div class="slds-media__body" style="padding-top:.5rem;padding-bottom:.5rem;"><span class="slds-text-title_caps">Note</span> Advanced Prompts were launched with a designated multiplier listed in the Agentforce
                      <a href="https://www.salesforce.com/agentforce/rates/" target="_blank">Flex Credits Rate Card</a>. Salesforce will start metering the use of Advanced
                      Prompts on July 21, 2026.
                    </div>
                  </div>
                </div>
              </div>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">Credits are only consumed in this usage type when your org doesn’t
              have any Einstein Requests credits.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Data Services</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Data Queries</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              <p>Usage is calculated based on the number of records
                processed. </p>
              <p style="margin-bottom:0;">The count of records processed depends on the structure of a query as well as
                other related factors such as the total number of records in the objects being
                queried.</p>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">This usage is considered when a code extension batch data
              transform script runs locally and queries DLOs or DMOs through the
              Data Query API.</td>

          </tr>
          <tr class="">
            <td data-label="Digital Wallet Card" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e92 ">Flex Credits</td>

            <td data-label="Usage Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e95 ">Data 360 Queries</td>

            <td data-label="Usage Type Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e98 ">
              <p>Usage is calculated based on the number of records processed. </p>
              <p>The count of records processed depends on the structure of a query as well as other
                related factors such as the total number of records in the objects being queried.</p>
              <p style="margin-bottom:0;">When an object is queried in the context of a data space, the number of rows processed is
                based on the total number of processed rows in the source object, not the number of rows
                pertaining to the particular data space</p>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d207128e101 ">Credits are only consumed in this usage type when your org doesn’t
              have any Data Services credits. This usage is considered when a code
              extension batch data transform script runs locally and queries DLOs
              or DMOs through the Data Query API.</td>

          </tr>
        </tbody>
      </table>

## Compute Size Impact on Billing

The compute size that you select for your custom code deployment directly affects credit consumption.

The available compute size options are:

- Standard - Large - 4 Compute Units per hour
- Standard - X-Large - 8 Compute Units per hour
- Standard - 2X-Large - 16 Compute Units per hour
- Standard - 4X-Large - 32 Compute Units per hour

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_important.png)

Important Larger compute sizes provide more processing power but consume proportionally more credits. Choose the compute size that balances your performance requirements with cost considerations.

## Compute Unit Consumption Calculation

Compute Unit consumption depends on the compute size you select for your code execution and on total compute time. Total compute time accounts for the total run time of all underlying components. Because the job uses parallel processing for underlying components, total compute time can be greater than the start-to-finish duration.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png)

Note Code extension chunking functions incur compute charges while the function is active, including 1 hour of standby time after execution completes. If a new request arrives during the standby period, the 1-hour timer resets. This reset keeps the function ready for incoming requests to ensure faster and more reliable search index processing.

Compute Unit consumption is calculated by using the following formula:

**Compute Unit Consumption = Total Compute Time (hours) x Compute Unit Rate per Hour for the Compute Size**

For compute unit consumption, the total compute time value is applied as follows:

- If total compute time is less than 1 minute, it is rounded up to 60 seconds.
- If total compute time is greater than 1 minute, billing uses 1-second increments. For example, if total compute time is 5 minutes and 1 second, it is billed as 5 minutes and 1 second (not 6 minutes).

Example: Suppose you execute a code extension script configured for a Standard - Large Compute size. Total compute time is 1.5 hours. When configured to use Standard - Large compute size, the code uses 4 Compute Units for every hour it runs.

- **Compute Size:** Standard - Large - 4 Compute Units per hour
- **Total Compute Time:** 1.5 hours (illustrative)
- **Compute Unit Rate per Hour for the Compute Size:** 4 Compute Units/hour
- **Compute Unit Consumption:** 1.5 hours x 4 Compute Units/hour = 6 Compute Units

Your code consumes 6 compute units.

Your code could execute in less time if you chose a larger compute size, however, larger compute sizes consume more compute units per hour.

#### See Also

- [_Salesforce Help_: Data Services Billable Usage Types for Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_data_usage_types.htm&type=5&language=en_US)
- [_Salesforce Help_: About Digital Wallet](https://help.salesforce.com/s/articleView?language=en_US&id=sf.wallet_about.htm&type=5)
- [_Salesforce Help_: Flex Credits Billable Usage Types for Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_flex_credits_for_data360.htm&type=5&language=en_US)
- [_Downloadable PDF_: Understanding Credit Consumption: Breaking Down a Use Case](https://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/EnRelList_UseCase_WP.pdf)