# Subscription credit rates

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


A subscription credit rate shows the credit rate a subscription uses for a metered feature: its [credit rate override](/docs/api/credit_rate_overrides) if it has one, otherwise the [feature-level credit rate](/docs/api/credit_rates).

**Which rate this is**

Each entry is the rate the subscription uses for one metered feature. `is_overridden` says where it comes from:

-   `true`: the subscription's [credit rate override](/docs/api/credit_rate_overrides). Every field, including `id`, `version`, and `effective_from`, describes the override.
-   `false`: the feature-level [credit rate](/docs/api/credit_rates) that applies to the subscription.

To see the feature-level rate behind an override, use [Retrieve a credit rate](/docs/api/credit_rates/retrieve-a-credit-rate).

See [Credit rates](/docs/api/credit_rates#how-the-applicable-credit-rate-is-determined) for how credit rates are versioned and how the applicable rate is determined.

## Sample Subscription credit rate

```json
{
  "id": "u2c_override_9Pq4RtV7",
  "metered_feature_id": "opus-usage",
  "credit_unit_id": "ai-credits",
  "unit": "tokens",
  "subscription_id": "8281018822",
  "is_overridden": true,
  "credit_rate_version": 0,
  "status": "active",
  "conversion_model": "package",
  "package_size": 10,
  "credit_cost": 12,
  "effective_from": 1787098600,
  "version": 0,
  "resource_version": 1787098600000,
  "note": "Renegotiated onto package pricing for this subscription",
  "created_by": "admin@acme.com",
  "created_at": 1787088600,
  "updated_by": "ops@acme.com",
  "updated_at": 1787098600,
  "object": "subscription_credit_rate"
}
```

## Subscription credit rates attributes

## Input Parameters

- `id` (required, string, max chars=50)
  Identifier of the rate that applies to the subscription: the subscription's [credit rate override](/docs/api/credit_rate_overrides) when `is_overridden` is `true`, otherwise the feature-level [credit rate](/docs/api/credit_rates). It stays the same across that rate's versions.

- `metered_feature_id` (required, string, max chars=50)
  The identifier of the [metered feature](/docs/api/metered_features) this credit rate belongs to.

- `credit_unit_id` (required, string, max chars=50)
  The identifier of the [credit unit](/docs/api/credit_units) that usage is converted into.

- `unit` (optional, string, max chars=50)
  The unit of measure of the metered feature, such as `tokens`. Included so the rate can be displayed without retrieving the metered feature.

- `status` (optional, enumerated string)
  The status of the credit rate. Currently always `active`.
  Possible enum values:
    - `active`
      Usage is converted into credits according to this credit rate.
    - `archived`
      Reserved for future use.

- `conversion_model` (optional, enumerated string)
  Determines how the subscription's usage of this metered feature is converted into credits. See [Conversion models](/docs/api/credit_rates#conversion-models).
  Possible enum values:
    - `unit`
      Every unit of usage costs `credit_cost` credits. `package_size` is always `1`.
    - `package`
      Usage is charged in packages of `package_size` units, and each package costs `credit_cost` credits. Packages are counted on the total usage in the billing term, and a partly used package is charged as a full package.

- `package_size` (optional, bigdecimal, min=1E-9, max=999999999.999999999)
  The number of usage units in one package; `1` when `conversion_model` is `unit`.

- `credit_cost` (optional, bigdecimal, min=0, max=999999999.999999999)
  The credits charged for each unit of usage when `conversion_model` is `unit`, or for each package of `package_size` units when `conversion_model` is `package`.

- `effective_from` (optional, long)
  The time the version in this entry took effect, in UTC seconds.

- `version` (optional, long)
  The version number of the rate in this entry: the override's version when `is_overridden` is `true`, otherwise the feature-level credit rate's. The two are versioned separately, each starting at `0`. Use `resource_version` to detect changes.

- `resource_version` (optional, long)
  A timestamp in milliseconds identifying the version of the rate in this entry. It changes when that rate gets a new version, or when an override is set or removed. Use it to detect changes when syncing. It is not a version number; see `version` for that.

- `updated_at` (optional, timestamp(UTC) in seconds)
  The time at which the rate in this entry was last modified, in UTC seconds.

- `note` (optional, string, max chars=500)
  The reason given for the version in this entry, shown in the version history.

- `created_by` (optional, string, max chars=100)
  The email of the user who created the credit rate.

- `created_at` (optional, long)
  The time at which the credit rate was created, in UTC seconds.

- `updated_by` (optional, string, max chars=100)
  The email of the user who last modified the rate in this entry.

- `subscription_id` (required, string, max chars=50)
  The identifier of the [subscription](/docs/api/subscriptions) this credit rate applies to.

- `is_overridden` (optional, boolean)
  Whether the rate in this entry is the subscription's credit rate override (`true`) or the feature-level credit rate (`false`).

- `credit_rate_version` (optional, long)
  The version of the feature-level credit rate the subscription would use without an override. Returned only when `is_overridden` is `true`.

